Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sat, Feb 1, 6:36 PM

in-portal

This file is larger than 256 KB, so syntax highlighting was skipped.
Index: trunk/kernel/include/modules.php
===================================================================
--- trunk/kernel/include/modules.php (revision 40)
+++ trunk/kernel/include/modules.php (revision 41)
@@ -1,897 +1,899 @@
<?php
/* List of installed modules and module-specific variables
Copyright 2002, Intechnic Corporation, All rights reserved
*/
setcookie("CookiesTest", "1");
$ExtraVars = array();
function ParseEnv()
{
global $env, $var_list, $mod_prefix,$objSession, $SessionQueryString;
/* parse individual sections */
$env = isset($_GET['env']) ? $_GET['env'] : '';
if ($env == "")
{
$var_list["t"] = "index";
if(is_array($mod_prefix))
{
foreach($mod_prefix as $key => $value)
{
if(strlen($key))
{
$parser_name = $key . "_ParseEnv";
if(function_exists($parser_name))
{
@$parser_name();
}
}
}
}
}
else
{
$envsections = explode(":", $env);
foreach($mod_prefix as $key => $value)
{
if(strlen($key))
{
$parsed=FALSE;
$parser_name = $key . "_ParseEnv";
for($i=1; $i<sizeof($envsections); $i++)
{
$pieces = explode("-", $envsections[$i]);
if(substr($pieces[0],0,strlen($key))==$key)
{
$parsed=TRUE;
if(function_exists($parser_name))
{
$parser_name($envsections[$i]);
}
}
}
if(!$parsed)
{
if(function_exists($parser_name))
{
@$parser_name();
}
}
}
}
$req_vars = explode("-", $envsections[0]);
$sid = $req_vars[0];
if(!$SessionQueryString)
{
if(!strlen($sid) || $sid=="_")
{
if($sid != "_")
$sid = $_COOKIE["sid"];
}
else
$SessionQueryString = TRUE;
}
$var_list["sid"] = $sid;
$var_list["t"] = $req_vars[1];
if( isset($_GET['dest']) )
$var_list['dest'] = $_GET['dest'];
}
}
function LoadEnv()
{
global $env, $var_list, $mod_prefix,$objSession;
$env = $_GET["env"];
// echo "Loading Variables..<br>\n";
if ($env != "")
{
$envsections = explode(":", $env);
foreach($mod_prefix as $key => $value)
{
if(strlen($key))
{
$parsed=FALSE;
for($i=1; $i<sizeof($envsections); $i++)
{
$pieces = explode("-", $envsections[$i]);
if(substr($pieces[0],0,strlen($key))==$key)
{
$parsed=TRUE;
break;
}
}
if(!$parsed)
{
$parser_name = $key . "_LoadEnv";
//echo $parser_name;
if(function_exists($parser_name))
{
$parser_name();
}
}
else
{
$parser_name = $key . "_SaveEnv";
//echo $parser_name;
if(function_exists($parser_name))
{
$parser_name($envsections[$i]);
}
}
}
}
}
}
function BuildEnv()
{
global $var_list,$m_var_list, $var_list_update, $mod_prefix, $objSession, $objConfig,
$ExtraVars, $objThemes, $CurrentTheme, $SessionQueryString, $FrontEnd;
static $theme;
$env = "";
//echo "Query String: $SessionQueryString<br>\n";
if(($objConfig->Get("CookieSessions")==0 || !$FrontEnd || ($objConfig->Get("CookieSessions")==2 && $SessionQueryString==TRUE)))
{
if(!$objSession->UseTempKeys)
{
$sessionkey = $objSession->GetSessionKey();
}
else
$sessionkey = $objSession->Get("CurrentTempKey");
$env = $sessionkey;
}
$env .= "-";
if (isset($var_list_update["t"]))
{
if($var_list_update["t"]=="_referer_")
{
$var_list_update["t"] =$objSession->GetVariable("Template_Referer");
}
$t = $var_list_update["t"];
if(!is_numeric($t))
{
if(!is_object($theme))
$theme = $objThemes->GetItem($m_var_list["theme"]);
$id = $theme->GetTemplateId($t);
$var_list_update["t"] = $id;
}
$env .= $var_list_update["t"];
}
else
{
$t = $var_list["t"];
if(!is_numeric($t))
{
if(!is_object($theme))
$theme = $objThemes->GetItem($m_var_list["theme"]);
$id = $theme->GetTemplateId($t);
$t = $id;
}
$env .= $t;
}
if(is_array($mod_prefix))
{
foreach($mod_prefix as $key => $value)
{
$builder_name = $key . "_BuildEnv";
if(function_exists($builder_name))
$env .= $builder_name();
}
}
$extra = "";
$keys = array_keys($ExtraVars);
if(is_array($keys))
{
for($i=0;$i<count($keys);$i++)
{
$key = $keys[$i];
$e = "&".$key."=".$ExtraVars[$key];
$extra .= $e;
$e = "";
}
}
$env .= $extra;
return $env;
}
function CategoryActionFunc($basename,$CatList)
{
global $mod_prefix;
foreach($mod_prefix as $key => $value)
{
$function_name = $key."_".$basename;
if(function_exists($function_name))
{
$function_name($CatList);
}
}
}
function RegisterEnv($Var,$Value)
{
global $ExtraVars;
$ExtraVars[$Var] = $Value;
}
function UnregisterEnv($Var)
{
global $ExtraVars;
unset($ExtraVars[$Var]);
}
function ModuleTagPrefix($name)
{
global $modules_loaded;
$ret = "";
foreach($modules_loaded as $prefix=>$mod_name)
{
if($name==$mod_name)
{
$ret = $prefix;
break;
}
}
return $ret;
}
function ModuleEnabled($name)
{
global $template_path;
$a = array_keys($template_path);
if(in_array($name,$a))
return TRUE;
return FALSE;
}
function GetModuleArray($array_name="mod_prefix")
{
switch($array_name)
{
case "mod_prefix":
global $mod_prefix;
return $mod_prefix;
break;
case "admin":
global $mod_prefix, $modules_loaded;
$mod = array();
if(is_array($mod_prefix) && is_array($modules_loaded))
{
foreach ($mod_prefix as $key=>$value)
{
if(_ModuleLicensed($modules_loaded[$key]) || $key=="m")
{
$mod[$key] = $value;
}
}
}
return $mod;
break;
case "loaded":
global $modules_loaded;
return $modules_loaded;
break;
case "template":
global $template_path;
return $template_path;
case "rootcat":
global $mod_root_cats;
return $mod_root_cats;
break;
}
}
function admin_login()
{
global $objSession,$login_error, $objConfig,$g_Allow,$g_Deny;
//echo "<pre>"; print_r($objSession); echo "</pre>";
-
+
+ if( GetVar('help_usage') == 'install' ) return true;
+
$env_arr = explode('-', $_GET['env']);
$get_session_key = $env_arr[0];
if(!$objSession->ValidSession() || ($objSession->GetSessionKey() != $get_session_key && $_POST['adminlogin'] != 1)) {
if ($_GET['expired'] == 1) {
$login_error = admin_language("la_text_sess_expired");
}
return FALSE;
//echo "Expired<br>";
}
if ($objSession->HasSystemPermission("ADMIN") == 1)
return TRUE;
if(count($_POST)==0 || $_POST["adminlogin"]!=1)
return FALSE;
$login=$_POST["login"];
$password = $_POST["password"];
if (strlen($login) && strlen($password))
{
if(!_IpAccess($_SERVER['REMOTE_ADDR'],$g_Allow,$g_Deny))
{
$login_error = admin_language("la_text_address_denied");
return FALSE;
}
$valid = $objSession->Login($login, md5($password));
$hasperm = ($objSession->HasSystemPermission("ADMIN") == 1);
if (($login=="root" || $hasperm) && $valid)
{
if(_ValidateModules())
{
return TRUE;
}
else
$login_error = "Missing or invalid In-Portal License";
}
else
{
if(!$hasperm && $valid)
{
$login_error = admin_language("la_text_nopermissions");
}
else
{
$login_error = admin_language("la_Text_Access_Denied");
}
return FALSE;
}
}
else
{
if(!strlen($login))
{
$login_error = admin_language("la_Text_Missing_Username");
}
else
if(!strlen($password))
$login_error = admin_language("la_Text_Missing_Password");
return FALSE;
}
}
#---------------------------------------------------------------------------
function _EnableCookieSID()
{
global $var_list, $objConfig;
if((!$_COOKIE["sid"] && $objConfig->Get("CookieSessions")>0 && strlen($var_list["sid"])<2 && !headers_sent())
|| strlen($_COOKIE["sid"])>0)
{
return TRUE;
}
else
return FALSE;
}
function _IsSpider($UserAgent)
{
global $robots, $pathtoroot;
$lines = file($pathtoroot."robots_list.txt");
if(!is_array($robots))
{
$robots = array();
for($i=0;$i<count($lines);$i++)
{
$l = $lines[$i];
$p = explode("\t",$l,3);
$robots[] = $p[2];
}
}
return in_array($UserAgent,$robots);
}
function _StripDomainHost($d)
{
$dotcount = substr_count($d,".");
if($dotcount==3)
{
$IsIp = TRUE;
for($x=0;$x<strlen($d);$x++)
{
if(!is_numeric(substr($d,$x,1)) && substr($d,$x,1)!=".")
{
$IsIp = FALSE;
break;
}
}
}
if($dotcount>1 && !$IsIp)
{
$p = explode(".",$d);
$ret = $p[count($p)-2].".".$p[count($p)-1];
}
else
$ret = $d;
return $ret;
}
function _MatchIp($ip1,$ip2)
{
$matched = TRUE;
$ip = explode(".",$ip1);
$MatchIp = explode(".",$ip2);
for($i=0;$i<count($ip);$i++)
{
if($i==count($MatchIp))
break;
if(trim($ip[$i]) != trim($MatchIp[$i]) || trim($ip[$i])=="*")
{
$matched=FALSE;
break;
}
}
return $matched;
}
function _IpAccess($IpAddress,$AllowList,$DenyList)
{
$allowed = explode(",",$AllowList);
$denied = explode(",",$DenyList);
$MatchAllowed = FALSE;
for($x=0;$x<count($allowed);$x++)
{
$ip = explode(".",$allowed[$x]);
$MatchAllowed = _MatchIp($IpAddress,$allowed[$x]);
if($MatchAllowed)
break;
}
$MatchDenied = FALSE;
for($x=0;$x<count($denied);$x++)
{
$ip = explode(".",$denied[$x]);
$MatchDenied = _MatchIp($IpAddress,$denied[$x]);
if($MatchDenied)
break;
}
$Result = (($MatchAllowed && !$MatchDenied) || (!$MatchAllowed && !$MatchDenied) ||
($MatchAllowed && $MatchDenied));
return $Result;
}
function _ValidateModules()
{
global $i_Keys, $objConfig, $g_License;
$lic = base64_decode($g_License);
_ParseLicense($lic);
$modules = array();
//echo "License: ".$lic."<br>";
$domain = _GetDomain();
//echo "Domain: ".$domain."<br>";
if(!_IsLocalSite($domain))
{
$domain = _StripDomainHost($domain);
//echo "New domain: $domain<br>";
//echo "<pre>"; print_r($i_Keys); echo "</pre>";
for($x=0;$x<count($i_Keys);$x++)
{
$key = $i_Keys[$x];
if(strlen(stristr($key["domain"],$domain)))
{
$modules = explode(",",$key["mod"]);
//echo "Modules: $modules";
}
}
if(count($modules)>0)
{
return TRUE;
}
}
else
return TRUE;
return FALSE;
}
function _ModuleLicensed($name)
{
global $i_Keys, $objConfig, $pathtoroot;
$vars = parse_ini_file($pathtoroot."config.php");
while($key = key($vars))
{
$key = "g_".$key;
global $$key;
$$key = current($vars); //variable variables
if(strlen($$key)>80)
{
$lic = base64_decode($$key);
}
next($vars);
}
//$lic = base64_decode($g_License);
_ParseLicense($lic);
$modules = array();
if(!_IsLocalSite(_GetDomain()))
{
for($x=0;$x<count($i_Keys);$x++)
{
$key = $i_Keys[$x];
if(strlen(stristr(_GetDomain(),$key["domain"])))
{
//echo "ok<br>";
$modules = explode(",",$key["mod"]);
}
}
if(in_array($name,$modules)) {
//echo "ok<br>";
return TRUE;
}
}
else {
return TRUE;
}
return FALSE;
}
function _GetDomain()
{
global $objConfig, $g_Domain;
if($objConfig->Get("DomainDetect"))
{
$d = $_SERVER['HTTP_HOST'];
}
else
$d = $g_Domain;
return $d;
}
function _keyED($txt,$encrypt_key)
{
$encrypt_key = md5($encrypt_key);
$ctr=0;
$tmp = "";
for ($i=0;$i<strlen($txt);$i++)
{
if ($ctr==strlen($encrypt_key)) $ctr=0;
$tmp.= substr($txt,$i,1) ^ substr($encrypt_key,$ctr,1);
$ctr++;
}
return $tmp;
}
function _decrypt($txt,$key)
{
$txt = _keyED($txt,$key);
$tmp = "";
for ($i=0;$i<strlen($txt);$i++)
{
$md5 = substr($txt,$i,1);
$i++;
$tmp.= (substr($txt,$i,1) ^ $md5);
}
return $tmp;
}
function LoadFromRemote()
{
return "";
}
function DLid()
{
global $lid;
echo $lid."\n";
die();
}
function _LoadLicense($LoadRemote=FALSE)
{
global $pathtoroot, $objConfig;
$f = $pathtoroot."intechnic.php";
if(file_exists($f))
{
$contents = file($f);
$data = base64_decode($contents[1]);
}
else
if($LoadRemote)
return $LoadFromRemote;
return $data;
}
function _VerifyKey($domain,$k)
{
$key = md5($domain);
$lkey = substr($key,0,strlen($key)/2);
$rkey = substr($key,strlen($key)/2);
$r = $rkey.$lkey;
if($k==$r)
return TRUE;
return FALSE;
}
function _ParseLicense($txt)
{
global $i_User, $i_Pswd, $i_Keys;
$data = _decrypt($txt,"beagle");
$i_Keys = array();
$lines = explode("\n",$data);
for($x=0;$x<count($lines);$x++)
{
$l = $lines[$x];
$p = explode("=",$l,2);
switch($p[0])
{
case "Username":
$i_User = $p[1];
break;
case "UserPass":
$i_Pswd = $p[1];
break;
default:
if(substr($p[0],0,3)=="key")
{
$parts = explode("|",$p[1]);
if(_VerifyKey($parts[0],$parts[1]))
{
unset($K);
$k["domain"]=$parts[0];
$k["key"]=$parts[1];
$k["desc"]=$parts[2];
$k["mod"]=$parts[3];
$i_Keys[] = $k;
}
}
break;
}
}
}
function _IsLocalSite($domain)
{
$localb = FALSE;
if(substr($domain,0,3)=="172")
{
$b = substr($domain,0,6);
$p = explode(".",$domain);
$subnet = $p[1];
if($p[1]>15 && $p[1]<32)
$localb=TRUE;
}
if($domain=="localhost" || $domain=="127.0.0.1" || substr($domain,0,7)=="192.168" ||
substr($domain,0,3)=="10." || $localb || strpos($domain,".")==0)
{
return TRUE;
}
return FALSE;
}
LogEntry("Loading Modules\n");
/* get the module list from the database */
$adodbConnection = GetADODBConnection();
$sql = "SELECT Name, Path, Var,TemplatePath, RootCat from ".GetTablePrefix()."Modules where Loaded=1 ORDER BY LoadOrder";
$rs = $adodbConnection->Execute($sql);
while($rs && !$rs->EOF)
{
$key = $rs->fields["Var"];
$mod_prefix[$key] = $rs->fields["Path"];
$modules_loaded[$key] = $rs->fields["Name"];
$name = $rs->fields["Name"];
$template_path[$name] = $rs->fields["TemplatePath"];
$mod_root_cats[$name] = $rs->fields["RootCat"];
// echo $key . "=". $modules_loaded[$key]."<br>\n";
$rs->MoveNext();
}
LogEntry("Loading Module Parser scripts\n");
/* for each module enabled, load up parser.php */
//foreach($mod_prefix as $key => $value)
$LogLevel++;
if(is_array($mod_prefix))
{
foreach($mod_prefix as $key => $value)
{
$mod = $pathtoroot . $value . "parser.php";
// LogEntry("Loading parser $mod \n");
require_once($mod);
}
}
$LogLevel--;
LogEntry("Finished Loading Module Parser scripts\n");
/*now each module gets a look at the environment string */
$SessionQueryString = FALSE;
if(!isset($FrontEnd)) $FrontEnd = false;
if($FrontEnd != 1)
$SessionQueryString = TRUE;
if(is_array($mod_prefix))
ParseEnv();
/* create the session object */
$ip = $_SERVER["REMOTE_ADDR"];
if ( !isset($var_list['sid']) ) $var_list['sid'] = '';
if ( !isset($_GET['env']) ) $_GET['env'] = '';
if(strlen($var_list["sid"])==0 && strlen($_GET["env"])>0 && $objConfig->Get("CookieSessions")==2)
{
if(_IsSpider($_SERVER["HTTP_USER_AGENT"]))
{
$UseSession = FALSE;
}
else
{
/* switch user to GET session var */
if (!$_COOKIE['sid']) {
$SessionQueryString = TRUE;
}
//else {
//$SessionQueryString = FALSE;
//}
$UseSession = TRUE;
}
}
else {
$UseSession = TRUE;
}
if($var_list["sid"]=="_")
$var_list["sid"]="";
/*setup action variable*/
$Action = isset($_REQUEST['Action']) ? $_REQUEST['Action'] : '';
if($Action=="m_logout")
{
$u = new clsUserSession($var_list["sid"] ,($SessionQueryString && $FrontEnd==1));
$u->Logout();
unset($u);
$var_list_update["t"] = "index";
$var_list["t"] = "";
$var_list["sid"]="";
setcookie("login","",time()-3600);
setcookie("sid","",time()-3600);
}
$CookieTest = isset($_COOKIE["CookiesTest"]) ? $_COOKIE["CookiesTest"] : '';
$HTTP_REFERER = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
if ( ($CookieTest == 1) || !strstr($HTTP_REFERER, $_SERVER['SERVER_NAME'].$objConfig->Get("Site_Path"))) {
$SessionQueryString = FALSE;
}
if ($FrontEnd != 1) {
$SessionQueryString = TRUE;
}
$objSession = new clsUserSession($var_list["sid"],($SessionQueryString && $FrontEnd==1));
if($UseSession)
{
if(!$objSession->ValidSession())
{
/* Get rid of Invalid Session and make a brand new one*/
// echo "Dumping Session ".$var_list["sid"]."<br>";
unset($var_list["sid"]);
$objSession->GetNewSession();
$var_list["sid"] = $objSession->GetSessionKey();
$var_list_update["sid"]=$objSession->GetSessionKey();
if(is_numeric($m_var_list["theme"]))
$objSession->SetThemeName($m_var_list["theme"]);
if($objConfig->Get("CookieSessions")>0 && !$SessionQueryString && !headers_sent())
setcookie("sid",$var_list["sid"]);
//echo "New Session: ".$objSession->GetSessionKey()."<br>\n";
if(isset($_COOKIE["login"]) && $Action != "m_logout" && $FrontEnd==1)
{
$parts = explode("|",$_COOKIE["login"]);
$username = $parts[0];
$pass = $parts[1];
$objSession->Login($username,$pass);
}
}
else
{ //echo "Update Session<br>";
if($objSession->Get("Language")!=$m_var_list["lang"])
{
$objSession->Set("Language",$m_var_list["lang"]);
}
$objSession->LoadSessionData();
$objSession->UpdateAccessTime();
$objSession->Update();
LoadEnv();
}
}
if(is_numeric($var_list["t"]))
{
if( !isset($CurrentTheme) ) $CurrentTheme = null;
if(!is_object($CurrentTheme))
$CurrentTheme = $objThemes->GetItem($m_var_list["theme"]);
$var_list["t"] = $CurrentTheme->GetTemplateById($var_list["t"]);
$objSession->Set("Theme",$CurrentTheme->Get("Name"));
}
/*create the global current user object */
$UserID=$objSession->Get("PortalUserId");
$objCurrentUser = new clsPortalUser($UserID);
$objLanguageCache = new clsLanguageCache($m_var_list["lang"]);
/* include each module's action.php script */
LogEntry("Loading Module action scripts\n");
## Global Referer Template
$_local_t = $var_list["t"];
if(is_array($mod_prefix))
{
foreach($mod_prefix as $key => $value)
{
if($FrontEnd==0 || !is_numeric($FrontEnd) || $FrontEnd==2)
{
$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
$admin = $objConfig->Get("AdminDirectory");
if(!strlen($admin))
$admin = "admin";
$adminURL = $rootURL.$admin;
$imagesURL = $adminURL."/images";
if(_ModuleLicensed($modules_loaded[$key]))
{
$mod = $pathtoroot.$value."module_init.php";
if(file_exists($mod))
require_once($mod);
$mod = $pathtoroot . $value . "action.php";
if(file_exists($mod))
require_once($mod);
$mod = $pathtoroot . $value . "searchaction.php";
if(file_exists($mod))
require_once($mod);
}
}
if($FrontEnd==1 || $FrontEnd==2)
{
$mod = $pathtoroot.$value."module_init.php";
if(file_exists($mod))
require_once($mod);
$mod = $pathtoroot . $value . "frontaction.php";
if(file_exists($mod))
require_once($mod);
}
}
}
if( !isset($SearchPerformed) ) $SearchPerformed = false;
if($SearchPerformed == true) $objSearch->BuildIndexes();
LogEntry("Finished Loading Module action scripts\n");
?>
Property changes on: trunk/kernel/include/modules.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/kernel/include/usersession.php
===================================================================
--- trunk/kernel/include/usersession.php (revision 40)
+++ trunk/kernel/include/usersession.php (revision 41)
@@ -1,1111 +1,1114 @@
<?php
class clsUserSession
{
//Common DB operation class variables
var $m_dirtyFieldsMap = array();
//Identity
var $m_SessionKey;
var $m_CurrentTempKey;
var $m_PrevTempKey;
//Required attributes
var $m_LastAccessed;
var $m_PortalUserId;
var $m_Language;
var $m_Theme;
var $m_GroupId;
var $adodbConnection;
var $m_Errors;
var $m_GroupList;
var $PermCache;
var $SysPermCache;
var $PermCacheGroups;
var $CurrentUser;
var $UseTempKeys;
function clsUserSession($id=NULL, $TempKeys=FALSE)
{
global $objConfig, $objLanguages, $objThemes, $m_var_list;
$this->m_Errors = new clsErrorManager();
$this->adodbConnection = GetADODBConnection();
$this->PermCache = array();
$this->PermCacheGroups ="";
$this->UseTempKeys = $TempKeys;
+
+ if( GetVar('help_usage') == 'install' ) return;
+
if(!$this->UseTempKeys || strlen($id)==0)
{
//echo "with cookies";
if( !isset($_SERVER['HTTP_REFERER']) ) $_SERVER['HTTP_REFERER'] = '';
- if(strlen($id) && (strstr($_SERVER['HTTP_REFERER'], $_SERVER['SERVER_NAME'].$objConfig->Get("Site_Path")) || $_GET['destform'] == 'popup' || $_GET['continue_sess'] == 1))
+ if( strlen($id) && (strstr($_SERVER['HTTP_REFERER'], $_SERVER['SERVER_NAME'].$objConfig->Get("Site_Path")) || $_GET['destform'] == 'popup' || $_GET['continue_sess'] == 1))
{
$this->Set("SessionKey",$id);
return $this->LoadFromDatabase($id);
}
else
{
$this->Set("PortalUserId", 0);
$this->Set("Language", $objLanguages->GetPrimary());
$ThemeId = $m_var_list["theme"];
$this->SetThemeName($ThemeId);
//$this->Set("Theme", $objConfig->Get("Default_Theme"));
$this->Set("GroupList",0);
$this->Set("SessionKey","");
$this->Set("GroupList",$objConfig->Get("User_GuestGroup"));
}
}
else
{
//echo "without cookies";
return $this->LoadFromTempKey($id);
}
}
function CopyToNewSession()
{
$OldKey = $this->GetSessionKey();
$this->GetNewSession();
if($OldKey != $this->GetSessionKey())
{
$this->Set("PortalUserId",$this->Get("PortalUserId"));
$this->Set("GroupId",$this->Get("GroupId"));
$this->Set("GroupList",$this->Get("GroupList"));
$this->Set("Language",$this->Get("Language"));
$this->Set("tz",$this->Get("tz"));
$this->Set("LastAccessed",date("U"));
$this->Update();
}
}
function Get($name)
{
$var = "m_" . $name;
return isset($this->$var) ? $this->$var : '';
}
function Set($name, $value)
{
if (is_array($name))
{
for ($i=0; $i<sizeof($name); $i++)
{ $var = "m_" . $name[$i];
$this->$var = $value[$i];
$this->m_dirtyFieldsMap[$name[$i]] = $value[$i];
}
}
else
{
$var = "m_" . $name;
$this->$var = $value;
$this->m_dirtyFieldsMap[$name] = $value;
//echo "Set: $var = $value <br>\n";
}
}
function Validate()
{
$dataValid = true;
if(!isset($this->m_LastAccessed))
{
$this->m_Errors->AddError("error.fieldIsRequired",'LastAccessed',"","",get_class($this),"Validate");
$dataValid = false;
}
if(!isset($this->m_PortalUserId))
{
$this->m_Errors->AddError("error.fieldIsRequired",'PortalUserId',"","",get_class($this),"Validate");
$dataValid = false;
}
if(!isset($this->m_Language))
{
$this->m_Errors->AddError("error.fieldIsRequired",'Language',"","",get_class($this),"Validate");
$dataValid = false;
}
if(!isset($this->m_Theme))
{
$this->m_Errors->AddError("error.fieldIsRequired",'Theme',"","",get_class($this),"Validate");
$dataValid = false;
}
return $dataValid;
}
function Delete()
{
if(!isset($this->m_SessionKey))
{
$this->m_Errors->AddError("error.AppError",NULL,'Internal error: Delete requires set id',"",get_class($this),"Delete");
return false;
}
//Delete associated adata first
$sql = sprintf("DELETE FROM ".GetTablePrefix()."SessionData WHERE SessionKey = '%s'", $this->Get("SessionKey"));
$this->adodbConnection->Execute($sql);
$sql = sprintf("DROP TABLE %s%s_search",GetTablePrefix(), $this->Get("SessionKey"));
$this->adodbConnection->Execute($sql);
$sql = sprintf("DELETE FROM ".GetTablePrefix()."UserSession WHERE SessionKey = '%s'", $this->Get("SessionKey"));
$this->adodbConnection->Execute($sql);
if ($this->adodbConnection->Execute($sql) === false)
{
$this->m_Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Delete");
return false;
}
$this->Set("SessionKey","");
$this->Set("SessionDataLoaded",false);
return true;
}
function Update()
{
global $objConfig;
//$this->Set("LastAccessed",date("U"));
$this->Set("IpAddress",$_SERVER["REMOTE_ADDR"]);
if(!isset($this->m_SessionKey))
{
$this->m_Errors->AddError("error.AppError",NULL,'Internal error: Update requires set id',"",get_class($this),"Update");
return false;
}
if(!is_numeric($this->Get("PortalUserId")))
{
$this->Set("PortalUserId",0);
}
if(!strlen($this->Get("GroupList")))
{
$this->Set("GroupList",$objConfig->Get("User_GuestGroup"));
}
if(count($this->m_dirtyFieldsMap) == 0)
return true;
$sql = "UPDATE ".GetTablePrefix()."UserSession SET ";
$first = 1;
foreach ($this->m_dirtyFieldsMap as $key => $value)
{
if($first)
{
$sql = sprintf("%s %s=%s",$sql,$key,$this->adodbConnection->qstr($value));
$first = 0;
}
else
{
$sql = sprintf("%s, %s=%s",$sql,$key,$this->adodbConnection->qstr($value));
}
}
$sql = sprintf("%s WHERE SessionKey = '%s'",$sql, $this->Get("SessionKey"));
//echo $sql;
if ($this->adodbConnection->Execute($sql) === false)
{
$this->m_Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Update");
return false;
}
return true;
}
function Create()
{
global $objConfig;
$this->Set("LastAccessed", time());
if(!is_numeric($this->Get("PortalUserId")))
{
$this->Set("PortalUserId",0);
}
if(!strlen($this->Get("GroupList")))
{
$this->Set("GroupList",$objConfig->Get("User_GuestGroup"));
}
$sql = "INSERT INTO ".GetTablePrefix()."UserSession (";
$first = 1;
foreach ($this->m_dirtyFieldsMap as $key => $value)
{
if($first)
{
$sql = sprintf("%s %s",$sql,$key);
$first = 0;
}
else
{
$sql = sprintf("%s, %s",$sql,$key);
}
}
$sql = sprintf('%s ) VALUES (',$sql);
$first = 1;
foreach ($this->m_dirtyFieldsMap as $key => $value)
{
if($first)
{
$sql = sprintf("%s %s",$sql,$this->adodbConnection->qstr($value));
$first = 0;
}
else
{
$sql = sprintf("%s, %s",$sql,$this->adodbConnection->qstr($value));
}
}
$sql = sprintf('%s)',$sql);
//echo $sql."<br>\n";
if ($this->adodbConnection->Execute($sql) === false)
{
$this->m_Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Create");
return false;
}
return true;
}
function LoadFromTempKey($id=NULL)
{
global $objLanguages, $objConfig,$m_var_list;
$referer = $_SERVER["HTTP_REFERER"];
//echo "Referer: $referer <br>\n";
if(strlen($referer) && strpos($referer,"env="))
{
$keystart = strpos($referer,"env=")+4;
$referer = substr($referer,$keystart);
$keyend = strpos($referer,"-");
$LastKey = substr($referer,0,$keyend);
if(strlen($LastKey))
{
$sql = "SELECT * FROM ".GetTablePrefix()."UserSession WHERE (CurrentTempKey = '$id' OR PrevTempKey='$id' OR CurrentTempKey='$LastKey' OR PrevTempKey='$LastKey') ";
}
else
$sql = "SELECT * FROM ".GetTablePrefix()."UserSession WHERE CurrentTempKey = '$id' AND PrevTempKey IS NULL";
}
else
$sql = "SELECT * FROM ".GetTablePrefix()."UserSession WHERE CurrentTempKey = '$id' AND PrevTempKey IS NULL";
$result = $this->adodbConnection->Execute($sql);
if ($result === false)
{
$this->m_Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromDatabase");
return false;
}
$data = $result->fields;
if (is_array($data))
{
foreach($data as $field => $value)
{
$mname = "m_" . $field;
$this->$mname = $data[$field];
}
if($this->Get("CurrentTempKey")) {
$this->Set("PrevTempKey",$this->Get("CurrentTempKey"));
$this->UseTempKeys=TRUE;
}
if (!$this->Get("CurrentTempKey") || !strstr($_SERVER['HTTP_REFERER'], $_SERVER['SERVER_NAME'].$objConfig->Get("Site_Path"))) {
//$this->Set("PrevTempKey",$this->Get("CurrentTempKey"));
//$this->Set("CurrentTempKey",$this->GetUniqueKey());
$this->UseTempKeys=FALSE;
$this->Set("PortalUserId", 0);
$this->Set("Language", $objLanguages->GetPrimary());
$ThemeId = $m_var_list["theme"];
$this->SetThemeName($ThemeId);
//$this->Set("Theme", $objConfig->Get("Default_Theme"));
$this->Set("GroupList",0);
$this->Set("SessionKey","");
$this->Set("GroupList",$objConfig->Get("User_GuestGroup"));
}
//$this->UseTempKeys=TRUE;
$this->Update();
return true;
}
else
{
$this->Set("PortalUserId", 0);
$this->Set("Language", $objLanguages->GetPrimary());
$ThemeId = $m_var_list["theme"];
$this->SetThemeName($ThemeId);
//$this->Set("Theme", $objConfig->Get("Default_Theme"));
$this->Set("GroupList",0);
$this->Set("SessionKey","");
$this->Set("GroupList",$objConfig->Get("User_GuestGroup"));
$this->Set("CurrentTempKey",$this->GetUniqueKey());
return false;
}
}
function LoadFromDatabase($id)
{
if(!isset($id))
{
$this->m_Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"",get_class($this),"LoadFromDatabase");
return false;
}
$sql = sprintf("SELECT * FROM ".GetTablePrefix()."UserSession WHERE SessionKey = '%s'",$id);
$result = $this->adodbConnection->Execute($sql);
if ($result === false)
{
$this->m_Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromDatabase");
return false;
}
$data = $result->fields;
if (is_array($data))
{
foreach($data as $field => $value)
{
$mname = "m_" . $field;
$this->$mname = $data[$field];
}
return true;
}
else
{
return false;
}
}
function Login($userLogin, $userPassword)
{
global $expired, $objConfig;
if($userLogin=="root")
{
$rootpass = $objConfig->Get("RootPass");
if($rootpass!=$userPassword)
{
return FALSE;
}
else
{
if(!strlen($this->GetSessionKey()))
$this->GetNewSession();
$this->Set("PortalUserId",-1);
$this->Update();
return TRUE;
}
}
else
{
$pre = GetTablePrefix();
$sql = "SELECT *,MD5(".$pre."PortalUser.Password) as md5pw FROM ".$pre."PortalUser LEFT JOIN ".$pre."UserGroup USING (PortalUserId) "
."LEFT JOIN ".$pre."PortalGroup ON (".$pre."UserGroup.GroupId=".$pre."PortalGroup.GroupId)
WHERE
".$pre."PortalUser.Login='$userLogin' AND ".$pre."PortalUser.Status=1
AND (".$pre."PortalUser.Password='$userPassword' OR MD5(".$pre."PortalUser.Password)='$userPassword' OR ".$pre."PortalUser.Password='".md5($userPassword)."')
ORDER BY ".$pre."UserGroup.PrimaryGroup DESC, ".$pre."PortalGroup.Personal DESC";
//echo $sql."<br>\n";
$result = $this->adodbConnection->Execute($sql);
if ($result === false)
{
$this->m_Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Login");
return false;
}
if($result->EOF)
return false;
}
if(!strlen($this->GetSessionKey()))
{
$this->GetNewSession();
}
$this->Set("PortalUserId", $result->fields["PortalUserId"]);
if(strlen($result->fields["tz"])>0)
$this->Set("tz",$result->fields["tz"]);
$PrimaryGroup=0;
$PersonalGroup=0;
$GroupList = array();
while($result && !$result->EOF)
{
$skipadd=0;
$g = $result->fields["GroupId"];
if($result->fields["PrimaryGroup"]==1)
{
$PrimaryGroup = $g;
$skipadd=1;
}
if($result->fields["Personal"]==1)
{
$PersonalGroup=$g;
$skipadd=0;
}
if(!$skipadd)
$GroupList[] = $g;
$result->MoveNext();
}
$extra_groups = implode(",",$GroupList);
if($PrimaryGroup)
$extra_groups = $PrimaryGroup.",".$extra_groups;
if($PersonalGroup)
{
$this->Set("GroupId",$PersonalGroup);
//$extra_groups .= ",".$PersonalGroup;
}
else
{
$this->Set("GroupId",$PrimaryGroup);
}
$this->Set("GroupList", $extra_groups);
$this->Set("LastAccessed",date("U"));
$this_login = $this->GetPersistantVariable("ThisLogin");
$this->SetPersistantVariable("LastLogin", $this_login);
$this->SetPersistantVariable("ThisLogin", time());
$this->ResetSysPermCache();
$this->PermCache = array();
$this->Update();
return true;
}
function Logout()
{
global $objConfig;
$this->Set("PortalUserId", 0);
$this->Set("GroupId", $objConfig->Get("User_GuestGroup"));
#$this->SetPersistantVariable("LastLogin", time());
$this->Set("GroupList",$objConfig->Get("User_GuestGroup"));
$this->Set("IpAddress",$_SERVER['REMOTE_ADDR']);
$this->DeleteSessionData($this->GetSessionKey());
$this->Update();
$this->Delete();
$this->ResetSysPermCache();
$this->PermCache = array();
}
function SetVariable( $variableName, $variableValue)
{
global $objConfig, $FrontEnd;
$objConfig->Set($variableName,$variableValue,2);
//if(!(int)$FrontEnd==1)
//{
$sessionkey = $this->GetSessionKey();
$sql = "SELECT * FROM ".GetTablePrefix()."SessionData WHERE VariableName='$variableName' AND SessionKey='$sessionkey'";
$rs = $this->adodbConnection->Execute($sql);
if($rs && !$rs->EOF)
{
$sql = "UPDATE ".GetTablePrefix()."SessionData SET VariableValue='$variableValue' WHERE VariableName='$variableName' AND SessionKey='$sessionkey'";
}
else
$sql = "INSERT INTO ".GetTablePrefix()."SessionData (VariableName,VariableValue,SessionKey) VALUES ('$variableName','$variableValue','$sessionkey')";
$this->adodbConnection->Execute($sql);
// echo "<BR>UPDATE: $sql<BR>";
//}
}
function SetPersistantVariable($variableName, $variableValue)
{
global $objConfig;
$userid = (int)$this->Get("PortalUserId");
if($userid > 0)
{
if(!is_object($this->CurrentUser))
$this->CurrentUser = $objUsers->GetItem($this->Get("PortalUserId"));
if(!$this->CurrentUser->VarsLoaded)
$this->CurrentUser->LoadPersistantVars();
$this->CurrentUser->SetPersistantVariable($variableName, $variableValue);
}
else
$this->SetVariable($variableName,$variableValue);
}
function GetPersistantVariable($variableName)
{
global $objConfig, $objUsers;
if(is_numeric($this->Get("PortalUserId")))
{
if(!is_object($this->CurrentUser))
$this->CurrentUser = $objUsers->GetItem($this->Get("PortalUserId"));
if(!$this->CurrentUser->VarsLoaded)
$this->CurrentUser->LoadPersistantVars();
$val = $this->CurrentUser->GetPersistantVariable($variableName);
}
if(!strlen($val))
$val = $objConfig->Get($variableName);
return $val;
}
function GetVariable($variableName)
{
global $objConfig;
return $objConfig->Get($variableName);
}
function LoadSessionData()
{
global $objConfig, $objUsers;
if(is_numeric($this->Get("PortalUserId")))
{
if(!is_object($this->CurrentUser))
$this->CurrentUser = $objUsers->GetItem($this->Get("PortalUserId"));
if(!$this->CurrentUser->VarsLoaded)
$this->CurrentUser->LoadPersistantVars();
$sql = "SELECT VariableName, VariableValue FROM ".GetTablePrefix()."SessionData where SessionKey='" . $this->Get("SessionKey") . "'";
//echo $sql."<br>\n";
$result = $this->adodbConnection->Execute($sql);
while ($result && !$result->EOF)
{
$data = $result->fields;
//echo "<PRE>"; print_r($data); echo "</PRE>";
$objConfig->Set($data["VariableName"],$data["VariableValue"],FALSE);
$result->MoveNext();
}
}
if((int)$this->GetPersistantVariable("Language"))
$this->Set("Language",$objConfig->Get("Language"));
$this->DeleteExpiredSessions();
return true;
}
function DeleteSessionData($key)
{
$sql = "DELETE FROM ".GetTablePrefix()."SessionData WHERE SessionKey='$key'";
$this->adodbConnection->Execute($sql);
}
function SaveSessionData()
{
global $objConfig;
//echo "Saving Session Data..<br>\n";
if($this->SessionEnabled())
{
$data = $objConfig->GetDirtySessionValues(2); //session data
//echo "<PRE>"; print_r($data); echo "</PRE>";
$sessionkey = $this->GetSessionKey();
foreach($data as $field=>$value)
{
$sql = "UPDATE ".GetTablePrefix()."SessionData SET VariableValue='$value' WHERE VariableName='$field' AND SessionKey='$sessionkey'";
$this->adodbConnection->Execute($sql);
//echo $sql."<br>\n";
if($this->adodbConnection->Affected_Rows()==0)
{
$sql = "INSERT INTO ".GetTablePrefix()."SessionData (VariableName,VariableValue,SessionKey) VALUES ('$field','$value','$sessionkey')";
$this->adodbConnection->Execute($sql);
}
// echo $sql."<br>\n";
}
}
}
function DeleteEditTables()
{
$tables = $this->adodbConnection->MetaTables();
$sql = "SHOW TABLES";
//echo "<PRE>";print_r($tables); echo "</PRE>";
for($i=0;$i<count($tables);$i++)
{
$t = strtoupper($tables[$i]);
$p = strtoupper(GetTablePrefix()."ses_ad");
$k = substr($t,0,strlen($p));
if($k == $p && strpos($t,"FD_")>0)
{
$key = "AD".strtoupper(substr($t,strlen($p),strpos($t,"FD_")-strlen($p)))."FD";
$sql = "SELECT * FROM ".GetTablePrefix()."UserSession WHERE SessionKey='$key'";
//echo $sql."<br>\n";
$rs = $this->adodbConnection->Execute($sql);
if(!$rs || $rs->EOF)
{
//echo "Dropping Table $tables[$i] <br>\n";
@$this->adodbConnection->Execute("DROP TABLE ".$tables[$i]);
}
}
}
}
function DeleteExpiredSessions()
{
global $objConfig;
$cutoff = time()-$objConfig->Get("SessionTimeout");
$thiskey = $this->GetSessionKey();
$sql = "SELECT SessionKey from ".GetTablePrefix()."UserSession WHERE LastAccessed<$cutoff AND SessionKey != '$thiskey'";
$result = $this->adodbConnection->Execute($sql);
$keys = array();
while ($result && !$result->EOF)
{
$keys[] = "SessionKey='" . $result->fields["SessionKey"] . "'";
$result->MoveNext();
}
if(count($keys)>0)
{
$keywhere = implode(" OR ", $keys);
$sql = "DELETE FROM ".GetTablePrefix()."SessionData WHERE $keywhere";
//echo $sql;
$this->adodbConnection->Execute($sql);
$this->adodbConnection->Execute("DELETE FROM ".GetTablePrefix()."UserSession WHERE LastAccessed<$cutoff");
$this->DeleteEditTables();
}
}
function SetSysPermCache()
{
unset($this->SysPermCache);
$GroupList = $this->Get("GroupList");
if(strlen($GroupList) && $GroupList !="0")
{
$this->SysPermCache = array();
$sql = "SELECT * FROM ".GetTablePrefix()."Permissions WHERE Type=1 AND PermissionValue=1 AND GroupId IN (".$GroupList.")";
//echo $sql."<br>\n";
$rs = $this->adodbConnection->Execute($sql);
while($rs && !$rs->EOF)
{
$val = $rs->fields["PermissionValue"];
if($val==1)
$this->SysPermCache[$rs->fields["Permission"]] = 1;
$PermList[] = $rs->fields["Permission"];
$rs->MoveNext();
}
if( isset($PermList) && count($PermList) > 0) // I think this is never issued (comment by Alex)
$this->SetVariable("SysPerm",implode(",",$PermList));
}
}
function GetSysPermCache()
{
$perms = trim($this->GetVariable("SysPerm"));
if(!strlen($perms))
{
$this->SetSysPermCache();
}
else
{
$p = explode(",",$perms);
$this->SysPermCache = array();
for($i=0;$i<count($p);$i++)
{
$n = $p[$i];
$this->SysPermCache[$n]=1;
}
}
}
function SysPermCacheLoaded()
{
return (isset($this->SysPermCache));
}
function ResetSysPermCache()
{
// echo "Resetting Perm Cache<br>\n";
$this->SetVariable("SysPerm","");
unset($this->SysPermCache);
//$this->SysPermCache=array();
}
function HasSystemPermission($PermissionName)
{
global $objGroups;
if($this->Get("PortalUserId")==-1 && ($PermissionName=="ADMIN" || $PermissionName=="LOGIN"))
return TRUE;
//echo "Looking up $PermissionName:".$this->Get("GroupList")."<br>\n";
//echo $this->Get("GroupList")." - ".$this->PermCacheGroups;
$GroupList = $this->Get("GroupList");
if(substr($GroupList,-1)==",")
{
$GroupList = substr($GroupList,0,-1);
$this->Set("GroupList",$GroupList);
}
if($this->Get("GroupList")!=$this->PermCacheGroups)
$this->ResetSysPermCache();
if(!$this->SysPermCacheLoaded())
{
//echo "Loading Perm Cache<br>\n";
$this->GetSysPermCache();
$this->PermCacheGroups = $this->Get("GroupList");
}
//echo "SysPerm $PermissionName: ". $this->SysPermCache[$PermissionName]."<br>\n";
return isset($this->SysPermCache[$PermissionName]) ? $this->SysPermCache[$PermissionName] == 1 : false;
}
function HasCatPermission($PermissionName,$CatId=NULL)
{
global $objCatList, $objUsers;
$PermSet =FALSE;
$Value = 0;
if($this->Get("PortalUserId")==-1)
return TRUE;
if(!strlen($PermissionName))
return FALSE;
$GroupList = $this->Get("GroupList");
if(substr($GroupList,-1)==",")
{
$GroupList = substr($GroupList,0,-1);
$this->Set("GroupList",$GroupList);
}
if(!strlen($this->Get("SessionKey")))
$this->Set("GroupId",0);
if(strlen(trim($GroupList)))
{
if(strlen($this->Get("GroupId")))
{
$GroupList = $this->Get("GroupId").",".$GroupList;
}
}
else
{
$GroupList = $this->Get("GroupId");
}
if($CatId == NULL)
{
$CatId = $objCatList->CurrentCategoryID();
}
$Cat = &$objCatList->GetCategory($CatId);
$Value="";
for($p=0;$p<count($this->PermCache);$p++)
{
$pItem = $this->PermCache[$p];
if($pItem["perm"]==$PermissionName && $pItem["cat"]==$CatId)
{
$Value=$pItem["value"];
break;
}
}
if(is_object($Cat) && !is_numeric($Value))
{
$Value = 0;
$CatList = $Cat->Get("ParentPath");
$CatList = substr($CatList,1,-1);
$CatList = str_replace("|",",",$CatList);
if(strlen($CatList))
{
$CatList ="0,".$CatList;
}
else
$CatList = "0";
$sql = "SELECT * FROM ".GetTablePrefix()."Permissions WHERE Permission LIKE '$PermissionName' AND CatId IN ($CatList) AND GroupId IN ($GroupList)";
// echo $sql."<br>\n";
$rs = $this->adodbConnection->Execute($sql);
$PermValue = array();
while($rs && !$rs->EOF)
{
$index = $rs->fields["CatId"];
if(!is_numeric($PermValue[$index]))
$PermValue[$index] = $rs->fields["PermissionValue"];
$rs->MoveNext();
}
$cats = array_reverse(explode(",",$CatList));
for($c=0;$c<count($cats);$c++)
{
$index = $cats[$c];
if(is_numeric($PermValue[$index]))
{
$Value = $PermValue[$index];
break;
}
}
$perm = array();
$perm["perm"] = $PermissionName;
$perm["cat"] = $CatId;
$perm["value"] = $Value;
array_push($this->PermCache, $perm);
}
//echo $GroupList." Has Permission $PermissionName = $Value<br>\n";
return $Value;
}
function HasCatPermInList($PermList,$CatId=NULL, $System=FALSE)
{
$value = 0;
if(strlen($PermList))
{
$plist = explode(",",$PermList);
$value=0;
for($p=0;$p<count($plist);$p++)
{
if($this->HasCatPermission($plist[$p]))
{
$value = 1;
break;
}
else
{
if($System)
{
if($this->HasSystemPermission($plist[$p]))
{
$value = 1;
break;
}
}
}
}
}
return $value;
}
function GetACLClause()
{
$GroupList = $this->Get("GroupList");
if(strlen($GroupList))
$Groups = explode(",",$GroupList);
$acl_where = "";
if(@count($Groups)>0 && is_array($Groups))
{
$acl_where = array();
for($i=0;$i<count($Groups);$i++)
{
$g = $Groups[$i];
if(strlen($g)>0)
$acl_where[] = "(FIND_IN_SET($g,acl) OR ((NOT FIND_IN_SET($g,dacl)) AND acl='')) ";
}
if(count($acl_where))
{
$acl_where = "(".implode(" OR ",$acl_where).")";
}
else
$acl_where = "(FIND_IN_SET(0,acl))";
}
else
$acl_where = "(FIND_IN_SET(0,acl))";
return $acl_where;
}
function GetEditTable($base_table)
{
$prefix = GetTablePrefix();
if(strlen($prefix))
{
if(substr($base_table,0,strlen($prefix))!=$prefix)
$base_table = $prefix.$base_table;
}
$table = $prefix."ses_".$this->GetSessionKey()."_edit_".$base_table;
//echo "Table: $table <br>\n";
return $table;
}
function GetSessionTable($base_table,$name)
{
$prefix = GetTablePrefix();
if(strlen($prefix))
{
if(substr($base_table,0,strlen($prefix))!=$prefix)
$base_table = $prefix.$base_table;
}
$table = $prefix."ses_".$this->GetSessionKey()."_".$name.$base_table;
//echo "Table: $table <br>\n";
return $table;
}
function GetSearchTable($base_table="")
{
$prefix = GetTablePrefix();
if(strlen($base_table))
{
if(strlen($prefix))
{
if(substr($base_table,0,strlen($prefix))!=$prefix)
$base_table = $prefix.$base_table;
}
$table = $prefix."ses_".$this->GetSessionKey()."_search_".$base_table;
}
else
$table = $this->GetSessionTable('Search',''); //$prefix."ses_".$this->GetSessionKey()."_search";
return $table;
}
function GetTotalSessions()
{
# $time = time() - 900;
$sql = "SELECT count(*) as SesCount FROM ".GetTablePrefix()."UserSession";
$result = $this->adodbConnection->Execute($sql);
if ($result === false)
{
$this->m_Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"GetTotalSessions");
return false;
}
return $result->fields["SesCount"];
}
function Query_UserSession($whereClause,$orderByClause)
{
$resultSet = array();
$sql = "SELECT ".GetTablePrefix()."* FROM ".GetTablePrefix()."UserSession ";
if(isset($whereClause))
$sql = sprintf('%s WHERE %s',$sql,$whereClause);
if(isset($orderByClause))
$sql = sprintf('%s ORDER BY %s',$sql,$orderByClause);
$result = $this->adodbConnection->Execute($sql);
if ($result === false)
{
$this->m_Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Query_UserSession");
return false;
}
while (!$result->EOF)
{
$item = new clsUserSession(NULL);
$item->Set("SessionKey",$result->fields["SessionKey"]);
$item->Set("LastAccessed", $result->fields["LastAccessed"]);
$item->Set("PortalUserId", $result->fields["PortalUserId"]);
$item->Set("Language", $result->fields["Language"]);
$item->Set("Theme" , $result->fields["Theme"]);
array_push($resultSet,$item);
$result->MoveNext();
}
return $resultSet;
}
function GetUniqueKey()
{
while(true)
{
/* create the new session key here */
mt_srand(100000000*(double)microtime());
$sessionId=strtoupper(sprintf("AD%xFD",mt_rand(100000000,999999999))); //9 digit hex session id
$query = "select SessionKey from ".GetTablePrefix()."UserSession ";
$query .= "where SessionKey='$sessionId' OR CurrentTempKey='$sessionId' OR PrevTempKey='$sessionId'";
$rs = $this->adodbConnection->Execute($query);
if($rs->EOF)
break;
if($i>100)
{
return "";
}
$i++;
}
//echo "Getting Unique Key: $sessionId<br>";
return $sessionId;
}
function GetNewSession()
{
global $sessionId, $objConfig, $objLanguages, $m_var_list;
$i=0;
if($this->Get("PortalUserId")>0 || $objConfig->Get("GuestSessions")==1)
{
//echo "Creating Session<br>\n";
$sessionId = $this->GetUniqueKey();
$this->Set("SessionKey", $sessionId);
$this->Set("CurrentTempKey",$sessionId);
if($m_var_list["lang"])
{
$this->Set("Language",$m_var_list["lang"]);
}
else
$this->Set("Language", $objLanguages->GetPrimary());
$this->SetThemeName();
//$this->Set("Theme", $objConfig->Get("Default_Theme"));
$this->UpdateAccessTime();
$this->Set("IpAddress", $_SERVER['REMOTE_ADDR'] );
$this->Create();
}
else
$this->Set("SessionKey","");
}
function SessionEnabled()
{
$res = FALSE;
$key = $this->GetSessionKey();
if(strlen($key)>0)
$res = TRUE;
return $res;
}
function GetSessionKey()
{
return $this->Get("SessionKey");
}
function SetThemeName($id=0)
{
global $objThemes;
if($id==0)
$id = $objThemes->GetPrimaryTheme();
$Theme = $objThemes->GetItem($id);
$name = $Theme->Get("Name");
$this->Set("Theme",$name);
//$this->Update();
}
function ValidSession($SessionKey=NULL)
{
global $objConfig;
$a = $this->Get("LastAccessed");
$cutoff = time()-$objConfig->Get("SessionTimeout");
//echo $a." ".$cutoff."<br>";
//$ip = ($_SERVER['REMOTE_ADDR'] == $this->Get("IpAddress"));
//echo $this->Get("IpAddress");
//$ip = TRUE;
if ($a < $cutoff) {
//$this->UpdateAccessTime();
}
return ($a >= $cutoff);
}
function UpdateAccessTime()
{
$now = time();
$this->Set("LastAccessed",$now);
}
function InSpamControl($ResourceId,$DataType=NULL)
{
static $ClearStat;
if(!$ClearStat)
$this->PurgeSpamControl();
$ClearStat=1;
if(strlen($DataType))
$DataType="'".$DataType."'";
$sql = "SELECT count(*) as SpamCount FROM ".GetTablePrefix()."SpamControl WHERE ItemResourceId=$ResourceId AND DataType=$DataType";
if($this->Get("PortalUserId")==0)
{
$sql .= " AND PortalUserId=0 AND IPaddress='".$_SERVER["REMOTE_ADDR"]."'";
}
else
{
$sql .= " AND PortalUserId=".$this->Get("PortalUserId");
}
$rs = $this->adodbConnection->Execute($sql);
$value = (int)$rs->fields["SpamCount"];
if($value>0)
{
return TRUE;
}
else
return FALSE;
}
function AddToSpamControl($ResourceId,$secstoexpire,$DataType=NULL)
{
$expire = adodb_date("U") + $secstoexpire;
if(strlen($DataType))
$DataType = "'".$DataType."'";
$sql = "INSERT INTO ".GetTablePrefix()."SpamControl (ItemResourceId,IPaddress,Expire,PortalUserId,DataType) VALUES (";
$sql .= $ResourceId.",'".$_SERVER["REMOTE_ADDR"]."',$expire,".$this->Get("PortalUserId").",$DataType)";
//echo $sql;
$this->adodbConnection->Execute($sql);
}
function PurgeSpamControl()
{
$sql = "DELETE FROM ".GetTablePrefix()."SpamControl WHERE Expire<".adodb_date("U");
$this->adodbConnection->Execute($sql);
}
}/* clsUserSession */
?>
Property changes on: trunk/kernel/include/usersession.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Index: trunk/kernel/admin/include/navmenu.php
===================================================================
--- trunk/kernel/admin/include/navmenu.php (revision 40)
+++ trunk/kernel/admin/include/navmenu.php (revision 41)
@@ -1,347 +1,353 @@
<?php
##############################################################
## In-portal :: Section & Navigation Structure Library ##
##############################################################
## In-portal ##
## Intechnic Corporation ##
## All Rights Reserved, 1998-2002 ##
## ##
## No portion of this code may be copied, reproduced or ##
## otherwise redistributed without proper written ##
## consent of Intechnic Corporation. Violation will ##
## result in revocation of the license and support ##
## privileges along maximum prosecution allowed by law.. ##
##############################################################
+$objSections->AddSection("in-portal:install","la_tab_Install","la_title_Install",$admin."/", "",
+ $admin."/images/icon_install.gif","",
+ NULL,"in-portal:site",NULL,null,0,"",1,NULL,NULL,NULL,"");
+
+
/* browse data tree items */
$objSections->AddSection("in-portal:browse","la_tab_Browse","la_title_Browse",$admin."/", "browse.php",
- $admin."/icons/icon46_catalog.gif",$admin."/icons/icon24_catalog.gif", NULL,"in-portal:site",NULL,"in-portal:configure_categories",0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_catalog.gif");
+ $admin."/icons/icon46_catalog.gif",$admin."/icons/icon24_catalog.gif",
+ NULL,"in-portal:site",NULL,"in-portal:configure_categories",0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_catalog.gif");
$objSections->AddSection("in-portal:configure_categories", "la_tab_Settings", "la_tab_Settings", $admin."/config/",
"edit_config.php?&module=In-Portal&section=in-portal:configure_categories",
$admin."/icons/icon46_cat_settings.gif", $admin."/icons/icon24_cat_settings.gif",
NULL, "in-portal:site","in-portal:browse", "in-portal:configuration_search",0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_cat_settings.gif","la_updating_config");
$objSections->AddSection("in-portal:configuration_search", "la_tab_ConfigSearch", "la_tab_ConfigSearch", $admin."/config/",
"config_search.php?&module=In-Portal&section=in-portal:configuration_search",
$admin."/icons/icon46_settings_search.gif",$admin."/icons/icon24_settings_search.gif",
NULL, "in-portal:site", "in-portal:configure_categories","in-portal:configuration_email",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_settings_search.gif","la_updating_config");
$objSections->AddSection("in-portal:configuration_email", "la_tab_ConfigE-mail", "la_tab_ConfigE-mail", $admin."/config/",
"module_email.php?&module=In-Portal:Category&section=in-portal:configuration_email&lpn=1",
$admin."/icons/icon46_settings_email.gif",$admin."/icons/icon24_settings_email.gif",
NULL,"in-portal:site", "in-portal:configuration_search", "in-portal:configuration_custom",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_settings_email.gif","la_updating_config");
$objSections->AddSection("in-portal:configuration_custom","la_tab_ConfigCustom","la_tab_ConfigCustom",$admin."/config/",
"edit_customfields.php?&section=in-portal:configuration_custom&DataType=1",
$admin."/icons/icon46_settings_custom.gif",$admin."/icons/icon24_settings_custom.gif",
NULL, "in-portal:site", "in-portal:configuration_email", NULL,0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_settings_custom.gif","la_updating_config");
/* check datatype either 1 or 0 */
$objSections->AddSection("in-portal:tools","la_tab_Tools","la_title_Tools",$admin."/","subitems.php",
$admin."/icons/icon46_tools.gif",$admin."/icons/icon24_tools.gif",
"in-portal:backup","in-portal:root","in-portal:system","in-portal:help",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_tools.gif","la_section_overview");
$objSections->AddSection("in-portal:backup","la_tab_Backup","la_tab_Backup",$admin."/backup/","backup1.php",
$admin."/icons/icon46_tool_backup.gif",$admin."/icons/icon24_tool_backup.gif",
NULL,"in-portal:tools",NULL,"in-portal:restore",0,"",1,
NULL,"in-portal:tools",NULL,$admin."/icons/icon46_list_tool_backup.gif","la_performing_backup");
$objSections->AddSection("in-portal:backup_toolbar",NULL,NULL,NULL,NULL,
NULL,NULL,
NULL,NULL,NULL,NULL,0,"",1,
NULL,NULL,NULL,NULL);
$objSections->AddSection("in-portal:restore_toolbar",NULL,NULL,NULL,NULL,
NULL,NULL,
NULL,NULL,NULL,NULL,0,"",1,
NULL,NULL,NULL,NULL);
$objSections->AddSection("in-portal:restore","la_tab_Restore","la_tab_Restore",$admin."/backup/","restore1.php",
$admin."/icons/icon46_tool_restore.gif",$admin."/icons/icon24_tool_restore.gif",
NULL,"in-portal:tools","in-portal:backup","in-portal:export",0,"",1,
NULL,"in-portal:tools",NULL,$admin."/icons/icon46_list_tool_restore.gif","la_performing_restore");
$objSections->AddSection("in-portal:export","la_tab_ExportData","la_tab_ExportData",$admin."/backup/","export1.php",
$admin."/icons/icon46_tool_export.gif",$admin."/icons/icon24_tool_export.gif",
NULL,"in-portal:tools","in-portal:restore","in-portal:inlink_inport",0,"",1,
NULL,"in-portal:tools",NULL,$admin."/icons/icon46_list_tool_export.gif","la_performing_export");
$objSections->AddSection("in-portal:inlink_inport","la_tab_ImportData","la_tab_ImportData",$admin."/import/","inlinkimport1.php",
$admin."/icons/icon46_tool_import.gif",$admin."/icons/icon24_tool_import.gif",
NULL,"in-portal:tools","in-portal:export","in-portal:sql_query",1,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_tool_import.gif","la_performing_import");
$objSections->AddSection("in-portal:sql_query","la_tab_QueryDB","la_tab_QueryDB",$admin."/tools/","sql_query.php",
$admin."/icons/icon46_tool_import.gif",$admin."/icons/icon24_tool_import.gif",
NULL,"in-portal:tools","in-portal:inlink_inport",NULL,0,"",1,
NULL,"in-portal:tools",NULL,$admin."/icons/icon46_list_tool_import.gif","la_running_query");
$objSections->AddSection("in-portal:system","la_tab_Sys_Config","la_title_Sys_Config",$admin."/","subitems.php",
$admin."/icons/icon46_conf.gif",$admin."/icons/icon24_conf.gif",NULL,
"in-portal:root","in-portal:reports","in-portal:tools",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_conf.gif","la_section_overview");
$objSections->AddSection("in-portal:tag_library","la_tab_TagLibrary","la_tab_TagLibrary",$admin."/","tag_listing.php",
$admin."/icons/icon46_modules.gif",$admin."/icons/icon24_modules.gif",
NULL,NULL,NULL,NULL,0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_modules.gif","la_tag_library");
/* system configuration tree items */
$objSections->AddSection("in-portal:configure_general", "la_tab_General", "la_tab_General", $admin."/config/",
"edit_config.php?&module=In-Portal&section=in-portal:configure_general",
$admin."/icons/icon46_conf_general.gif", $admin."/icons/icon24_conf_general.gif",
NULL, "in-portal:system", NULL, "in-portal:configure_themes",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_conf_general.gif","la_updating_config");
$objSections->AddSection("in-portal:configure_themes", "la_tab_Themes", "la_tab_Themes", $admin."/config/","config_theme.php",
$admin."/icons/icon46_conf_themes.gif", $admin."/icons/icon24_conf_themes.gif",
NULL, "in-portal:system", "in-portal:configure_general", "in-portal:configure_lang",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_conf_themes.gif");
$objSections->AddSection("in-portal:configure_lang", "la_tab_Regional", "la_tab_Regional", $admin."/config/","config_lang.php",
$admin."/icons/icon46_conf_regional.gif", $admin."/icons/icon24_conf_regional.gif",
NULL, "in-portal:system", "in-portal:configure_themes", NULL,0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_conf_regional.gif");
/* theme tabs */
$objSections->AddSection("in-portal:theme_general", "la_tab_General", NULL, $admin."/config/",
"javascript:edit_submit('theme','ThemeEditStatus','".$admin."/config/addtheme.php',0);",
$admin."/icons/icon46_conf_themes.gif", $admin."/icons/icon24_conf_themes.gif",
NULL, "in-portal:configure_themes", NULL, "in-portal:theme_templates",-1);
$objSections->AddSection("in-portal:theme_templates", "la_tab_Templates", NULL, $admin."/config/",
"javascript:edit_submit('theme','ThemeEditStatus','".$admin."/config/addtheme_templates.php',0);",
$admin."/icons/icon46_conf_themes.gif", $admin."/icons/icon24_conf_themes.gif",
NULL, "in-portal:configure_themes", "in-portal:theme_general",NULL,-1);
/*language tabs */
$objSections->AddSection("in-portal:lang_general", "la_tab_General", NULL, $admin."/config/",
"javascript:edit_submit('language','LangEditStatus','".$admin."/config/addlang.php',0);",
$admin."/icons/icon46_conf_regional.gif", $admin."/icons/icon24_conf_regional.gif",
NULL, "in-portal:configure_lang", NULL, "in-portal:lang_labels",-1);
$objSections->AddSection("in-portal:lang_labels", "la_tab_Labels", NULL, $admin."/config/",
"javascript:edit_submit('language','LangEditStatus','".$admin."/config/addlang_labels.php',0);",
$admin."/icons/icon46_conf_regional.gif", $admin."/icons/icon24_conf_regional.gif",
NULL, "in-portal:configure_lang", "in-portal:lang_general", "in-portal:lang_email",-1);
$objSections->AddSection("in-portal:lang_email", "la_tab_EmailEvents", NULL, $admin."/config/",
"javascript:edit_submit('language','LangEditStatus','".$admin."/config/addlang_email.php',0);",
$admin."/icons/icon46_conf_regional.gif", $admin."/icons/icon24_conf_regional.gif",
NULL, "in-portal:configure_lang", "in-portal:lang_labels", NULL,-1);
$objSections->AddSection("in-portal:lang_import", "la_tab_ImportLang", "la_tab_ImportLang", $admin."/config/",
"javascript:edit_submit('language','LangEditStatus','".$admin."/config/addlang.php',0);",
$admin."/icons/icon46_conf_regional.gif", $admin."/icons/icon24_conf_regional.gif",
NULL, NULL, NULL, NULL,-1);
$objSections->AddSection("in-portal:lang_export", "la_tab_ExportLang", "la_tab_ExportLang", $admin."/config/",
"javascript:edit_submit('language','LangEditStatus','".$admin."/config/addlang.php',0);",
$admin."/icons/icon46_conf_regional.gif", $admin."/icons/icon24_conf_regional.gif",
NULL, NULL, NULL, NULL,-1, "", 1);
/*Community Section tree items */
$objSections->AddSection("in-portal:user_list","la_tab_User_List","la_tab_User_List",$admin."/users/","user_list.php?resetpage=1",
$admin."/icons/icon46_users.gif",$admin."/icons/icon24_users.gif",
NULL, "in-portal:users", NULL, "in-portal:user_groups",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_users.gif");
$objSections->AddSection("in-portal:user_groups","la_tab_User_Groups","la_tab_User_Groups", $admin."/users/", "user_groups.php?resetpage=1", $admin."/icons/icon46_usergroups.gif",$admin."/icons/icon24_usergroups.gif",
NULL, "in-portal:users", "in-portal:user_list","in-portal:configure_users",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_usergroups.gif");
$objSections->AddSection("in-portal:configure_users", "la_tab_ConfigSettings", "la_tab_ConfigSettings", $admin."/config/",
"edit_config.php?&module=In-Portal:Users&section=in-portal:configure_users",
$admin."/icons/icon46_users_settings.gif", $admin."/icons/icon24_users_settings.gif",
NULL, "in-portal:users","in-portal:user_groups", "in-portal:user_email",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_users_settings.gif","la_updating_config");
$objSections->AddSection("in-portal:user_email", "la_tab_ConfigE-mail", "la_tab_ConfigE-mail", $admin."/config/",
"module_email.php?&module=In-Portal:Users&section=in-portal:user_email&lpn=1",
$admin."/icons/icon46_settings_email.gif",$admin."/icons/icon24_settings_email.gif",
NULL,"in-link", "in-portal:configure_users", "in-portal:user_custom",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_settings_email.gif","la_updating_config");
$objSections->AddSection("in-portal:user_custom","la_tab_ConfigCustom","la_tab_ConfigCustom",$admin."/config/",
"edit_customfields.php?&section=in-portal:user_custom&DataType=6",
$admin."/icons/icon46_settings_custom.gif",$admin."/icons/icon24_settings_custom.gif",
NULL, "in-portal:users", "in-portal:user_email", "in-portal:user_banlist",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_settings_custom.gif","la_updating_config");
$objSections->AddSection("in-portal:user_banlist","la_tab_BanList","la_tab_UserBanList",$admin."/config/",
"edit_banlist.php?&section=in-portal:user_banlist&DataType=6",
$admin."/icons/icon46_banlist.gif",$admin."/icons/icon24_banlist.gif",
NULL, "in-portal:users", "in-portal:user_custom",NULL,0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_banlist.gif","la_updating_rules");
/*Edit Category Section*/
$objSections->AddSection("in-portal:editcategory_general","la_tab_General",NULL,$admin."/category/",
"javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory.php',0);",
$admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif",
NULL, "in-portal:browse",NULL, "in-portal:editcategory_relations",-1);
$objSections->AddSection("in-portal:editcategory_relations","la_tab_Relations",NULL, $admin."/category/",
"javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory_relations.php',0);",
$admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif",
NULL,"in-portal:browse","in-portal:editcategory_general","in-portal:editcategory_images",-1);
$objSections->AddSection("in-portal:editcategory_images","la_tab_Images", NULL,$admin."/category/",
"javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory_images.php',0);",
$admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif",
NULL, "in-portal:browse", "in-portal:editcategory_relations", "in-portal:editcategory_permissions",-1);
$objSections->AddSection("in-portal:editcategory_permissions","la_tab_Permissions", NULL,$admin."/category/",
"javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory_permissions.php',0);",
$admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif",
NULL, "in-portal:browse", "in-portal:editcategory_images","in-portal:editcategory_custom",-1);
$objSections->AddSection("in-portal:editcategory_custom", "la_tab_Custom", NULL, $admin."/category/",
"javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory_custom.php',0);",
$admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif", NULL,
"in-portal:browse", "in-portal:editcategory_permissions", NULL,-1);
/* category edit subitems */
$objSections->AddSection("in-portal:cat_imageedit","la_tab_Images","la_title_edit_category",$admin."/category/",
"javascript:edit_submit('category','CatEditStatus','".$admin."/category/addimage.php',0);",
$admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_catalog.gif",
NULL, NULL, NULL,NULL,-1);
$objSections->AddSection("in-portal:editcategory_relation","la_tab_Relations","la_title_edit_category",$admin."/category/",
"javascript:edit_submit('category','CatEditStatus','".$admin."/category/addrelation.php',0);",
$admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_catalog.gif",
NULL, NULL, NULL,NULL,-1);
/* permission edit subtabs */
$objSections->AddSection("in-portal:catperm_modules","la_tab_Permissions","la_title_edit_category",$admin."/category/",
"javascript:edit_submit('category','CatEditStatus','".$admin."/category/addpermission_modules.php',0);",
$admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_catalog.gif",
NULL, NULL, NULL,NULL,-1);
$objSections->AddSection("in-portal:catperm_setperm","la_tab_Permissions","la_title_edit_category",$admin."/category/",
"javascript:edit_submit('category','CatEditStatus','".$admin."/category/addpermission_modules.php',0);",
$admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_catalog.gif",
NULL, NULL, NULL,NULL,-1);
/*user list toolbar - edit user*/
/*$objSections->AddSection("in-portal:user_rule_edit","la_tab_UserBan","la_title_edit_ban",$admin."/users/",
"javascript:edit_submit('rule','RuleEditStatus','".$admin."/config/edit_banlist.php',1,'$addSection&DataType=6');",
$admin."/icons/icon46_banlist.gif", $admin."/icons/icon24_banlist.gif",
NULL, NULL, NULL,NULL,-1);*/
$objSections->AddSection("in-portal:edituser_general", "la_tab_General", NULL, $admin."/users/",
"javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/adduser.php',0);",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
NULL, "in-portal:user_list", NULL, 'in-portal:edituser_groups',-1);
$objSections->AddSection("in-portal:edituser_groups", "la_tab_Groups", NULL, $admin."/users/",
"javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/adduser_groups.php',0);",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
NULL, "in-portal:user_list", "in-portal:edituser_general", "in-portal:edituser_images",-1);
$objSections->AddSection("in-portal:edituser_images", "la_tab_Images", NULL, $admin."/users/",
"javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/adduser_images.php',0);",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
NULL, "in-portal:user_list", "in-portal:edituser_groups", "in-portal:edituser_permissions",-1);
$objSections->AddSection("in-portal:edituser_permissions", "la_tab_Permissions", NULL, $admin."/users/",
"javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/adduser_permissions.php',0);",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
NULL, "in-portal:user_list", "in-portal:edituser_images", "in-portal:edituser_items",-1);
$objSections->AddSection("in-portal:edituser_items", "la_tab_Items", NULL, $admin."/users/",
"javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/adduser_items.php',0);",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
NULL, "in-portal:user_list", "in-portal:edituser_permissions", "in-portal:edituser_custom",-1);
$objSections->AddSection("in-portal:edituser_custom","la_tab_Custom", NULL, $admin."/users/",
"javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/adduser_custom.php',0);",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
NULL, "in-portal:user_list", "in-portal:edituser_permissions", NULL,-1);
/* user edit subitems */
$objSections->AddSection("in-portal:edituser_image","la_tab_Images","la_title_edit_user",$admin."/category/",
"javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/user_addimage.php',0);",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
NULL, NULL, NULL,NULL,-1);
$objSections->AddSection("in-portal:edituser_permission","la_tab_Permissions","la_title_edit_user",$admin."/category/",
"javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/user_addpermission.php',0);",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
NULL, NULL, NULL,NULL,-1);
/* group list toolbar - edit group */
$objSections->AddSection("in-portal:editgroup_general", "la_tab_General",NULL, $admin."/users/",
"javascript:edit_submit('editgroup','GroupEditStatus','".$admin."/users/addgroup.php',0);",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_usergroups.gif",
NULL, "in-portal:user_groups", NULL, "in-portal:editgroup_users",-1);
$objSections->AddSection("in-portal:editgroup_users", "la_tab_Users", NULL,$admin."/users/",
"javascript:edit_submit('editgroup','GroupEditStatus','".$admin."/users/addgroup_users.php',0)",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_usergroups.gif",
NULL, "in-portal:user_groups", "in-portal:editgroup_general","in-portal:editgroup_permissions",-1);
$objSections->AddSection("in-portal:editgroup_permissions", "la_tab_Permissions", NULL,$admin."/users/",
"javascript:edit_submit('editgroup','GroupEditStatus','".$admin."/users/addgroup_permissions.php',0)",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_usergroups.gif",
NULL, "in-portal:user_groups", "in-portal:editgroup_users",NULL,-1);
/* reports tree items */
/*
*/
//$notree=0,$onClick = "",$notabs=0,$nonavbar=0,$notitle=0,$toolbar=0
$objSections->AddSection("in-portal:editcategory_relationselect","la_tab_Category_RelationSelect",
"la_title_Category_RelationSelect", $admin."/","relation_select.php",$admin."/icons/icon46_navigate.gif",
$admin."/icons/icon24_navigate.gif",
NULL,NULL,NULL,NULL,-1,"",1,0,1,1);
$objSections->AddSection("in-portal:catselect","la_tab_Category_Select","la_title_Category_Select",
$admin."/","relation_select.php",$admin."/icons/icon46_navigate.gif",$admin."/icons/icon24_navigate.gif",
NULL,NULL,NULL,NULL,-1,"",1,0,1,1);
$objSections->AddSection("in-portal:groupselect","la_tab_GroupSelect","la_title_GroupSelect",
$admin."/users","group_select.php",
$admin."/icons/icon46_navigate.gif",$admin."/icons/icon24_usergroups.gif",
NULL,NULL,NULL,NULL,-1,"",1,0,1,1);
$objSections->AddSection("in-portal:userselect","la_tab_UserSelect","la_title_UserSelect",
$admin."/users","user_select.php",
$admin."/icons/icon46_community.gif",$admin."/icons/icon24_usergroups.gif",
NULL,NULL,NULL,NULL,-1,"",1,0,1,1);
$objSections->AddSection("in-portal:phrase_editor","la_tab_Label","la_title_Label",
$admin."/config","edit_label.php",
$admin."/icons/icon46_conf_regional.gif",$admin."/icons/icon24_conf_regional.gif",
NULL,NULL,NULL,NULL,-1,"",1,0,1,1);
$objSections->AddSection("in-portal:sendmail","la_tab_SendMail","la_title_SendMail",
$admin."/email","sendmail.php",
$admin."/icons/icon46_conf_regional.gif",$admin."/icons/icon24_conf_regional.gif",
NULL,NULL,NULL,NULL,-1,"",1,0,1,1);
$objSections->AddSection("in-portal:user_rule_edit","la_tab_UserBan","la_tab_UserBan",
$admin."/users","addrule.php",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
NULL,NULL,NULL,NULL,-1,"",1,0,0,1);
$objSections->AddSection("in-portal:banuser","la_Text_BanUserFields","la_Text_BanUserFields",
$admin."/users","banuser.php",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
NULL,NULL,NULL,NULL,-1,"",1,0,0,1);
?>
Property changes on: trunk/kernel/admin/include/navmenu.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/kernel/startup.php
===================================================================
--- trunk/kernel/startup.php (revision 40)
+++ trunk/kernel/startup.php (revision 41)
@@ -1,151 +1,152 @@
<?php
/*
startup.php: this is the primary startup sequence for in-portal services
*/
if( file_exists($pathtoroot.'debug.php') ) include_once($pathtoroot.'debug.php');
if( defined('DEBUG_MODE') )
{
error_reporting(E_ALL & E_NOTICE);
}
else
error_reporting(0);
$kernel_version = "1.0.0";
$FormError = array();
$FormValues = array();
/* include PHP version compatibility functions */
require_once($pathtoroot."compat.php");
/* set global variables and module lists */
require_once($pathtoroot."globals.php");
LogEntry("Initalizing System..\n");
/* for 64 bit timestamps */
require_once("include/adodb/adodb-time.inc.php");
require_once("include/dates.php");
/* create the global error object */
require_once("include/error.php");
$Errors = new clsErrorManager();
require_once("include/itemdb.php");
require_once("include/config.php");
/* create the global configuration object */
LogEntry("Creating Config Object..\n");
$objConfig = new clsConfig();
$objConfig->Load(); /* Populate our configuration data */
LogEntry("Done Loading Configuration\n");
if( defined('ADODB_EXTENSION') && constant('ADODB_EXTENSION') > 0 )
LogEntry("ADO Extension: ".ADODB_EXTENSION."\n");
require_once("include/parseditem.php");
require_once("include/item.php");
require_once("include/syscache.php");
require_once("include/modlist.php");
require_once("include/searchconfig.php");
require_once("include/banrules.php");
$objModules = new clsModList();
$objSystemCache = new clsSysCacheList();
$objSystemCache->PurgeExpired();
$objBanList = new clsBanRuleList();
require_once("include/image.php");
require_once("include/itemtypes.php");
$objItemTypes = new clsItemTypeList();
require_once("include/theme.php");
$objThemes = new clsThemeList();
require_once("include/language.php");
$objLanguages = new clsLanguageList();
$objImageList = new clsImageList();
/* Load session and user class definitions */
//require_once("include/customfield.php");
//require_once("include/custommetadata.php");
require_once("include/usersession.php");
require_once("include/favorites.php");
require_once("include/portaluser.php");
require_once("include/portalgroup.php");
/* create the user management class */
$objFavorites = new clsFavoriteList();
$objUsers = new clsUserManager();
$objGroups = new clsGroupList();
require_once("include/cachecount.php");
require_once("include/customfield.php");
require_once("include/custommetadata.php");
require_once("include/permissions.php");
require_once("include/relationship.php");
require_once("include/category.php");
require_once("include/statitem.php");
/* category base class, used by all the modules at some point */
$objPermissions = new clsPermList();
$objPermCache = new clsPermCacheList();
$objCatList = new clsCatList();
$objCustomFieldList = new clsCustomFieldList();
$objCustomDataList = new clsCustomDataList();
$objCountCache = new clsCacheCountList();
require_once("include/smtp.php");
require_once("include/emailmessage.php");
require_once("include/events.php");
LogEntry("Creating Mail Queue..\n");
$objMessageList = new clsEmailMessageList();
$objEmailQueue = new clsEmailQueue();
LogEntry("Done creating Mail Queue Objects\n");
require_once("include/searchitems.php");
require_once("include/advsearch.php");
require_once("include/parse.php");
require_once("include/socket.php");
/* responsible for including module code as required
This script also creates an instance of the user session onject and
handles all session management. The global session object is created
and populated, then the global user object is created and populated
each module's parser functions and action code is included here
*/
LogEntry("Startup complete\n");
include_once("include/modules.php");
/* startup is complete, so now check the mail queue to see if there's anything that needs to be sent*/
$objEmailQueue->SendMailQeue();
$ado=GetADODBConnection();
$rs = $ado->Execute("SELECT * FROM ".GetTablePrefix()."Modules WHERE LoadOrder = 0");
$kernel_version = $rs->fields['Version'];
$adminDir = $objConfig->Get("AdminDirectory");
if ($adminDir == '') {
$adminDir = 'admin';
}
if (strstr($_SERVER['SCRIPT_FILENAME'], $adminDir) && !GetVar('logout') && !strstr($_SERVER['SCRIPT_FILENAME'], "install") && !strstr($_SERVER['SCRIPT_FILENAME'], "index")) {
- //echo "test<br>";
+ //echo "testz [".admin_login()."]<br>";
+
if (!admin_login())
{
if(!headers_sent())
setcookie("sid"," ",time()-3600);
$objSession->Logout();
if ($_GET['expired']) {
header("Location: ".$adminURL."/login.php?expired=1");
}
else {
header("Location: ".$adminURL."/login.php");
}
die();
//require_once($pathtoroot."admin/login.php");
}
}
?>
Property changes on: trunk/kernel/startup.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/admin/help/topics/in-portal@install.txt
===================================================================
--- trunk/admin/help/topics/in-portal@install.txt (nonexistent)
+++ trunk/admin/help/topics/in-portal@install.txt (revision 41)
@@ -0,0 +1 @@
+<h3>INSTALLATION & GETTING STARTED</h3>
\ No newline at end of file
Property changes on: trunk/admin/help/topics/in-portal@install.txt
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/admin/help/install_help.php
===================================================================
--- trunk/admin/help/install_help.php (nonexistent)
+++ trunk/admin/help/install_help.php (revision 41)
@@ -0,0 +1,138 @@
+<?php
+
+$pathtoroot = "";
+if(!strlen($pathtoroot))
+{
+ //$path=dirname(realpath($_SERVER['SCRIPT_FILENAME']));PATH_TRANSLATED
+ $path=dirname(realpath($_SERVER['PATH_TRANSLATED']));
+ if(strlen($path))
+ {
+ /* determine the OS type for path parsing */
+ $pos = strpos($path,":");
+ if ($pos === false)
+ {
+ $gOS_TYPE="unix";
+ $pathchar = "/";
+ }
+ else
+ {
+ $gOS_TYPE="win";
+ $pathchar="\\";
+ }
+ $p = $path.$pathchar;
+ /*Start looking for the root flag file */
+ while(!strlen($pathtoroot) && strlen($p))
+ {
+ $sub = substr($p,strlen($pathchar)*-1);
+ if($sub==$pathchar)
+ {
+ $filename = $p."root.flg";
+ }
+ else
+ $filename = $p.$pathchar."root.flg";
+ if(file_exists($filename))
+ {
+ $pathtoroot = $p;
+ }
+ else
+ {
+ $parent = realpath($p.$pathchar."..".$pathchar);
+ if($parent!=$p)
+ {
+ $p = $parent;
+ }
+ else
+ $p = "";
+ }
+ }
+ if(!strlen($pathtoroot))
+ $pathtoroot = ".".$pathchar;
+ }
+ else
+ {
+ $pathtoroot = ".".$pathchar;
+ }
+}
+function GetPathChar($path = null)
+{
+ if( !isset($path) ) $path = $GLOBALS['pathtoroot'];
+ $pos = strpos($path, ':');
+ return ($pos === false) ? "/" : "\\";
+}
+$path_char = GetPathChar();
+
+$rootURL = 'http://'.dirname($_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']);
+$rootURL = str_replace('/help','',$rootURL);
+
+$tmp = explode('/', $rootURL);
+if( $tmp[ count($tmp) - 1 ] == $admin) unset( $tmp[ count($tmp) - 1 ] );
+$rootURL = implode('/', $tmp).'/';
+unset($tmp);
+
+
+
+function print_pre($s)
+{
+ echo '<pre>'.print_r($s, true).'</pre>';
+}
+
+
+$topic_path = dirname($_SERVER['PATH_TRANSLATED']).'/topics/'.str_replace(':','@',$section).'.txt';
+//echo "TP: $topic_path<br>";
+
+?>
+<html>
+ <head>
+ <title>In-Portal - Help</title>
+ <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+ <meta http-equiv="Pragma" content="no-cache">
+ <link rel="stylesheet" type="text/css" href="<?php echo $rootURL; ?>include/style.css">
+ </head>
+ <body topmargin="0" leftmargin="8" marginheight="8" marginwidth="8" bgcolor="#FFFFFF">
+ <DIV style='position:relative; z-Index: 1; background-color: #ffffff; padding-top:1px;'>
+ <div style='position:absolute; width:100%;top:0px;' align='right'>
+ <img src='<?php echo $rootURL; ?>images/logo_bg.gif'>
+ </div>
+ <img src="<?php echo $rootURL; ?>images/spacer.gif" width="1" height="7"><br>
+ <div style='z-Index:1; position:relative'>
+ <!-- ADMIN TITLE -->
+ <table cellpadding="0" cellspacing="0" border="0" width="100%">
+ <tr><td valign="top" class="admintitle" align="left">
+ <img alt="" width="46" height="46" src="<?php echo $rootURL; ?>images/icon_install.gif" align="absmiddle">&nbsp;Installtion Help<br>
+ <img src='<?php echo $rootURL; ?>images/spacer.gif' width=1 height=4><br>
+ </td></tr></table>
+ <!-- SECTION NAVIGATOR -->
+ <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30"><tr>
+ <TD class="header_left_bg" width="100%">
+ <span class="tablenav_link">Install</span>
+ </td>
+ <td align="right" class="tablenav" background="<?php echo $rootURL; ?>images/tabnav_back.jpg" width="10">
+ </td>
+ </tr>
+ </table>
+ <!-- END SECTION NAVIGATOR -->
+ <table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+ <tr>
+ <td bgcolor="F6F6F6">
+ <div class="help_box">
+ <h3>
+<?php
+ if( file_exists($topic_path) )
+ {
+
+ echo file_get_contents($topic_path);
+
+ }
+
+
+
+
+?>
+ </h3> </div>
+
+ </td>
+
+ </tr>
+</table>
+</body>
+</html>
\ No newline at end of file
Property changes on: trunk/admin/help/install_help.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/admin/help/help.php
===================================================================
--- trunk/admin/help/help.php (revision 40)
+++ trunk/admin/help/help.php (revision 41)
@@ -1,130 +1,133 @@
<?php
if(!strlen($pathtoroot))
{
$path=dirname(realpath($_SERVER['SCRIPT_FILENAME']));
if(strlen($path))
{
/* determine the OS type for path parsing */
$pos = strpos($path,":");
if ($pos === false)
{
$gOS_TYPE="unix";
$pathchar = "/";
}
else
{
$gOS_TYPE="win";
$pathchar="\\";
}
$p = $path.$pathchar;
/*Start looking for the root flag file */
while(!strlen($pathtoroot) && strlen($p))
{
$sub = substr($p,strlen($pathchar)*-1);
if($sub==$pathchar)
{
$filename = $p."root.flg";
}
else
$filename = $p.$pathchar."root.flg";
if(file_exists($filename))
{
$pathtoroot = $p;
}
else
{
$parent = realpath($p.$pathchar."..".$pathchar);
if($parent!=$p)
{
$p = $parent;
}
else
$p = "";
}
}
if(!strlen($pathtoroot))
$pathtoroot = ".".$pathchar;
}
else
{
$pathtoroot = ".".$pathchar;
}
}
$sub = substr($pathtoroot,strlen($pathchar)*-1);
if($sub!=$pathchar)
{
$pathtoroot = $pathtoroot.$pathchar;
}
//echo $pathtoroot;
require_once($pathtoroot."kernel/startup.php");
$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
$baseURL = $_SERVER['DOCUMENT_ROOT'].$path_char.$objConfig->Get("Site_Path");
$admin = $objConfig->Get("AdminDirectory");
if(!strlen($admin))
$admin = "admin";
$localURL=$rootURL."kernel/";
$adminURL = $rootURL.$admin;
$imagesURL = $adminURL."/images";
//admin only util
$pathtolocal = $pathtoroot."kernel/";
require_once ($pathtoroot.$admin."/include/elements.php");
//require_once ($pathtoroot."kernel/admin/include/navmenu.php");
//require_once ($pathtolocal."admin/include/navmenu.php");
require_once($pathtoroot.$admin."/toolbar.php");
$section = $_REQUEST["section"];
$envar = BuildEnv();
int_help_header();
$topic_path = $baseURL.$admin.'/help/topics/'.str_replace(':','@',$section).'.txt';
// for debugging: save new help content
if( GetVar('action') == 'save_help' )
{
error_reporting(E_ALL);
$fp = fopen($topic_path, 'w');
fwrite($fp, stripslashes(GetVar('help_content')) );
fclose($fp);
}
$help_data = file_exists($topic_path) ? file_get_contents($topic_path) : GetVar('help_content');
?>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
<tr>
<td bgcolor="F6F6F6">
<div class="help_box">
<?php
if( file_exists($topic_path) )
echo $help_data;
else
echo defined('DEBUG_HELP') ? 'missing section help file <b>'.str_replace(':','@',$section).'.txt</b><br>' : admin_language('la_help_in_progress');
?>
</div>
<?php
if( defined('DEBUG_HELP') )
{
?>
<br><input type="button" onclick="document.save_help.submit();" value="Save Changes" style="font-weight: bolder; background-color: #F6F6F6;"><br>
<form name="save_help" id="save_help" method="post" action="<?php echo $_SERVER['PHP_SELF'].'?env='.$envar; ?>">
<textarea id="help_content" name="help_content" rows="15" cols="85"><?php echo $help_data; ?></textarea>
<input type="hidden" name="section" value="<?php echo $section; ?>">
<input type="hidden" name="action" value="save_help">
+ <?php if( GetVar('help_usage') ) { ?>
+ <input type="hidden" name="help_usage" value="<?php echo GetVar('help_usage'); ?>">
+ <?php } ?>
</form>
<?php
}
?>
</td>
</tr>
</table>
<? int_footer(); ?>
\ No newline at end of file
Property changes on: trunk/admin/help/help.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/admin/install.php
===================================================================
--- trunk/admin/install.php (revision 40)
+++ trunk/admin/install.php (revision 41)
@@ -1,1828 +1,1862 @@
<?php
error_reporting(0);
//$new_version = '1.0.2';
define("GET_LICENSE_URL", "http://www.in-portal.net/licensing/license.php");
define('BACKUP_NAME', 'dump(.*).txt'); // how backup dump files are named
$general_error = '';
if ($_POST['install_type'] != '') {
$install_type = $_POST['install_type'];
}
else if ($_GET['install_type'] != '') {
$install_type = $_GET['install_type'];
}
$pathtoroot = "";
if(!strlen($pathtoroot))
{
//$path=dirname(realpath($_SERVER['SCRIPT_FILENAME']));PATH_TRANSLATED
$path=dirname(realpath($_SERVER['PATH_TRANSLATED']));
if(strlen($path))
{
/* determine the OS type for path parsing */
$pos = strpos($path,":");
if ($pos === false)
{
$gOS_TYPE="unix";
$pathchar = "/";
}
else
{
$gOS_TYPE="win";
$pathchar="\\";
}
$p = $path.$pathchar;
/*Start looking for the root flag file */
while(!strlen($pathtoroot) && strlen($p))
{
$sub = substr($p,strlen($pathchar)*-1);
if($sub==$pathchar)
{
$filename = $p."root.flg";
}
else
$filename = $p.$pathchar."root.flg";
if(file_exists($filename))
{
$pathtoroot = $p;
}
else
{
$parent = realpath($p.$pathchar."..".$pathchar);
if($parent!=$p)
{
$p = $parent;
}
else
$p = "";
}
}
if(!strlen($pathtoroot))
$pathtoroot = ".".$pathchar;
}
else
{
$pathtoroot = ".".$pathchar;
}
}
$path_char = GetPathChar();
//phpinfo(INFO_VARIABLES);
$sub = substr($pathtoroot,strlen($pathchar)*-1);
if($sub!=$pathchar)
{
$pathtoroot = $pathtoroot.$pathchar;
}
$is_install = TRUE;
$admin = substr($path,strlen($pathtoroot));
$state = $_GET["state"];
if(!strlen($state))
{
$state = $_POST["state"];
}
include("install/install_lib.php");
$ini_file = $pathtoroot."config.php";
if(file_exists($ini_file))
{
$write_access = is_writable($ini_file);
$ini_vars = parse_ini_file($ini_file,TRUE);
foreach($ini_vars as $secname => $section)
{
foreach($section as $key => $value)
{
$key = "g_".$key;
global $$key;
$$key = $value;
}
}
}
else
{
$state="";
$write_access = is_writable($pathtoroot);
if($write_access)
{
set_ini_value("Database", "DBType", "");
set_ini_value("Database", "DBHost", "");
set_ini_value("Database", "DBUser", "");
set_ini_value("Database", "DBUserPassword", "");
set_ini_value("Database", "DBName", "");
set_ini_value("Module Versions", "In-Portal", "");
save_values();
}
}
$titles[1] = "General Site Setup";
$configs[1] = "in-portal:configure_general";
$mods[1] = "In-Portal";
$titles[2] = "User Setup";
$configs[2] = "in-portal:configure_users";
$mods[2] = "In-Portal:Users";
$titles[3] = "Category Display Setup";
$configs[3] = "in-portal:configure_categories";
$mods[3] = "In-Portal";
+
+// simulate rootURL variable: begin
+ $rootURL = 'http://'.dirname($_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']);
+ $tmp = explode('/', $rootURL);
+ if( $tmp[ count($tmp) - 1 ] == $admin) unset( $tmp[ count($tmp) - 1 ] );
+ $rootURL = implode('/', $tmp).'/';
+ unset($tmp);
+ echo "RU: $rootURL<br>";
+// simulate rootURL variable: end
+
if(strlen($g_DBType)>0 && strlen($state)>0 && $state !="dbinfo" && $state !="db_config_save")
{
require_once($pathtoroot."kernel/startup.php");
$localURL=$rootURL."kernel/";
$adminURL = $rootURL.$admin;
$imagesURL = $adminURL."/images";
//admin only util
$pathtolocal = $pathtoroot."kernel/";
require_once ($pathtoroot.$admin."/include/elements.php");
//require_once ($pathtoroot."kernel/admin/include/navmenu.php");
require_once ($pathtolocal."admin/include/navmenu.php");
require_once($pathtoroot.$admin."/toolbar.php");
}
function GetPathChar($path = null)
{
if( !isset($path) ) $path = $GLOBALS['pathtoroot'];
$pos = strpos($path, ':');
return ($pos === false) ? "/" : "\\";
}
function SuperStrip($str, $inverse = false)
{
$str = $inverse ? str_replace("%5C","\\",$str) : str_replace("\\","%5C",$str);
return stripslashes($str);
}
require_once($pathtoroot.$admin."/install/inst_ado.php");
-
+$helpURL = $rootURL.$admin.'/help/install_help.php?destform=popup&help_usage=install';
?>
<html>
<head>
<title>In-Portal Installation</title>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Notepad">
<link rel="stylesheet" type="text/css" href="include/style.css">
<LINK REL="stylesheet" TYPE="text/css" href="install/2col.css">
<SCRIPT LANGUAGE="JavaScript1.2">
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function swap(imgid, src){
var ob = document.getElementById(imgid);
ob.src = 'images/' + src;
}
function Continue() {
document.iform1.submit();
}
+
+ function CreatePopup(window_name, url, width, height)
+ {
+ // creates a popup window & returns it
+ if(url == null && typeof(url) == 'undefined' ) url = '';
+ if(width == null && typeof(width) == 'undefined' ) width = 750;
+ if(height == null && typeof(height) == 'undefined' ) height = 400;
+
+
+ return window.open(url,window_name,'width='+width+',height='+height+',status=yes,resizable=yes,menubar=no,scrollbars=yes,toolbar=no');
+ }
+
+ function ShowHelp(section)
+ {
+ var frm = document.getElementById('help_form');
+
+ frm.section.value = section;
+ frm.method = 'POST';
+ CreatePopup('HelpPopup','<?php echo $rootURL.$admin; ?>/help/blank.html', null, 600);
+ frm.target = 'HelpPopup';
+ frm.submit();
+ }
+
</SCRIPT>
</head>
<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" style="height: 100%">
+<form name="help_form" id="help_form" action="<?php echo $helpURL; ?>" method="post"><input type="hidden" id="section" name="section" value=""></form>
<form enctype="multipart/form-data" name="iform1" id="iform1" method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>">
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
<tr>
<td height="90">
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="90">
<tr>
<td rowspan="3" valign="top"><a href="http://www.in-portal.net" target="_top"><img alt="In-portal" src="images/globe.gif" width="84" height="91" border="0"></a></td>
<td rowspan="3" valign="top"><a href="http://www.in-portal.net" target="_top"><img alt="In-portal" src="images/logo.gif" width="150" height="91" border="0"></a></td>
<td rowspan="3" width="100000" align="right">&nbsp;</td>
<td width="400"><img alt="" src="images/blocks.gif" width="400" height="73"></td>
</tr>
<tr><td align="right" background="images/version_bg.gif" class="head_version" valign="top"><img alt="" src="images/spacer.gif" width="1" height="14">In-Portal Version 1.0.0: English US</td></tr>
<tr><td><img alt="" src="images/blocks2.gif" width="400" height="2"><br></td></tr>
<tr><td bgcolor="black" colspan="4"><img alt="" src="images/spacer.gif" width="1" height="1"><br></td></tr>
</table>
</td>
</tr>
<?php
require_once($pathtoroot."kernel/include/adodb/adodb.inc.php");
if(!strlen($state))
$state = @$_POST["state"];
//echo $state;
if(strlen($state)==0)
{
$ado = inst_GetADODBConnection();
if($ado)
{
$installed = TableExists($ado,"ConfigurationAdmin,Category,Permissions");
}
if(!minimum_php_version("4.1.2"))
{
$general_error = "You have version ".phpversion()." - please upgrade!";
//die();
}
if(!$write_access)
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "Install cannot write to config.php in the root directory of your in-portal installation ($pathtoroot).";
//die();
}
if(!is_writable($pathtoroot."themes/"))
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "In-portal's Theme directory must be writable (".$pathtoroot."themes/).";
//die();
}
if(!is_writable($pathtoroot."kernel/images/"))
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "In-portal's Image Upload directory must be writable (".$pathtoroot."kernel/images/).";
//die();
}
if(!is_writable($pathtoroot."admin/backupdata/"))
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "In-portal's Backup directory must be writable (".$pathtoroot."admin/backupdata/).";
//die();
}
if(!is_writable($pathtoroot."admin/export/"))
{
if ($general_error != '') {
$general_error .= '<br /><br />';
}
$general_error .= "In-portal's Exportd directory must be writable (".$pathtoroot."admin/export/).";
//die();
}
if($installed)
{
$state="reinstall";
}
else {
$state="dbinfo";
}
}
if($state=="reinstall_process")
{
$lic = base64_decode($g_License);
if(strlen($lic))
{
inst_ParseLicense($lic);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
}
$LoggedIn = FALSE;
if($_POST["UserName"]=="root")
{
$ado = inst_GetADODBConnection();
$sql = "SELECT * FROM ".$g_TablePrefix."ConfigurationValues WHERE VariableName='RootPass'";
$rs = $ado->Execute($sql);
if($rs && !$rs->EOF)
{
$RootPass = $rs->fields["VariableValue"];
if(strlen($RootPass)>0)
$LoggedIn = ($RootPass==md5($_POST["UserPass"]));
}
}
else
{
$rfile = @fopen(GET_LICENSE_URL."?login=".md5($_POST['UserName'])."&password=".md5($_POST['UserPass'])."&domain=".$_SERVER['SERVER_NAME'], "r");
if (!$rfile) {
$LoggedIn = false;
}
else {
$rcontents = '';
while (!feof($rfile)) {
$line = fgets($rfile, 10000);
$rcontents .= $line;
}
@fclose($rfile);
if (substr($rcontents, 0, 5) == 'Error') {
$LoggedIn = false;
}
else {
$LoggedIn = true;
}
}
//$LoggedIn = ($i_User == $_POST["UserName"] && ($i_Pswd == $_POST["UserPass"]) && strlen($i_User)>0) || strlen($i_User)==0;
}
if($LoggedIn)
{
if (!(int)$_POST["inp_opt"]) {
$state="reinstall";
$inst_error = "Please select one of the options above!";
}
else {
switch((int)$_POST["inp_opt"])
{
case 0:
$inst_error = "Please select an option above";
break;
case 1:
/* clean out all tables */
$install_type = 4;
$ado = inst_GetADODBConnection();
$filename = $pathtoroot.$admin."/install/inportal_remove.sql";
RunSchemaFile($ado,$filename);
/* run install again */
$state="license";
break;
case 2:
$install_type = 3;
$state="dbinfo";
break;
case 3:
$install_type = 5;
$state="license";
break;
case 4:
$install_type = 6;
/* clean out all tables */
$ado = inst_GetADODBConnection();
//$filename = $pathtoroot.$admin."/install/inportal_remove.sql";
//RunSchemaFile($ado,$filename);
/* run install again */
$state="restore_select";
break;
case 5:
$install_type = 7;
/* change DB config */
$state="db_reconfig";
break;
case 6:
$install_type = 8;
$state = "upgrade";
break;
}
}
}
else
{
$state="reinstall";
$login_error = "Invalid Username or Password - Try Again";
}
}
if ($state == "upgrade") {
$ado = inst_GetADODBConnection();
$Modules = array();
$Texts = array();
$sql = "SELECT Name, Version FROM ".$g_TablePrefix."Modules";
$rs = $ado->Execute($sql);
while ($rs && !$rs->EOF) {
$p = strtolower($rs->fields['Name']);
// $modules .= strtolower($rs->fields['Name']).',';
// $rs->MoveNext();
// }
// $mod_arr = explode(",", substr($modules, 0, strlen($modules) - 1));
// foreach($mod_arr as $p)
// {
if ($p == 'in-portal') {
$p = '';
}
$dir_name = $pathtoroot.$p."/admin/install/upgrades/";
$dir = @dir($dir_name);
//echo "<pre>"; print_r($dir); echo "</pre>";
while ($file = $dir->read()) {
if ($file != "." && $file != ".." && !is_dir($dir_name.$file))
{
$file = str_replace("inportal_upgrade_v", "", $file);
$file = str_replace(".sql", "", $file);
if ($file != '') {
$sql = "SELECT count(*) AS count FROM ".$g_TablePrefix."Modules WHERE Name = '".$rs->fields['Name']."' AND Version = '$file'";
$rs1 = $ado->Execute($sql);
if ($rs1->fields['count'] == 0 && str_replace('.', '', $file) > str_replace('.', '', $rs->fields['Version'])) {
//$sql = "SELECT Version FROM ".$g_TablePrefix."Modules WHERE Name = '".$p."'";
//$rs2 = $ado->Execute($sql);
$Texts[] = $rs->fields['Name']." (".$rs->fields['Version']." ".prompt_language("la_to")." ".$file.")";
$Modules[] = $rs->fields['Name'];
}
}
}
}
$rs->MoveNext();
}
$include_file = "install/upgrade.php";
}
if ($state == "upgrade_process") {
$ado = inst_GetADODBConnection();
$mod_arr = $_POST['modules'];
foreach($mod_arr as $p)
{
$mod_name = strtolower($p);
$sql = "SELECT Version FROM ".$g_TablePrefix."Modules WHERE Name = '$p'";
$rs = $ado->Execute($sql);
$current_version = $rs->fields['Version'];
if ($mod_name == 'in-portal') {
$mod_name = '';
}
$dir_name = $pathtoroot.$mod_name."/admin/install/upgrades/";
$dir = @dir($dir_name);
$new_version = '';
$tmp1 = 0;
$tmp2 = 0;
while ($file = $dir->read()) {
if ($file != "." && $file != ".." && !is_dir($dir_name.$file))
{
$file = str_replace("inportal_upgrade_v", "", $file);
$file = str_replace(".sql", "", $file);
if ($file != '') {
$tmp1 = str_replace(".", "", $file);
if ($tmp1 > $tmp2) {
$new_version = $file;
}
}
}
$tmp2 = $tmp1;
}
$version_nrs = explode(".", $new_version);
for ($i = 0; $i < $version_nrs[0] + 1; $i++) {
for ($j = 0; $j < $version_nrs[1] + 1; $j++) {
for ($k = 0; $k < $version_nrs[2] + 1; $k++) {
$try_version = "$i.$j.$k";
if (str_replace('.', '', $try_version) > str_replace('.', '', $current_version)) {
$filename = $pathtoroot.$mod_name."/admin/install/upgrades/inportal_upgrade_v$try_version.sql";
//echo "Trying Version: $try_version<br>";
if(file_exists($filename))
{
RunSQLFile($ado, $filename);
set_ini_value("Module Versions", $p, $try_version);
save_values();
}
}
}
}
}
}
$state = "finish";
$include_file = "install/install_finish.php";
}
if($state=="db_reconfig_save")
{
$ini_vars = parse_ini_file($ini_file,TRUE);
foreach($ini_vars as $secname => $section)
{
foreach($section as $key => $value)
{
$key = "g_".str_replace("-", "", $key);
global $$key;
$$key = $value;
}
}
unset($ado);
$ado = inst_GetADODBConnection();
if($ado->ErrorNo()!=0)
{
$db_error = "Connection Error: (".$ado->ErrorNo().") ".$ado->ErrorMsg();
$state = "db_reconfig";
}
else
{
if(!TableExists($ado,"ConfigurationAdmin,Category,Permissions"))
{
$state="db_reconfig";
$db_error = "An In-Portal Database was not found at this location";
}
else {
set_ini_value("Database", "DBType",$_POST["ServerType"]);
set_ini_value("Database", "DBHost",$_POST["ServerHost"]);
set_ini_value("Database", "DBName",$_POST["ServerDB"]);
set_ini_value("Database", "DBUser",$_POST["ServerUser"]);
set_ini_value("Database", "DBUserPassword",$_POST["ServerPass"]);
set_ini_value("Database","TablePrefix",$_POST["TablePrefix"]);
save_values();
$state = "finish";
$include_file = "install/install_finish.php";
}
}
}
if($state=="db_reconfig")
{
$include_file = "install/db_reconfig.php";
}
if($state=="restore_file")
{
if($_POST["submit"]=="Update")
{
$filepath = $_POST["backupdir"];
$state="restore_select";
}
else
{
$filepath = stripslashes($_POST['backupdir']);
$backupfile = $filepath.$path_char.str_replace('(.*)', $_POST['backupdate'], BACKUP_NAME);
if(file_exists($backupfile) && is_readable($backupfile))
{
$ado = inst_GetADODBConnection();
$show_warning = false;
if (!$_POST['warning_ok']) {
// Here we comapre versions between backup and config
$file_contents = file_get_contents($backupfile);
$file_tmp_cont = explode("#------------------------------------------", $file_contents);
$tmp_vers = $file_tmp_cont[0];
$vers_arr = explode(";", $tmp_vers);
$ini_values = parse_ini_file($ini_file);
foreach ($ini_values as $key => $value) {
foreach ($vers_arr as $k) {
if (strstr($k, $key)) {
if (!strstr($k, $value)) {
$show_warning = true;
}
}
}
}
//$show_warning = true;
}
if (!$show_warning) {
$filename = $pathtoroot.$admin.$path_char.'install'.$path_char.'inportal_remove.sql';
RunSchemaFile($ado,$filename);
$state="restore_run";
}
else {
$state = "warning";
$include_file = "install/warning.php";
}
}
else {
if ($_POST['backupdate'] != '') {
$include_file = "install/restore_select.php";
$restore_error = "$backupfile not found or could not be read";
}
else {
$include_file = "install/restore_select.php";
$restore_error = "No backup selected!!!";
}
}
}
//echo $restore_error;
}
if($state=="restore_select")
{
if( isset($_POST['backupdir']) ) $filepath = stripslashes($_POST['backupdir']);
$include_file = "install/restore_select.php";
}
if($state=="restore_run")
{
$ado = inst_GetADODBConnection();
$FileOffset = (int)$_GET["Offset"];
if(!strlen($backupfile))
$backupfile = SuperStrip($_GET['File'], true);
$include_file = "install/restore_run.php";
}
if($state=="db_config_save")
{
set_ini_value("Database", "DBType",$_POST["ServerType"]);
set_ini_value("Database", "DBHost",$_POST["ServerHost"]);
set_ini_value("Database", "DBName",$_POST["ServerDB"]);
set_ini_value("Database", "DBUser",$_POST["ServerUser"]);
set_ini_value("Database", "DBUserPassword",$_POST["ServerPass"]);
set_ini_value("Database","TablePrefix",$_POST["TablePrefix"]);
save_values();
$ini_vars = parse_ini_file($ini_file,TRUE);
foreach($ini_vars as $secname => $section)
{
foreach($section as $key => $value)
{
$key = "g_".str_replace("-", "", $key);
global $$key;
$$key = $value;
}
}
unset($ado);
$ado = inst_GetADODBConnection();
if($ado->ErrorNo()!=0)
{
$db_error = "Connection Error: (".$ado->ErrorNo().") ".$ado->ErrorMsg();
$state = "dbinfo";
}
else
{
if(TableExists($ado,"ConfigurationAdmin,Category,Permissions"))
{
$state="dbinfo";
$db_error = "An In-Portal Database already exists at this location";
}
else
$state = "license";
}
}
if($state=="dbinfo")
{
if ($install_type == '') {
$install_type = 1;
}
$include_file = "install/dbinfo.php";
}
if ($state == "download_license") {
$ValidLicense = FALSE;
if ($_POST['login'] != '' && $_POST['password'] != '') {
// Here we determine weather login is ok & check available licenses
$rfile = @fopen(GET_LICENSE_URL."?login=".md5($_POST['login'])."&password=".md5($_POST['password'])."&domain=".$_SERVER['SERVER_NAME'], "r");
if (!$rfile) {
$get_license_error = "Unable to connect to the Intechnic server! Please try again later!";
$state = "get_license";
$include_file = "install/get_license.php";
}
else {
$rcontents = '';
while (!feof($rfile)) {
$line = fgets($rfile, 10000);
$rcontents .= $line;
}
@fclose($rfile);
if (substr($rcontents, 0, 5) == 'Error') {
$get_license_error = substr($rcontents, 6);
$state = "get_license";
$include_file = "install/get_license.php";
}
else {
if (substr($rcontents, 0, 3) == "SEL") {
$state = "download_license";
$license_select = substr($rcontents, 4);
$include_file = "install/download_license.php";
}
else {
// Here we get one license
$data = base64_decode(str_replace("In-Portal License File - do not edit!\n", "", $rcontents));
inst_ParseLicense($data);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
if($ValidLicense)
{
set_ini_value("Intechnic","License",base64_encode($data));
save_values();
$state="domain_select";
$got_license = 1;
}
else {
$license_error="Invalid License File";
}
if(!$ValidLicense)
{
$state="license";
}
}
}
}
}
else if ($_POST['licenses'] == '') {
$state = "get_license";
$get_license_error = "Username and / or password not specified!!!";
$include_file = "install/get_license.php";
}
else {
// Here we download license
$rfile = @fopen(GET_LICENSE_URL."?license_id=".md5($_POST['licenses'])."&dlog=".md5($_POST['dlog'])."&dpass=".md5($_POST['dpass'])."&domain=".$_POST['domain'], "r");
if (!$rfile) {
$get_license_error = "Unable to connect to the Intechnic server! Please try again later!";
$state = "get_license";
$include_file = "install/get_license.php";
}
else {
$rcontents = '';
while (!feof($rfile)) {
$line = fgets($rfile, 10000);
$rcontents .= $line;
}
@fclose($rfile);
if (substr($rcontents, 0, 5) == 'Error') {
$download_license_error = substr($rcontents, 6);
$state = "download_license";
$include_file = "install/download_license.php";
}
else {
$data = base64_decode(str_replace("In-Portal License File - do not edit!\n", "", $rcontents));
inst_ParseLicense($data);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
if($ValidLicense)
{
set_ini_value("Intechnic","License",base64_encode($data));
save_values();
$state="domain_select";
}
else {
$license_error="Invalid License File";
}
if(!$ValidLicense)
{
$state="license";
}
}
}
}
}
if($state=="license_process")
{
$ValidLicense = FALSE;
switch($_POST["lic_opt"])
{
case 1: /* download from intechnic */
$include_file = "install/get_license.php";
$state = "get_license";
//if(!$ValidLicense)
//{
// $state="license";
//}
break;
case 2: /* upload file */
$file = $_FILES["licfile"];
if(is_array($file))
{
move_uploaded_file($file["tmp_name"],$pathtoroot."themes/tmp.lic");
$fp = @fopen($pathtoroot."themes/tmp.lic","rb");
if($fp)
{
$lic = fread($fp,filesize($pathtoroot."themes/tmp.lic"));
fclose($fp);
}
$data = inst_LoadLicense(FALSE,$pathtoroot."themes/tmp.lic");
@unlink($pathtoroot."themes/tmp.lic");
inst_ParseLicense($data);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
if($ValidLicense)
{
set_ini_value("Intechnic","License",base64_encode($data));
save_values();
$state="domain_select";
}
else
$license_error="Invalid License File";
}
if(!$ValidLicense)
{
$state="license";
}
break;
case 3: /* existing */
if(strlen($g_License))
{
$lic = base64_decode($g_License);
inst_ParseLicense($lic);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
if($ValidLicense)
{
$state="domain_select";
}
else
{
$state="license";
$license_error="Invalid or corrupt license detected";
}
}
else
{
$state="license";
$license_error="Missing License File";
}
if(!$ValidLicense)
{
$state="license";
}
break;
case 4:
$state="domain_select";
break;
}
if($ValidLicense)
$state="domain_select";
}
if($state=="license")
{
$include_file = "install/sel_license.php";
}
if($state=="reinstall")
{
$ado = inst_GetADODBConnection();
$show_upgrade = false;
$sql = "SELECT Name FROM ".$g_TablePrefix."Modules";
$rs = $ado->Execute($sql);
$modules = '';
while ($rs && !$rs->EOF) {
$modules .= strtolower($rs->fields['Name']).',';
$rs->MoveNext();
}
$mod_arr = explode(",", substr($modules, 0, strlen($modules) - 1));
foreach($mod_arr as $p)
{
if ($p == 'in-portal') {
$p = '';
}
$dir_name = $pathtoroot.$p."/admin/install/upgrades/";
$dir = @dir($dir_name);
//echo "<pre>"; print_r($dir); echo "</pre>";
while ($file = $dir->read()) {
if ($file != "." && $file != ".." && !is_dir($dir_name.$file))
{
$file = str_replace("inportal_upgrade_v", "", $file);
$file = str_replace(".sql", "", $file);
if ($file != '') {
if ($p == '') {
$p = 'in-portal';
}
$sql = "SELECT Version FROM ".$g_TablePrefix."Modules WHERE Name = '".$p."'";
$rs = $ado->Execute($sql);
if (str_replace(".", "", $rs->fields['Version']) < str_replace(".", "", $file)) {
$show_upgrade = true;
}
}
}
}
}
if ($install_type == '') {
$install_type = 2;
}
$include_file = "install/reinstall.php";
}
if($state=="login")
{
$lic = base64_decode($g_License);
if(strlen($lic))
{
inst_ParseLicense($lic);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
}
if(!$ValidLicense)
{
$state="license";
}
else
if($i_User == $_POST["UserName"] || $i_Pswd == $_POST["UserPass"])
{
$state = "domain_select";
}
else
{
$state="getuser";
$login_error = "Invalid User Name or Password. If you don't know your username or password, contact Intechnic Support";
}
//die();
}
if($state=="getuser")
{
$include_file = "install/login.php";
}
if($state=="set_domain")
{
if(!is_array($i_Keys))
{
$lic = base64_decode($g_License);
if(strlen($lic))
{
inst_ParseLicense($lic);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
}
}
if($_POST["domain"]==1)
{
$domain = $_SERVER['HTTP_HOST'];
set_ini_value("Intechnic","Domain",$domain);
save_values();
$state="runsql";
}
else
{
$domain = str_replace(" ", "", $_POST["other"]);
if ($domain != '') {
set_ini_value("Intechnic","Domain",$domain);
save_values();
$state="runsql";
}
else {
$DomainError = 'Please enter valid domain!';
$state = "domain_select";
}
}
}
if($state=="domain_select")
{
if(!is_array($i_Keys))
{
$lic = base64_decode($g_License);
if(strlen($lic))
{
inst_ParseLicense($lic);
$ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0));
}
}
$include_file = "install/domain.php";
}
if($state=="runsql")
{
$ado = inst_GetADODBConnection();
$installed = TableExists($ado,"ConfigurationAdmin,Category,Permissions");
if(!$installed)
{
// create tables
$filename = $pathtoroot.$admin."/install/inportal_schema.sql";
RunSchemaFile($ado,$filename);
// insert default info
$filename = $pathtoroot.$admin."/install/inportal_data.sql";
RunSQLFile($ado,$filename);
$sql = "SELECT Version FROM ".$g_TablePrefix."Modules WHERE Name = 'In-Portal'";
$rs = $ado->Execute($sql);
set_ini_value("Module Versions", "In-Portal", $rs->fields['Version']);
save_values();
require_once $pathtoroot.'kernel/include/tag-class.php';
if( !is_object($objTagList) ) $objTagList = new clsTagList();
// install kernel specific tags
$objTagList->DeleteTags(); // delete all existing tags in db
// create 3 predifined tags (because there no functions with such names
$t = new clsTagFunction();
$t->Set("name","include");
$t->Set("description","insert template output into the current template");
$t->Create();
$t->AddAttribute("_template","tpl","Template to insert","",TRUE);
$t->AddAttribute("_supresserror","bool","Supress missing template errors","",FALSE);
$t->AddAttribute("_dataexists","bool","Only include template output if content exists (content is defined by the tags in the template)","",FALSE);
$t->AddAttribute("_nodatatemplate","tpl","Template to include if the nodataexists condition is true","",FALSE);
unset($t);
$t = new clsTagFunction();
$t->Set("name","perm_include");
$t->Set("description","insert template output into the current template if permissions are set");
$t->Create();
$t->AddAttribute("_template","tpl","Template to insert","",TRUE);
$t->AddAttribute("_noaccess","tpl","Template to insert if access is denied","",FALSE);
$t->AddAttribute("_permission","","Comma-separated list of permissions, any of which will grant access","",FALSE);
$t->AddAttribute("_module","","Used in place of the _permission attribute, this attribute verifies the module listed is enabled","",FALSE);
$t->AddAttribute("_system","bool","Must be set to true if any permissions in _permission list is a system permission","",FALSE);
$t->AddAttribute("_supresserror","bool","Supress missing template errors","",FALSE);
$t->AddAttribute("_dataexists","bool","Only include template output if content exists (content is defined by the tags in the template)","",FALSE);
$t->AddAttribute("_nodatatemplate","tpl","Template to include if the nodataexists condition is true","",FALSE);
unset($t);
$t = new clsTagFunction();
$t->Set("name","mod_include");
$t->Set("description","insert templates from all enabled modules. No error occurs if the template does not exist.");
$t->Create();
$t->AddAttribute("_template","tpl","Template to insert. This template path should be relative to the module template root directory","",TRUE);
$t->AddAttribute("_modules","","Comma-separated list of modules. Defaults to all enabled modules if not set","",FALSE);
$t->AddAttribute("_supresserror","bool","Supress missing template errors","",FALSE);
$t->AddAttribute("_dataexists","bool","Only include template output if content exists (content is defined by the tags in the template)","",FALSE);
$t->AddAttribute("_nodatatemplate","tpl","Template to include if the nodataexists condition is true","",FALSE);
$objTagList->ParseFile($pathtoroot.'kernel/parser.php'); // insert module tags
if( is_array($ItemTagFiles) )
foreach($ItemTagFiles as $file)
$objTagList->ParseItemFile($pathtoroot.$file);
$state="RootPass";
}
else {
$include_file = "install/install_finish.php";
$state="finish";
}
}
if ($state == "finish") {
$include_file = "install/install_finish.php";
}
if($state=="RootSetPass")
{
$pass = $_POST["RootPass"];
if(strlen($pass)<4)
{
$PassError = "Root Password must be at least 4 characters";
$state = "RootPass";
}
else if ($pass != $_POST["RootPassConfirm"]) {
$PassError = "Passwords does not match";
$state = "RootPass";
}
else
{
$pass = md5($pass);
$sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '$pass' WHERE VariableName='RootPass' OR VariableName='RootPassVerify'";
$ado = inst_GetADODBConnection();
$ado->Execute($sql);
$state="modselect";
}
}
if($state=="RootPass")
{
$include_file = "install/rootpass.php";
}
if($state=="lang_install_init")
{
include_once($pathtoroot."kernel/include/xml.php");
$ado = inst_GetADODBConnection();
if (TableExists($ado, "Language,Phrase")) {
$MaxInserts = 200;
$PhraseTable = GetTablePrefix()."ImportPhrases";
$EventTable = GetTablePrefix()."ImportEvents";
$sql = "CREATE TABLE $PhraseTable SELECT Phrase,Translation,PhraseType,LanguageId FROM ".GetTablePrefix()."Phrase WHERE PhraseId=-1";
$ado->Execute($sql);
$sql = "CREATE TABLE $EventTable SELECT Template,MessageType,EventId,LanguageId FROM ".GetTablePrefix()."EmailMessage WHERE EmailMessageId=-1";
$ado->Execute($sql);
$sql = "SELECT EventId,Event,Type FROM ".GetTablePrefix()."Events";
$rs = $ado->Execute($sql);
$Events = array();
while($rs && !$rs->EOF)
{
$Events[$rs->fields["Event"]."_".$rs->fields["Type"]] = $rs->fields["EventId"];
$rs->MoveNext();
}
if(count($_POST["lang"])>0)
{
$Langs = $_POST["lang"];
for($x=0;$x<count($Langs);$x++)
{
$lang = $Langs[$x];
$p = $pathtoroot.$admin."/install/langpacks/".$lang;
/* parse xml file */
$fp = fopen($p,"r");
$xml = fread($fp,filesize($p));
fclose($fp);
unset($objInXML);
$objInXML = new xml_doc($xml);
$objInXML->parse();
$objInXML->getTag(0,$name,$attribs,$contents,$tags);
if(is_array($tags))
{
foreach($tags as $t)
{
$LangRoot =& $objInXML->getTagByID($t);
$PackName = $LangRoot->attributes["PACKNAME"];
$l = $objLanguages->GetItemByField("PackName",$PackName);
if(is_object($l))
{
$LangId = $l->Get("LanguageId");
}
else
{
$l = new clsLanguage();
$l->Set("Enabled",1);
$l->Create();
$NewLang = TRUE;
$LangId = $l->Get("LanguageId");
}
foreach($LangRoot->children as $tag)
{
switch($tag->name)
{
case "PHRASES":
foreach($tag->children as $PhraseTag)
{
$Phrase = $PhraseTag->attributes["LABEL"];
$Translation = base64_decode($PhraseTag->contents);
$PhraseType = $PhraseTag->attributes["TYPE"];
$psql = "INSERT INTO $PhraseTable (Phrase,Translation,PhraseType,LanguageId) VALUES ('$Phrase','$Translation',$PhraseType,$LangId)";
$ado->Execute($psql);
//echo "$psql <br>\n";
}
break;
case "DATEFORMAT":
$DateFormat = $tag->contents;
break;
case "TIMEFORMAT":
$TimeFormat = $tag->contents;
break;
case "DECIMAL":
$Decimal = $tag->contents;
break;
case "THOUSANDS":
$Thousands = $tag->contents;
break;
case "EVENTS":
foreach($tag->children as $EventTag)
{
$event = $EventTag->attributes["EVENT"];
$MsgType = strtolower($EventTag->attributes["MESSAGETYPE"]);
$template = base64_decode($EventTag->contents);
$Type = $EventTag->attributes["TYPE"];
$EventId = $Events[$event."_".$Type];
$esql = "INSERT INTO $EventTable (Template,MessageType,EventId,LanguageId) VALUES ('$template','$MsgType',$EventId,$LangId)";
$ado->Execute($esql);
//echo htmlentities($esql)."<br>\n";
}
break;
}
if($NewLang)
{
$l->Set("PackName",$PackName);
$l->Set("LocalName",$PackName);
$l->Set("DateFormat",$DateFormat);
$l->Set("TimeFormat",$TimeFormat);
$l->Set("DecimalPoint",$Decimal);
$l->Set("ThousandSep",$Thousands);
$l->Update();
}
}
}
}
}
$state="lang_install";
}
else {
$state="lang_select";
}
}
else {
$general_error = 'Database error! No language tables found!';
}
}
if($state=="lang_install")
{
/* do pack install */
$Offset = (int)$_GET["Offset"];
$Status = (int)$_GET["Status"];
$PhraseTable = GetTablePrefix()."ImportPhrases";
$EventTable = GetTablePrefix()."ImportEvents";
if($Status==0)
{
$Total = TableCount($PhraseTable,"",0);
}
else
{
$Total = TableCount($EventTable,"",0);
}
if($Status==0)
{
$Offset = $objLanguages->ReadImportTable($PhraseTable, 1,"0,1,2",TRUE,200,$Offset);
if($Offset>=$Total)
{
$Offset=0;
$Status=1;
}
if ($_POST['next_step']) {
$next_step = $_POST['next_step'];
}
else if ($_GET['next_step']) {
$next_step = $_GET['next_step'];
}
$NextUrl = $_SERVER['PHP_SELF']."?Offset=$Offset&Status=$Status&state=lang_install&next_step=$next_step&install_type=$install_type";
$include_file = "install/lang_run.php";
}
else
{
if(!is_object($objMessageList))
$objMessageList = new clsEmailMessageList();
$Offset = $objMessageList->ReadImportTable($EventTable,TRUE,100,$Offset);
if($Offset>$Total)
{
if ($_POST['next_step']) {
$next_step = $_POST['next_step'];
}
else if ($_GET['next_step']) {
$next_step = $_GET['next_step'];
}
$NextUrl = $_SERVER['PHP_SELF']."?Offset=$Offset&Status=$Status&State=lang_install&next_step=$next_step&install_type=$install_type";
$include_file = "install/lang_run.php";
}
else
$state="lang_default";
}
}
if($state=="lang_default_set")
{
// phpinfo(INFO_VARIABLES);
$ado = inst_GetADODBConnection();
$PhraseTable = GetTablePrefix()."ImportPhrases";
$EventTable = GetTablePrefix()."ImportEvents";
$ado->Execute("DROP TABLE $PhraseTable");
$ado->Execute("DROP TABLE $EventTable");
$Id = $_POST["lang"];
$objLanguages->SetPrimary($Id);
$state="postconfig_1";
}
if($state=="lang_default")
{
$Packs = Array();
$objLanguages->Clear();
$objLanguages->LoadAllLanguages();
foreach($objLanguages->Items as $l)
{
$Packs[$l->Get("LanguageId")] = $l->Get("PackName");
}
$include_file = "install/lang_default.php";
}
if($state=="modinstall")
{
$doms = $_POST["domain"];
if(is_array($doms))
{
$ado = inst_GetADODBConnection();
require_once $pathtoroot.'kernel/include/tag-class.php';
if( !is_object($objTagList) ) $objTagList = new clsTagList();
foreach($doms as $p)
{
$filename = $pathtoroot.$p."/admin/install.php";
if(file_exists($filename))
{
include($filename);
}
}
}
$sql = "SELECT Name FROM ".GetTablePrefix()."Modules";
$rs = $ado->Execute($sql);
while($rs && !$rs->EOF)
{
$p = $rs->fields['Name'];
$mod_name = strtolower($p);
if ($mod_name == 'in-portal') {
$mod_name = '';
}
$dir_name = $pathtoroot.$mod_name."/admin/install/upgrades/";
$dir = @dir($dir_name);
$new_version = '';
$tmp1 = 0;
$tmp2 = 0;
while ($file = $dir->read()) {
if ($file != "." && $file != ".." && !is_dir($dir_name.$file))
{
$file = str_replace("inportal_upgrade_v", "", $file);
$file = str_replace(".sql", "", $file);
if ($file != '') {
$tmp1 = str_replace(".", "", $file);
if ($tmp1 > $tmp2) {
$new_version = $file;
}
}
}
$tmp2 = $tmp1;
}
$version_nrs = explode(".", $new_version);
for ($i = 0; $i < $version_nrs[0] + 1; $i++) {
for ($j = 0; $j < $version_nrs[1] + 1; $j++) {
for ($k = 0; $k < $version_nrs[2] + 1; $k++) {
$try_version = "$i.$j.$k";
$filename = $pathtoroot.$mod_name."/admin/install/upgrades/inportal_upgrade_v$try_version.sql";
if(file_exists($filename))
{
RunSQLFile($ado, $filename);
set_ini_value("Module Versions", $p, $try_version);
save_values();
}
}
}
}
$rs->MoveNext();
}
$state="lang_select";
}
if($state=="lang_select")
{
$Packs = GetLanguageList();
$include_file = "install/lang_select.php";
}
if($state=="modselect")
{
/* /admin/install.php */
$UrlLen = (strlen($admin) + 12)*-1;
$pathguess =substr($_SERVER["SCRIPT_NAME"],0,$UrlLen);
$sitepath = $pathguess;
$esc_path = str_replace("\\","/",$pathtoroot);
$esc_path = str_replace("/","\\",$esc_path);
//set_ini_value("Site","DomainName",$_SERVER["SERVER_NAME"]);
//$g_DomainName= $_SERVER["SERVER_NAME"];
save_values();
$ado = inst_GetADODBConnection();
if(substr($sitepath,0,1)!="/")
$sitepath="/".$sitepath;
if(substr($sitepath,-1)!="/")
$sitepath .= "/";
$sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '$sitepath' WHERE VariableName='Site_Path'";
$ado->Execute($sql);
$sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '$g_Domain' WHERE VariableName='Server_Name'";
$ado->Execute($sql);
$Modules = inst_GetModuleList();
$include_file = "install/modselect.php";
}
if(substr($state,0,10)=="postconfig")
{
$p = explode("_",$state);
$step = $p[1];
if ($_POST['Site_Path'] != '') {
//echo "ok<br>";
$rfile = @fopen(GET_LICENSE_URL."?url=".base64_encode($_SERVER['SERVER_NAME'].$_POST['Site_Path'])."&domain=".md5($_SERVER['SERVER_NAME']), "r");
if (!$rfile) {
$get_license_error = "Unable to connect to the Intechnic server! Please try again later!";
$state = "postconfig_1";
$include_file = "install/postconfig.php";
}
else {
$rcontents = '';
while (!feof($rfile)) {
$line = fgets($rfile, 10000);
$rcontents .= $line;
}
@fclose($rfile);
}
}
if(strlen($_POST["oldstate"])>0)
{
$s = explode("_",$_POST["oldstate"]);
$oldstep = $s[1];
if($oldstep<count($configs))
{
$section = $configs[$oldstep];
$module = $mods[$oldstep];
$title = $titles[$oldstep];
$objAdmin = new clsConfigAdmin($module,$section,TRUE);
$objAdmin->SaveItems($_POST,TRUE);
}
}
$section = $configs[$step];
$module = $mods[$step];
$title = $titles[$step];
$step++;
if($step <= count($configs)+1)
{
$include_file = "install/postconfig.php";
}
else
$state = "theme_sel";
}
if($state=="theme_sel")
{
$objThemes->CreateMissingThemes();
$include_file = "install/theme_select.php";
}
if($state=="theme_set")
{
## get & define Non-Blocking & Blocking versions ##
$blocking_sockets = minimum_php_version("4.3.0")? 0 : 1;
$ado = inst_GetADODBConnection();
$sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '$blocking_sockets' WHERE VariableName='SocketBlockingMode'";
$ado->Execute($sql);
## get & define Non-Blocking & Blocking versions ##
$theme_id = $_POST["theme"];
$pathchar="/";
//$objThemes->SetPrimaryTheme($theme_id);
$t = $objThemes->GetItem($theme_id);
$t->Set("Enabled",1);
$t->Set("PrimaryTheme",1);
$t->Update();
$t->VerifyTemplates();
$include_file = "install/install_finish.php";
$state="finish";
}
if ($state == "adm_login") {
echo "<script>window.location='index.php';</script>";
}
switch($state)
{
case "modselect":
$title = "Select Modules";
$help = "<p>Select the In-Portal modules you wish to install. The modules listed to the right ";
$help .="are all modules included in this installation that are licensed to run on this server. </p>";
break;
case "reinstall":
$title = "Installation Maintenance";
$help = "<p>A Configuration file has been detected on your system and it appears In-Portal is correctly installed. ";
$help .="In order to work with the maintenance functions provided to the left you must provide the Intechnic ";
$help .="Username and Password you used when obtaining the license file residing on the server, or your admin Root password. ";
$help .=" <i>(Use Username 'root' if using your root password)</i></p>";
$help .= "<p>To removing your existing database and start with a fresh installation, select the first option ";
$help .= "provided. Note that this operation cannot be undone and no backups are made! Use at your own risk.</p>";
$help .="<p>If you wish to scrap your current installation and install to a new location, choose the second option. ";
$help .="If this option is selected you will be prompted for new database configuration information.</p>";
$help .="<p>The <i>Update License Information</i> option is used to update your In-Portal license data. Select this option if you have ";
$help .="modified your licensing status with Intechnic, or you have received new license data via email</p>";
break;
case "RootPass":
$title = "Set Admin Root Password";
$help = "<p>The Root Password is initially required to access the admin sections of In-Portal. ";
$help .="The root user cannot be used to access the front-end of the system, so it is recommended that you ";
$help .="create additional users with admin privlidges.</p>";
break;
case "finish":
$title = "Thank You!";
$help ="<P>Thanks for using In-Portal! Be sure to visit <A TARGET=\"_new\" HREF=\"http://www.in-portal.net\">www.in-portal.net</A> ";
$help.=" for the latest news, module releases and support. </p>";
break;
case "license":
$title = "License Configuration";
$help ="<p>A License is required to run In-Portal on a server connected to the Internet. You ";
$help.="can run In-Portal on localhost, non-routable IP addresses, or other computers on your LAN. ";
$help.="If Intechnic has provided you with a license file, upload it here. Otherwise select the first ";
$help.="option to allow Install to download your license for you.</p>";
$help.="<p>If a valid license has been detected on your server, you can choose the <i>Use Existing License</i> ";
$help.="and continue the installation process</p>";
break;
case "domain_select":
$title="Select Licensed Domain";
$help ="<p>Select the domain you wish to configure In-Portal for. The <i>Other</i> option ";
$help.=" can be used to configure In-Portal for use on a local domain.</p>";
$help.="<p>For local domains, enter the hostname or LAN IP Address of the machine running In-Portal.</p>";
break;
case "db_reconfig":
case "dbinfo":
$title="Database Configuration";
$help = "<p>In-Portal needs to connect to your Database Server. Please provide the database server type*, ";
$help .="host name (<i>normally \"localhost\"</i>), Database user name, and database Password. ";
$help .="These fields are required to connect to the database.</p><p>If you would like In-Portal ";
$help .="to use a table prefix, enter it in the field provided. This prefix can be any ";
$help .=" text which can be used in the names of tables on your system. The characters entered in this field ";
$help .=" are placed <i>before</i> the names of the tables used by In-Portal. For example, if you enter \"inp_\"";
$help .=" into the prefix field, the table named Category will be named inp_Category.</p>";
break;
case "lang_select":
$title="Language Pack Installation";
$help = "<p>Select the language packs you wish to install. Each language pack contains all the phrases ";
$help .="used by the In-Portal administration and the default template set. Note that at least one ";
$help .="pack <b>must</b> be installed.</p>";
break;
case "lang_default":
$title="Select Default Language";
$help = "<p>Select which language should be considered the \"default\" language. This is the language ";
$help .="used by In-Portal when a language has not been selected by the user. This selection is applicable ";
$help .="to both the administration and front-end.</p>";
break;
case "lang_install":
$title="Installing Language Packs";
$help = "<p>The language packs you have selected are being installed. You may install more languages at a ";
$help.="later time from the Regional admin section.</p>";
break;
case "postconfig_1":
$help = "<P>These options define the general operation of In-Portal. Items listed here are ";
$help .="required for In-Portal's operation.</p><p>When you have finished, click <i>save</i> to continue.</p>";
break;
case "postconfig_2":
$help = "<P>User Management configuration options determine how In-Portal manages your user base.</p>";
$help .="<p>The groups listed to the right are pre-defined by the installation process and may be changed ";
$help .="through the Groups section of admin.</p>";
break;
case "postconfig_3":
$help = "<P>The options listed here are used to control the category list display functions of In-Portal. </p>";
break;
case "theme_sel":
$title="Select Default Theme";
$help = "<P>This theme will be used whenever a front-end session is started. ";
$help .="If you intend to upload a new theme and use that as default, you can do so through the ";
$help .="admin at a later date. A default theme is required for session management.</p>";
break;
case "get_license":
$title="Download License from Intechnic";
$help ="<p>A License is required to run In-Portal on a server connected to the Internet. You ";
$help.="can run In-Portal on localhost, non-routable IP addresses, or other computers on your LAN.</p>";
$help.="<p>Here as you have selected download license from Intechnic you have to input your username and ";
$help.="password of your In-Business account in order to download all your available licenses.</p>";
break;
case "download_license":
$title="Download License from Intechnic";
$help ="<p>A License is required to run In-Portal on a server connected to the Internet. You ";
$help.="can run In-Portal on localhost, non-routable IP addresses, or other computers on your LAN.</p>";
$help.="<p>Please choose the license from the drop down for this site! </p> ";
break;
case "restore_select":
$title="Select Restore File";
$help = "<P>Select the restore file to use to reinstall In-Portal. If your backups are not performed ";
$help .= "in the default location, you can enter the location of the backup directory and click the ";
$help .="<i>Update</i> button.</p>";
case "restore_run":
$title= "Restore in Progress";
$help = "<P>Restoration of your system is in progress. When the restore has completed, the installation ";
$help .="will continue as normal. Hitting the <i>Cancel</i> button will restart the entire installation process. ";
break;
case "warning":
$title = "Restore in Progress";
$help = "<p>Please approve that you understand that you are restoring your In-Portal data base from other version of In-Portal.</p>";
break;
case "update":
$title = "Update In-Portal";
$help = "<p>Select modules from the list, you need to update to the last downloaded version of In-Portal</p>";
break;
}
if ($_POST['next_step']) {
$tmp_step = $_POST['next_step'];
}
else if ($_GET['next_step']) {
$tmp_step = $_GET['next_step'];
}
if (!$tmp_step) {
$tmp_step = 1;
}
if ($got_license == 1) {
$tmp_step++;
}
$next_step = $tmp_step + 1;
if ($general_error != '') {
$state = '';
$title = '';
$help = '';
$general_error = $general_error.'<br /><br />Installation cannot continue!';
}
if ($include_file == '' && $general_error == '' && $state == '') {
$state = '';
$title = '';
$help = '';
$filename = $pathtoroot.$admin."/install/inportal_remove.sql";
RunSQLFile($ado,$filename);
$general_error = 'Unexpected installation error! <br /><br />Installation has been stopped!';
}
if ($restore_error != '') {
$next_step = 3;
$tmp_step = 2;
}
if ($PassError != '') {
$tmp_step = 4;
$next_step = 5;
}
if ($DomainError != '') {
$tmp_step--;
$next_step = $tmp_step + 1;
}
if ($db_error != '') {
$tmp_step--;
$next_step = $tmp_step + 1;
}
if ($state == "warning") {
$tmp_step--;
$next_step = $tmp_step + 1;
}
?>
<tr height="100%">
<td valign="top">
<table cellpadding=10 cellspacing=0 border=0 width="100%" height="100%">
<tr valign="top">
<td style="width: 200px; background: #009ff0 url(images/bg_install_menu.gif) no-repeat bottom right; border-right: 1px solid #000">
<img src="images/spacer.gif" width="180" height="1" border="0" alt=""><br>
<span class="admintitle-white">Installation</span>
<!--<ol class="install">
<li class="current">Licence Verification
<li>Configuration
<li>File Permissions
<li>Security
<li>Integrity Check
</ol>
</td>-->
<?php if ($general_error == '') { ?>
<?php if ($install_type == 1) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1) { ?>class="current"<?php } ?>>Database Configuration
<li <?php if ($tmp_step == 2 || $_POST['lic_opt'] == 1) { ?>class="current"<?php } ?>>Select License
<li <?php if ($tmp_step == 3 && $_POST['lic_opt'] != 1) { ?>class="current"<?php } ?>>Select Domain
<li <?php if ($tmp_step == 4 ) { ?>class="current"<?php } ?>>Set Root Password
<li <?php if ($tmp_step == 5) { ?>class="current"<?php } ?>>Select Modules to Install
<li <?php if ($tmp_step == 6) { ?>class="current"<?php } ?>>Install Language Packs
<li <?php if ($tmp_step == 7) { ?>class="current"<?php } ?>>Post-Install Configuration
<li <?php if ($tmp_step == 8) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } else if ($install_type == 2) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1 || $login_error != '' || $inst_error != '') { ?>class="current"<?php } ?>>License Verification
<!--<li <?php if (($tmp_step == 2 && $login_error == '' && $inst_error == '') || $_POST['lic_opt'] == 1) { ?>class="current"<?php } ?>>Select License
<li <?php if ($tmp_step == 3 && $_POST['lic_opt'] != 1) { ?>class="current"<?php } ?>>Select Domain
<li <?php if ($tmp_step == 4) { ?>class="current"<?php } ?>>Set Root Password
<li <?php if ($tmp_step == 5) { ?>class="current"<?php } ?>>Select Modules to Install
<li <?php if ($tmp_step == 6) { ?>class="current"<?php } ?>>Install Language Packs
<li <?php if ($tmp_step == 7) { ?>class="current"<?php } ?>>Post-Install Configuration
<li <?php if ($tmp_step == 8) { ?>class="current"<?php } ?>>Finish-->
</ol>
<?php } else if ($install_type == 3) { ?>
<ol class="install">
<li>License Verification
<li <?php if ($tmp_step == 2) { ?>class="current"<?php } ?>>Database Configuration
<li <?php if ($tmp_step == 3 || $_POST['lic_opt'] == 1) { ?>class="current"<?php } ?>>Select License
<li <?php if ($tmp_step == 4 && $_POST['lic_opt'] != 1) { ?>class="current"<?php } ?>>Select Domain
<li <?php if ($tmp_step == 5) { ?>class="current"<?php } ?>>Set Root Password
<li <?php if ($tmp_step == 6) { ?>class="current"<?php } ?>>Select Modules to Install
<li <?php if ($tmp_step == 7) { ?>class="current"<?php } ?>>Install Language Packs
<li <?php if ($tmp_step == 8) { ?>class="current"<?php } ?>>Post-Install Configuration
<li <?php if ($tmp_step == 9) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } else if ($install_type == 4) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1 || $login_error != '' || $inst_error != '') { ?>class="current"<?php } ?>>License Verification
<li <?php if (($tmp_step == 2 && $login_error == '' && $inst_error == '') || $_POST['lic_opt'] == 1) { ?>class="current"<?php } ?>>Select License
<li <?php if ($tmp_step == 3 && $_POST['lic_opt'] != 1) { ?>class="current"<?php } ?>>Select Domain
<li <?php if ($tmp_step == 4) { ?>class="current"<?php } ?>>Set Root Password
<li <?php if ($tmp_step == 5) { ?>class="current"<?php } ?>>Select Modules to Install
<li <?php if ($tmp_step == 6) { ?>class="current"<?php } ?>>Install Language Packs
<li <?php if ($tmp_step == 7) { ?>class="current"<?php } ?>>Post-Install Configuration
<li <?php if ($tmp_step == 8) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } else if ($install_type == 5) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1 || $login_error != '' || $inst_error != '') { ?>class="current"<?php } ?>>License Verification
<li <?php if (($tmp_step == 2 && $login_error == '' && $inst_error == '') || $_POST['lic_opt'] == 1) { ?>class="current"<?php } ?>>Select License
<li <?php if ($tmp_step == 3 && $_POST['lic_opt'] != 1) { ?>class="current"<?php } ?>>Select Domain
<li <?php if ($tmp_step == 4) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } else if ($install_type == 6) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1 || $login_error != '' || $inst_error != '') { ?>class="current"<?php } ?>>License Verification
<li <?php if (($tmp_step == 2 && $login_error == '' && $inst_error == '') || $_GET['show_prev'] == 1 || $_POST['backupdir']) { ?>class="current"<?php } ?>>Select Backup File
<li <?php if ($tmp_step == 3 && $_POST['lic_opt'] != 1 && $_GET['show_prev'] != 1 && !$_POST['backupdir']) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } else if ($install_type == 7) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1 || $login_error != '' || $inst_error != '') { ?>class="current"<?php } ?>>License Verification
<li <?php if ($tmp_step == 2 && $login_error == '' && $inst_error == '') { ?>class="current"<?php } ?>>Database Configuration
<li <?php if ($tmp_step == 3) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } else if ($install_type == 8) { ?>
<ol class="install">
<li <?php if ($tmp_step == 1 || $login_error != '' || $inst_error != '') { ?>class="current"<?php } ?>>License Verification
<li <?php if ($tmp_step == 2 && $login_error == '' && $inst_error == '') { ?>class="current"<?php } ?>>Select Modules to Upgrade
<li <?php if ($tmp_step == 3) { ?>class="current"<?php } ?>>Finish
</ol>
<?php } ?>
<?php include($include_file); ?>
<?php } else { ?>
<?php include("install/general_error.php"); ?>
<?php } ?>
<td width="40%" style="border-left: 1px solid #000; background: #f0f0f0">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td class="subsectiontitle" style="border-bottom: 1px solid #000000; background-color:#999"><?php echo $title;?></td>
</tr>
<tr>
<td class="text"><?php echo $help;?></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td id="footer">
Powered by In-portal &copy; 1997-2004, Intechnic Corporation. All rights reserved.
<br><img src="images/spacer.gif" width="1" height="10" alt="">
</td>
</tr>
</table>
</form>
</body>
</html>
\ No newline at end of file
Property changes on: trunk/admin/install.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5
\ No newline at end of property
+1.6
\ No newline at end of property
Index: trunk/admin/install/install_lib.php
===================================================================
--- trunk/admin/install/install_lib.php (revision 40)
+++ trunk/admin/install/install_lib.php (revision 41)
@@ -1,491 +1,504 @@
<?php
function minimum_php_version( $vercheck )
{
$minver = explode(".", $vercheck);
$curver = explode(".", phpversion());
if (($curver[0] < $minver[0])
|| (($curver[0] == $minver[0])
&& ($curver[1] < $minver[1]))
|| (($curver[0] == $minver[0]) && ($curver[1] == $minver[1])
&& ($curver[2][0] < $minver[2][0])))
return false;
else
return true;
}
function TableExists($ado, $tables)
{
global $g_TablePrefix;
$t = explode(",",$tables);
$i = $ado->MetaTables();
for($x=0;$x<count($i);$x++)
$i[$x] = strtolower($i[$x]);
$AllFound = TRUE;
for($tIndex=0;$tIndex<count($t);$tIndex++)
{
$table = $g_TablePrefix.$t[$tIndex];
$table = strtolower($table);
if(!in_array($table,$i))
{
$AllFound = FALSE;
}
}
return $AllFound;
}
function set_ini_value($section, $key, $newvalue)
{
global $ini_vars;
$ini_vars[$section][$key] = $newvalue;
}
function save_values()
{
// Should write something to somwere, but it doesn't :(
global $ini_file,$ini_vars;
//if( file_exists($ini_file) )
//{
$fp = fopen($ini_file, "w");
foreach($ini_vars as $secname => $section)
{
fwrite($fp,"[".$secname."]\n");
foreach($section as $key => $value) fwrite($fp,"$key = \"$value\"\n");
fwrite($fp,"\n");
}
fclose($fp);
//}
}
function RunSchemaFile($ado,$filename)
{
if(file_exists($filename))
{
$fp = fopen($filename, "r");//open file
$sql = fread($fp, filesize($filename));
fclose($fp);
if(strlen($sql))
RunSchemaText($ado,$sql);
}
}
function RunSchemaText($ado,$sql)
{
global $g_TablePrefix;
if(strlen($g_TablePrefix))
{
$what = "CREATE TABLE ";
$replace = "CREATE TABLE ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "DROP TABLE ";
$replace = "DROP TABLE ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "INSERT INTO ";
$replace = "INSERT INTO ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "UPDATE ";
$replace = "UPDATE ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "ALTER TABLE ";
$replace = "ALTER TABLE ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
}
$commands = explode("# --------------------------------------------------------",$sql);
if(count($commands)>0)
{
for($i=0;$i<count($commands);$i++)
{
$cmd = $commands[$i];
$cmd = trim($cmd);
if(strlen($cmd)>0)
{
$ado->Execute($cmd);
if($ado->ErrorNo()!=0)
{
$db_error = $ado->ErrorMsg()." COMMAND:<PRE>$cmd</PRE>";
//echo "<br><p class=\"error\">$db_error</p>";
//break;
}
}
}
}
}
function RunSQLText($ado,$allsql)
{
global $g_TablePrefix;
$line = 0;
while($line<count($allsql))
{
$sql = $allsql[$line];
if(strlen(trim($sql))>0 && substr($sql,0,1)!="#")
{
if(strlen($g_TablePrefix))
{
$what = "CREATE TABLE ";
$replace = "CREATE TABLE ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "DROP TABLE ";
$replace = "DROP TABLE ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "INSERT INTO ";
$replace = "INSERT INTO ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "UPDATE ";
$replace = "UPDATE ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
$what = "ALTER TABLE ";
$replace = "ALTER TABLE ".$g_TablePrefix;
$sql = ereg_replace($what, $replace, $sql);
}
$sql = trim($sql);
if(strlen($sql)>0)
{
$ado->Execute($sql);
if($ado->ErrorNo()!=0)
{
$db_error = $ado->ErrorMsg()." COMMAND:<PRE>$sql</PRE>";
//echo "<br><p class=\"error\">$db_error</p>";
$error = TRUE;
}
}
}
$line++;
}
}
function RunSQLFile($ado,$filename)
{
if(file_exists($filename))
{
$allsql = file($filename);
RunSQLText($ado,$allsql);
}
}
function RunRestoreFile($ado,$filename,$FileOffset,$MaxLines)
{
$size = filesize($filename);
if($FileOffset > $size)
return -2;
$fp = fopen($filename,"r");
if(!$fp)
return -1;
if($FileOffset>0)
{
fseek($fp,$FileOffset);
}
else
{
$EndOfSQL = FALSE;
$sql = "";
while(!feof($fp) && !$EndOfSQL)
{
$l = fgets($fp,16384);
if(substr($l,0,11)=="INSERT INTO")
{
$EndOfSQL = TRUE;
}
else
{
$sql .= $l;
$FileOffset = ftell($fp) - strlen($l);
}
}
if(strlen($sql))
{
RunSchemaText($ado,$sql);
}
fseek($fp,$FileOffset);
}
$LinesRead = 0;
$sql = "";
$AllSql = array();
while($LinesRead < $MaxLines && !feof($fp))
{
$sql = fgets($fp, 16384);
if(strlen($sql))
{
$AllSql[] = $sql;
$LinesRead++;
}
}
if(!feof($fp))
{
$FileOffset = ftell($fp);
}
else
{
$FileOffset = $TotalSize;
}
fclose($fp);
if(count($AllSql)>0)
RunSQLText($ado,$AllSql);
return (int)$FileOffset;
}
function inst_keyED($txt,$encrypt_key)
{
$encrypt_key = md5($encrypt_key);
$ctr=0;
$tmp = "";
for ($i=0;$i<strlen($txt);$i++)
{
if ($ctr==strlen($encrypt_key)) $ctr=0;
$tmp.= substr($txt,$i,1) ^ substr($encrypt_key,$ctr,1);
$ctr++;
}
return $tmp;
}
function inst_decrypt($txt,$key)
{
$txt = inst_keyED($txt,$key);
$tmp = "";
for ($i=0;$i<strlen($txt);$i++)
{
$md5 = substr($txt,$i,1);
$i++;
$tmp.= (substr($txt,$i,1) ^ $md5);
}
return $tmp;
}
function inst_LoadFromRemote()
{
return "";
}
function mod_DLid()
{
global $DownloadId;
echo $DownloadId."\n";
die();
}
function inst_LoadLicense($LoadRemote=FALSE,$file="")
{
global $path,$admin;
if(!strlen($file))
{
$f = $path.$admin."/include/inportal.dat";
}
else
$f = $file;
if(file_exists($f))
{
$contents = file($f);
$data = base64_decode($contents[1]);
}
else
if($LoadRemote)
return $LoadFromRemote;
return $data;
}
function inst_SaveLicense($data)
{
}
function inst_VerifyKey($domain,$k)
{
$key = md5($domain);
$lkey = substr($key,0,strlen($key)/2);
$rkey = substr($key,strlen($key)/2);
$r = $rkey.$lkey;
if($k==$r)
return TRUE;
return FALSE;
}
function inst_ParseLicense($txt)
{
global $i_User, $i_Pswd, $i_Keys;
$data = inst_decrypt($txt,"beagle");
$i_Keys = array();
$lines = explode("\n",$data);
for($x=0;$x<count($lines);$x++)
{
$l = $lines[$x];
$p = explode("=",$l,2);
switch($p[0])
{
case "Username":
$i_User = $p[1];
break;
case "UserPass":
$i_Pswd = $p[1];
break;
default:
if(substr($p[0],0,3)=="key")
{
$parts = explode("|",$p[1]);
if(inst_VerifyKey($parts[0],$parts[1]))
{
unset($K);
$k["domain"]=$parts[0];
$k["key"]=$parts[1];
$k["desc"]=$parts[2];
$k["mod"]=$parts[3];
$i_Keys[] = $k;
}
}
break;
}
}
}
function inst_IsLocalSite($domain)
{
$localb = FALSE;
if(substr($domain,0,3)=="172")
{
$b = substr($domain,0,6);
$p = explode(".",$domain);
$subnet = $p[1];
if($p[1]>15 && $p[1]<32)
$localb=TRUE;
}
$localname = (strpos($domain,".")==0);
if($domain=="localhost" || $domain=="127.0.0.1" || substr($domain,0,7)=="192.168" ||
substr($domain,0,3)=="10." || $localb || $localname)
{
return TRUE;
}
return FALSE;
}
function inst_ModuleLicensed($name)
{
global $i_Keys, $objConfig, $g_License, $g_Domain;
//$lic = LoadLicense();
$lic = base64_decode($g_License);
inst_ParseLicense($lic);
// echo "Checking $g_Domain..<br>\n";
// echo "<PRE>";print_r($i_Keys); echo "</PRE><br>";
$modules = array();
if(!inst_IsLocalSite($g_Domain))
{
for($x=0;$x<count($i_Keys);$x++)
{
$key = $i_Keys[$x];
if($key["domain"]==$g_Domain)
{
$modules = explode(",",strtolower($key["mod"]));
}
}
if(in_array($name,$modules))
{
// echo "Module $name is licensed<br>\n";
return TRUE;
}
else
{
// echo "Module $name is not licensed<br>\n";
return FALSE;
}
}
else
return TRUE;
return FALSE;
}
function inst_GetModuleList()
{
global $rootpath,$pathchar,$admin, $pathtoroot;
$path = $pathtoroot;
$new = array();
if ($dir = @opendir($path))
{
while (($file = readdir($dir)) !== false)
{
if($file !="." && $file !=".." && substr($file,0,1)!="_")
{
if(is_dir($path."/".$file))
{
$inst_file = $path.$file."/admin/install.php";
if(file_exists($inst_file))
{
// if(inst_ModuleLicensed($file))
// {
$new[$file] = $inst_file;
// }
}
}
}
}
closedir($dir);
}
return array_keys($new);
}
function GetDirList ($dirName)
{
$filedates = array();
$d = dir($dirName);
while($entry = $d->read())
{
if ($entry != "." && $entry != "..")
{
if (!is_dir($dirName."/".$entry))
{
$filedate[]=$entry;
}
}
}
$d->close();
return $filedate;
}
function GetLanguageList()
{
global $pathtoroot, $admin;
$packs = array();
$dir = $pathtoroot.$admin."/install/langpacks";
$files = GetDirList($dir);
if(is_array($files))
{
foreach($files as $f)
{
$p = pathinfo($f);
if($p["extension"]=="lang")
{
$packs[] = $f;
}
}
}
return $packs;
}
+function section_header($title, $return_result = false)
+{
+ $ret = '<table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">'.
+ '<tr><td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;'.$title.'</span>'.
+ '</td><td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%">'.
+ "<a class=\"link\" onclick=\"ShowHelp('in-portal:install');\"><img src=\"images/blue_bar_help.gif\" border=\"0\"></A>".
+ '</td></tr></table>';
+ if( $return_result )
+ return $ret;
+ else
+ echo $ret;
+}
+
?>
Property changes on: trunk/admin/install/install_lib.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/settings.php
===================================================================
--- trunk/admin/install/settings.php (revision 40)
+++ trunk/admin/install/settings.php (revision 41)
@@ -1,47 +1,41 @@
<td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">Set Root Password</span><br><br>
- <!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Step <?php echo $tmp_step;?> - Set Root Password</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ <?php section_header('Step '.$tmp_step.' - Set Root Password'); ?>
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<?php include("install/toolbar.php"); ?>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<tr class="table_color2">
<td class="txt">
<b>Enter the URL which the In-Portal root directory (<I><?php echo $path; ?></I>) corresponds to on your web server.</b></td>
<td>
http://
<input TYPE="TEXT" class="text" NAME="domain" VALUE="<?php echo $_SERVER["SERVER_NAME"]; ?>">
<?php
$pathguess =substr($_SERVER["SCRIPT_NAME"],0,-17);
?>
<input type="text" name="site" class="text" VALUE="<?php echo $pathguess; ?>">
</td>
</tr>
<tr class="table_color2">
<td colspan="2"><p class="error"><?php echo $PassError; ?></p><br/></td>
</tr>
<td>
<br>
<input TYPE="hidden" NAME ="state" VALUE="server_settings_save">
<input type="hidden" name="next_step" value="<?php echo $next_step;?>">
<input type="hidden" name="install_type" value="<?php echo $install_type;?>">
<input type="submit" name="submit_form" value="Login" class="button">
<input type="reset" name="Cancel" value="Cancel" class="button" ONCLICK = "history.go(-1);">
<input type="hidden" name="UserPass" VALUE="<?php echo $UserPass; ?>">
<input type="hidden" name="UserName" VALUE="<?php echo $UserName; ?>">
</td>
</tr>
</table>
</td>
\ No newline at end of file
Property changes on: trunk/admin/install/settings.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/dbinfo.php
===================================================================
--- trunk/admin/install/dbinfo.php (revision 40)
+++ trunk/admin/install/dbinfo.php (revision 41)
@@ -1,76 +1,70 @@
<td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">Database Configuration</span><br><br>
- <!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Step <?php echo $tmp_step;?> - Database Configuration</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ <?php section_header('Step '.$tmp_step.' - Database Configuration'); ?>
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<?php include("install/toolbar.php"); ?>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0f" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<tr class="table_color2">
<td class="txt"><b>Server Type:</b></td>
<td ALIGN="left">
<SELECT NAME="ServerType">
<OPTION VALUE="mysql" <?php if($g_DBType=="mysql") echo "SELECTED"; ?>>MySQL</OPTION>
<!--<OPTION VALUE="mssql" <?php if($g_DBType=="mssql") echo "SELECTED"; ?>>MS-SQL Server</OPTION>
<OPTION VALUE="pgsql" <?php if($g_DBType=="pgsql") echo "SELECTED"; ?>>pgSQL</OPTION>-->
</SELECT>
</td>
</tr>
<tr class="table_color2">
<td class="txt"><b>Hostname:</b></td>
<td ALIGN="left">
<input type="text" name="ServerHost" class="text" VALUE="<?php echo $g_DBHost; ?>">
</td>
</tr>
<tr class="table_color2">
<td class="txt"><b>Database Name:</b></td>
<td ALIGN="left">
<input type="text" name="ServerDB" class="text" VALUE="<?php echo $g_DBName; ?>">
</td>
</tr>
<tr class="table_color2">
<td class="txt"><b>Databse User Name:</b></td>
<td ALIGN="left">
<input type="text" name="ServerUser" class="text" VALUE="<?php echo $g_DBUser; ?>">
</td>
</tr>
<tr class="table_color2">
<td class="txt"><b>Database User Password:</b></td>
<td ALIGN="left">
<input type="password" name="ServerPass" class="text" VALUE="<?php echo $g_DBUserPassword; ?>">
</td>
</tr>
<tr class="table_color2">
<td class="txt"><b>Table Name Prefix:</b></td>
<td ALIGN="left">
<input type="text" name="TablePrefix" class="text" VALUE="<?php echo $g_TablePrefix; ?>">
</td>
</tr>
<tr class="table_color2">
<td colspan="2"><p class="error"><?php if ($general_error != '') echo $general_error; else echo $db_error; ?></p><br/></td>
</tr>
<input type="hidden" name="UserPass" VALUE="<?php echo $UserPass; ?>">
<input type="hidden" name="UserName" VALUE="<?php echo $UserName; ?>">
<input TYPE="hidden" NAME ="state" VALUE="db_config_save">
<input type="hidden" name="next_step" value="<?php echo $next_step;?>">
<input type="hidden" name="install_type" value="<?php echo $install_type;?>">
<tr>
<td COLSPAN=2>
<br>
<input type="submit" name="submit_form" value="Continue" class="button">
<input type="button" name="Cancel" value="Cancel" CLASS="button" ONCLICK = "history.go(-1);">
</td>
</tr>
</table>
</td>
\ No newline at end of file
Property changes on: trunk/admin/install/dbinfo.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/lang_run.php
===================================================================
--- trunk/admin/install/lang_run.php (revision 40)
+++ trunk/admin/install/lang_run.php (revision 41)
@@ -1,77 +1,72 @@
<?php
function stats($caption,$myprogress,$totalnum)
{
global $rootURL, $CancelURL, $admin, $force_finish;
$step_num = $force_finish ? 3 : 6;
if($totalnum>0)
{
$pct=round(($myprogress/ $totalnum)*100);
}
else
$pct = 100;
$o .=' <td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">'.$caption.'</span><br><br>
- <!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Step '.$step_num.' - '.$caption."-".$pct.'%</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ '.section_header('Step '.$step_num.' - '.$caption.' - '.$pct.'%',true).'
+
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<tr>
<td><img src="images/toolbar/tool_cancel.gif" id="img_Cancel" width="32" height="32" border="0" alt="Next Category" onMouseOut="swap(\'img_Cancel\', \'images/toolbar/tool_cancel.gif\');" onMouseOver="swap(\'img_Cancel\',\'images/toolbar/tool_cancel_f2.gif\');" onClick="history.go(-1);"></td>
<!--<td><img src="images/toolbar/tool_divider.gif" width="4" height="32" border="0"><br></td>-->
<td width="100%">&nbsp;</td>
</tr>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0"><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">';
echo "\n";
$o .= " <tr class=\"table_color2\">
<td ALIGN=\"center\"> <br/>
<TABLE CLASS=\"tableborder_full\" width=\"75%\">
<TR border=1><TD bgcolor=\"#507F15\" width=\"".$pct."%\">&nbsp;</TD>";
$comp_pct = 100-$pct;
$o .= " <TD bgcolor=#FFFFFF width=\"".$comp_pct."%\"></TD></TR>";
$o .= " </TABLE><BR /><input type=button VALUE=\"Cancel\" CLASS=\"button\" ONCLICK=\"document.location='".$CancelURL."';\">
</td>
</tr></table></td>";
//$o .= "<!--<tr><td class=\"tabletitle\" STYLE=\"border: 1px solid #000000;\" bgcolor=\"#333333\">".$caption."-".$pct."%</td></tr>-->";
//$o .= "<TR><TD align=\"middle\" bgcolor=\"#F0F0F0\"><br />";
//$o .= " <TABLE CLASS=\"tableborder_full\" width=\"75%\">";
//$o .=" <TR border=1><TD bgcolor=\"#507F15\" width=\"".$pct."%\">&nbsp;</TD>";
//$comp_pct = 100-$pct;
//$o .= " <TD bgcolor=#FFFFFF width=\"".$comp_pct."%\"></TD></TR>";
//$o .= " </TABLE>";
//$o .= " <BR /><input type=button VALUE=\"Cancel\" CLASS=\"button\" ONCLICK=\"document.location='".$CancelURL."';\">";
echo $o."\n";
//echo "</TD></TR></TABLE></td>";
}
function reload($url)
{
print "<script language=\"javascript\">" ;
print "setTimeout(\"document.location='$url';\",40);";
print " </script>";
//echo "<A HREF=\"$url\">Next </A>";
}
$PageTitle = "Language Pack Installation In Progress";
$CancelURL = $rootURL ."admin/install.php";
stats($PageTitle,$Offset,$Total);
reload($NextUrl);
?>
Property changes on: trunk/admin/install/lang_run.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/admin/install/warning.php
===================================================================
--- trunk/admin/install/warning.php (revision 40)
+++ trunk/admin/install/warning.php (revision 41)
@@ -1,44 +1,38 @@
<td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">Approve Restore from Backup</span><br><br>
- <!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Step <?php echo $tmp_step;?> - Approve Restore from Backup</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ <?php section_header('Step '.$tmp_step.' - Approve Restore from Backup'); ?>
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<?php include("install/toolbar.php"); ?>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<tr class="table_color2">
<td class="text" colspan="2"><?php echo int_hint(prompt_language("la_text_restore warning")); ?></td>
</tr>
<tr class="table_color2">
<td class="text" colspan="2">
<?php echo prompt_language("la_prompt_approve_warning")?>
<input type="checkbox" name="warning_ok" value="1">
</td>
</tr>
<tr class="table_color2">
<td colspan="2"><p class="error"><?php echo $login_error; ?></p><br/></td>
</tr>
<td>
<br>
<input TYPE="hidden" NAME ="state" VALUE="restore_file">
<input TYPE="hidden" NAME ="backupdir" VALUE="<?php echo $_POST["backupdir"];?>">
<input TYPE="hidden" NAME ="backupdate" VALUE="<?php echo $_POST["backupdate"];?>">
<input type="hidden" name="next_step" value="<?php echo $next_step;?>">
<input type="submit" name="submit_form" value="Select" class="button">
<input type="reset" name="Cancel" value="Cancel" class="button" ONCLICK = "history.go(-1);">
<input type="hidden" name="install_type" value="<?php echo $install_type;?>">
</td>
</tr>
</table>
</td>
\ No newline at end of file
Property changes on: trunk/admin/install/warning.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/install_finish.php
===================================================================
--- trunk/admin/install/install_finish.php (revision 40)
+++ trunk/admin/install/install_finish.php (revision 41)
@@ -1,38 +1,32 @@
<td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">Installation Complete</span><br><br>
- <!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Installation Complete</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ <?php section_header('Installation Complete'); ?>
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<?php include("install/toolbar.php"); ?>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<tr class="table_color2">
<td class="txt">
In-portal has successfully been installed on your server. Click the button below to log into the site administration using the root password you just configurered.
</td>
</tr>
<tr class="table_color2">
<td><p class="error"><?php echo ""; ?></p><br/></td>
</tr>
<td>
<br>
<input TYPE="hidden" NAME ="state" VALUE="adm_login">
<input type="submit" name="submit_form" value="Continue" class="button">
<!--<input type="reset" name="Cancel" value="Cancel" class="button" ONCLICK = "history.go(-1);">-->
<!--<input type="hidden" name="UserPass" VALUE="<?php echo $UserPass; ?>">
<input type="hidden" name="UserName" VALUE="<?php echo $UserName; ?>"> -->
</td>
</tr>
</table>
</td>
\ No newline at end of file
Property changes on: trunk/admin/install/install_finish.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/restore_run.php
===================================================================
--- trunk/admin/install/restore_run.php (revision 40)
+++ trunk/admin/install/restore_run.php (revision 41)
@@ -1,128 +1,121 @@
<?php
function stats($caption,$myprogress,$totalnum)
{
global $rootURL, $CancelURL, $admin;
if($totalnum>0)
{
$pct=round(($myprogress/ $totalnum)*100);
}
else
$pct = 100;
$o .=' <td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">'.$caption.'</span><br><br>
-
- <!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Step 2 - '.$caption."-".$pct.'%</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ '.section_header('Step 2 - '.$caption.' - '.$pct.'%').'
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<tr>
<td><img src="images/toolbar/tool_cancel.gif" id="img_Cancel" width="32" height="32" border="0" alt="Next Category" onMouseOut="swap(\'img_Cancel\', \'images/toolbar/tool_cancel.gif\');" onMouseOver="swap(\'img_Cancel\',\'images/toolbar/tool_cancel_f2.gif\');" onClick="history.go(-1);"></td>
<!--<td><img src="images/toolbar/tool_divider.gif" width="4" height="32" border="0"><br></td>-->
<td width="100%">&nbsp;</td>
</tr>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0"><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">';
echo "\n";
$o .= " <tr class=\"table_color2\">
<td ALIGN=\"center\"><br>
<TABLE CLASS=\"tableborder_full\" width=\"75%\">
<TR border=1><TD bgcolor=\"#507F15\" width=\"".$pct."%\">&nbsp;</TD>";
$comp_pct = 100-$pct;
$o .= " <TD bgcolor=#FFFFFF width=\"".$comp_pct."%\"></TD></TR>";
$o .= " </TABLE><BR /><input type=button VALUE=\"Cancel\" CLASS=\"button\" ONCLICK=\"document.location='".$CancelURL."';\">
</td>
</tr></table></td>";
//$o .= "<!--<tr><td class=\"tabletitle\" STYLE=\"border: 1px solid #000000;\" bgcolor=\"#333333\">".$caption."-".$pct."%</td></tr>-->";
//$o .= "<TR><TD align=\"middle\" bgcolor=\"#F0F0F0\"><br />";
//$o .= " <TABLE CLASS=\"tableborder_full\" width=\"75%\">";
//$o .=" <TR border=1><TD bgcolor=\"#507F15\" width=\"".$pct."%\">&nbsp;</TD>";
//$comp_pct = 100-$pct;
//$o .= " <TD bgcolor=#FFFFFF width=\"".$comp_pct."%\"></TD></TR>";
//$o .= " </TABLE>";
//$o .= " <BR /><input type=button VALUE=\"Cancel\" CLASS=\"button\" ONCLICK=\"document.location='".$CancelURL."';\">";
echo $o."\n";
//echo "</TD></TR></TABLE></td>";
}
function reload($url)
{
print "<script language=\"javascript\">" ;
print "setTimeout(\"document.location='$url';\",40);";
print " </script>";
//echo "<A HREF=\"$url\">Next </A>";
}
$TotalSize = filesize($backupfile);
$MaxLines = 200;
$PageTitle = "Restore In Progress";
$CancelURL = $rootURL ."admin/install.php";
stats($PageTitle,$FileOffset,$TotalSize);
if($FileOffset < $TotalSize)
{
$FileOffset = RunRestoreFile($ado,$backupfile,$FileOffset,$MaxLines);
if($FileOffset>-1)
{
if ($_POST['next_step']) {
$next_step = $_POST['next_step'];
}
else if ($_GET['next_step']) {
$next_step = $_GET['next_step'];
}
//$next_step--;
if($FileOffset ==0)
$FileOffset = $TotalSize;
$backupfile = SuperStrip($backupfile);
$url = $_SERVER['PHP_SELF']."?Offset=$FileOffset&File=$backupfile&state=restore_run&next_step=$next_step&install_type=$install_type&show_prev=1";
}
else
{
switch($FileOffset)
{
case -1:
$error = prompt_language("la_restore_file_error");
break;
case -2:
$error = prompt_language("la_restore_read_error");
break;
default:
$error = "(".$FileOffset.") ".prompt_language("la_restore_unknown_error");
break;
}
echo $error;
die();
}
}
else {
if ($_POST['next_step']) {
$next_step = $_POST['next_step'];
}
else if ($_GET['next_step']) {
$next_step = $_GET['next_step'];
}
$url = $_SERVER['PHP_SELF']."?state=finish&next_step=$next_step&install_type=$install_type";
}
reload($url);
?>
<!--<br>
<p class="error"><?php echo $restore_error; ?></p> -->
Property changes on: trunk/admin/install/restore_run.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/login.php
===================================================================
--- trunk/admin/install/login.php (revision 40)
+++ trunk/admin/install/login.php (revision 41)
@@ -1,46 +1,40 @@
<td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">Intechnic Account Login</span><br><br>
- <!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Step <?php echo $tmp_step;?> - Intechnic Account Login</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ <?php section_header('Step '.$tmp_step.' - Intechnic Account Login'); ?>
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<?php include("install/toolbar.php"); ?>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<tr class="table_color2">
<td class="txt"><b>Username:</b></td>
<td>
<input type="text" name="UserName" class="text">
</td>
</tr>
<tr class="table_color2">
<td class="text">
<b>Password:</b></td>
<td>
<input type="password" name="UserPass" class="text">
</td>
</tr>
<tr class="table_color2">
<td colspan="2"><p class="error"><?php echo $login_error; ?></p><br/></td>
</tr>
<td>
<br>
<input TYPE="hidden" NAME ="state" VALUE="login">
<input type="hidden" name="next_step" value="<?php echo $next_step;?>">
<input type="submit" name="submit_form" value="Select" class="button">
<input type="reset" name="Cancel" value="Cancel" class="button" ONCLICK = "history.go(-1);">
<input type="hidden" name="install_type" value="<?php echo $install_type;?>">
</td>
</tr>
</table>
</td>
\ No newline at end of file
Property changes on: trunk/admin/install/login.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/download_license.php
===================================================================
--- trunk/admin/install/download_license.php (revision 40)
+++ trunk/admin/install/download_license.php (revision 41)
@@ -1,45 +1,42 @@
<td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">Select License</span><br><br>
- <!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Step <?php $stmp_step = $tmp_step; echo $stmp_step; ?> - Select License</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ <?php
+ $stmp_step = $tmp_step;
+ section_header('Step '.$stmp_step;.' - Select License');
+ ?>
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<?php include("install/toolbar.php"); ?>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<tr class="table_color2">
<td ALIGN="left" class="txt"><b>Domain:</b></td>
<td ALIGN="left" class="txt"><input type="text" readonly name="domain" value="<?php echo $_SERVER['SERVER_NAME']?>"></td>
</tr>
<tr class="table_color2">
<td ALIGN="left" class="txt"><b>Available licenses:</b></td>
<td ALIGN="left" class="txt"><?php echo $license_select;?></td>
</tr>
<tr class="table_color2">
<td colspan="2"><p class="error"><?php echo $download_license_error; ?></p><br/></td>
</tr>
<td>
<br>
<input TYPE="hidden" NAME ="state" VALUE="download_license">
<input type="submit" name="submit_form" value="Continue" class="button">
<input type="reset" name="Cancel" value="Cancel" class="button" ONCLICK = "history.go(-1);">
<input type="hidden" name="UserPass" VALUE="<?php echo $UserPass; ?>">
<input type="hidden" name="UserName" VALUE="<?php echo $UserName; ?>">
<input type="hidden" name="dlog" VALUE="<?php echo $_POST['login']; ?>">
<input type="hidden" name="dpass" VALUE="<?php echo $_POST['password']; ?>">
<input type="hidden" name="next_step" value="<?php echo $next_step;?>">
<input type="hidden" name="install_type" value="<?php echo $install_type;?>">
</td>
</tr>
</table>
</td>
\ No newline at end of file
Property changes on: trunk/admin/install/download_license.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/postconfig.php
===================================================================
--- trunk/admin/install/postconfig.php (revision 40)
+++ trunk/admin/install/postconfig.php (revision 41)
@@ -1,71 +1,64 @@
<td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">Post-Install Configuration</span><br><br>
-
- <!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Step <?php echo $tmp_step?> - Post-Install Configuration</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ <?php section_header('Step '.$tmp_step.' - Post-Install Configuration'); ?>
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<?php include("install/toolbar.php"); ?>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<?php
$objAdmin = new clsConfigAdmin($module,$section);
$objAdmin->Clear();
$objAdmin->LoadItems(TRUE,TRUE);
$headings = $objAdmin->GetHeadingList();
for($i=0;$i<=count($headings);$i++)
{
$h = $headings[$i];
if(strlen($h))
{
int_subsection_title_install(admin_language($h));
$Items = $objAdmin->GetHeadingItems($h);
foreach($Items as $c)
{
print "<tr ".int_table_color_ret().">\n";
print " <td width=\"80%\" valign=\"top\" class=\"txt\"><b>".str_replace(':', '', $c->GetPrompt()).":</b></td>\n";
print " <td nowrap>".$c->ItemFormElement()."</TD>";
if(is_object($c->NextItem))
{
$n = $c->NextItem;
print " <td>".$n->ItemFormElement()."</TD>";
}
else
print " <td><span class=\"txt\">&nbsp;</span></td>\n";
print "</tr>\n";
}
}
}
//print "<tr ".int_table_color_ret().">\n";
//print "<td colspan=3 STYLE=\"text-align:center;\">";
$newstate="postconfig_".$step;
?>
<tr class="table_color2">
<td colspan="3"><p class="error"><?php echo $db_error; ?></p><br/></td>
</tr>
<input type="hidden" name="UserPass" VALUE="<?php echo $UserPass; ?>">
<input type="hidden" name="UserName" VALUE="<?php echo $UserName; ?>">
<input TYPE="hidden" NAME ="state" VALUE="<?php echo $newstate; ?>">
<input TYPE="hidden" NAME ="oldstate" VALUE="<?php echo $state; ?>">
<input type="hidden" name="next_step" value="<?php echo $tmp_step;?>">
<input type="hidden" name="install_type" value="<?php echo $install_type;?>">
<tr>
<td COLSPAN=3>
<br>
<input type="submit" name="submit_form" value="Continue" class="button">
<input type="button" name="Cancel" value="Cancel" CLASS="button" ONCLICK = "history.go(-1);">
</td>
</tr>
</table>
</td>
\ No newline at end of file
Property changes on: trunk/admin/install/postconfig.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/modselect.php
===================================================================
--- trunk/admin/install/modselect.php (revision 40)
+++ trunk/admin/install/modselect.php (revision 41)
@@ -1,45 +1,39 @@
<td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">Select Modules to Install</span><br><br>
- <!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Step <?php echo $tmp_step;?> - Select Modules</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ <?php section_header('Step '.$tmp_step.' - Select Modules'); ?>
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<?php include("install/toolbar.php"); ?>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<?php
foreach($Modules as $m)
{
echo "<TR class=\"table_color2\"><TD colspan=\"2\" align=\"left\" class=\"txt\">";
echo "<INPUT TYPE=\"CHECKBOX\" NAME=\"domain[]\" VALUE=\"$m\" CHECKED=\"checked\">";
echo $m;
echo "</TD></TR>\n";
}
?>
<tr class="table_color2">
<td colspan="2"><p class="error"><?php echo $ModuleError; ?></p><br/></td>
</tr>
<td>
<br>
<input TYPE="hidden" NAME ="state" VALUE="modinstall">
<input type="submit" name="submit_form" value="Select" class="button">
<input type="reset" name="Cancel" value="Cancel" class="button" ONCLICK = "history.go(-1);">
<input type="hidden" name="UserPass" VALUE="<?php echo $UserPass; ?>">
<input type="hidden" name="UserName" VALUE="<?php echo $UserName; ?>">
<input type="hidden" name="next_step" value="<?php echo $next_step;?>">
<input type="hidden" name="install_type" value="<?php echo $install_type;?>">
</td>
</tr>
</table>
</td>
\ No newline at end of file
Property changes on: trunk/admin/install/modselect.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/get_license.php
===================================================================
--- trunk/admin/install/get_license.php (revision 40)
+++ trunk/admin/install/get_license.php (revision 41)
@@ -1,46 +1,39 @@
<td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">Select License</span><br><br>
-
- <!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Step 2<?php //$stmp_step = $tmp_step-1; echo $stmp_step; ?> - Select License</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ <?php section_header('Step 2 - Select License'); ?>
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<?php include("install/toolbar.php"); ?>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<tr class="table_color2">
<td ALIGN="left" class="txt"><b>Login / E-mail:</b></td>
<td ALIGN="left" class="txt"><input type="text" name="login" value="<?php echo $_POST['login'];?>" class="text"></td>
</tr>
<tr class="table_color2">
<td ALIGN="left" class="txt"><b>Password:</b></td>
<td ALIGN="left" class="txt"><input type="password" name="password" value="" class="text"></td>
</tr>
<tr class="table_color2">
<td ALIGN="left" colspan="2" WIDTH="100%" class="txt"><a href="http://www.in-portal.net/licensing/index.php?t=users/reveal_password&">Forgot password</a></td>
</tr>
<tr class="table_color2">
<td colspan="2"><p class="error"><?php echo $get_license_error; ?></p><br/></td>
</tr>
<td>
<br>
<input TYPE="hidden" NAME ="state" VALUE="download_license">
<input type="submit" name="submit_form" value="Continue" class="button">
<input type="reset" name="Cancel" value="Cancel" class="button" ONCLICK = "history.go(-1);">
<input type="hidden" name="UserPass" VALUE="<?php echo $UserPass; ?>">
<input type="hidden" name="UserName" VALUE="<?php echo $UserName; ?>">
<input type="hidden" name="next_step" value="2">
<input type="hidden" name="install_type" value="<?php echo $install_type;?>">
</td>
</tr>
</table>
</td>
\ No newline at end of file
Property changes on: trunk/admin/install/get_license.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/sel_license.php
===================================================================
--- trunk/admin/install/sel_license.php (revision 40)
+++ trunk/admin/install/sel_license.php (revision 41)
@@ -1,55 +1,49 @@
<td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">Select License</span><br><br>
- <!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Step <?php echo $tmp_step;?> - Select License</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ <?php section_header('Step '.$tmp_step.' - Select License'); ?>
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<?php include("install/toolbar.php"); ?>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<tr class="table_color2">
<td ALIGN="left" WIDTH="100%" class="txt"><INPUT TYPE="RADIO" NAME="lic_opt" VALUE="1">Download from Intechnic</td>
</tr>
<tr class="table_color2">
<td ALIGN="left" WIDTH="100%" class="txt"><INPUT TYPE=RADIO value="2" name="lic_opt">Upload License File:
<INPUT TYPE="FILE" CLASS="button" NAME="licfile">
</td>
</tr>
<tr class="table_color2">
<?php
if(!strlen($g_License))
{
$enabled="disabled='true'";
}
?>
<td ALIGN="left" WIDTH="100%" class="txt" <?php echo $enabled; ?>><INPUT TYPE=RADIO value="3" name="lic_opt">Use Existing License</td>
</tr>
<tr class="table_color2">
<td ALIGN="left" WIDTH="100%" class="txt"><INPUT TYPE=RADIO value="4" name="lic_opt">Skip License (Local Domain Installation)</td>
</tr>
<tr class="table_color2">
<td colspan="2"><p class="error"><?php echo $license_error; ?></p><br/></td>
</tr>
<td>
<br>
<input TYPE="hidden" NAME ="state" VALUE="license_process">
<input type="submit" name="submit_form" value="Continue" class="button">
<input type="reset" name="Cancel" value="Cancel" class="button" ONCLICK = "history.go(-1);">
<input type="hidden" name="UserPass" VALUE="<?php echo $UserPass; ?>">
<input type="hidden" name="UserName" VALUE="<?php echo $UserName; ?>">
<input type="hidden" name="next_step" value="<?php echo $next_step;?>">
<input type="hidden" name="install_type" value="<?php echo $install_type;?>">
</td>
</tr>
</table>
</td>
\ No newline at end of file
Property changes on: trunk/admin/install/sel_license.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/upgrade.php
===================================================================
--- trunk/admin/install/upgrade.php (revision 40)
+++ trunk/admin/install/upgrade.php (revision 41)
@@ -1,50 +1,44 @@
<td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">Select Modules to Upgrade</span><br><br>
- <!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Step <?php echo $tmp_step;?> - Select Modules</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ <?php section_header('Step '.$tmp_step.' - Select Modules'); ?>
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<?php include("install/toolbar.php"); ?>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<?php
$i = 0;
foreach($Modules as $m)
{
echo "<TR class=\"table_color2\"><TD colspan=\"2\" align=\"left\" class=\"txt\">";
echo "<INPUT TYPE=\"CHECKBOX\" NAME=\"modules[]\" VALUE=\"$m\" CHECKED=\"checked\">";
echo $Texts[$i];
echo "</TD></TR>\n";
$i++;
}
?>
<tr class="table_color1">
<td colspan="2"><?php echo int_hint(prompt_language("la_text_upgrade_disclaimer")); ?><br/></td>
</tr>
<tr class="table_color2">
<td colspan="2"><p class="error"><?php echo $ModuleError; ?></p><br/></td>
</tr>
<td>
<br>
<input TYPE="hidden" NAME ="state" VALUE="upgrade_process">
<input type="submit" name="submit_form" value="Select" class="button">
<input type="reset" name="Cancel" value="Cancel" class="button" ONCLICK = "history.go(-1);">
<input type="hidden" name="UserPass" VALUE="<?php echo $UserPass; ?>">
<input type="hidden" name="UserName" VALUE="<?php echo $UserName; ?>">
<input type="hidden" name="next_step" value="<?php echo $next_step;?>">
<input type="hidden" name="install_type" value="<?php echo $install_type;?>">
</td>
</tr>
</table>
</td>
\ No newline at end of file
Property changes on: trunk/admin/install/upgrade.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/reinstall.php
===================================================================
--- trunk/admin/install/reinstall.php (revision 40)
+++ trunk/admin/install/reinstall.php (revision 41)
@@ -1,75 +1,70 @@
<td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">Licence Verification</span><br><br>
- <!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Step 1<?php//=$tmp_step;?> - Licence Verification</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ <?php section_header('Step 1 - Licence Verification'); ?>
+
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<?php include("install/toolbar.php"); ?>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr class="table_color1">
<td COLSPAN=2><p class="error">In-Portal is already installed at this location.</p></TD>
</tr>
<tr class="table_color2">
<td COLSPAN=2>In order to use the installation tool, please provide your Intechnic account information:</td>
</tr>
<tr class="table_color2">
<td class="text"><B>Username:</B></td>
<td width="80%"><input type="text" name="UserName" value="<?php $_POST['UserName'];?>" class="text"></td>
</tr>
<tr class="table_color2">
<td class="text"><B>Password:</B></td>
<td><input type="password" name="UserPass" class="text"></td>
</tr>
<tr class="table_color2"><td COLSPAN=2><p class="error"><?php echo $login_error;?></p><br></TD></tr>
<?php if($show_upgrade) { ?>
<tr class="table_color1">
<td COLSPAN=2 ><INPUT TYPE=RADIO value="6" name="inp_opt">Upgrade In-Portal</span></td>
</tr>
<?php } ?>
<tr class="table_color2">
<td COLSPAN=2 >
<INPUT TYPE="RADIO" NAME="inp_opt" VALUE="1">Clean out the In-Portal database and reinstall<br>
</td>
</tr>
<tr class="table_color1">
<td COLSPAN=2 >
<INPUT TYPE="RADIO" NAME="inp_opt" VALUE="4">Clean out the In-Portal database and reinstall from backup
</td>
</tr>
<tr class="table_color2">
<td COLSPAN=2><INPUT TYPE=RADIO value="2" name="inp_opt">Install to a new database</td>
</tr>
<tr class="table_color1">
<td COLSPAN=2><INPUT TYPE=RADIO value="3" name="inp_opt">Update License Information</td>
</tr>
<tr class="table_color2">
<td COLSPAN=2 ><INPUT TYPE=RADIO value="5" name="inp_opt">Change Database Configuration</td>
</tr>
<tr class="table_color1">
<td colspan="2"><p class="error"><?php echo $inst_error; ?></p><br/></td>
</tr>
<tr>
<td COLSPAN=2>
<br>
<input TYPE="hidden" NAME ="state" VALUE="reinstall_process">
<input type="hidden" name="next_step" value="2<?php //=$next_step;?>">
<input type="hidden" name="install_type" value="<?php echo $install_type;?>">
<input type="submit" name="submit_form" value="Continue" class="button">
<input type="reset" name="Cancel" value="Cancel" class="button">
</td>
</tr>
</table>
</td>
\ No newline at end of file
Property changes on: trunk/admin/install/reinstall.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/theme_select.php
===================================================================
--- trunk/admin/install/theme_select.php (revision 40)
+++ trunk/admin/install/theme_select.php (revision 41)
@@ -1,51 +1,45 @@
<td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">Select Default Theme</span><br><br>
- <!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Step <?php echo $tmp_step;?> - Select Default Theme</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ <?php section_header('Step '.$tmp_step.' - Select Default Theme'); ?>
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<?php include("install/toolbar.php"); ?>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<tr class="table_color2">
<td class="txt">
<b>Default Theme:</b></td>
<td>
<SELECT NAME="theme">
<?php
$objThemes->Clear();
$objThemes->Query_Item("SELECT * FROM ".GetTablePrefix()."Theme");
foreach($objThemes->Items as $t)
{
echo "<OPTION VALUE=\"".$t->Get("ThemeId")."\">".$t->Get("Name")."\n";
}
?>
</SELECT>
</td>
</tr>
<tr class="table_color2">
<td colspan="2"><p class="error"><?php echo $ThemeError; ?></p><br/></td>
</tr>
<td>
<br>
<input TYPE="hidden" NAME ="state" VALUE="theme_set">
<input type="submit" name="submit_form" value="Select" class="button">
<input type="reset" name="Cancel" value="Cancel" class="button" ONCLICK = "history.go(-1);">
<input type="hidden" name="UserPass" VALUE="<?php echo $UserPass; ?>">
<input type="hidden" name="UserName" VALUE="<?php echo $UserName; ?>">
<input type="hidden" name="next_step" value="<?php echo $next_step;?>">
<input type="hidden" name="install_type" value="<?php echo $install_type;?>">
</td>
</tr>
</table>
</td>
\ No newline at end of file
Property changes on: trunk/admin/install/theme_select.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/db_reconfig.php
===================================================================
--- trunk/admin/install/db_reconfig.php (revision 40)
+++ trunk/admin/install/db_reconfig.php (revision 41)
@@ -1,76 +1,70 @@
<td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">Database Configuration</span><br><br>
- <!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Step <?php echo $tmp_step;?> - Database Configuration</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ <?php section_header('Step '.$tmp_step.' - Database Configuration'); ?>
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<?php include("install/toolbar.php"); ?>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<tr class="table_color2">
<td ALIGN="right" class="txt"><b>Server Type:</b></td>
<td ALIGN="left">
<SELECT NAME="ServerType">
<OPTION VALUE="mysql" <?php if($g_DBType=="mysql") echo "SELECTED"; ?>>MySQL</OPTION>
<!-- <OPTION VALUE="mssql" <?php if($g_DBType=="mssql") echo "SELECTED"; ?>>MS-SQL Server</OPTION>
<OPTION VALUE="pgsql" <?php if($g_DBType=="pgsql") echo "SELECTED"; ?>>pgSQL</OPTION>-->
</SELECT>
</td>
</tr>
<tr class="table_color2">
<td ALIGN="right" class="txt"><b>Server Hostname:</b></td>
<td ALIGN="left">
<input type="text" name="ServerHost" class="text" VALUE="<?php echo $g_DBHost; ?>">
</td>
</tr>
<tr class="table_color2">
<td ALIGN="right" class="txt"><b>Server Database:</b></td>
<td ALIGN="left">
<input type="text" name="ServerDB" class="text" VALUE="<?php echo $g_DBName; ?>">
</td>
</tr>
<tr class="table_color2">
<td ALIGN="right" class="txt"><b>Databse User Name:</b></td>
<td ALIGN="left">
<input type="text" name="ServerUser" class="text" VALUE="<?php echo $g_DBUser; ?>">
</td>
</tr>
<tr class="table_color2">
<td ALIGN="right" class="txt"><b>Server Password:</b></td>
<td ALIGN="left">
<input type="password" name="ServerPass" class="text" VALUE="<?php echo $g_DBUserPassword; ?>">
</td>
</tr>
<tr class="table_color2">
<td ALIGN="right" class="txt"><b>Table Name Prefix:</b></td>
<td ALIGN="left">
<input type="text" name="TablePrefix" class="text" VALUE="<?php echo $g_TablePrefix; ?>">
</td>
</tr>
<tr class="table_color2">
<td colspan="2"><p class="error"><?php echo $db_error; ?></p><br/></td>
</tr>
<input type="hidden" name="UserPass" VALUE="<?php echo $UserPass; ?>">
<input type="hidden" name="UserName" VALUE="<?php echo $UserName; ?>">
<input TYPE="hidden" NAME ="state" VALUE="db_reconfig_save">
<input type="hidden" name="next_step" value="<?php echo $next_step;?>">
<input type="hidden" name="install_type" value="<?php echo $install_type;?>">
<tr>
<td COLSPAN=2>
<br>
<input type="submit" name="submit_form" value="Continue" class="button">
<input type="button" name="Cancel" value="Cancel" CLASS="button" ONCLICK = "history.go(-1);">
</td>
</tr>
</table>
</td>
\ No newline at end of file
Property changes on: trunk/admin/install/db_reconfig.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/admin/install/domain.php
===================================================================
--- trunk/admin/install/domain.php (revision 40)
+++ trunk/admin/install/domain.php (revision 41)
@@ -1,49 +1,43 @@
<td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">Select Domain</span><br><br>
- <!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Step <?php echo $tmp_step;?> - Select Domain</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ <?php section_header('Step '.$tmp_step.' - Select Domain'); ?>
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<?php include("install/toolbar.php"); ?>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<?php
$current = $_SERVER['HTTP_HOST'];
echo "<TR class=\"table_color2\"><TD colspan=\"2\" class=\"txt\" align=\"left\">";
echo "<INPUT TYPE=\"RADIO\" NAME=\"domain\" checked VALUE=\"1\" $sel>";
echo $current;
echo "</TD></TR>\n";
?>
<tr class="table_color2">
<TD COLSPAN=2 align="left" class="txt">
<INPUT TYPE="radio" NAME="domain" VALUE="2">Other:
<input TYPE="TEXT" NAME="other" VALUE="">
</TD>
</tr>
<tr class="table_color2">
<td colspan="2"><p class="error"><?php echo $DomainError; ?></p><br/></td>
</tr>
<td>
<br>
<input TYPE="hidden" NAME ="state" VALUE="set_domain">
<input type="submit" name="submit_form" value="Select" class="button">
<input type="reset" name="Cancel" value="Cancel" class="button" ONCLICK = "history.go(-1);">
<input type="hidden" name="UserPass" VALUE="<?php echo $UserPass; ?>">
<input type="hidden" name="UserName" VALUE="<?php echo $UserName; ?>">
<input type="hidden" name="next_step" value="<?php echo $next_step;?>">
<input type="hidden" name="install_type" value="<?php echo $install_type;?>">
</td>
</tr>
</table>
</td>
\ No newline at end of file
Property changes on: trunk/admin/install/domain.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/rootpass.php
===================================================================
--- trunk/admin/install/rootpass.php (revision 40)
+++ trunk/admin/install/rootpass.php (revision 41)
@@ -1,49 +1,43 @@
<td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">Set Root Password</span><br><br>
- <!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Step <?php echo $tmp_step;?> - Set Root Password</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ <?php section_header('Step '.$tmp_step.' - Set Root Password'); ?>
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<?php include("install/toolbar.php"); ?>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<tr class="table_color2">
<td class="txt">
<b>Root Password:</b></td>
<td>
<input type="password" name="RootPass" class="text">
</td>
</tr>
<tr class="table_color2">
<td class="txt">
<b>Confirm Root Password:</b></td>
<td>
<input type="password" name="RootPassConfirm" class="text">
</td>
</tr>
<tr class="table_color2">
<td colspan="2"><p class="error"><?php echo $PassError; ?></p><br/></td>
</tr>
<td>
<br>
<input TYPE="hidden" NAME ="state" VALUE="RootSetPass">
<input type="submit" name="submit_form" value="Select" class="button">
<input type="reset" name="Cancel" value="Cancel" class="button" ONCLICK = "history.go(-1);">
<input type="hidden" name="UserPass" VALUE="<?php echo $UserPass; ?>">
<input type="hidden" name="UserName" VALUE="<?php echo $UserName; ?>">
<input type="hidden" name="next_step" value="<?php echo $next_step;?>">
<input type="hidden" name="install_type" value="<?php echo $install_type;?>">
</td>
</tr>
</table>
</td>
\ No newline at end of file
Property changes on: trunk/admin/install/rootpass.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/lang_select.php
===================================================================
--- trunk/admin/install/lang_select.php (revision 40)
+++ trunk/admin/install/lang_select.php (revision 41)
@@ -1,45 +1,39 @@
<td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">Select Language Packs to Install</span><br><br>
- <!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Step <?php echo $tmp_step;?> - Select Language Packs</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ <?php section_header('Step '.$tmp_step.' - Select Language Packs'); ?>
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<?php include("install/toolbar.php"); ?>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<?php
foreach($Packs as $p)
{
echo "<TR class=\"table_color2\"><TD colspan=\"2\" align=\"left\" class=\"txt\">";
echo "<INPUT TYPE=\"CHECKBOX\" NAME=\"lang[]\" VALUE=\"$p\" CHECKED=\"checked\">";
echo substr($p,0,-5);
echo "</TD></TR>\n";
}
?>
<tr class="table_color2">
<td colspan="2"><p class="error"><?php echo $LangError; ?></p><br/></td>
</tr>
<td>
<br>
<input TYPE="hidden" NAME ="state" VALUE="lang_install_init">
<input type="submit" name="submit_form" value="Select" class="button">
<input type="reset" name="Cancel" value="Cancel" class="button" ONCLICK = "history.go(-1);">
<input type="hidden" name="UserPass" VALUE="<?php echo $UserPass; ?>">
<input type="hidden" name="UserName" VALUE="<?php echo $UserName; ?>">
<input type="hidden" name="next_step" value="<?php echo $tmp_step;?>">
<input type="hidden" name="install_type" value="<?php echo $install_type;?>">
</td>
</tr>
</table>
</td>
\ No newline at end of file
Property changes on: trunk/admin/install/lang_select.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/restore_select.php
===================================================================
--- trunk/admin/install/restore_select.php (revision 40)
+++ trunk/admin/install/restore_select.php (revision 41)
@@ -1,110 +1,105 @@
<?php
if(!strlen($filepath))
$filepath = $pathtoroot.$admin.$path_char.'backupdata';
function getRestoreDirList($dirName)
{
global $objSession, $path_char;
$filedates = array();
$d = @dir($dirName);
if (!$d) {
$restore_error = 'Cannot open backup directory!';
return;
}
while($entry = $d->read())
{
if ($entry != "." && $entry != "..")
{
if (!is_dir($dirName.$path_char.$entry) && eregi("dump",$entry))
{
$shortversion=chopchop($entry);
$filedate[]=$shortversion;
}
}
}
$d->close();
rsort($filedate);
return $filedate;
}
function chopchop ($filename)
{
eregi(BACKUP_NAME, $filename, $rets);
return $rets[1];
}
?>
<?php
$datearray=getRestoreDirList($filepath);
$count = 0;
if (count($datearray) != 0) {
$options = '';
foreach($datearray as $key => $value)
{
$sel = ($value == $_REQUEST['backupdate']) ? ' checked' : '';
$options .= "<TR class=\"table_color2\">";
$options .= "<TD class=\"txt\" size=40><input id=\"$key\" type=radio NAME=\"backupdate\" VALUE=\"$value\" $sel>";
$options .= '<label for="'.$key.'">'.date("F j, Y, g:i a",$value)."</label></TD></TR>";
$count++;
if($count>10)
break;
}
}
else {
$tmp_step = 2;
$next_step = 3;
$restore_error = "No backup files found or directory does not exist!";
}
if ($_POST["state"]=="restore_select") {
$tmp_step = 2;
$next_step = 3;
}
?>
<td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">Select Backup File</span><br><br>
<!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Step <?php echo $tmp_step;?> - Select Backup File</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ <?php section_header('Step '.$tmp_step.' - Select Backup File'); ?>
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<?php include("install/toolbar.php"); ?>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<tr class="table_color2">
<td ALIGN="left" WIDTH="100%" class="txt">
<b>Backup Directory:</b> <INPUT TYPE="text" NAME="backupdir" VALUE="<?php echo $filepath; ?>">
<input type="button" NAME="update" VALUE="Update" class="button" ONCLICK="this.form.state.value='restore_select'; this.form.submit();">
</td>
</tr>
<?php echo $options;?>
<tr class="table_color2">
<td colspan="2"><p class="error"><?php echo $restore_error; ?></p><br/></td>
</tr>
<td>
<br>
<input TYPE="hidden" NAME ="state" VALUE="restore_file">
<input type="hidden" name="next_step" value="<?php echo $next_step;?>">
<input type="hidden" name="install_type" value="<?php echo $install_type;?>">
<input type="submit" name="submit_form" value="Continue" class="button">
<input type="reset" name="Cancel" value="Cancel" class="button" ONCLICK = "history.go(-1);">
</td>
</tr>
</table>
</td>
\ No newline at end of file
Property changes on: trunk/admin/install/restore_select.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/lang_default.php
===================================================================
--- trunk/admin/install/lang_default.php (revision 40)
+++ trunk/admin/install/lang_default.php (revision 41)
@@ -1,48 +1,42 @@
<td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">Select Default Language</span><br><br>
- <!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Step <?php echo $tmp_step?> - Select Default Language</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ <?php section_header('Step '.$tmp_step.' - Select Default Language'); ?>
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<?php include("install/toolbar.php"); ?>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<?php
$checked=" CHECKED";
foreach($Packs as $id=>$p)
{
echo "<TR class=\"tabel_color2\"><TD colspan=\"2\" align=\"left\" class=\"text\">";
echo "<INPUT TYPE=\"RADIO\" NAME=\"lang\" VALUE=\"$id\" $checked>";
echo $p;
echo "</TD></TR>\n";
$checked = "";
}
?>
<tr class="table_color2">
<td colspan="2"><p class="error"><?php echo $ModuleError; ?></p><br/></td>
</tr>
<td>
<br>
<input TYPE="hidden" NAME ="state" VALUE="lang_default_set">
<input type="submit" name="submit_form" value="Select" class="button">
<input type="reset" name="Cancel" value="Cancel" class="button" ONCLICK = "history.go(-1);">
<input type="hidden" name="UserPass" VALUE="<?php echo $UserPass; ?>">
<input type="hidden" name="UserName" VALUE="<?php echo $UserName; ?>">
<input type="hidden" name="next_step" value="<?php echo $next_step;?>">
<input type="hidden" name="install_type" value="<?php echo $install_type;?>">
</td>
</tr>
</table>
</td>
\ No newline at end of file
Property changes on: trunk/admin/install/lang_default.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/general_error.php
===================================================================
--- trunk/admin/install/general_error.php (revision 40)
+++ trunk/admin/install/general_error.php (revision 41)
@@ -1,33 +1,27 @@
<td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">Installation Error</span><br><br>
- <!-- toolbar buttons //-->
- <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
- <tr>
- <td class="tablenav" width="580" nowrap background="images/tabnav_left.jpg"><span class="tablenav_link">&nbsp;Installation Error</span></td>
- <td align="right" class="tablenav" background="images/tabnav_back.jpg" width="100%"><img src="images/blue_bar_help.gif" border="0" ><br></td>
- </tr>
- </table>
+ <?php section_header('Installation Error'); ?>
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<?php include("install/toolbar.php"); ?>
</table>
<!-- toolbar button \\-->
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<tr class="table_color2" valign="top">
<td><p class="error"><?php echo $general_error; ?></p><br/></td>
</tr>
<td>
<br>
<!--<input TYPE="hidden" NAME ="state" VALUE="adm_login">-->
<!--<input type="submit" name="submit_form" value="Continue" class="button">-->
<!--<input type="reset" name="Cancel" value="Cancel" class="button" ONCLICK = "history.go(-1);">-->
<!--<input type="hidden" name="UserPass" VALUE="<?php echo $UserPass; ?>">
<input type="hidden" name="UserName" VALUE="<?php echo $UserName; ?>"> -->
</td>
</tr>
</table>
</td>
\ No newline at end of file
Property changes on: trunk/admin/install/general_error.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property

Event Timeline