public function startAvailableAuth()
{
if (!S::logged() && Get::has('auth')) {
- if (!$this->start(AUTH_MDP)) {
+ if (!$this->start(AUTH_PASSWD)) {
return false;
}
}
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')) {
return null;
}
Get::kill('auth');
- S::set('auth', AUTH_MDP);
+ S::set('auth', AUTH_PASSWD);
return User::getSilentWithValues(null, array('uid' => Get::i('uid')));
}
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);
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');
if (!$this->startSUID($user)) {
return false;
}
- S::set('perms', User::makePerms(PERMS_USER));
+ S::set('perms', User::makePerms(PERMS_USER . ",groups"));
return true;
}