示例#1
0
    error_reporting(E_ALL);
    ini_set('display_errors', 1);

ob_start();  // Output buffering - allows header rewrites to happen at anytime before flushing the buffer
session_start();

require_once("incdir.php.inc");
require_once("config.php");

include_php_dir("includes",$debug);

mysql_init();
handle_ajax();
document_header();
echo include_javascript_dir("js");
echo include_stylesheet_dir("stylesheets");

if (isset($_SESSION['validated']) && $_SESSION['validated']) { redirect("index.php"); }	//Logged in users should not be at this page

if (!isset($_POST['username']) AND !isset($_POST['password'])) {
	drawlogin(NULL); 
} //No action yet

elseif (!$_POST['username'] OR  !$_POST['password']) {
		drawlogin("missing"); 
}
elseif (validate($_POST['username'],$_POST['password']))
{
	redirect("index.php");
}
示例#2
0
<?php

ob_start();
// Output buffering - allows header rewrites to happen at anytime before flushing the buffer
session_start();
require_once "incdir.php.inc";
require_once "config.php";
include_php_dir("includes", $debug);
mysql_init();
handle_ajax();
document_header();
echo include_javascript_dir("js", $debug);
echo include_stylesheet_dir("stylesheets", $debug);
check_validated();
//If a new user was submitted!
if (isset($_POST['newuser-submit'])) {
    $userinfo = array("username" => $_POST['username'], "fname" => $_POST['fname'], "lname" => $_POST['lname'], "emplid" => $_POST['emplid'], "password" => $_POST['password'], "email" => $_POST['email'], "phone" => $_POST['phone'], "address" => $_POST['address'], "pwconfirm" => $_POST['pwconfirm']);
    adduser($userinfo);
}
if (!check_app_admin()) {
    header('Location: index.php');
}
open_page("Not User Management");
draw_page();
close_page();
ob_end_flush();
// Flush the buffer out to client
document_footer();
mysql_end();
//The actual page.
function draw_page()