Commit 8d079fa3 authored by Yoginth's avatar Yoginth 🦄

Started Implementing User Verification

parent 70839f71
Pipeline #30302132 passed with stages
in 33 minutes and 20 seconds
......@@ -74,6 +74,7 @@ type User struct {
// Permissions
IsActive bool // Activate primary email
IsVerified bool
IsAdmin bool
AllowGitHook bool
AllowImportLocal bool // Allow migrate repository by local path
......
......@@ -32,6 +32,7 @@ type AdminEditUser struct {
AllowGitHook bool
AllowImportLocal bool
ProhibitLogin bool
IsVerified bool
}
func (f *AdminEditUser) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
......
......@@ -209,6 +209,7 @@ func EditUserPost(c *context.Context, f form.AdminEditUser) {
u.AllowGitHook = f.AllowGitHook
u.AllowImportLocal = f.AllowImportLocal
u.ProhibitLogin = f.ProhibitLogin
u.IsVerified = f.IsVerified
if err := models.UpdateUser(u); err != nil {
if models.IsErrEmailAlreadyUsed(err) {
......
......@@ -73,6 +73,12 @@
<input name="active" type="checkbox" {{if .User.IsActive}}checked{{end}}>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
<label><strong>This account is Verified</strong></label>
<input name="verified" type="checkbox" {{if .User.IsVerified}}checked{{end}}>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
<label><strong>This account is prohibited to login</strong></label>
......
......@@ -24,6 +24,11 @@
<p>{{.Owner.Description}}</p>
</li>
{{end}}
{{if .IsVerified}}
<li class="user description">
<p>IsVerified</p>
</li>
{{end}}
{{if .Owner.Location}}
<li><i class="menu-icon octicon">📍</i>{{.Owner.Location}}</li>
{{end}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment