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
S
scripts
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Blanc
scripts
Commits
f986184e
Commit
f986184e
authored
Jun 15, 2013
by
Valentin Samir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[wiki/auth/cas] Affichage du lien vers le cas sur la page de login
parent
e44c44f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
wiki/auth/cas.py
wiki/auth/cas.py
+9
-1
No files found.
wiki/auth/cas.py
View file @
f986184e
...
...
@@ -21,6 +21,7 @@ logging = log.getLogger(__name__)
from
MoinMoin.auth
import
BaseAuth
from
MoinMoin
import
user
,
wikiutil
from
MoinMoin.theme
import
load_theme_fallback
class
PyCAS
(
object
):
"""A class for working with a CAS server."""
...
...
@@ -75,7 +76,7 @@ class PyCAS(object):
class
CASAuth
(
BaseAuth
):
""" handle login from CAS """
name
=
'CAS'
login_inputs
=
[
'username'
,
'password'
]
login_inputs
=
[]
logout_possible
=
True
def
__init__
(
self
,
auth_server
,
login_path
=
"/login"
,
logout_path
=
"/logout"
,
validate_path
=
"/validate"
,
action
=
"login_cas"
,
create_user
=
False
,
fallback_url
=
None
,
ticket_path
=
None
):
...
...
@@ -130,6 +131,8 @@ class CASAuth(BaseAuth):
if
not
force
and
user_obj
and
user_obj
.
valid
:
if
self
.
action
==
action
:
request
.
http_redirect
(
url
)
if
ticket
:
request
.
http_redirect
(
url
)
return
user_obj
,
True
if
self
.
ticket_path
and
request
.
method
==
'POST'
:
...
...
@@ -156,6 +159,7 @@ class CASAuth(BaseAuth):
request
.
http_redirect
(
"%s?action=%s&wiki_url=%s"
%
(
self
.
fallback_url
,
self
.
action
,
url
))
if
u
.
valid
:
store_ticket
(
ticket
,
username
)
load_theme_fallback
(
request
,
u
.
theme_name
)
return
u
,
True
# login
...
...
@@ -174,3 +178,7 @@ class CASAuth(BaseAuth):
return
user_obj
,
False
def
login_hint
(
self
,
request
):
_
=
request
.
getText
msg
=
_
(
'<p><a href="?action=login_cas">Se connecter via le CAS</a> (vous devez disposer d
\'
un compte Cr@ns pour cela)</p>'
)
return
msg
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