Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
c5526a2d
Commit
c5526a2d
authored
Apr 28, 2016
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change skip_user_confirmation_email to send_user_confirmation_email
parent
71ca2de7
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
30 additions
and
19 deletions
+30
-19
CHANGELOG
CHANGELOG
+4
-1
app/controllers/admin/application_settings_controller.rb
app/controllers/admin/application_settings_controller.rb
+1
-1
app/models/user.rb
app/models/user.rb
+2
-1
app/views/admin/application_settings/_form.html.haml
app/views/admin/application_settings/_form.html.haml
+2
-2
db/migrate/20160421141709_add_send_confirmation_email_to_application_settings.rb
...09_add_send_confirmation_email_to_application_settings.rb
+12
-0
db/migrate/20160421141709_add_skip_confirmation_email_to_application_settings.rb
...09_add_skip_confirmation_email_to_application_settings.rb
+0
-8
spec/controllers/registrations_controller_spec.rb
spec/controllers/registrations_controller_spec.rb
+6
-6
spec/features/signup_spec.rb
spec/features/signup_spec.rb
+2
-0
spec/models/user_spec.rb
spec/models/user_spec.rb
+1
-0
No files found.
CHANGELOG
View file @
c5526a2d
...
@@ -28,6 +28,8 @@ v 8.8.0 (unreleased)
...
@@ -28,6 +28,8 @@ v 8.8.0 (unreleased)
- Display informative message when new milestone is created
- Display informative message when new milestone is created
- Sanitize milestones and labels titles
- Sanitize milestones and labels titles
- Support multi-line tag messages. !3833 (Calin Seciu)
- Support multi-line tag messages. !3833 (Calin Seciu)
- Toggle sign-up confirmation emails in application settings
- Replace Devise Async with Devise ActiveJob integration. !3902 (Connor Shea)
- Allow "NEWS" and "CHANGES" as alternative names for CHANGELOG. !3768 (Connor Shea)
- Allow "NEWS" and "CHANGES" as alternative names for CHANGELOG. !3768 (Connor Shea)
- Added button to toggle whitespaces changes on diff view
- Added button to toggle whitespaces changes on diff view
- Backport GitHub Enterprise import support from EE
- Backport GitHub Enterprise import support from EE
...
@@ -93,6 +95,8 @@ v 8.7.1
...
@@ -93,6 +95,8 @@ v 8.7.1
v 8.7.0
v 8.7.0
- Gitlab::GitAccess and Gitlab::GitAccessWiki are now instrumented
- Gitlab::GitAccess and Gitlab::GitAccessWiki are now instrumented
- Fix vulnerability that made it possible to gain access to private labels and milestones
- Fix vulnerability that made it possible to gain access to private labels and milestones
v 8.7.0 (unreleased)
- The number of InfluxDB points stored per UDP packet can now be configured
- The number of InfluxDB points stored per UDP packet can now be configured
- Fix error when cross-project label reference used with non-existent project
- Fix error when cross-project label reference used with non-existent project
- Transactions for /internal/allowed now have an "action" tag set
- Transactions for /internal/allowed now have an "action" tag set
...
@@ -189,7 +193,6 @@ v 8.7.0
...
@@ -189,7 +193,6 @@ v 8.7.0
- Add Slack notifications when Wiki is edited (Sebastian Klier)
- Add Slack notifications when Wiki is edited (Sebastian Klier)
- Diffs load at the correct point when linking from from number
- Diffs load at the correct point when linking from from number
- Selected diff rows highlight
- Selected diff rows highlight
- Toggle sign-up confirmation emails in application settings
- Fix emoji categories in the emoji picker
- Fix emoji categories in the emoji picker
- API: Properly display annotated tags for GET /projects/:id/repository/tags (Robert Schilling)
- API: Properly display annotated tags for GET /projects/:id/repository/tags (Robert Schilling)
- Add encrypted credentials for imported projects and migrate old ones
- Add encrypted credentials for imported projects and migrate old ones
...
...
app/controllers/admin/application_settings_controller.rb
View file @
c5526a2d
...
@@ -106,7 +106,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
...
@@ -106,7 +106,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
:email_author_in_body
,
:email_author_in_body
,
:repository_checks_enabled
,
:repository_checks_enabled
,
:metrics_packet_size
,
:metrics_packet_size
,
:s
kip
_user_confirmation_email
,
:s
end
_user_confirmation_email
,
restricted_visibility_levels:
[],
restricted_visibility_levels:
[],
import_sources:
[],
import_sources:
[],
disabled_oauth_sign_in_sources:
[]
disabled_oauth_sign_in_sources:
[]
...
...
app/models/user.rb
View file @
c5526a2d
...
@@ -309,7 +309,8 @@ class User < ActiveRecord::Base
...
@@ -309,7 +309,8 @@ class User < ActiveRecord::Base
end
end
def
check_confirmation_email
def
check_confirmation_email
skip_confirmation!
if
current_application_settings
.
skip_user_confirmation_email
byebug
skip_confirmation!
unless
current_application_settings
.
send_user_confirmation_email
end
end
def
recently_sent_password_reset?
def
recently_sent_password_reset?
...
...
app/views/admin/application_settings/_form.html.haml
View file @
c5526a2d
...
@@ -107,8 +107,8 @@
...
@@ -107,8 +107,8 @@
.col-sm-offset-2.col-sm-10
.col-sm-offset-2.col-sm-10
.checkbox
.checkbox
=
f
.
label
:skip_confirmation_email
do
=
f
.
label
:skip_confirmation_email
do
=
f
.
check_box
:s
kip
_user_confirmation_email
=
f
.
check_box
:s
end
_user_confirmation_email
S
kip
sign-up email confirmation
S
end
sign-up email confirmation
.form-group
.form-group
.col-sm-offset-2.col-sm-10
.col-sm-offset-2.col-sm-10
.checkbox
.checkbox
...
...
db/migrate/20160421141709_add_send_confirmation_email_to_application_settings.rb
0 → 100644
View file @
c5526a2d
class
AddSendConfirmationEmailToApplicationSettings
<
ActiveRecord
::
Migration
def
up
add_column
:application_settings
,
:send_user_confirmation_email
,
:boolean
,
default:
false
#Sets confirmation email to true by default on existing installations.
ApplicationSetting
.
update_all
(
send_user_confirmation_email:
true
)
end
def
down
remove_column
:application_settings
,
:send_user_confirmation_email
end
end
db/migrate/20160421141709_add_skip_confirmation_email_to_application_settings.rb
deleted
100644 → 0
View file @
71ca2de7
class
AddSkipConfirmationEmailToApplicationSettings
<
ActiveRecord
::
Migration
def
change
#Skip confirmation emails just for new installations
default_value
=
User
.
count
>
0
?
false
:
true
add_column
:application_settings
,
:skip_user_confirmation_email
,
:boolean
,
default:
default_value
end
end
spec/controllers/registrations_controller_spec.rb
View file @
c5526a2d
...
@@ -8,10 +8,10 @@ describe RegistrationsController do
...
@@ -8,10 +8,10 @@ describe RegistrationsController do
end
end
end
end
let
(
:user_params
)
{
{
"user"
=>
{
"name"
=>
"new_user"
,
"username"
=>
"new_username"
,
"email"
=>
"new@user.com"
,
"password"
=>
"Any_password"
}
}
}
let
(
:user_params
)
{
{
user:
{
name:
"new_user"
,
username:
"new_username"
,
email:
"new@user.com"
,
password:
"Any_password"
}
}
}
context
'when s
kipp
ing email confirmation'
do
context
'when s
end
ing email confirmation'
do
before
{
allow
(
current_application_settings
).
to
receive
(
:s
kip_user_confirmation_email
).
and_return
(
tru
e
)
}
before
{
allow
(
current_application_settings
).
to
receive
(
:s
end_user_confirmation_email
).
and_return
(
fals
e
)
}
it
'logs user in directly'
do
it
'logs user in directly'
do
post
(
:create
,
user_params
)
post
(
:create
,
user_params
)
...
@@ -20,12 +20,12 @@ describe RegistrationsController do
...
@@ -20,12 +20,12 @@ describe RegistrationsController do
end
end
end
end
context
'when not s
kipp
ing email confirmation'
do
context
'when not s
end
ing email confirmation'
do
before
{
allow
(
current_application_settings
).
to
receive
(
:s
kip_user_confirmation_email
).
and_return
(
fals
e
)
}
before
{
allow
(
current_application_settings
).
to
receive
(
:s
end_user_confirmation_email
).
and_return
(
tru
e
)
}
it
'does not authenticate user and sends confirmation email'
do
it
'does not authenticate user and sends confirmation email'
do
post
(
:create
,
user_params
)
post
(
:create
,
user_params
)
expect
(
ActionMailer
::
Base
.
deliveries
.
last
.
to
.
first
).
to
eq
(
user_params
[
"user"
][
"email"
])
expect
(
ActionMailer
::
Base
.
deliveries
.
last
.
to
.
first
).
to
eq
(
user_params
[
:user
][
:email
])
expect
(
subject
.
current_user
).
to
be_nil
expect
(
subject
.
current_user
).
to
be_nil
end
end
end
end
...
...
spec/features/signup_spec.rb
View file @
c5526a2d
...
@@ -2,6 +2,8 @@ require 'spec_helper'
...
@@ -2,6 +2,8 @@ require 'spec_helper'
feature
'Signup'
,
feature:
true
do
feature
'Signup'
,
feature:
true
do
describe
'signup with no errors'
do
describe
'signup with no errors'
do
before
{
allow_any_instance_of
(
ApplicationSetting
).
to
receive
(
:send_user_confirmation_email
).
and_return
(
true
)
}
it
'creates the user account and sends a confirmation email'
do
it
'creates the user account and sends a confirmation email'
do
user
=
build
(
:user
)
user
=
build
(
:user
)
...
...
spec/models/user_spec.rb
View file @
c5526a2d
...
@@ -141,6 +141,7 @@ describe User, models: true do
...
@@ -141,6 +141,7 @@ describe User, models: true do
end
end
describe
'#confirm'
do
describe
'#confirm'
do
before
{
allow
(
current_application_settings
).
to
receive
(
:send_user_confirmation_email
).
and_return
(
true
)
}
let
(
:user
)
{
create
(
:user
,
confirmed_at:
nil
,
unconfirmed_email:
'test@gitlab.com'
)
}
let
(
:user
)
{
create
(
:user
,
confirmed_at:
nil
,
unconfirmed_email:
'test@gitlab.com'
)
}
it
'returns unconfirmed'
do
it
'returns unconfirmed'
do
...
...
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