Documentation ¶
Index ¶
- Variables
- func Error403(rw http.ResponseWriter, r *http.Request)
- func Error404(rw http.ResponseWriter, r *http.Request)
- func Error500(rw http.ResponseWriter, r *http.Request)
- func ErrorIPBan(rw http.ResponseWriter, r *http.Request)
- func ErrorOnce(rw http.ResponseWriter, r *http.Request)
- func GetLoginRedirectUrl(ctx *context.Context) (returnUrl string)
- func OAuthAccess(ctx *context.Context)
- func OAuthRedirect(ctx *context.Context)
- func SocialInit()
- type AuthController
- func (this *AuthController) Activate()
- func (this *AuthController) DoLogin()
- func (this *AuthController) DoRegister()
- func (this *AuthController) ForgetPassword()
- func (this *AuthController) IsStopForumSpamListed(user *models.User) bool
- func (this *AuthController) Login()
- func (this *AuthController) Logout()
- func (this *AuthController) Register()
- func (this *AuthController) ResetPassword()
- func (this *AuthController) ValidateCaptcha()
- func (this *AuthController) ValidateEmail()
- func (this *AuthController) ValidateUsername()
- type BaseController
- func (this *BaseController) CheckOnceToken()
- func (this *BaseController) CheckRequestFrequency(minutes, warningLevel, banLevel int64)
- func (this *BaseController) DeleteRememberCookie()
- func (this *BaseController) FlashRead(key string) (string, bool)
- func (this *BaseController) FlashWrite(key string, value string)
- func (this *BaseController) LogUserIn(user *models.User, remember bool)
- func (this *BaseController) LogUserOut()
- func (this *BaseController) Prepare()
- func (this *BaseController) SetPaginator(per int, nums int64) *utils.Paginator
- type ForgetPasswordForm
- type LoginForm
- type MainController
- type RegisterForm
- type ResetPasswordForm
- type SocialAuthController
- type SocialAuthLoginForm
- type SocialAuthRegisterForm
- type UserController
- func (this *UserController) Edit()
- func (this *UserController) FollowUnfollow()
- func (this *UserController) List(orderBy string)
- func (this *UserController) ListByComments()
- func (this *UserController) ListByDigests()
- func (this *UserController) ListByFollowers()
- func (this *UserController) ListById()
- func (this *UserController) ListByRep()
- func (this *UserController) ListByTopics()
- func (this *UserController) Profile()
- func (this *UserController) ResendValidation()
- type UserEditForm
- type UserPasswordForm
Constants ¶
This section is empty.
Variables ¶
View Source
var ( GithubAuth *apps.Github QQAuth *apps.QQ WeiboAuth *apps.Weibo SocialAuth *social.SocialAuth )
View Source
var SocialAuther social.SocialAuther = new(socialAuther)
Functions ¶
func ErrorIPBan ¶
func ErrorIPBan(rw http.ResponseWriter, r *http.Request)
func GetLoginRedirectUrl ¶
func OAuthAccess ¶
func OAuthRedirect ¶
func SocialInit ¶
func SocialInit()
Types ¶
type AuthController ¶
type AuthController struct {
BaseController
}
登录控制器
func (*AuthController) Activate ¶
func (this *AuthController) Activate()
func (*AuthController) DoLogin ¶
func (this *AuthController) DoLogin()
func (*AuthController) DoRegister ¶
func (this *AuthController) DoRegister()
func (*AuthController) ForgetPassword ¶
func (this *AuthController) ForgetPassword()
输入email,发送重设密码邮件
func (*AuthController) IsStopForumSpamListed ¶
func (this *AuthController) IsStopForumSpamListed(user *models.User) bool
func (*AuthController) Login ¶
func (this *AuthController) Login()
func (*AuthController) Logout ¶
func (this *AuthController) Logout()
func (*AuthController) Register ¶
func (this *AuthController) Register()
func (*AuthController) ValidateCaptcha ¶
func (this *AuthController) ValidateCaptcha()
func (*AuthController) ValidateEmail ¶
func (this *AuthController) ValidateEmail()
func (*AuthController) ValidateUsername ¶
func (this *AuthController) ValidateUsername()
type BaseController ¶
type BaseController struct { beego.Controller User *models.User IsLogin bool }
func (*BaseController) CheckRequestFrequency ¶
func (this *BaseController) CheckRequestFrequency(minutes, warningLevel, banLevel int64)
func (*BaseController) DeleteRememberCookie ¶
func (this *BaseController) DeleteRememberCookie()
删除记忆登录cookie
func (*BaseController) FlashRead ¶
func (this *BaseController) FlashRead(key string) (string, bool)
read beego flash message
func (*BaseController) FlashWrite ¶
func (this *BaseController) FlashWrite(key string, value string)
write beego flash message
func (*BaseController) LogUserIn ¶
func (this *BaseController) LogUserIn(user *models.User, remember bool)
登录用户
func (*BaseController) Prepare ¶
func (this *BaseController) Prepare()
func (*BaseController) SetPaginator ¶
func (this *BaseController) SetPaginator(per int, nums int64) *utils.Paginator
type ForgetPasswordForm ¶
type ForgetPasswordForm struct {
Email string `form:"Email"valid:"Required;Email"`
}
type LoginForm ¶
type LoginForm struct { Username string `form:"username,text"valid:"Required;"` Password string `form:"password,password"valid:"Required;"` Remember string `form:"remember,text"` }
登录表单
type MainController ¶
type MainController struct {
BaseController
}
func (*MainController) Get ¶
func (this *MainController) Get()
type RegisterForm ¶
type RegisterForm struct { Username string `form:"username,text"valid:"Required;"` Password string `form:"password,password"valid:"Required;MinSize(6);"` PasswordConfirm string `form:"password_confirm,password"valid:"Required;"` Email string `form:"email,text"valid:"Required;Email;"` CaptchaId string `form:"captcha-id,hidden"valid:"Required;"` Captcha string `form:"captcha,text"valid:"Required"` }
注册表单
type ResetPasswordForm ¶
type SocialAuthController ¶
type SocialAuthController struct {
BaseController
}
社交帐号登录控制器
func (*SocialAuthController) Connect ¶
func (this *SocialAuthController) Connect()
type SocialAuthLoginForm ¶
type SocialAuthRegisterForm ¶
type UserController ¶
type UserController struct {
BaseController
}
用户控制器
func (*UserController) Edit ¶
func (this *UserController) Edit()
func (*UserController) FollowUnfollow ¶
func (this *UserController) FollowUnfollow()
func (*UserController) List ¶
func (this *UserController) List(orderBy string)
func (*UserController) ListByComments ¶
func (this *UserController) ListByComments()
func (*UserController) ListByDigests ¶
func (this *UserController) ListByDigests()
func (*UserController) ListByFollowers ¶
func (this *UserController) ListByFollowers()
func (*UserController) ListById ¶
func (this *UserController) ListById()
func (*UserController) ListByRep ¶
func (this *UserController) ListByRep()
func (*UserController) ListByTopics ¶
func (this *UserController) ListByTopics()
func (*UserController) Profile ¶
func (this *UserController) Profile()
func (*UserController) ResendValidation ¶
func (this *UserController) ResendValidation()
type UserEditForm ¶
type UserEditForm struct { Username string `form:"Username,text"valid:"Required"` Email string `form:"Email,text"valid:"Required;Email;"` PublicEmail bool `form:"PublicEmail,checkbox""` Nickname string `form:"Nickname,text"` Info string `form:"Info,textarea"` Company string `form:"Company,text"` Location string `form:"Location,text"` Url string `form:"Url,text"` Qq string `form:"Qq,text"` WeChat string `form:"WeChat,file"` Weibo string `form:"Weibo,text"` }
type UserPasswordForm ¶
Click to show internal directories.
Click to hide internal directories.