Sessions: fixed on_critical_page(), it referenced the wrong global; enabled better extensible behavior in the account_active column
authorDan
Wed Jan 06 01:18:19 2010 -0500 (6 months ago)
changeset 1205c922ef08167a
parent 1204 eaab1c22e237
child 1206 50f6c144ec68
Sessions: fixed on_critical_page(), it referenced the wrong global; enabled better extensible behavior in the account_active column
includes/sessions.php
     1.1 --- a/includes/sessions.php	Tue Jan 05 09:56:21 2010 -0500
     1.2 +++ b/includes/sessions.php	Wed Jan 06 01:18:19 2010 -0500
     1.3 @@ -434,13 +434,13 @@
     1.4    
     1.5    function on_critical_page($strict = false)
     1.6    {
     1.7 -    global $title;
     1.8 -    list($page_id, $namespace) = RenderMan::strToPageID($title);
     1.9 +    global $urlname;
    1.10 +    list($page_id, $namespace) = RenderMan::strToPageID($urlname);
    1.11      list($page_id) = explode('/', $page_id);
    1.12      
    1.13      if ( $strict )
    1.14      {
    1.15 -      return $namespace == 'Special' && in_array($page_id, array('CSS', 'Login', 'Logout'));
    1.16 +      return $namespace == 'Special' && in_array($page_id, array('CSS', 'Login', 'Logout', 'LangExportJSON'));
    1.17      }
    1.18      else
    1.19      {
    1.20 @@ -582,7 +582,7 @@
    1.21      $this->check_banlist();
    1.22      
    1.23      // make sure the account is active
    1.24 -    if ( !$this->compat && $this->user_logged_in && $userdata['account_active'] != 1 && !$this->on_critical_page() )
    1.25 +    if ( !$this->compat && $this->user_logged_in && $userdata['account_active'] < 1 && !$this->on_critical_page() )
    1.26      {
    1.27        $this->show_inactive_error($userdata);
    1.28      }
    1.29 @@ -2051,8 +2051,6 @@
    1.30        eval($cmd);
    1.31      }
    1.32      
    1.33 -    // Uncomment to automatically log the user in (WARNING: commented out for a reason - doesn't consider activation and other things)
    1.34 -    // $this->register_session($user_orig, $password);
    1.35      return 'success';
    1.36    }
    1.37