function require_user() { if (!isset($_COOKIE["user_name"]) || !isset($_COOKIE["user_password_hash"])) { Header("Location: login.php"); exit; } $user_name = $_COOKIE["user_name"]; $user_password_hash = $_COOKIE["user_password_hash"]; if (!fof_authenticate($user_name, $user_password_hash)) { Header("Location: login.php"); exit; } }
<?php $fof_no_login = 1; require "fof-main.php"; if (defined('FOF_AUTH_EXTERNAL') && !empty($_SERVER['REMOTE_USER'])) { $unread = fof_db_tag_count(fof_db_get_user_id($_SERVER['REMOTE_USER']), 'unread'); } else { if (isset($_COOKIE['user_name']) && isset($_COOKIE['user_password_hash'])) { if (fof_authenticate($_COOKIE['user_name'], $_COOKIE['user_password_hash'])) { $unread = fof_db_tag_count(fof_current_user(), 'unread'); } } } echo 'Feed on Feeds' . ($unread ? " ({$unread})" : ''); ?>
* * login.php - username / password entry * * * Copyright (C) 2004-2007 Stephen Minutillo * steve@minutillo.com - http://minutillo.com/steve/ * * Distributed under the GPL - see LICENSE * */ ob_start(); $fof_no_login = true; include_once "fof-main.php"; fof_set_content_type(); if (isset($_POST["user_name"]) && isset($_POST["user_password"])) { if (fof_authenticate($_POST['user_name'], md5($_POST['user_password'] . $_POST['user_name']))) { Header("Location: ."); exit; } else { $failed = true; } } ?> <!DOCTYPE html> <html> <head> <title>Feed on Feeds - Log on</title> <style> body
<?php $fof_no_login = 1; require "fof-main.php"; if (isset($_COOKIE["user_name"]) && isset($_COOKIE["user_password_hash"])) { $user_name = $_COOKIE["user_name"]; $user_password_hash = $_COOKIE["user_password_hash"]; if (fof_authenticate($user_name, $user_password_hash)) { $unread = fof_get_unread_count(fof_current_user()); } } echo "Feed on Feeds"; if ($unread) { echo " ({$unread})"; } ?>
* * 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 {
function require_user() { global $fof_user_id, $fof_user_name, $fof_user_level; if (defined('FOF_AUTH_EXTERNAL') && !empty($_SERVER['REMOTE_USER'])) { $user_row = fof_db_get_user($_SERVER['REMOTE_USER']); if (empty($user_row)) { fof_log('user \'' . $_SERVER['REMOTE_USER'] . '\' not indexed', 'auth'); if (defined('FOF_AUTH_EXTERNAL_ADD')) { $result = fof_db_add_user($_SERVER['REMOTE_USER'], 'unused password' . $_SERVER['UNIQUE_ID']); $user_row = fof_db_get_user($_SERVER['REMOTE_USER']); fof_log('added new index for user \'' . $_SERVER['REMOTE_USER'] . '\'', 'auth'); } } if (!empty($user_row)) { $fof_user_id = $user_row['user_id']; $fof_user_name = $user_row['user_name']; $fof_user_level = $user_row['user_level']; fof_log('user \'' . $_SERVER['REMOTE_USER'] . '\' established', 'auth'); return true; } if (defined('FOF_AUTH_EXTERNAL_ONLY')) { return false; } } if (!isset($_COOKIE['user_name']) || !isset($_COOKIE['user_password_hash'])) { header('Location: login.php'); exit; } $user_name = $_COOKIE['user_name']; $user_password_hash = $_COOKIE['user_password_hash']; if (!fof_authenticate($user_name, $user_password_hash)) { header('Location: login.php'); exit; } }