diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-01-13 09:49:47 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-01-13 09:49:47 +0000 |
commit | 10c147aa5e2e1be5a3d4eddebff1cdf1df0b604a (patch) | |
tree | 8433a42e47a5583b0f298a96cacc7f6f6689ae9a /login.php | |
parent | f2bf44079e365e8ff78cd48d901d5a86020bf13f (diff) | |
download | ampache-10c147aa5e2e1be5a3d4eddebff1cdf1df0b604a.tar.gz ampache-10c147aa5e2e1be5a3d4eddebff1cdf1df0b604a.tar.bz2 ampache-10c147aa5e2e1be5a3d4eddebff1cdf1df0b604a.zip |
removed libglue in favor of brand new vauth session handler fixes remember me
Diffstat (limited to 'login.php')
-rw-r--r-- | login.php | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -36,7 +36,11 @@ set_site_preferences(); if ( $_POST['username'] && $_POST['password'] ) { if ($_POST['rememberme']) { - setcookie('amp_longsess', '1', time()+3600*24*30*120); + $month = 86400*30; + vauth_conf(array('cookie_life'=>$month),1); + $cookie_name = vauth_conf('session_name') . "_remember"; + $cookie_life = time() + $month; + setcookie($cookie_name, '1', $cookie_life,'/',vauth_conf('cookie_domain')); } /* If we are in demo mode let's force auth success */ @@ -47,8 +51,8 @@ if ( $_POST['username'] && $_POST['password'] ) { $auth['info']['offset_limit'] = 25; } else { - $username = trim($_POST['username']); - $password = trim($_POST['password']); + $username = scrub_in($_POST['username']); + $password = scrub_in($_POST['password']); $auth = authenticate($username, $password); $user = new User($username); if ($user->disabled === '1') { @@ -61,17 +65,17 @@ if ( $_POST['username'] && $_POST['password'] ) { // // If we succeeded in authenticating, create a session // -if ( ($auth['success'] == 1)) { +if ($auth['success']) { // $auth->info are the fields specified in the config file // to retrieve for each user - make_local_session_only($auth); + vauth_session_create($auth); // // Not sure if it was me or php tripping out, // but naming this 'user' didn't work at all // - $_SESSION['userdata'] = $auth['info']; + $_SESSION['userdata'] = $auth; /* Make sure they are actually trying to get to this site and don't try to redirect them back into * an admin section |