diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-07-26 07:43:18 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-07-26 07:43:18 +0000 |
commit | 392354df0a4f2c21aabad2f1b527448251a60f99 (patch) | |
tree | ab34820cef4990e4139326ccd2e507c5731d216c /login.php | |
parent | 975af37b254ebc74533f1562005dccf75ef0f021 (diff) | |
download | ampache-392354df0a4f2c21aabad2f1b527448251a60f99.tar.gz ampache-392354df0a4f2c21aabad2f1b527448251a60f99.tar.bz2 ampache-392354df0a4f2c21aabad2f1b527448251a60f99.zip |
switched to sha() password encryption not using sha2 because of limitations of amarok, also added some caching and fixed some misc bugs
Diffstat (limited to 'login.php')
-rw-r--r-- | login.php | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -99,13 +99,23 @@ if ($_POST['username'] && $_POST['password']) { /* If the authentication was a success */ if ($auth['success']) { + + // Generate the user we need for a few things + $user = User::get_from_username($username); + + if (Config::get('prevent_multiple_logins')) { + $current_ip = $user->is_logged_in(); + if ($current_ip != sprintf("%u",ip2long($_SERVER['REMOTE_ADDR']))) { + Error::add('general',_('User Already Logged in')); + require Config::get('prefix') . '/templates/show_login_form.inc.php'; + exit; + } + } // if prevent_multiple_logins + // $auth->info are the fields specified in the config file // to retrieve for each user vauth::session_create($auth); - // Generate the user we need for a few things - $user = User::get_from_username($username); - // // Not sure if it was me or php tripping out, // but naming this 'user' didn't work at all |