Don't add 'user' perm automatically.
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Wed, 10 Aug 2011 22:50:13 +0000 (00:50 +0200)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Thu, 8 Sep 2011 23:14:46 +0000 (01:14 +0200)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
classes/user.php
classes/xorgsession.php

index 8647ddd..bd58db8 100644 (file)
@@ -886,7 +886,6 @@ class User extends PlUser
     public static function makePerms($perms, $is_admin)
     {
         $flags = new PlFlagSet($perms);
-        $flags->addFlag(PERMS_USER);
         if ($is_admin) {
             $flags->addFlag(PERMS_ADMIN);
         }
index 815ad81..3862b91 100644 (file)
@@ -228,7 +228,10 @@ class XorgSession extends PlSession
         $this->securityChecks();
         $this->setSkin();
         $this->updateNbNotifs();
-        check_redirect();
+        // Only check email redirection for 'internal' users.
+        if ($user->checkPerms(PERMS_USER)) {
+            check_redirect();
+        }
 
         // We should not have to use this private data anymore
         S::kill('auth_by_cookie');