Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1055358
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
Tue, Jul 8, 6:21 AM
Size
6 KB
Mime Type
text/x-diff
Expires
Thu, Jul 10, 6:21 AM (8 h, 37 m)
Engine
blob
Format
Raw Data
Handle
680879
Attached To
rINP In-Portal
in-portal
View Options
Index: trunk/admin/backup/backup1.php
===================================================================
--- trunk/admin/backup/backup1.php (revision 214)
+++ trunk/admin/backup/backup1.php (revision 215)
@@ -1,202 +1,202 @@
<?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")
+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.2
\ No newline at end of property
+1.3
\ No newline at end of property
Event Timeline
Log In to Comment