X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fxnetsession.php;h=f03a838efa093650ca8ad467a654309463e06f2a;hb=fda78a6777a5f385537fc9f291afb310e12525e5;hp=2833d329b934f01cfe3bb64dc9538628fd3f7096;hpb=5e1513f67936a6c6866113d260746711af4ea2ee;p=platal.git diff --git a/classes/xnetsession.php b/classes/xnetsession.php index 2833d32..f03a838 100644 --- a/classes/xnetsession.php +++ b/classes/xnetsession.php @@ -1,6 +1,6 @@ start(AUTH_MDP)) { + if (!$this->start(AUTH_PASSWD)) { return false; } } @@ -77,7 +77,7 @@ class XnetSession extends XorgSession protected function doAuth($level) { - if (S::identified()) { // ok, c'est bon, on n'a rien à faire + if (S::identified()) { // Nothing to do there return User::getSilentWithValues(null, array('uid' => S::i('uid'))); } if (!Get::has('auth')) { @@ -88,7 +88,7 @@ class XnetSession extends XorgSession return null; } Get::kill('auth'); - S::set('auth', AUTH_MDP); + S::set('auth', AUTH_PASSWD); return User::getSilentWithValues(null, array('uid' => Get::i('uid'))); } @@ -98,8 +98,9 @@ class XnetSession extends XorgSession if (!$user->checkPerms('groups')) { return false; } + if ($level == AUTH_SUID) { - S::set('auth', AUTH_MDP); + S::set('auth', AUTH_PASSWD); } S::set('uid', $user->uid); @@ -114,8 +115,8 @@ class XnetSession extends XorgSession S::set('perms', $user->perms); S::set('is_admin', $user->is_admin); - - $this->makePerms($user->perms, $user->is_admin); + // Add the 'user' perms to the user. + $this->makePerms($user->perms . ',' . PERMS_USER, $user->is_admin); S::kill('challenge'); S::kill('loginX'); S::kill('may_update'); @@ -136,7 +137,7 @@ class XnetSession extends XorgSession if (!$this->startSUID($user)) { return false; } - S::set('perms', User::makePerms(PERMS_USER)); + S::set('perms', User::makePerms(PERMS_USER . ",groups")); return true; } @@ -217,5 +218,5 @@ function is_member($force = false, $lose = false) } // }}} -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8: ?>