Minor Change for Adding New MySQL User to Existing Database

This commit is contained in:
earnolmartin 2020-05-05 23:22:44 -06:00
parent 069290fd7a
commit d12b7c9669

View file

@ -3017,6 +3017,10 @@ function dbAddUser(){
if($this->recordcount($this->conf['mysqldbstable']['tablename'], "panelusername='$this->activeuser' and dbname='$dbname'")==0)
return $this->errorText("This database is not owned by your account.");
if(empty($domainname)){
$domainname = $this->getField($this->conf['mysqldbuserstable']['tablename'],'domainname',"panelusername='" . $this->activeuser . "' and dbname='" . $dbname . "'");
}
$q="grant all privileges on `$dbname`.* to '$dbusername'@'localhost' identified by '$dbuserpass' ";
$success=$success && $this->mysqlRootQuery($q);