示例#1
0
 function changeAdminPass()
 {
     if ($this->main->nname === 'admin') {
         $newp = client::createDbPass($this->main->realpass);
         //exec("mysqladmin -u kloxo -p$oldpass password $newp 2>&1", $out, $return);
         $sql = new Sqlite(null, "client");
         //$sql->rawQuery("grant all on kloxo.* to kloxo@'localhost' identified by $newp");
         //$sql->rawQuery("grant all on kloxo.* to kloxo@'%' identified by $newp");
         $return = $sql->setPassword($newp);
         dprint("i am here <br> \n");
         dprintr($return);
         dprint("i am here <br> \n");
         if ($return) {
             log_log("admin_error", "mysql change password Failed . {$out}");
             throw new lxException("could_not_change_admin_pass", '');
         }
         $return = lfile_put_contents("__path_admin_pass", $newp);
         if (!$return) {
             log_log("admin_error", "Admin pass change failed  {$last_error}");
             throw new lxException("could_not_change_admin_pass", '');
         }
     }
 }