Dotclear


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/auth.php

    r27 r42  
    3232$login_data = !empty($_POST['login_data']) ? $_POST['login_data'] : null; 
    3333$recover = $core->auth->allowPassChange() && !empty($_REQUEST['recover']); 
     34$safe_mode = !empty($_REQUEST['safe_mode']); 
    3435$akey = $core->auth->allowPassChange() && !empty($_GET['akey']) ? $_GET['akey'] : null; 
    3536$user_id = $user_pwd = $user_key = $user_email = null; 
     
    205206          } 
    206207     } 
     208     elseif ($check_user && !empty($_POST['safe_mode']) && !$core->auth->isSuperAdmin())  
     209     { 
     210          $err = __('Safe Mode can only be used for super administrators.'); 
     211     } 
    207212     elseif ($check_user) 
    208213     { 
     
    213218          if (!empty($_POST['blog'])) { 
    214219               $_SESSION['sess_blog_id'] = $_POST['blog']; 
     220          } 
     221           
     222          if (!empty($_POST['safe_mode']) && $core->auth->isSuperAdmin()) { 
     223               $_SESSION['sess_safe_mode'] = true; 
    215224          } 
    216225           
     
    284293      return true; 
    285294    }; 
     295     
     296    $('a#safe_mode_link_help').click(function() { 
     297      $(this).parent().next().slideToggle(); 
     298    }); 
    286299  }); 
    287300  //]]> 
     
    346359          echo 
    347360          '<fieldset>'; 
     361          if ($safe_mode) { 
     362               echo '<legend>'.__('Safe mode login').'</legend>'; 
     363          } 
    348364          echo 
    349365          '<p><label for="user_id">'.__('Username:').' '. 
     
    353369          form::password(array('user_pwd','user_pwd'),20,255,'','',2).'</label></p>'. 
    354370           
    355           '<p><label class="classic">'. 
    356371          '<p><label for="user_remember" class="classic">'. 
    357372          form::checkbox(array('user_remember','user_remember'),1,'','',3).' '. 
     
    363378               echo form::hidden('blog',html::escapeHTML($_REQUEST['blog'])); 
    364379          } 
     380          if($safe_mode) { 
     381               echo form::hidden('safe_mode',1); 
     382          } 
    365383           
    366384          echo 
     
    368386           
    369387          '<p>'.__('You must accept cookies in order to use the private area.').'</p>'; 
     388           
     389          if ($safe_mode) { 
     390               echo 
     391               '<p><a href="auth.php" id="normal_mode_link">'.__('Get back to normal authentication').'</a></p>'; 
     392          } else { 
     393               echo 
     394               '<p><a href="auth.php?safe_mode=1" id="safe_mode_link">'.__('I want to log in in safe mode').'</a></p>'. 
     395               '<p class="form-note"><a href="#" id="safe_mode_link_help">'.__('What is dotclear safe mode ?').'</a></p>'. 
     396               '<p id="safe_mode_help"><em>'. 
     397                    __('This mode allows you to login without activating any of your plugins. This may be useful to solve compatibility problems').'&nbsp;'. 
     398                    __('Disable or delete any plugin suspected to cause trouble, then log out and log back in normally.'). 
     399               '</em></p>'; 
     400          } 
    370401           
    371402          if ($core->auth->allowPassChange()) { 
Note: See TracChangeset for help on using the changeset viewer.

Sites map