Beispiel #1
0
function humanize_user(&$user)
{
    $level_permissions = auth_user_level_permissions($user['level']);
    $level_real = $level_permissions['level'];
    if (isset($GLOBALS['config']['user_level'][$level_real])) {
        $def = $GLOBALS['config']['user_level'][$level_real];
        $user['level_label'] = $def['name'];
        $user['level_name'] = $def['name'];
        $user['level_real'] = $level_real;
        unset($def['name'], $level_permissions['level']);
        $user = array_merge($user, $def, $level_permissions);
        // Add label class
        $user['label_class'] = $user['row_class'] == 'disabled' ? 'inverse' : $user['row_class'];
    }
    //r($user);
}
         unset($_SESSION['user_ckey_id']);
     }
 } else {
     if (!$_SESSION['authenticated']) {
         // Not authenticated
         $_SESSION['auth_message'] = "Authentication Failed";
         session_logout(function_exists('auth_require_login'));
     }
 }
 // Retrieve user ID and permissions
 if ($_SESSION['authenticated']) {
     if (!is_numeric($_SESSION['userlevel']) || !is_numeric($_SESSION['user_id'])) {
         $_SESSION['userlevel'] = auth_user_level($_SESSION['username']);
         $_SESSION['user_id'] = auth_user_id($_SESSION['username']);
     }
     $level_permissions = auth_user_level_permissions($_SESSION['userlevel']);
     // If userlevel == 0 - user disabled an can not be logon
     if (!$level_permissions['permission_access']) {
         $_SESSION['auth_message'] = 'User login disabled';
         session_logout(FALSE, 'User disabled');
         header('Location: ' . $config['base_url']);
         exit;
     } else {
         if (!isset($_SESSION['user_limited']) || $_SESSION['user_limited'] != $level_permissions['limited']) {
             // Store user limited flag, required for quick permissions list generate
             $_SESSION['user_limited'] = $level_permissions['limited'];
         }
     }
     // Now we can enable debug if required
     if (defined('OBS_DEBUG_WUI')) {
         if ($_SESSION['userlevel'] < 7 && !$config['permit_user_debug']) {