Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1052286
backup1.php
No One
Temporary
Actions
Download 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
Fri, Jul 4, 10:36 AM
Size
4 KB
Mime Type
text/x-php
Expires
Sun, Jul 6, 10:36 AM (3 h, 32 m)
Engine
blob
Format
Raw Data
Handle
679518
Attached To
rINP In-Portal
backup1.php
View Options
<?php
// new startup: begin
define
(
'REL_PATH'
,
'admin/backup'
);
$relation_level
=
count
(
explode
(
'/'
,
REL_PATH
)
);
define
(
'FULL_PATH'
,
realpath
(
dirname
(
__FILE__
)
.
str_repeat
(
'/..'
,
$relation_level
)
)
);
require_once
FULL_PATH
.
'/kernel/startup.php'
;
// new startup: end
$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
=
adodb_mktime
();
$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
();
?>
Event Timeline
Log In to Comment