Fix SQL syntax (#2570)
This commit is contained in:
@@ -659,7 +659,7 @@ include "root.php";
|
|||||||
$this->write_progress("... superuser exists as '" . $this->admin_uuid . "', updating password");
|
$this->write_progress("... superuser exists as '" . $this->admin_uuid . "', updating password");
|
||||||
$sql = "update v_users ";
|
$sql = "update v_users ";
|
||||||
$sql .= "set password = '".md5($salt.$this->admin_password)."' ";
|
$sql .= "set password = '".md5($salt.$this->admin_password)."' ";
|
||||||
$sql .= "set salt = '$salt' ";
|
$sql .= ",salt = '$salt' ";
|
||||||
$sql .= "where USER_uuid = '".$this->admin_uuid."' ";
|
$sql .= "where USER_uuid = '".$this->admin_uuid."' ";
|
||||||
$this->write_debug($sql);
|
$this->write_debug($sql);
|
||||||
$this->dbh->exec(check_sql($sql));
|
$this->dbh->exec(check_sql($sql));
|
||||||
@@ -712,7 +712,7 @@ include "root.php";
|
|||||||
$prep_statement = $this->dbh->prepare(check_sql($sql));
|
$prep_statement = $this->dbh->prepare(check_sql($sql));
|
||||||
$prep_statement->execute();
|
$prep_statement->execute();
|
||||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||||
if ($row['count'] == 0) {
|
if ($row['count(*)'] == 0) {
|
||||||
$sql = "insert into v_contacts ";
|
$sql = "insert into v_contacts ";
|
||||||
$sql .= "(";
|
$sql .= "(";
|
||||||
$sql .= "domain_uuid, ";
|
$sql .= "domain_uuid, ";
|
||||||
@@ -742,7 +742,7 @@ include "root.php";
|
|||||||
$prep_statement = $this->dbh->prepare(check_sql($sql));
|
$prep_statement = $this->dbh->prepare(check_sql($sql));
|
||||||
$prep_statement->execute();
|
$prep_statement->execute();
|
||||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||||
if ($row['count'] == 0) {
|
if ($row['count(*)'] == 0) {
|
||||||
//add the user to the superadmin group
|
//add the user to the superadmin group
|
||||||
$sql = "insert into v_group_users ";
|
$sql = "insert into v_group_users ";
|
||||||
$sql .= "(";
|
$sql .= "(";
|
||||||
|
|||||||
Reference in New Issue
Block a user