-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdatabase.php
More file actions
52 lines (43 loc) · 1007 Bytes
/
database.php
File metadata and controls
52 lines (43 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
//Flydragon<ipv6china@comsenz.com
$pageTitle="数据库管理";
include_once('common.php');
include_once("view/header.php");
$standalone='no';
if($authUser != $superAdmin) die("没有权限");
if($_SERVER['REQUEST_METHOD']=='GET'){
$mod=(!empty($_GET['mod']))?$_GET['mod']:'list';
//////////////
if($mod == 'list'){
$pageTitle='备份列表';
include_once('view/dblist.php');
}
//////////////
if($mod == 'del'){
$ver=$_GET['ver'];
if(unlink('data/backup/'.$ver.'.db')){
echo <<<EOF
<script language="JavaScript">
self.resizeTo(800,600);
alert('修改已经提交,窗口将自动关闭。');
window.close();
</script>
EOF;
}
}
//////////////
if($mod == 'change'){
$ver=$_GET['ver'];
restoreDatabase($ver, $redis);
}
//////////////
if($mod == 'view'){
$ver=$_GET['ver'];
$content=file_get_contents($dataBakDir.'/'.$ver.'.db');
print <<<EOT
<pre>
$content
</pre>
EOT;
}
}