-
Notifications
You must be signed in to change notification settings - Fork 7
/
zipit-db-menu.php
48 lines (39 loc) · 1.62 KB
/
zipit-db-menu.php
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
<?php
###############################################################
# Zipit Backup Utility
###############################################################
# Developed by Jereme Hancock for Cloud Sites
# Visit http://zipitbackup.com for updates
###############################################################
// include password protection
require_once("zipit-login.php");
$db_dir = "./dbs";
$show = array('.php');
$select = "<center><form name = \"db_form\"><select name=\"db_select\" onchange = \"showDBBackupButton();update(this);\"><option value='Select Database to Backup'>Select Database to Backup</option>\n";
$dh = @opendir($db_dir);
while(false !== ($file = readdir($dh))) {
$ext=substr($file,-4,4);
if (in_array($ext, $show)) {
$file = str_replace("-config.php", "", $file);
if ($file != "index.php") {
$select .= "<option value='$file'>$file</option>\n";
}
}
}
$select .= "</select><a href='#' class='update_db_menu' id='update_db_menu' onclick='updateDbMenu();' style='margin-left:10px;position:relative;top:5px;' title='Refresh Database Menu'><img src='images/refresh.png'/></a></form></center><br/>";
closedir($dh);
if ($dh = opendir($db_dir)) {
while(($file = readdir($dh)) !== false) {
if($file != "." && $file != ".." && $file != "index.php") {
$file_list[] = $file;
}
}
closedir($dh);
}
if (isset($file_list)) {
echo "$select";
}
else {
echo "<center><font color='red'>Use the \"Add Credentials\" button below to add your database connection information.</font></center><br/>";
}
?>