Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
redmine-oauth
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyECP
redmine-oauth
Commits
fc430d6e
Commit
fc430d6e
authored
Oct 30, 2012
by
Дмитрий Коваленок
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reactoring method oauth_google_callback from the RedmineOmniauthController
parent
2d36aedd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
app/controllers/redmine_omniauth_controller.rb
app/controllers/redmine_omniauth_controller.rb
+9
-2
config/locales/en.yml
config/locales/en.yml
+1
-1
No files found.
app/controllers/redmine_omniauth_controller.rb
View file @
fc430d6e
...
...
@@ -16,9 +16,13 @@ class RedmineOmniauthController < AccountController
# Self-registration off
redirect_to
(
home_url
)
&&
return
unless
Setting
.
self_registration?
# Create on the fly
user
.
login
=
info
[
"email"
].
match
(
/(.+)@/
)[
1
]
unless
info
[
"email"
].
nil?
user
.
mail
=
info
[
"email"
]
unless
info
[
"email"
].
nil?
user
.
firstname
,
user
.
lastname
=
info
[
"name"
].
split
(
' '
)
unless
info
[
'name'
].
nil?
user
.
firstname
||=
info
[
:given_name
]
user
.
lastname
||=
info
[
:family_name
]
user
.
mail
=
info
[
"email"
]
login
=
info
[
"email"
].
match
(
/(.+)@/
)
unless
info
[
"email"
].
nil?
user
.
login
=
login
[
1
]
if
login
user
.
login
||=
[
user
.
firstname
,
user
.
lastname
]
*
"."
user
.
random_password
user
.
register
...
...
@@ -44,6 +48,9 @@ class RedmineOmniauthController < AccountController
account_pending
end
end
else
flash
[
:error
]
=
l
(
:notice_unable_to_obtain_google_credentials
)
redirect_to
signin_path
end
end
...
...
config/locales/en.yml
View file @
fc430d6e
# English strings go here for Rails i18n
en
:
my_label
:
"
My
label
"
notice_unable_to_obtain_google_credentials
:
"
Unable
to
obtain
credentials
from
Google.
You
have
not
yet
registered.
"
\ No newline at end of file
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