Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix a weird case were updateAdminRights() can actually trigger the re…
Browse files Browse the repository at this point in the history
…pository list loading BEFORE user is stored in the session, and create an empty repository list.
  • Loading branch information
cdujeu committed Nov 24, 2014
1 parent 102efe7 commit e5cbea6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 4 additions & 6 deletions core/src/core/classes/class.AuthService.php
Expand Up @@ -370,15 +370,13 @@ public static function logUser($user_id, $pwd, $bypass_pwd = false, $cookieLogin
if ($authDriver->isAjxpAdmin($user_id)) {
$user->setAdmin(true);
}
if(self::$useSession) $_SESSION["AJXP_USER"] = $user;
else self::$currentUser = $user;

if ($user->isAdmin()) {
$user = self::updateAdminRights($user);
} else {
if (!$user->hasParent() && $user_id != "guest") {
//$user->setAcl("ajxp_shared", "rw");
}
self::updateUser($user);
}
if(self::$useSession) $_SESSION["AJXP_USER"] = $user;
else self::$currentUser = $user;

if ($authDriver->autoCreateUser() && !$user->storageExists()) {
$user->save("superuser"); // make sure update rights now
Expand Down
5 changes: 5 additions & 0 deletions core/src/core/classes/class.ConfService.php
Expand Up @@ -215,6 +215,11 @@ public static function getAuthDriverImpl()
return AJXP_PluginsService::getInstance()->getPluginById("core.auth")->getAuthImpl();
}

/**
* @param AbstractAjxpUser $loggedUser
* @param String|int $parameterId
* @return bool
*/
public static function switchUserToActiveRepository($loggedUser, $parameterId = -1)
{
if (isSet($_SESSION["PENDING_REPOSITORY_ID"]) && isSet($_SESSION["PENDING_FOLDER"])) {
Expand Down

0 comments on commit e5cbea6

Please sign in to comment.