Commit 216fc122 authored by Steven Mondji-Lerider's avatar Steven Mondji-Lerider

adding a second script in stable branch for adding phpmyadmin user for the...

adding a second script in stable branch for adding phpmyadmin user for the upgrades that failed to add it.
parent 9b80e234
......@@ -546,6 +546,7 @@ install/upgrades/3.0.0~1.sql -text
install/upgrades/3.0.0~2.sh -text
install/upgrades/3.0.0~3.php -text
install/upgrades/3.0.0~4.sh -text
install/upgrades/3.0.1.php -text
install/upgrades/README -text
lang/.svnignore -text
lang/README -text
......
#!/usr/bin/php
<?php
// We check that mysql php module is loaded
if(!function_exists('mysql_connect')) {
if(!dl("mysql.so"))
exit(1);
}
// we don't check our AlternC session
if(!chdir("/var/alternc/bureau"))
exit(1);
require("/var/alternc/bureau/class/config_nochk.php");
$db2=new DB_System();
// we go super-admin
$admin->enabled=1;
$db->query("select distinct uid,login,pass from db;");
//on insere dans dbusers avec enabled = admin
$query=array();
while($db->next_record()){
$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){
$db->query($q);
}
?>
//done ? :)
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