Commit d32f2372 authored by Steven Mondji-Lerider's avatar Steven Mondji-Lerider

Bugfixing upgrade script 3.0.0~3.php adding the special phpmyadmin user to dbusers table

parent 922c9be9
...@@ -7,11 +7,13 @@ if(!function_exists('mysql_connect')) { ...@@ -7,11 +7,13 @@ if(!function_exists('mysql_connect')) {
exit(1); exit(1);
} }
// we don't check our AlternC session // we don't check our AlternC session
if(!chdir("/var/alternc/bureau")) if(!chdir("/var/alternc/bureau"))
exit(1); exit(1);
require("/var/alternc/bureau/class/config_nochk.php"); require("/var/alternc/bureau/class/config_nochk.php");
$db2=new DB_System();
// we go super-admin // we go super-admin
$admin->enabled=1; $admin->enabled=1;
...@@ -37,10 +39,13 @@ $db->query("select distinct uid,login,pass from db;"); ...@@ -37,10 +39,13 @@ $db->query("select distinct uid,login,pass from db;");
//on insere dans dbusers avec enabled = admin //on insere dans dbusers avec enabled = admin
$query=array(); $query=array();
while($db->next_record()){ while($db->next_record()){
$query[]="insert into dbusers values('',".$db->f('uid').",'".$db->f('login')."','".$db->f('pass')."',\"ADMIN\");"; $db2->query("select id from dbusers where name ='".$db->f('login')."' and password='".$db->f('pass')."';");
if($db2->num_rows() ==0 ){
$query[]="insert ignore into dbusers values('',".$db->f('uid').",'".$db->f('login')."','".$db->f('pass')."',\"ADMIN\");";
}
} }
foreach ($query as $q){ foreach ($query as $q){
print_r($q);
$db->query($q); $db->query($q);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment