summaryrefslogtreecommitdiffstats
path: root/login.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-01-25 08:16:53 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-01-25 08:16:53 +0000
commit0237890676fd9556db8d8505e0b84a652eaff33d (patch)
tree27290f937091e5db928596cc3061dd984a1dc468 /login.php
parentd36f8bdb45c6586807aa37b4ac32acf6de973269 (diff)
downloadampache-0237890676fd9556db8d8505e0b84a652eaff33d.tar.gz
ampache-0237890676fd9556db8d8505e0b84a652eaff33d.tar.bz2
ampache-0237890676fd9556db8d8505e0b84a652eaff33d.zip
hopefully fixed mysql5 problems with vauth as well as the remember me mojo for rubin
Diffstat (limited to 'login.php')
-rw-r--r--login.php21
1 files changed, 10 insertions, 11 deletions
diff --git a/login.php b/login.php
index 96a023fe..6940ccbc 100644
--- a/login.php
+++ b/login.php
@@ -30,16 +30,14 @@ $no_session = true;
require_once("modules/init.php");
set_site_preferences();
-//
-// So we check for a username and password first
-//
-if ( $_POST['username'] && $_POST['password'] ) {
+/* Check for posted username and password */
+if ($_POST['username'] && $_POST['password']) {
if ($_POST['rememberme']) {
- $month = 86400*30;
- vauth_conf(array('cookie_life'=>$month),1);
+ $extended = vauth_conf('remember_length');
+ vauth_conf(array('cookie_life'=>$extended),1);
$cookie_name = vauth_conf('session_name') . "_remember";
- $cookie_life = time() + $month;
+ $cookie_life = time() + $extended;
setcookie($cookie_name, '1', $cookie_life,'/',vauth_conf('cookie_domain'));
}
@@ -62,9 +60,7 @@ if ( $_POST['username'] && $_POST['password'] ) {
} // if we aren't in demo mode
}
-//
-// If we succeeded in authenticating, create a session
-//
+/* If the authentication was a success */
if ($auth['success']) {
// $auth->info are the fields specified in the config file
@@ -93,10 +89,13 @@ if ($auth['success']) {
header("Location: " . conf('web_path') . "/index.php");
exit();
} // auth success
+/* If auth failed then setup the error */
+else {
+ $GLOBALS['error']->add_error('general',$auth['error']);
+}
$htmllang = str_replace("_","-",conf('lang'));
?>
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $htmllang; ?>" lang="<?php echo $htmllang; ?>">
<head>