|
| |
1 |
|
<?php |
|
| |
2 |
|
|
|
| |
3 |
|
|
|
| |
4 |
|
if(!strlen($pathtoroot)) |
|
| |
5 |
|
{ |
|
| |
6 |
|
$path=dirname(realpath(__FILE__)); |
|
| |
7 |
|
if(strlen($path)) |
|
| |
8 |
|
{ |
|
| |
9 |
|
|
|
| |
10 |
|
$pos = strpos($path,":"); |
|
| |
11 |
|
if ($pos === false) |
|
| |
12 |
|
{ |
|
| |
13 |
|
$gOS_TYPE="unix"; |
|
| |
14 |
|
$pathchar = "/"; |
|
| |
15 |
|
} |
|
| |
16 |
|
else |
|
| |
17 |
|
{ |
|
| |
18 |
|
$gOS_TYPE="win"; |
|
| |
19 |
|
$pathchar="\\"; |
|
| |
20 |
|
} |
|
| |
21 |
|
$p = $path.$pathchar; |
|
| |
22 |
|
|
|
| |
23 |
|
while(!strlen($pathtoroot) && strlen($p)) |
|
| |
24 |
|
{ |
|
| |
25 |
|
$sub = substr($p,strlen($pathchar)*-1); |
|
| |
26 |
|
if($sub==$pathchar) |
|
| |
27 |
|
{ |
|
| |
28 |
|
$filename = $p."root.flg"; |
|
| |
29 |
|
} |
|
| |
30 |
|
else |
|
| |
31 |
|
$filename = $p.$pathchar."root.flg"; |
|
| |
32 |
|
if(file_exists($filename)) |
|
| |
33 |
|
{ |
|
| |
34 |
|
$pathtoroot = $p; |
|
| |
35 |
|
} |
|
| |
36 |
|
else |
|
| |
37 |
|
{ |
|
| |
38 |
|
$parent = realpath($p.$pathchar."..".$pathchar); |
|
| |
39 |
|
if($parent!=$p) |
|
| |
40 |
|
{ |
|
| |
41 |
|
$p = $parent; |
|
| |
42 |
|
} |
|
| |
43 |
|
else |
|
| |
44 |
|
$p = ""; |
|
| |
45 |
|
} |
|
| |
46 |
|
} |
|
| |
47 |
|
if(!strlen($pathtoroot)) |
|
| |
48 |
|
$pathtoroot = ".".$pathchar; |
|
| |
49 |
|
} |
|
| |
50 |
|
else |
|
| |
51 |
|
{ |
|
| |
52 |
|
$pathtoroot = ".".$pathchar; |
|
| |
53 |
|
} |
|
| |
54 |
|
} |
|
| |
55 |
|
|
|
| |
56 |
|
$sub = substr($pathtoroot,strlen($pathchar)*-1); |
|
| |
57 |
|
if($sub!=$pathchar) |
|
| |
58 |
|
{ |
|
| |
59 |
|
$pathtoroot = $pathtoroot.$pathchar; |
|
| |
60 |
|
} |
|
| |
61 |
|
|
|
| |
62 |
|
|
|
| |
63 |
|
require_once($pathtoroot."kernel/startup.php"); |
|
| |
64 |
|
$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path"); |
|
| |
65 |
|
$admin = $objConfig->Get("AdminDirectory"); |
|
| |
66 |
|
if(!strlen($admin)) |
|
| |
67 |
|
$admin = "admin"; |
|
| |
68 |
|
$adminURL = $rootURL.$admin; |
|
| |
69 |
|
$localURL=$rootURL."kernel/"; |
|
| |
70 |
|
$imagesURL = $rootURL."admin/images"; |
|
| |
71 |
|
|
|
| |
72 |
|
$pathtolocal = $pathtoroot."kernel/"; |
|
| |
73 |
|
require_once ($pathtoroot."admin/include/elements.php"); |
|
| |
74 |
|
require_once ($pathtoroot."kernel/admin/include/navmenu.php"); |
|
| |
75 |
|
require_once ($pathtolocal."admin/include/navmenu.php"); |
|
| |
76 |
|
require_once($pathtoroot."admin/toolbar.php"); |
|
| |
77 |
|
|
|
| |
78 |
|
$section = "in-portal:restore"; |
|
| |
79 |
|
|
|
| |
80 |
|
$envar = "env=" . BuildEnv(); |
|
| |
81 |
|
global $tables; |
|
| |
82 |
|
unset($tables); |
|
| |
83 |
|
|
|
| |
84 |
|
|
|
| |
85 |
|
if($_POST["Action"]=="update") |
|
| |
86 |
|
{ |
|
| |
87 |
|
$newpath= $_POST["backup_path"]; |
|
| |
88 |
|
$newpath = str_replace('\\\\','\\',$newpath); |
|
| |
89 |
|
$objConfig->Set("Backup_Path",$newpath); |
|
| |
90 |
|
$objConfig->Save(); |
|
| |
91 |
|
|
|
| |
92 |
|
} |
|
| |
93 |
|
$filepath=$objConfig->Get("Backup_Path"); |
|
| |
94 |
|
|
|
| |
95 |
|
$limit = 100; |
|
| |
96 |
|
$success =0; |
|
| |
97 |
|
|
|
| |
98 |
|
$objSession->SetVariable("restore_filepath",$filepath); |
|
| |
99 |
|
$objSession->SetVariable("restore_success",0); |
|
| |
100 |
|
$objSession->SetVariable("restore_todo",""); |
|
| |
101 |
|
|
|
| |
102 |
|
$sec = $objSections->GetSection($section); |
|
| |
103 |
|
$objCatToolBar = new clsToolBar(); |
|
| |
104 |
|
|
|
| |
105 |
|
$ro_perm = $objSession->HasSystemPermission("SYSTEM_ACCESS.READONLY"); |
|
| |
106 |
|
|
|
| |
107 |
|
if (true) |
|
| |
108 |
|
{ |
|
| |
109 |
|
|
|
| |
110 |
|
if($en_prev>-1) |
|
| |
111 |
|
{ |
|
| |
112 |
|
$MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');"; |
|
| |
113 |
|
$MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');"; |
|
| |
114 |
|
$onClick= $sec->Get("onclick"); |
|
| |
115 |
|
$var="?env=".BuildEnv()."&en=$en_prev"; |
|
| |
116 |
|
$link=$PHP_SELF.$var; |
|
| |
117 |
|
$objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,"","tool_prev.gif"); |
|
| |
118 |
|
} |
|
| |
119 |
|
else |
|
| |
120 |
|
{ |
|
| |
121 |
|
$MouseOver=""; |
|
| |
122 |
|
$MouseOut=""; |
|
| |
123 |
|
$onClick=""; |
|
| |
124 |
|
$link="#"; |
|
| |
125 |
|
$objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),"#","","","","tool_prev_f3.gif"); |
|
| |
126 |
|
|
|
| |
127 |
|
} |
|
| |
128 |
|
if(true) |
|
| |
129 |
|
{ |
|
| |
130 |
|
$MouseOver="if (document.restore1.agree.checked == true) swap('moveright','toolbar/tool_next_f2.gif');"; |
|
| |
131 |
|
$MouseOut="if (document.restore1.agree.checked == true) swap('moveright', 'toolbar/tool_next.gif');"; |
|
| |
132 |
|
|
|
| |
133 |
|
|
|
| |
134 |
|
$var="?env=".BuildEnv()."&en=$en_next"; |
|
| |
135 |
|
$link2=$rootURL."admin/backup/restore2.php".$var; |
|
| |
136 |
|
$onClick="document.location= '$link2';"; |
|
| |
137 |
|
$onClick="if (document.restore1.agree.checked == true) document.restore1.submit();"; |
|
| |
138 |
|
|
|
| |
139 |
|
|
|
| |
140 |
|
$link="#"; |
|
| |
141 |
|
$objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,$onClick,"tool_next_f3.gif"); |
|
| |
142 |
|
} |
|
| |
143 |
|
|
|
| |
144 |
|
int_header($objCatToolBar,NULL,$title); |
|
| |
145 |
|
} |
|
| |
146 |
|
|
|
| |
147 |
|
$SubmitUrl = $ro_perm ? $adminURL.'/backup/restore1.php?'.$envar : $adminURL."/install.php"; |
|
| |
148 |
|
|
|
| |
149 |
|
?> |
|
| |
150 |
|
|
|
| |
151 |
|
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder"> |
|
| |
152 |
|
<form name="restore1" TARGET="<?php echo $ro_perm ? 'main' : '_top'; ?>" METHOD="POST" action="<?php echo $SubmitUrl; ?>"> |
|
| |
153 |
|
<?php int_subsection_title(prompt_language("la_Prompt_Warning")); ?> |
|
| |
154 |
|
<TR <?php echo int_table_color(); ?>> |
|
| |
155 |
|
<TD COLSPAN="2"><span class=\"text\"><?php echo prompt_language("la_Text_Restore_Heading"); ?> |
|
| |
156 |
|
</span> |
|
| |
157 |
|
</TD> |
|
| |
158 |
|
</TR> |
|
| |
159 |
|
|
|
| |
160 |
|
<TR <?php echo int_table_color(); ?>> |
|
| |
161 |
|
<td width=\"60%\" valign=\"top\"><span class=\"text\"><?php echo prompt_language("la_prompt_Root_Password"); ?></span></td> |
|
| |
162 |
|
<TD > |
|
| |
163 |
|
<INPUT type="password" name="UserPass" class="text" size="50" value=''> |
|
| |
164 |
|
</TD> |
|
| |
165 |
|
</TR> |
|
| |
166 |
|
|
|
| |
167 |
|
<tr <?php echo int_table_color(); ?>> |
|
| |
168 |
|
<TD COLSPAN="2"> |
|
| |
169 |
|
<?php |
|
| |
170 |
|
|
|
| |
171 |
|
|
|
| |
172 |
|
|
|
| |
173 |
|
|
|
| |
174 |
|
|
|
| |
175 |
|
|
|
| |
176 |
|
echo int_hint(prompt_language("la_text_disclaimer_part1")." ".prompt_language("la_text_disclaimer_part2")); |
|
| |
177 |
|
?> |
|
| |
178 |
|
</TD> |
|
| |
179 |
|
</tr> |
|
| |
180 |
|
<tr> |
|
| |
181 |
|
<td COLSPAN="2"> |
|
| |
182 |
|
<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> |
|
| |
183 |
|
</td> |
|
| |
184 |
|
</tr> |
|
| |
185 |
|
<input type=hidden name="state" value="reinstall_process"> |
|
| |
186 |
|
<input type=hidden name="install_type" value="8"> |
|
| |
187 |
|
<input type=hidden name="next_step" value="2"> |
|
| |
188 |
|
<input type=hidden name="UserName" value="root"> |
|
| |
189 |
|
<input type=hidden name="inp_opt" value="4"> |
|
| |
190 |
|
</FORM> |
|
| |
191 |
|
</TABLE> |
|
| |
192 |
|
<?php |
|
| |
193 |
|
int_footer(); |
|
| |
194 |
|
?> |