-
Notifications
You must be signed in to change notification settings - Fork 0
/
massupgrade.php
50 lines (36 loc) · 1.11 KB
/
massupgrade.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
49
50
<?php
//die ("Handbrake on!");
define("MASSUPGRADE",true);
if (!(include('config.php')))
die("Please configure the software");
if ($config['vhosts'] != 1) die("Not vhosted");
if ((!$config['massupgradepass'])||($config['massupgradepass'] != $_POST['pass']))
die("<html><body><form method='POST'><input type='password' name='pass'/><input type='submit'/></form></body></html>");
$done = Array();
$files = scandir("domains");
foreach ($files as $v)
{
if (!preg_match("/\.php$/",$v))
continue;
print "Attempting $v<br/>";
$config = Array(
'db_name' => "",
'db_user' => "",
'db_pass' => "",
'domain' => ""
);
include("domains/".$v);
if (($config['db_name'] == "") or
($config['db_user'] == "") or
($config['db_pass'] == "") or
($config['domain'] == ""))
{
print "$v failed (missing config info).<br/>";
continue;
}
mysql_connect("localhost", $config['db_user'], $config['db_pass']) or die("Could not connect");
mysql_select_db($config['db_name']) or die("Could not select database");
include ("upgrade.php");
mysql_close();
}
?>