Ignore:
Timestamp:
Mar 31, 2010, 6:32:40 PM (14 years ago)
Author:
george
Message:
  • Upraveno: Aktualizace fóra.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/forum/includes/auth/auth_apache.php

    r400 r702  
    66*
    77* @package login
    8 * @version $Id: auth_apache.php 8602 2008-06-04 16:05:27Z naderman $
     8* @version $Id$
    99* @copyright (c) 2005 phpBB Group
    1010* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    105105                                );
    106106                        }
    107        
     107
    108108                        // Successful login...
    109109                        return array(
     
    218218                'user_type'             => USER_NORMAL,
    219219                'user_ip'               => $user->ip,
     220                'user_new'              => ($config['new_member_post_limit']) ? 1 : 0,
    220221        );
    221222}
     
    228229function validate_session_apache(&$user)
    229230{
    230         if (!isset($_SERVER['PHP_AUTH_USER']))
    231         {
    232                 return false;
    233         }
    234 
    235         $php_auth_user = '';
    236         set_var($php_auth_user, $_SERVER['PHP_AUTH_USER'], 'string', true);
    237 
    238         return ($php_auth_user === $user['username']) ? true : false;
     231        // Check if PHP_AUTH_USER is set and handle this case
     232        if (isset($_SERVER['PHP_AUTH_USER']))
     233        {
     234                $php_auth_user = '';
     235                set_var($php_auth_user, $_SERVER['PHP_AUTH_USER'], 'string', true);
     236
     237                return ($php_auth_user === $user['username']) ? true : false;
     238        }
     239
     240        // PHP_AUTH_USER is not set. A valid session is now determined by the user type (anonymous/bot or not)
     241        if ($user['user_type'] == USER_IGNORE)
     242        {
     243                return true;
     244        }
     245
     246        return false;
    239247}
    240248
Note: See TracChangeset for help on using the changeset viewer.