* steve@minutillo.com - http://minutillo.com/steve/ * * Distributed under the GPL - see LICENSE * */ ob_start(); $fof_no_login = true; include_once "fof-main.php"; if (defined('FOF_AUTH_EXTERNAL_ONLY')) { header('Location: .'); exit; } fof_set_content_type(); $failed = false; if (isset($_POST["user_name"]) && isset($_POST["user_password"])) { $user_password_hash = fof_db_user_password_hash($_POST['user_password'], $_POST['user_name']); if (fof_authenticate($_POST['user_name'], $user_password_hash)) { header("Location: ."); exit; } else { $failed = true; } } ?> <!DOCTYPE html> <html> <head> <title>Feed on Feeds - Log on</title> <style> body
$prefs->set('sidebar_style', $_POST['sidebar_style']); $prefs->set('simple_sidebar', isset($_POST['simple_sidebar'])); $prefs->set('favicons', isset($_POST['favicons'])); $prefs->set('keyboard', isset($_POST['keyboard'])); $prefs->set('item_target', isset($_POST['item_target'])); $prefs->set('tzoffset', intval($_POST['tzoffset'])); $prefs->set('howmany', intval($_POST['howmany'])); $prefs->set('order', $_POST['order']); $prefs->set('sharing', $_POST['sharing']); $prefs->set('sharedname', $_POST['sharedname']); $prefs->set('sharedurl', $_POST['sharedurl']); $prefs->save(fof_current_user()); if (!defined('FOF_AUTH_EXTERNAL_ONLY')) { if ($_POST['password'] && $_POST['password'] == $_POST['password2']) { fof_db_change_password($fof_user_name, $_POST['password']); $user_password_hash = fof_db_user_password_hash($_POST['password'], $fof_user_name); setcookie("user_password_hash", $user_password_hash, time() + 60 * 60 * 24 * 365 * 10); $message = "Updated password."; } else { if ($_POST['password'] || $_POST['password2']) { $message = "Passwords do not match!"; } } } $message .= ' Saved prefs.'; } if (isset($_POST['plugins'])) { foreach (fof_get_plugin_prefs() as $plugin_pref) { $key = $plugin_pref[1]; $prefs->set($key, fof_prefs_get_key_($_POST, $key)); }
function fof_db_change_password($username, $password) { global $FOF_USER_TABLE; global $fof_connection; $query = "UPDATE {$FOF_USER_TABLE} SET user_password_hash = :user_password_hash WHERE user_name = :user_name"; $statement = $fof_connection->prepare($query); $statement->bindValue(':user_password_hash', fof_db_user_password_hash($password, $username)); $statement->bindValue(':user_name', $username); $result = $statement->execute(); $statement->closeCursor(); return $result; }