Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F772977
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Feb 1, 10:06 PM
Size
12 KB
Mime Type
text/x-diff
Expires
Mon, Feb 3, 10:06 PM (1 d, 19 h)
Engine
blob
Format
Raw Data
Handle
556251
Attached To
rINP In-Portal
in-portal
View Options
Index: trunk/admin/backup/restore1.php
===================================================================
--- trunk/admin/backup/restore1.php (revision 217)
+++ trunk/admin/backup/restore1.php (revision 218)
@@ -1,190 +1,194 @@
<?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;
//echo $pathtoroot;
require_once($pathtoroot."kernel/startup.php");
$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
$admin = $objConfig->Get("AdminDirectory");
if(!strlen($admin))
$admin = "admin";
$adminURL = $rootURL.$admin;
$localURL=$rootURL."kernel/";
$imagesURL = $rootURL."admin/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");
//Set Section
$section = "in-portal:restore";
//Set Environment Variable
$envar = "env=" . BuildEnv();
global $tables;
unset($tables);
if($_POST["Action"]=="update")
{
$newpath= $_POST["backup_path"];
$newpath = str_replace('\\\\','\\',$newpath);
$objConfig->Set("Backup_Path",$newpath);
$objConfig->Save();
}
$filepath=$objConfig->Get("Backup_Path");
$limit = 100;
$success =0;
$objSession->SetVariable("restore_filepath",$filepath);
$objSession->SetVariable("restore_success",0);
$objSession->SetVariable("restore_todo","");
$sec = $objSections->GetSection($section);
$objCatToolBar = new clsToolBar();
+$ro_perm = $objSession->HasSystemPermission("SYSTEM_ACCESS.READONLY");
+
if (true)
{
if($en_prev>-1)
{
$MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');";
$MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');";
$onClick= $sec->Get("onclick");
$var="?env=".BuildEnv()."&en=$en_prev";
$link=$PHP_SELF.$var;
$objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,"","tool_prev.gif");
}
else
{
$MouseOver="";
$MouseOut="";
$onClick="";
$link="#";
$objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),"#","","","","tool_prev_f3.gif");
}
if(true)
{
$MouseOver="if (document.restore1.agree.checked == true) swap('moveright','toolbar/tool_next_f2.gif');";
$MouseOut="if (document.restore1.agree.checked == true) swap('moveright', 'toolbar/tool_next.gif');";
$var="?env=".BuildEnv()."&en=$en_next";
$link2=$rootURL."admin/backup/restore2.php".$var;
$onClick="document.location= '$link2';";
$onClick="if (document.restore1.agree.checked == true) document.restore1.submit();";
$link="#";
$objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,$onClick,"tool_next_f3.gif");
}
int_header($objCatToolBar,NULL,$title);
}
-$SubmitUrl = $adminURL."/install.php";
+
+$SubmitUrl = $ro_perm ? $adminURL.'/backup/restore1.php?'.$envar : $adminURL."/install.php";
+//$SubmitUrl = $adminURL."/install.php";
?>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
-<form name="restore1" TARGET="_top" METHOD="POST" action="<?php echo $SubmitUrl; ?>">
+<form name="restore1" TARGET="<?php echo $ro_perm ? 'main' : '_top'; ?>" METHOD="POST" action="<?php echo $SubmitUrl; ?>">
<?php int_subsection_title(prompt_language("la_Prompt_Warning")); ?>
<TR <?php echo int_table_color(); ?>>
<TD COLSPAN="2"><span class=\"text\"><?php echo prompt_language("la_Text_Restore_Heading"); ?>
</span>
</TD>
</TR>
<TR <?php echo int_table_color(); ?>>
<td width=\"60%\" valign=\"top\"><span class=\"text\"><?php echo prompt_language("la_prompt_Root_Password"); ?></span></td>
<TD >
<INPUT type="password" name="UserPass" class="text" size="50" value=''>
</TD>
</TR>
<tr <?php echo int_table_color(); ?>>
<TD COLSPAN="2">
<?php
//$text = 'Running this utility will affect your database. '.
// 'Please be advised that you can use this utility '.
// 'at your own risk. Intechnic Corporation can not '.
// 'be held liable for any corrupt data or data loss. '.
// 'Please make sure to back up your database(s) before '.
// 'running this utility.';
echo int_hint(prompt_language("la_text_disclaimer_part1")." ".prompt_language("la_text_disclaimer_part2"));
?>
</TD>
</tr>
<tr>
<td COLSPAN="2">
<input type="checkbox" id="agree" value="0" name="agree" onclick="if (document.restore1.agree.checked == true) swap('moveright', 'toolbar/tool_next.gif'); else swap('moveright', 'toolbar/tool_next_f3.gif'); "><label for="agree"><?php echo admin_language("la_Text_IAgree"); ?></label>
</td>
</tr>
<input type=hidden name="state" value="reinstall_process">
<input type=hidden name="install_type" value="8">
<input type=hidden name="next_step" value="2">
<input type=hidden name="UserName" value="root">
<input type=hidden name="inp_opt" value="4">
</FORM>
</TABLE>
<?php
int_footer();
?>
Property changes on: trunk/admin/backup/restore1.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/backup/backup1.php
===================================================================
--- trunk/admin/backup/backup1.php (revision 217)
+++ trunk/admin/backup/backup1.php (revision 218)
@@ -1,202 +1,199 @@
<?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;
//echo $pathtoroot;
require_once($pathtoroot."kernel/startup.php");
$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
$admin = $objConfig->Get("AdminDirectory");
if(!strlen($admin))
$admin = "admin";
$localURL=$rootURL."kernel/";
$imagesURL = $rootURL."admin/images";
$adminURL = $rootURL.$admin;
//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");
//Set Section
$section = "in-portal:backup";
//Set Environment Variable
$envar = "env=" . BuildEnv();
-
$ro_perm = $objSession->HasSystemPermission("SYSTEM_ACCESS.READONLY");
-
-
global $tables;
unset($tables);
if($_POST["Action"]=="update" && !$ro_perm)
{
$newpath= $_POST["backup_path"];
$newpath = str_replace('\\\\','\\',$newpath);
$objConfig->Set("Backup_Path",$newpath);
$objConfig->Save();
}
//initializes default
$objSession->SetVariable("backup_start",0);
$objSession->SetVariable("backup_tnumber","start");
$date=time();
$filepath=$objConfig->Get("Backup_Path");
$filename="dump".$date.".txt";
//$filename= $filepath."".$filename;
$limit = 100;
$success =0;
$objSession->SetVariable("backup_filename",$filename);
$objSession->SetVariable("backup_limit",$limit);
$objSession->SetVariable("backup_success",$success);
$objSession->SetVariable("backup_total",0);
$objSession->SetVariable("backup_subitem",0);
$objSession->SetVariable("backup_totalsub",0);
$objSession->SetVariable("backup_key","");
$objSession->SetVariable("backup_tnumber","start");
$sec = $objSections->GetSection($section);
$objCatToolBar = new clsToolBar();
$backpath = $objConfig->Get("Backup_Path");
if(!strlen($backpath))
{
$backpath = $pathtoroot.$admin."/backupdata";
$objConfig->Set("Backup_Path",$backpath);
$objConfig->Save();
}
$writable = is_writable($backpath);
if (true)
{
if($en_prev>-1)
{
$MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');";
$MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');";
$onClick= $sec->Get("onclick");
$var="?env=".BuildEnv()."&en=$en_prev";
$link=$PHP_SELF.$var;
$objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,"","tool_prev.gif");
}
else
{
$MouseOver="";
$MouseOut="";
$onClick="";
$link = "#";
$objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),"#","","","","tool_prev_f3.gif");
}
if(true)
{
$MouseOver="swap('moveright','toolbar/tool_next_f2.gif');";
$MouseOut="swap('moveright', 'toolbar/tool_next.gif');";
$var="?env=".BuildEnv()."&en=$en_next";
$script_name = $ro_perm ? 'backup1' : 'backup2';
$link2 = $rootURL."admin/backup/".$script_name.".php".$var;
$onClick="document.location= '$link2';";
$link="#";
if ($writable) {
$objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,$onClick,"tool_next.gif");
}
else {
$objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),"#","","","","tool_next_f3.gif");
}
}
$title = admin_language("la_performing_backup")." - ".admin_language("la_Step")." 1";
int_header($objCatToolBar,NULL,$title);
}
?>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
<form name="backup1" METHOD="POST" action="<?php echo $_SERVER["PHP_SELF"]."?".$envar; ?>">
<?php int_subsection_title(admin_language("la_Prompt_Step_One")); ?>
<TR <?php echo int_table_color(); ?>>
<TD COLSPAN="2">
<span class=\"text\"><?php echo prompt_language("la_Text_Backup_Info");?></span>
</TD>
</TR>
<TR <?php echo int_table_color(); ?>>
<td width=\"60%\" valign=\"top\"><span class=\"text\"><?php echo prompt_language("la_prompt_Backup_Path"); ?></span>
<?php
if(!$writable)
echo "<br /><span class=\"error\">".prompt_language("la_Text_backup_access")."</SPAN>";
?>
</td>
<TD>
<INPUT type="text" name="backup_path" class="text" size="50" value='<?php echo $objConfig->Get("Backup_Path"); ?>'><input TYPE="hidden" NAME="Action" VALUE="update"> <input type="submit" name="submit" value="Update" class="button">
</TD>
</TR>
</FORM>
</TABLE>
<?php
int_footer();
?>
Property changes on: trunk/admin/backup/backup1.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Event Timeline
Log In to Comment