Do not grant all privileges to operators by default

This commit is contained in:
Dmitriy Simushev 2013-04-26 10:47:32 +00:00
parent 2d08fda940
commit 081c4a88a2

View File

@ -93,7 +93,7 @@ $dbtables = array(
"idisabled" => "int DEFAULT 0", "idisabled" => "int DEFAULT 0",
"vcavatar" => "varchar(255)", "vcavatar" => "varchar(255)",
"vcjabbername" => "varchar(255)", "vcjabbername" => "varchar(255)",
"iperm" => "int DEFAULT 65535", "iperm" => "int DEFAULT 0", /* Do not grant all privileges by default */
"dtmrestore" => "int NOT NULL DEFAULT 0", "dtmrestore" => "int NOT NULL DEFAULT 0",
"vcrestoretoken" => "varchar(64)", "vcrestoretoken" => "varchar(64)",
), ),
@ -254,6 +254,7 @@ function create_table($id, $link)
if ($id == "${mysqlprefix}chatoperator") { if ($id == "${mysqlprefix}chatoperator") {
// Create First Administrator // Create First Administrator
// Grant all privileges by default only for First Administrator
mysql_query( mysql_query(
"INSERT INTO ${mysqlprefix}chatoperator ( " . "INSERT INTO ${mysqlprefix}chatoperator ( " .
"vclogin, " . "vclogin, " .
@ -261,14 +262,16 @@ function create_table($id, $link)
"vclocalename, " . "vclocalename, " .
"vccommonname, " . "vccommonname, " .
"vcavatar, " . "vcavatar, " .
"vcemail " . "vcemail, " .
"iperm " .
") values ( " . ") values ( " .
"'admin', " . "'admin', " .
"MD5(''), " . "MD5(''), " .
"'', " . "'', " .
"'Administrator', " . "'Administrator', " .
"'Administrator', " . "'Administrator', " .
"''" . "'', " .
"65535" .
")", ")",
$link $link
); );