From 0077cb99704fe863cf731fc5cab792af2ede96c2 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Sun, 17 Apr 2011 20:13:07 -0400 Subject: Backporting retarded amount of changes outside of version control --- modules/admin/admin_functions.php | 302 +++++++++++++++++++------------------- 1 file changed, 151 insertions(+), 151 deletions(-) (limited to 'modules/admin/admin_functions.php') diff --git a/modules/admin/admin_functions.php b/modules/admin/admin_functions.php index 6c2b394..d0d54a8 100644 --- a/modules/admin/admin_functions.php +++ b/modules/admin/admin_functions.php @@ -1,152 +1,152 @@ -. - */ - /* -if(!defined("ADMIN_FILE")) -{ - die("Access denied."); - return; -} - -function is_loggedin() -{ - $id = session_id(); - if($id == "") - { - header("location: index.php"); - return false; - } - return true; -} - -function login() -{ - global $db; - - if(isset($_SESSION['username']) || isset($_SESSION['password'])) - { - return true; - } - - if(isset($_POST['processed'])) - { - $username = addslashes($_POST['username']); - $password = addslashes($_POST['password']); - $password = crypt(md5($password),'iamnotadirtywhorebitch'); - $result = $db->Query("SELECT * FROM bayonet_users WHERE username = '$username' AND password = '$password'"); - $rows = $db->Rows($result); - - if($rows > 0) - { - $_SESSION['username'] = stripslashes($username); - $_SESSION['password'] = stripslashes($password); - return true; - } - else - { - ReportError("Login incorrect."); - return false; - } - - } - else - { - echo "
\n"; - OpenTable(); - echo "Administrative Login\n"; - - echo "\n - \n - \n - \n -
Username
Password
\n"; - CloseTable(); - echo "
\n"; - return false; - } -} - -function logout() -{ - session_unset(); - session_destroy(); -} -*/ -/** - * CompileAdmin() - * - * because we want to have a horizontal display of options, we need to have - * the data separated by arrays. the data is processed into single tables, and is - * echoed in realtime. we checked to make sure they were arrays, but there is no - * checking to make sure the data passed is not malicious in nature. - * - * @param mixed $head - * @param mixed $body - * @return - */ - /* -function CompileAdmin($head,$body) -{ - /*if we were not passed arrays, then say goodbye - if(!is_array($head) || !is_array($body)) - { - echo "must be array\n"; - return; - } - - echo ""; - echo ""; - - $num = 1; - foreach($body as $td) - { - echo "\n"; - if($num%4 == 0){ - echo ""; - } - $num++; - } - echo "
$td
\n"; -} - - - * OpenTable() - * - * The administration OpenTable() function requires an argument to define - * the header title. It may be wise to replace the standard OpenTable() function - * with this one... that's alot of code to unfuck though. - * - * @param mixed $title - * @return - -function OpenTable_Ex($title) -{ - echo "
{$title}
"; -} - - - * CloseTable() - * - * @return - -function CloseTable_Ex() -{ - echo "
"; -} - */ +. + */ + /* +if(!defined("ADMIN_FILE")) +{ + die("Access denied."); + return; +} + +function is_loggedin() +{ + $id = session_id(); + if($id == "") + { + header("location: index.php"); + return false; + } + return true; +} + +function login() +{ + global $db; + + if(isset($_SESSION['username']) || isset($_SESSION['password'])) + { + return true; + } + + if(isset($_POST['processed'])) + { + $username = addslashes($_POST['username']); + $password = addslashes($_POST['password']); + $password = crypt(md5($password),'iamnotadirtywhorebitch'); + $result = $db->Query("SELECT * FROM bayonet_users WHERE username = '$username' AND password = '$password'"); + $rows = $db->Rows($result); + + if($rows > 0) + { + $_SESSION['username'] = stripslashes($username); + $_SESSION['password'] = stripslashes($password); + return true; + } + else + { + ReportError("Login incorrect."); + return false; + } + + } + else + { + echo "
\n"; + OpenTable(); + echo "Administrative Login\n"; + + echo "\n + \n + \n + \n +
Username
Password
\n"; + CloseTable(); + echo "
\n"; + return false; + } +} + +function logout() +{ + session_unset(); + session_destroy(); +} +*/ +/** + * CompileAdmin() + * + * because we want to have a horizontal display of options, we need to have + * the data separated by arrays. the data is processed into single tables, and is + * echoed in realtime. we checked to make sure they were arrays, but there is no + * checking to make sure the data passed is not malicious in nature. + * + * @param mixed $head + * @param mixed $body + * @return + */ + /* +function CompileAdmin($head,$body) +{ + /*if we were not passed arrays, then say goodbye + if(!is_array($head) || !is_array($body)) + { + echo "must be array\n"; + return; + } + + echo ""; + echo ""; + + $num = 1; + foreach($body as $td) + { + echo "\n"; + if($num%4 == 0){ + echo ""; + } + $num++; + } + echo "
$td
\n"; +} + + + * OpenTable() + * + * The administration OpenTable() function requires an argument to define + * the header title. It may be wise to replace the standard OpenTable() function + * with this one... that's alot of code to unfuck though. + * + * @param mixed $title + * @return + +function OpenTable_Ex($title) +{ + echo "
{$title}
"; +} + + + * CloseTable() + * + * @return + +function CloseTable_Ex() +{ + echo "
"; +} + */ ?> \ No newline at end of file -- cgit