mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-13 13:36:45 +02: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;
|
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…
x
Reference in New Issue
Block a user