controllers

package
v0.0.0-...-948c845 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2014 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

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 Error403

func Error403(rw http.ResponseWriter, r *http.Request)

func Error404

func Error404(rw http.ResponseWriter, r *http.Request)

func Error500

func Error500(rw http.ResponseWriter, r *http.Request)

func ErrorIPBan

func ErrorIPBan(rw http.ResponseWriter, r *http.Request)

func ErrorOnce

func ErrorOnce(rw http.ResponseWriter, r *http.Request)

func GetLoginRedirectUrl

func GetLoginRedirectUrl(ctx *context.Context) (returnUrl string)

func OAuthAccess

func OAuthAccess(ctx *context.Context)

func OAuthRedirect

func OAuthRedirect(ctx *context.Context)

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) ResetPassword

func (this *AuthController) ResetPassword()

重设密码

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) CheckOnceToken

func (this *BaseController) CheckOnceToken()

验证防重复提交token

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) LogUserOut

func (this *BaseController) LogUserOut()

登出用户

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 ResetPasswordForm struct {
	Password        string `form:"Password,password"valid:"Required;MinSize(6);"`
	PasswordConfirm string `form:"PasswordConfirm,password"valid:"Required;"`
}

type SocialAuthController

type SocialAuthController struct {
	BaseController
}

社交帐号登录控制器

func (*SocialAuthController) Connect

func (this *SocialAuthController) Connect()

type SocialAuthLoginForm

type SocialAuthLoginForm struct {
	Username string `form:"Username,text"valid:"Required;"`
	Password string `form:"Password,password"valid:"Required;"`
}

type SocialAuthRegisterForm

type SocialAuthRegisterForm struct {
	Username        string `form:"Username,text"valid:"Required;"`
	Password        string `form:"Password,password"valid:"Required;MinSize(6);"`
	PasswordConfirm string `form:"PasswordConfirm,password"valid:"Required;"`
	Email           string `form:"Email,text"valid:"Required;Email;"`
}

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

type UserPasswordForm struct {
	CurrentPassword string `Valid:"Required"`
	Password        string `Valid:"MinSize(6);"`
	PasswordConfirm string `Valid:"Required;"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL