Alternc  3.2
Alternc logiel libre pour l'hébergement
 All Data Structures Namespaces Files Functions Variables Pages
1.0.1.php
Go to the documentation of this file.
1 #!/usr/bin/php
2 <?php
3 
4  // We check that mysql php module is loaded
5 if(!function_exists('mysql_connect')) {
6  if(!dl("mysql.so"))
7  exit(1);
8 }
9 
10 // If we upgrade directly to 3.1 the panel directory change
11 $panel='';
12 if(chdir("/usr/share/alternc/panel")) $panel='/usr/share/alternc/panel';
13 elseif (chdir("/var/alternc/bureau")) $panel='/var/alternc/bureau';
14 
15 if (empty($panel)) { echo "Problem to load panel library"; exit(1); }
16 
17 require("$panel/class/config_nochk.php");
18 
19 // we go super-admin
20 $admin->enabled=1;
21 $dom->lock();
22 
23 // And we process the database changes :
24 $db->query("SELECT * FROM domaines;");
25 $domains=array();
26 while ($db->next_record()) {
27  $domains[]=array("dom"=>$db->Record["domaine"],"gesmx"=>$db->Record["gesmx"],"mx"=>$db->Record["mx"]);
28 }
29 foreach($domains as $v) {
30  if ($v["gesmx"]) {
31  $dom->alternc_add_mx_domain($v["dom"]);
32  } else {
33  $dom->set_sub_domain($v["dom"],"","mx",$v["mx"]);
34  }
35 }
36 
37 $dom->unlock();
38 
39 
40 ?>