return 4; } else { return 3; } break; default: return 0; } } $_REQUEST['login_user'] = @$_SERVER['PHP_AUTH_USER']; $_REQUEST['login_pwd'] = @$_SERVER['PHP_AUTH_PW']; require_once GS_DIR . 'htdocs/gui/inc/pamal/pamal.php'; $methods = explode(',', GS_GUI_AUTH_METHOD); array_walk($methods, 'gs_trim_value'); foreach ($methods as &$method) { $PAM = new PAMAL($method); $user = $PAM->getUser(); if ($user) { break; } } unset($method); if (!$user) { header('WWW-Authenticate: Basic realm="My Realm"'); header('HTTP/1.0 401 Unauthorized'); die('Unauthorized'); } $userinfo = gs_user_get($user); $DB = gs_db_slave_connect(); $GS_INSTALLATION_TYPE_SINGLE = gs_get_conf('GS_INSTALLATION_TYPE_SINGLE'); if (!$GS_INSTALLATION_TYPE_SINGLE) {
} # authenticate the user # $login_info = ''; $login_errmsg = ''; $is_login = false; if (!@$_SESSION['login_ok'] && !@$_SESSION['login_user']) { if (isset($_REQUEST['login_user'])) { $_REQUEST['login_user'] = strtolower($_REQUEST['login_user']); } $_SESSION['sudo_user']['boi_session'] = null; require_once GS_DIR . 'htdocs/gui/inc/pamal/pamal.php'; $methods = explode(',', GS_GUI_AUTH_METHOD); array_walk($methods, 'gs_trim_value'); foreach ($methods as &$method) { $PAM = new PAMAL($method); $user = $PAM->getUser(); if ($user) { break; } } unset($method); if (!$user) { $_SESSION['login_ok'] = false; $_SESSION['login_user'] = false; $login_info = sPrintF(__('You are not logged in (authentication method: "%s").'), $PAM->getAuthMethod()); $login_errmsg = __('Benutzer oder Paßwort ungültig'); return; } $_SESSION['real_user']['_origname'] = preg_replace('/[^A-Za-z0-9_\\-.]/', '', $user); //if (! @$_SESSION['real_user']['name']) {