mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 17:14:36 +01:00
Add real createdatabase() function for mssql - partial fix for 885687
This commit is contained in:
parent
742e25401a
commit
e50524c3ec
@ -371,5 +371,32 @@
|
||||
{
|
||||
return False;
|
||||
}
|
||||
function CreateDatabase($adminname='', $adminpasswd='')
|
||||
{
|
||||
$currentUser = $this->User;
|
||||
$currentPassword = $this->Password;
|
||||
$currentDatabase = $this->Database;
|
||||
|
||||
if($adminname != '')
|
||||
{
|
||||
$this->User = $adminname;
|
||||
$this->Password = $adminpasswd;
|
||||
$this->Database = 'master';
|
||||
}
|
||||
$this->disconnect();
|
||||
$outval = $this->query("CREATE DATABASE $currentDatabase");
|
||||
$this->disconnect();
|
||||
|
||||
if(!$outval)
|
||||
{
|
||||
echo 'Database creation failure <BR>';
|
||||
echo 'please setup the MSSQL database manually<BR>';
|
||||
}
|
||||
|
||||
$this->User = $currentUser;
|
||||
$this->Password = $currentPassword;
|
||||
$this->Database = $currentDatabase;
|
||||
$this->connect();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user