Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marcus Eibrink-Lunzenauer
Stud.IP
Commits
1d6da9b1
Commit
1d6da9b1
authored
2 months ago
by
André Noack
Browse files
Options
Downloads
Patches
Plain Diff
Resolve #5099 "PHP-Fehler beim Login über SSO, wenn das auth_plugin nicht übereinstimmt"
Closes #5099 Merge request
studip/studip!3815
parent
5bf6eefb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/authentication/Manager.php
+12
-4
12 additions, 4 deletions
lib/authentication/Manager.php
with
12 additions
and
4 deletions
lib/authentication/Manager.php
+
12
−
4
View file @
1d6da9b1
...
@@ -13,11 +13,14 @@ namespace Studip\Authentication;
...
@@ -13,11 +13,14 @@ namespace Studip\Authentication;
use
AccessDeniedException
;
use
AccessDeniedException
;
use
Config
;
use
Config
;
use
MessageBox
;
use
Metrics
;
use
Metrics
;
use
PageLayout
;
use
Request
;
use
Request
;
use
Seminar_Perm
;
use
Seminar_Perm
;
use
Seminar_User
;
use
Seminar_User
;
use
StudipAuthAbstract
;
use
StudipAuthAbstract
;
use
StudipAuthSSO
;
use
StudipMail
;
use
StudipMail
;
use
Token
;
use
Token
;
use
User
;
use
User
;
...
@@ -55,10 +58,9 @@ class Manager
...
@@ -55,10 +58,9 @@ class Manager
Metrics
::
increment
(
'core.sso_login.attempted'
);
Metrics
::
increment
(
'core.sso_login.attempted'
);
// then do login
// then do login
$authplugin
=
StudipAuthAbstract
::
GetInstance
(
$provider
);
$authplugin
=
StudipAuthAbstract
::
GetInstance
(
$provider
);
if
(
$authplugin
instanceof
\StudipAuthSSO
)
{
if
(
$authplugin
instanceof
StudipAuthSSO
)
{
$authplugin
->
authenticateUser
(
''
,
''
);
$user
=
$authplugin
->
authenticateUser
(
''
,
''
);
if
(
$authplugin
->
getUser
())
{
if
(
$user
)
{
$user
=
$authplugin
->
getStudipUser
(
$authplugin
->
getUser
());
if
(
$user
->
isExpired
())
{
if
(
$user
->
isExpired
())
{
throw
new
AccessDeniedException
(
throw
new
AccessDeniedException
(
_
(
'Dieses Benutzerkonto ist abgelaufen. Wenden Sie sich bitte an die Administration.'
)
_
(
'Dieses Benutzerkonto ist abgelaufen. Wenden Sie sich bitte an die Administration.'
)
...
@@ -73,6 +75,12 @@ class Manager
...
@@ -73,6 +75,12 @@ class Manager
$this
->
setAuthenticatedUser
(
$user
);
$this
->
setAuthenticatedUser
(
$user
);
sess
()
->
regenerateId
([
'auth'
,
'_language'
,
'phpCAS'
,
'contrast'
]);
sess
()
->
regenerateId
([
'auth'
,
'_language'
,
'phpCAS'
,
'contrast'
]);
}
else
{
PageLayout
::
postMessage
(
MessageBox
::
error
(
$authplugin
->
plugin_name
.
': '
.
_
(
'Login fehlgeschlagen'
),
$authplugin
->
error_msg
?
[
$authplugin
->
error_msg
]
:
[]),
md5
(
$authplugin
->
error_msg
)
);
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment