BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
4cd7a563
Unverified
Commit
4cd7a563
authored
Dec 26, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add User#email uniq validation. Fixed confirmation for admin/users form
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
a389d777
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
users_controller.rb
app/controllers/admin/users_controller.rb
+1
-1
user.rb
app/models/user.rb
+1
-1
show.html.haml
app/views/admin/users/show.html.haml
+10
-0
No files found.
app/controllers/admin/users_controller.rb
View file @
4cd7a563
...
...
@@ -47,7 +47,7 @@ class Admin::UsersController < Admin::ApplicationController
@user
.
admin
=
(
admin
&&
admin
.
to_i
>
0
)
@user
.
created_by_id
=
current_user
.
id
@user
.
generate_password
@user
.
confirm
!
@user
.
skip_confirmation
!
respond_to
do
|
format
|
if
@user
.
save
...
...
app/models/user.rb
View file @
4cd7a563
...
...
@@ -103,7 +103,7 @@ class User < ActiveRecord::Base
# Validations
#
validates
:name
,
presence:
true
validates
:email
,
presence:
true
,
format:
{
with:
/\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/
}
validates
:email
,
presence:
true
,
format:
{
with:
/\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/
}
,
uniqueness:
true
validates
:bio
,
length:
{
maximum:
255
},
allow_blank:
true
validates
:extern_uid
,
allow_blank:
true
,
uniqueness:
{
scope: :provider
}
validates
:projects_limit
,
presence:
true
,
numericality:
{
greater_than_or_equal_to:
0
}
...
...
app/views/admin/users/show.html.haml
View file @
4cd7a563
...
...
@@ -43,6 +43,16 @@
%span
.light
Member since:
%strong
=
@user
.
created_at
.
stamp
(
"Nov 12, 2031"
)
-
if
@user
.
confirmed_at
%li
%span
.light
Confirmed at:
%strong
=
@user
.
confirmed_at
.
stamp
(
"Nov 12, 2031"
)
-
else
%li
%span
.light
Confirmed:
%strong
.cred
No
%li
%span
.light
Last sign-in at:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment