Browse Source

Renamed ProhibitLogin -> Suspended

Yoginth 7 years ago
parent
commit
8ebda6d3eb

+ 1 - 1
models/user.go

@@ -81,7 +81,7 @@ type User struct {
 	IsAdmin          bool
 	AllowGitHook     bool
 	AllowImportLocal bool // Allow migrate repository by local path
-	ProhibitLogin    bool
+	Suspended        bool
 
 	// Badges
 	IsVerified  bool

+ 2 - 2
pkg/context/auth.go

@@ -28,9 +28,9 @@ func Toggle(options *ToggleOptions) macaron.Handler {
 		}
 
 		// Check prohibit login users.
-		if c.IsLogged && c.User.ProhibitLogin {
+		if c.IsLogged && c.User.Suspended {
 			c.Data["Title"] = c.Tr("auth.prohibit_login")
-			c.Data["PageIsProhibitLogin"] = true
+			c.Data["PageIsSuspended"] = true
 			c.HTML(200, "user/auth/prohibit_login")
 			return
 		}

+ 1 - 1
pkg/form/admin.go

@@ -45,7 +45,7 @@ type AdminEditUser struct {
 	Admin            bool
 	AllowGitHook     bool
 	AllowImportLocal bool
-	ProhibitLogin    bool
+	Suspended        bool
 	IsVerified       bool
 	IsMaker          bool
 	IsBugHunter      bool

+ 1 - 1
routes/admin/users.go

@@ -212,7 +212,7 @@ func EditUserPost(c *context.Context, f form.AdminEditUser) {
 	u.IsAdmin = f.Admin
 	u.AllowGitHook = f.AllowGitHook
 	u.AllowImportLocal = f.AllowImportLocal
-	u.ProhibitLogin = f.ProhibitLogin
+	u.Suspended = f.Suspended
 	u.IsVerified = f.IsVerified
 	u.IsMaker = f.IsMaker
 	u.IsBugHunter = f.IsBugHunter

+ 2 - 2
routes/user/profile.go

@@ -106,8 +106,8 @@ func Profile(c *context.Context) {
 		count := models.CountUserRepositories(ctxUser.ID, showPrivate)
 		c.Data["Page"] = paginater.New(int(count), setting.UI.User.RepoPagingNum, page, 5)
 	}
-	if ctxUser.ProhibitLogin == true {
-		c.Handle(404, "ProhibitLogin", err)
+	if ctxUser.Suspended == true {
+		c.Handle(404, "Suspended", err)
 	} else {
 		c.HTML(200, PROFILE)
 	}

+ 2 - 2
templates/admin/user/edit.tmpl

@@ -165,8 +165,8 @@
 						</div>
 						<div class="inline field">
 							<div class="ui checkbox">
-								<label><strong style="color:red">This account is prohibited to login</strong></label>
-								<input name="prohibit_login" type="checkbox" {{if .User.ProhibitLogin}}checked{{end}}>
+								<label><strong style="color:red">This account is suspended</strong></label>
+								<input name="prohibit_login" type="checkbox" {{if .User.Suspended}}checked{{end}}>
 							</div>
 						</div>
 						<div class="inline field">

+ 1 - 1
templates/base/footer.tmpl

@@ -3,7 +3,7 @@
 <body>
 	<div>
 */}}
-	{{if not .PageIsProhibitLogin}}
+	{{if not .PageIsSuspended}}
 	</div>
 	<footer>
 		<div class="ui container">

+ 1 - 1
templates/base/head.tmpl

@@ -172,7 +172,7 @@
 	<div class="full height">
 		<noscript>This website works better with JavaScript</noscript>
 		{{if not .PageIsInstall}}
-		{{if not .PageIsProhibitLogin}}
+		{{if not .PageIsSuspended}}
 			<div class="following bar light" style="{{if not .IsLogged}}padding-top:5px;padding-bottom:5px{{end}}">
 				{{if or .IsAdmin .IsStaff .IsIntern}}
 					{{template "misc/admin_bar" .}}