1){ $argc = $_SERVER['argc']; $argv = $_SERVER['argv']; $argv2 = explode('=', $argv[2]); if(!isset($_REQUEST[$argv2[0]]) || $_REQUEST[$argv2[0]]!=$argv2[1]){ foreach($argv as $v)if($v!=$argv[0]){ $w = explode('=', $v); $_REQUEST[$w[0]]=$w[1]; $_GET[$w[0]]=$w[1]; } } } $ProdPath = ''; $DocRoot =$CurPath; $_SERVER['SERVER_NAME'] = 'no-server-name'; $_SERVER['HTTP_HOST'] = 'no-http-host'; $_SERVER['HTTP_USER_AGENT'] = 'command line'; $_SERVER['REMOTE_ADDR'] = '1.1.1.1'; $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_HOST'].'/'.$argv[0]; $from_command_line=true; define("COMMAND_LINE", true); } else { $TSelf = @(strpos($_SERVER['ORIG_SCRIPT_NAME'],"index.php")!==false) ? $_SERVER['ORIG_SCRIPT_NAME'] : $_SERVER['PHP_SELF']; $ProdPath = str_replace("\\", '/', $TSelf); $ProdPath = preg_replace("/\/+/", "/", $ProdPath); $ProdPath = substr($ProdPath, 0, strrpos($ProdPath, '/')); $DocRoot=str_replace($ProdPath, "", $CurPath); } if (@is_dir($CurPath."/system")) $SPath=""; else $SPath="/.."; if(!isset($_SERVER['DOCUMENT_ROOT'])) $_SERVER['DOCUMENT_ROOT'] = $DocRoot; if (@file_exists($CurPath."/conf.vars.php")) include_once $CurPath."/conf.vars.php"; $ProductCall="tracker"; if (!defined("NO_EVENT")) define("NO_EVENT", true); if (!defined("MOD_R")) define("MOD_R", (!empty($_SERVER['MOD_R']) || !empty($_SERVER['REDIRECT_MOD_R'])) ); if (!defined("INSTALLED")) { if (!@is_dir($CurPath."/install")) die("Unable to find directory \"install\"."); Header("Location: http://".$_SERVER['HTTP_HOST']."$ProdPath/install/index.php"); exit(); } /////////////////////////////////////// if ((isset($_REQUEST['sc'])&&$_REQUEST['sc']=="plugin") || (isset($_REQUEST['RequestPath'])&&preg_match("|plugin/[^\.]+\.html$|", $_REQUEST['RequestPath']))) { if (!defined("NO_ACTION")) define("NO_ACTION", true); $PluginAction=true; } if (isset($_REQUEST['sc'])&&$_REQUEST['sc']=="track"&&!defined("NO_SESSION")) { define("NO_SESSION",true); } require_once SYS."/system/index.php"; $Db->SetMysql40Mode(); if ($nsProduct->Section=="track") { define("NO_BUTTONS", true); define("NO_CONSULT", true); if (!defined("NO_WARNING")) define("NO_WARNING", true); define("NO_CLIENT", true); } if ($nsProduct->Section!="track") { include_once SYS."/system/class/bf/blowfish.class.php"; include_once SELF."/lib/license.func.php"; $BF = new Crypt_Blowfish('ns tracker license '); if ($Db->ID) GetCurrentLicense(); } $_GP=$_REQUEST; $CompArr=array(); require_once SELF."/lib/misc.func.php"; DEFINE("IMG", $nsProduct->HL."/skins/".$nsProduct->SKIN); if ($nsProduct->InitExists) include $nsProduct->CurrentInit(); if (ValidVar($nsUser->ENC)) header('Content-Type:text/html; charset='.$nsUser->ENC); else header('Content-Type:text/html; charset='.$LangConfig['charset']); if (!defined("NO_BUTTONS")||!NO_BUTTONS) { require_once SELF."/class/buttons.class.php"; $nsButtons = new nsButtons(); } if (!defined("NO_CLIENT")||!NO_CLIENT) { if ($Db->ID) { $CompId=ValidVar($_COOKIE['CompId']); if (ValidId($_GP['CpId'])&&$_GP['CpId']>0) $CompId=$_GP['CpId']; if (ValidVar($_GP['CpId'])=="nocomp") { $CompId=false; $nsUser->SetCookie("CompId", 0, time()+60*60*24*10*365, "/"); $_COOKIE['CompId']=false; } if (ValidId($SiteId)&&(!ValidId($CompId)||$CompId<1)) { $CompId=$Db->ReturnValue("SELECT COMPANY_ID FROM ?_site WHERE ID = ?", $SiteId); } if (!ValidId($CpId)) $CpId=$CompId; if (ValidId($nsUser->UserInfo['ID'])&&ValidVar($nsUser->ADMIN)&&$nsProduct->LICENSE==3) { $Query = "SELECT * FROM ?_client WHERE HIDDEN != '1' ORDER BY NAME ASC"; $Sql = new Query($Query); $CompArr=array(); while ($Row = $Sql->Row()) { $CompArr[]=$Row; } if (count($CompArr)<1) $CompArr=false; } else $CompArr=false; if (ValidVar($nsUser->MERCHANT)) { $_GP['CpId']=$CompId=$nsUser->COMPANY_ID; $CurrentCompany=GetCurrentCompany($nsUser->COMPANY_ID); } if (ValidId($CompId)&&!ValidVar($CurrentCompany)) $CurrentCompany=GetCurrentCompany($CompId); if (ValidVar($CurrentCompany)&&ValidId($CurrentCompany->ID)) $CpId=$CompId=$CurrentCompany->ID; if (ValidId($CompId)) { $nsUser->SetCookie("CompId", $CompId, time()+60*60*24*10*365, "/"); $_COOKIE['CompId']=$CompId; } } } if (!defined("NO_CONSULT")||!NO_CONSULT) { require_once SELF."/class/consult.class.php"; $Consult=new TrackerConsult(); } if ((!defined("NO_WARNING")||!NO_WARNING)&&is_dir($CurPath."/install")) { $Logs->Err($Lang['InstallNotDeleted']); } //if (!NO_EVENT) { // $nsEvent->On("OnBeforeAction"); //} if (!defined("NO_ACTION")||!NO_ACTION) { include $nsProduct->CurrentInclude(); } if ($PluginAction&&ValidVar($_REQUEST['action'])) { require SELF."/plugins/".$_REQUEST['action'].".plugin/default.php"; } if(defined("DEBUG")&&DEBUG&&!defined("COMMAND_LINE")){ include SELF."/skins/default/_console.php"; echo ""; } ?>