Skip to content
Snippets Groups Projects
Commit 0f9838ce authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

ensure data is present before using it in Shib auth plugin, fixes #4616

Closes #4616

Merge request studip/studip!3429
parent e94126b1
No related branches found
No related tags found
No related merge requests found
......@@ -42,12 +42,14 @@ class StudipAuthShib extends StudipAuthSSO
$this->userdata = json_decode($auth, true);
if ($this->username_attribute !== 'username') {
$this->userdata['username'] = $this->userdata[$this->username_attribute];
}
if (isset($this->local_domain)) {
$this->userdata['username'] =
str_replace('@' . $this->local_domain, '', $this->userdata['username']);
if ($this->userdata) {
if ($this->username_attribute !== 'username') {
$this->userdata['username'] = $this->userdata[$this->username_attribute];
}
if (isset($this->local_domain)) {
$this->userdata['username'] =
str_replace('@' . $this->local_domain, '', $this->userdata['username']);
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment