Dotclear

Changeset 313:92f24bfd1563 for admin


Ignore:
Timestamp:
05/24/11 13:56:04 (14 years ago)
Author:
Dsls <dsls@…>
Branch:
default
Message:

superadmin now cannot delete themselves, nor remove their superadmin right.

Location:
admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • admin/user.php

    r270 r313  
    9696          $cur->user_post_status = $user_post_status = $_POST['user_post_status']; 
    9797           
     98          if ($cur->user_id == $core->auth->userID() && $core->auth->isSuperAdmin()) { 
     99               // force super_user to true if current user 
     100               $cur->user_super = $user_super = true; 
     101          } 
    98102          if ($core->auth->allowPassChange()) { 
    99103               $cur->user_change_pwd = !empty($_POST['user_change_pwd']) ? 1 : 0; 
     
    255259} 
    256260 
     261$super_disabled = $user_super && $user_id == $core->auth->userID(); 
     262 
    257263echo 
    258 '<p><label for="user_super" class="classic">'.form::checkbox('user_super','1',$user_super,'',16).' '. 
     264'<p><label for="user_super" class="classic">'.form::checkbox('user_super','1',$user_super,'',16,$super_disabled).' '. 
    259265__('Super administrator').'</label></p>'. 
    260266'</div>'. 
  • admin/users.php

    r270 r313  
    2424               # --BEHAVIOR-- adminBeforeUserDelete 
    2525               $core->callBehavior('adminBeforeUserDelete',$u); 
    26                 
    27                $core->delUser($u); 
     26               if ($u != $core->auth->userID()) { 
     27                    $core->delUser($u); 
     28               } 
    2829          } 
    2930          catch (Exception $e) 
     
    3233          } 
    3334     } 
    34       
    3535     if (!$core->error->flag()) { 
    3636          http::redirect('users.php?del=1'); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map