mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-25 20:31:31 +02:00
fix not being able to create new password, after r53051: allow to specify multiple ;-separated hosts for database
This commit is contained in:
parent
dc78a9987b
commit
0cd038b71f
@ -600,11 +600,13 @@ class egw extends egw_minimal
|
|||||||
_egw_log_exception($ex);
|
_egw_log_exception($ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* not needed as rpm uses /etc/cron.d/egroupware
|
||||||
// call the asyncservice check_run function if it is not explicitly set to cron-only
|
// call the asyncservice check_run function if it is not explicitly set to cron-only
|
||||||
if (!$GLOBALS['egw_info']['server']['asyncservice']) // is default
|
if (!$GLOBALS['egw_info']['server']['asyncservice']) // is default
|
||||||
{
|
{
|
||||||
ExecMethod('phpgwapi.asyncservice.check_run','fallback');
|
ExecMethod('phpgwapi.asyncservice.check_run','fallback');
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
$this->db->disconnect();
|
$this->db->disconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -584,6 +584,8 @@ class egw_db
|
|||||||
}
|
}
|
||||||
unset($this->Link_ID);
|
unset($this->Link_ID);
|
||||||
$this->Link_ID = 0;
|
$this->Link_ID = 0;
|
||||||
|
|
||||||
|
if (!empty($this->setupType)) $this->type = $this->setupType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1177,14 +1179,23 @@ class egw_db
|
|||||||
$currentPassword = $this->Password;
|
$currentPassword = $this->Password;
|
||||||
$currentDatabase = $this->Database;
|
$currentDatabase = $this->Database;
|
||||||
|
|
||||||
|
if ($adminname != '')
|
||||||
|
{
|
||||||
|
$this->User = $adminname;
|
||||||
|
$this->Password = $adminpasswd;
|
||||||
|
$this->Database = $this->Type == 'pgsql' ? 'template1' : 'mysql';
|
||||||
|
}
|
||||||
|
$this->disconnect();
|
||||||
|
|
||||||
$sqls = array();
|
$sqls = array();
|
||||||
switch ($this->Type)
|
switch ($this->Type)
|
||||||
{
|
{
|
||||||
case 'pgsql':
|
case 'pgsql':
|
||||||
$meta_db = 'template1';
|
|
||||||
$sqls[] = "CREATE DATABASE $currentDatabase";
|
$sqls[] = "CREATE DATABASE $currentDatabase";
|
||||||
break;
|
break;
|
||||||
case 'mysql':
|
case 'mysql':
|
||||||
|
case 'mysqli':
|
||||||
|
case 'mysqlt':
|
||||||
$create = "CREATE DATABASE `$currentDatabase`";
|
$create = "CREATE DATABASE `$currentDatabase`";
|
||||||
if ($charset && isset($this->Link_ID->charset2mysql[$charset]) && (float) $this->ServerInfo['version'] >= 4.1)
|
if ($charset && isset($this->Link_ID->charset2mysql[$charset]) && (float) $this->ServerInfo['version'] >= 4.1)
|
||||||
{
|
{
|
||||||
@ -1192,19 +1203,11 @@ class egw_db
|
|||||||
}
|
}
|
||||||
$sqls[] = $create;
|
$sqls[] = $create;
|
||||||
$sqls[] = "GRANT ALL ON `$currentDatabase`.* TO $currentUser@'$grant_host' IDENTIFIED BY ".$this->quote($currentPassword);
|
$sqls[] = "GRANT ALL ON `$currentDatabase`.* TO $currentUser@'$grant_host' IDENTIFIED BY ".$this->quote($currentPassword);
|
||||||
$meta_db = 'mysql';
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
echo "<p>db::create_database(user='$adminname',\$pw) not yet implemented for DB-type '$this->Type'</p>\n";
|
echo "<p>db::create_database(user='$adminname',\$pw) not yet implemented for DB-type '$this->Type'</p>\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ($adminname != '')
|
|
||||||
{
|
|
||||||
$this->User = $adminname;
|
|
||||||
$this->Password = $adminpasswd;
|
|
||||||
$this->Database = $meta_db;
|
|
||||||
}
|
|
||||||
$this->disconnect();
|
|
||||||
foreach($sqls as $sql)
|
foreach($sqls as $sql)
|
||||||
{
|
{
|
||||||
$this->query($sql,__LINE__,__FILE__);
|
$this->query($sql,__LINE__,__FILE__);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user