colorful rat Ratfactor.com > Dave's Repos

htmlwarden

A flat HTML file Wiki in PHP
git clone http://ratfactor.com/repos/htmlwarden/htmlwarden.git

htmlwarden/login.php

Download raw file: login.php

1 <?php 2 require 'core.php'; 3 4 $login = trim($_REQUEST['login']); 5 6 if(!isset($GLOBALS['wiki_logins']) || !isset($GLOBALS['wiki_logins'][$login])){ 7 # Remove existing cookie. (Failure also logs you out.) 8 setcookie('login','',0,$GLOBALS['cookie_root']); 9 echo "Login failed."; 10 exit; # Error status won't set cookie. 11 } 12 13 $ten_years = 315360000; # in seconds 14 setcookie( 15 'login', # Cookie name 16 $login, # Value 17 time() + $ten_years, # Expires 18 $GLOBALS['cookie_root'] # Path where cookie valid 19 ); 20 header("Location: index.php");