Skip to content

Commit

Permalink
Could not assign roles to new users #1183
Browse files Browse the repository at this point in the history
  • Loading branch information
Fasse committed Jan 22, 2022
1 parent 99df84b commit 9330116
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions adm_program/modules/profile/profile_save.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
// Only administrators could change loginname or within a new registration
if ($_POST['usr_login_name'] !== $user->getValue('usr_login_name')) {
if (strlen($_POST['usr_login_name']) > 0) {
// pruefen, ob der Benutzername bereits vergeben ist
// check if the username is already assigned
$sql = 'SELECT usr_uuid
FROM '.TBL_USERS.'
WHERE usr_login_name = ?';
Expand All @@ -237,7 +237,7 @@
}
}

// falls Registrierung, dann die entsprechenden Felder noch besetzen
// if registration, then still fill the corresponding fields
if ($getNewUser === 2) {
$user->setPassword($_POST['usr_password']);

Expand Down Expand Up @@ -269,7 +269,7 @@

$gDb->endTransaction();

// wenn Daten des eingeloggten Users geaendert werden, dann Session-Variablen aktualisieren
// if data of the logged in user is changed, then update session variables
if ((int) $user->getValue('usr_id') === $gCurrentUserId) {
$gCurrentUser = $user;
}
Expand All @@ -278,7 +278,7 @@
$gNavigation->deleteLastUrl();

// ------------------------------------------------------------
// je nach Aufrufmodus auf die richtige Seite weiterleiten
// redirect to the correct page depending on the call mode
// ------------------------------------------------------------

if ($getNewUser === 1 || $getNewUser === 3) {
Expand All @@ -304,7 +304,7 @@
// if current user has the right to assign roles then show roles dialog
// otherwise go to previous url (default roles are assigned automatically)
if ($gCurrentUser->assignRoles()) {
admRedirect(SecurityUtils::encodeUrl(ADMIDIO_URL . FOLDER_MODULES.'/profile/roles.php', array('user_uuid' => $getUserUuid, 'new_user' => $getNewUser)));
admRedirect(SecurityUtils::encodeUrl(ADMIDIO_URL . FOLDER_MODULES.'/profile/roles.php', array('user_uuid' => $user->getValue('usr_uuid'), 'new_user' => $getNewUser)));
// => EXIT
} else {
$gMessage->setForwardUrl($gNavigation->getPreviousUrl(), 2000);
Expand Down

0 comments on commit 9330116

Please sign in to comment.