# **************Use Sessions only when accessed by a "user" and not a "search engine"************* # $browser = array ("Gigabot","msnbot","Googlebot","Slurp","AltaVista","Scooter","appie","ArchitextSpider","BSDSeek","crawler@alexa.com","BSDSeek","AOL","Jeeves","T-H-U-N-D-E-R-S-T-O-N-E"); $isBot = 0; while (list ($key, $val) = each ($browser)) { if (strstr (strtolower($_SERVER['HTTP_USER_AGENT']), strtolower($val))) { $isBot = 1; } } if ($isBot) { ini_set('session.use_only_cookies', true); ini_set('session.use_cookies', true); ini_set ('url_rewriter.tags', ''); ini_set('session.use_trans_sid', false); } else { ini_set( 'arg_separator.output' , '&' ); ini_set( 'url_rewriter.tags' , 'a=href,area=href,frame=src,input=src,fieldset=' ); } session_start(); # *************************************end of session Code*************************************** # //**************Globals Off workaround******** foreach($_POST AS $key => $value) { ${$key} = $value; } foreach($_GET AS $key => $value) { ${$key} = $value; } //******************************************* //set poll cookie if ($submitpoll=="yes") { if(setcookie ("poll","yes", time()+3600)==TRUE) {} } // ************AUTHENTICATION CODE - Place under Globals Off Workaround*************** $intranetconfig = "content/.system-use/config/intranet.inc"; if (file_exists($intranetconfig)) { include $intranetconfig; $intranetlocation = explode("|", $intranet); if (($page==$intranetlocation[0])&&($subpage==$intranetlocation[1])) { list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':',base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6))); $password_file = "admin/intranetadmin/intranetpass.txt"; if(!$fh = fopen($password_file, "r")) {die("
Could Not Open Password File
");} $match = 0; $login = $_SERVER['PHP_AUTH_USER']; $password = md5($_SERVER['PHP_AUTH_PW']); while(!feof($fh)) { $line = fgets($fh, 4096); $user_pass = explode(":", $line); if($user_pass[0] == $login) { if(rtrim($user_pass[1]) == $password) { $match = 1; break; } } } if($match) {} else { header( 'WWW-Authenticate: Basic realm="Private"' ); header( 'HTTP/1.0 401 Unauthorized' ); echo 'Authorization Required. Access denied
'; exit; } fclose($fh); } } // **************************END AUTHENTICATION CODE *************************** ?> include "content/.system-use/config/config.inc"; include "content/.system-use/config/template.inc"; include "content/.system-use/config/cart.inc"; if ($page=="Order Received") {unset($_SESSION["cart"]);} if ((!$pagetemplatechoice)||($pagetemplatechoice=='')) {$pagetemplatechoice="template1";} if (($site_view=='off')&&($adminview!='on')) { include "content/.system-use/config/offline.inc"; die (""); } $sitelogo = "content/images/logos/sitelogo.jpg"; if ((!$page)&&(!$subpage)) { $page=$default_page; } if ($page) {$metapage = $page;} if ($subpage) {$submetapage = "-".$subpage;} //********* Load Custom Meta Tags*********** $metaincfile = 'content/metadata/'.$metapage.$submetapage.'.inc'; if (file_exists($metaincfile)) { require $metaincfile; } else { require 'content/metadata/default.inc'; if ($subpage) {$subpagemeta=" - ".$subpage;} $pagemetatitle=$company_name." - ".$page.$subpagemeta; } ?>