% // @General Required File for Websites // // @Rev 1.0.0:unknown - Initial Creation // @ // @Redistribution or use of this module without express written permission is not permissible. // @ // @(C) 2005 Matthew J. MacSuga. All Rights Reserved. // Require the main object/functions file require_once("required_database.php"); require_once("required_functions.php"); // Used variables in pages based on authentication $AUTH_userid = ""; $AUTH_access = ""; // Create the database object $DBObj = new DBClass_Main; // Assign the connection values to the object $DBObj->db_user = $CONFIG_database_user; $DBObj->db_pass = $CONFIG_database_pass; $DBObj->db_name = $CONFIG_database_name; $DBObj->db_host = $CONFIG_database_host; // Connect to the database if (!$DBObj->connect()) { die("Error connecting to the database. Application can not continue."); } // Generate unique shopperids if we need them if ($CONFIG_enable_shopperids) { $shopper_id = generate_id("shopper_id",0,""); //$shopper_permid = generate_id("shopper_permid",0,""); } function disable_cache($which = "header") { switch($which) { case "header": // Disable All Browser Caching header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); break; case "meta": RW(""); RW(""); RW(""); break; } } // This function verifies login information ; call on each page to validate function admin_authorization($check_page_usage = true, $prefix = "admin") { global $DBObj; global $AUTH_userid,$AUTH_access,$CONFIG_secure_hash,$validuser; global $AUTH_userpw; // Check to see if a user is logged in, and if so $cur_userid = nullWrap($_COOKIE["member_userid"],C_STRING); $cur_userpw = nullWrap($_COOKIE["member_userpw"],C_STRING); $cur_userhs = nullWrap($_COOKIE["member_userhs"],C_STRING); $cur_access = 0; $validuser = false; if ($cur_userid) { $params = '&action=user_info_request&gateway_pass=K2aAjTTxjTCgqj3N&account_id=223510'; $params .= '&user='.$cur_userid; $result = sendPost("http://205.134.229.222/gateway/",$params,true); // Loop through results and get values foreach($result as $key=>$val) { switch ($key) { case "pass": $verify_userpw = trim($val); break; } } $verify_hash = md5($cur_userid.$cur_userpw.$CONFIG_secure_hash); if (($cur_userpw != md5($verify_userpw.$CONFIG_secure_hash)) || ($verify_hash != $cur_userhs)) { setcookie("admin_userid","0",time() - 3600); setcookie("admin_userpw","0",time() - 3600); setcookie("admin_userhs","0",time() - 3600); } else { // Set the values for use in pages //$AUTH_access = $DBObj->query_r("SELECT flags FROM admin_user WHERE id = $cur_userid"); $AUTH_userid = $cur_userid; $AUTH_userpw = $verify_userpw; $validuser = true; // Check to make sure the page we're on is what we're allowed to be on if ($check_page_usage) { $pagename = basename($_SERVER["PHP_SELF"]); if (!$DBObj->query_r("SELECT COUNT(*) FROM admin_pages WHERE pageurl = '".$pagename."' AND (flags & $AUTH_access) = flags")) $validuser = false; } } } // Return to calling operation if the user is logged in / valid for current page return $validuser; } %>
adult chat spokane adult chats spokane alternative lifestyle spokane live chatroom idaho live chatroom spokane live chatroom washington live web cams spokane spokane adult webcams spokane amateurs spokane dancers spokane porn spokane sex spokane strippers spokane swingers spokane video chat washington porn washington web cams web cams spokane