bernd commited on 2007-06-18 07:32:07
Zeige 2 geänderte Dateien mit 14 Einfügungen und 0 Löschungen.
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@510 87cf0b9e-d624-0410-a070-f6ee81989793
| ... | ... |
@@ -55,6 +55,7 @@ function create_jabber_account($local, $domain, $password) |
| 55 | 55 |
$result = mysql_query($query); |
| 56 | 56 |
if (mysql_num_rows($result) == 0) |
| 57 | 57 |
{
|
| 58 |
+ logger("modules/jabber/include/jabberaccounts.php", "jabber", "attempt to create account for invalid domain »{$domain}«");
|
|
| 58 | 59 |
system_failure("Invalid domain!");
|
| 59 | 60 |
} |
| 60 | 61 |
} |
| ... | ... |
@@ -70,12 +71,14 @@ function create_jabber_account($local, $domain, $password) |
| 70 | 71 |
$result = mysql_query($query); |
| 71 | 72 |
if (mysql_num_rows($result) > 0) |
| 72 | 73 |
{
|
| 74 |
+ logger("modules/jabber/include/jabberaccounts.php", "jabber", "attempt to create already existing account »{$local}@{$domain}«");
|
|
| 73 | 75 |
system_failure("Diesen Account gibt es bereits!");
|
| 74 | 76 |
} |
| 75 | 77 |
|
| 76 | 78 |
$query = "INSERT INTO jabber.accounts (customerno,local,domain,password) VALUES ({$customerno}, '{$local}', {$domain}, '{$password}');";
|
| 77 | 79 |
DEBUG($query); |
| 78 | 80 |
mysql_query($query); |
| 81 |
+ logger("modules/jabber/include/jabberaccounts.php", "jabber", "created account »{$local}@{$domain}«");
|
|
| 79 | 82 |
} |
| 80 | 83 |
|
| 81 | 84 |
|
| ... | ... |
@@ -90,6 +93,7 @@ function change_jabber_password($id, $newpass) |
| 90 | 93 |
$query = "UPDATE jabber.accounts SET password='{$newpass}' WHERE customerno={$customerno} AND id={$id} LIMIT 1";
|
| 91 | 94 |
DEBUG($query); |
| 92 | 95 |
mysql_query($query); |
| 96 |
+ logger("modules/jabber/include/jabberaccounts.php", "jabber", "changed password for account »{$id}«");
|
|
| 93 | 97 |
} |
| 94 | 98 |
|
| 95 | 99 |
|
| ... | ... |
@@ -104,6 +108,7 @@ function delete_jabber_account($id) |
| 104 | 108 |
$query = "UPDATE jabber.accounts SET `delete`=1 WHERE customerno={$customerno} AND id={$id} LIMIT 1";
|
| 105 | 109 |
DEBUG($query); |
| 106 | 110 |
mysql_query($query); |
| 111 |
+ logger("modules/jabber/include/jabberaccounts.php", "jabber", "deleted account »{$id}«");
|
|
| 107 | 112 |
} |
| 108 | 113 |
|
| 109 | 114 |
?> |
| ... | ... |
@@ -57,12 +57,14 @@ function set_mysql_access($db, $account, $status) |
| 57 | 57 |
if (get_mysql_access($db, $account)) |
| 58 | 58 |
return NULL; |
| 59 | 59 |
$query = "INSERT INTO misc.mysql_access (`database`,user) VALUES ((SELECT id FROM misc.mysql_database WHERE name='{$db}' AND useraccount={$uid} LIMIT 1), (SELECT id FROM misc.mysql_accounts WHERE username='{$account}' AND useraccount={$uid}));";
|
| 60 |
+ logger("modules/mysql/include/mysql.php", "mysql", "granting access on »{$db}« to »{$account}«");
|
|
| 60 | 61 |
} |
| 61 | 62 |
else |
| 62 | 63 |
{
|
| 63 | 64 |
if (! get_mysql_access($db, $account)) |
| 64 | 65 |
return NULL; |
| 65 | 66 |
$query = "DELETE FROM misc.mysql_access WHERE `database`=(SELECT id FROM misc.mysql_database WHERE name='{$db}' AND useraccount={$uid} LIMIT 1) AND user=(SELECT id FROM misc.mysql_accounts WHERE username='{$account}' AND useraccount={$uid});";
|
| 67 |
+ logger("modules/mysql/include/mysql.php", "mysql", "revoking access on »{$db}« from »{$account}«");
|
|
| 66 | 68 |
} |
| 67 | 69 |
DEBUG($query); |
| 68 | 70 |
mysql_query($query); |
| ... | ... |
@@ -75,11 +77,13 @@ function create_mysql_account($username) |
| 75 | 77 |
{
|
| 76 | 78 |
if (! validate_mysql_dbname($username)) |
| 77 | 79 |
{
|
| 80 |
+ logger("modules/mysql/include/mysql.php", "mysql", "illegal username »{$username}«");
|
|
| 78 | 81 |
input_error("Der eingegebene Benutzername entspricht leider nicht der Konvention. Bitte tragen Sie einen passenden Namen ein.");
|
| 79 | 82 |
return NULL; |
| 80 | 83 |
} |
| 81 | 84 |
$uid = $_SESSION['userinfo']['uid']; |
| 82 | 85 |
$username = mysql_real_escape_string($username); |
| 86 |
+ logger("modules/mysql/include/mysql.php", "mysql", "creating user »{$username}«");
|
|
| 83 | 87 |
mysql_query("INSERT INTO misc.mysql_accounts (username, password, useraccount) VALUES ('$username', '!', $uid);");
|
| 84 | 88 |
if (mysql_error()) |
| 85 | 89 |
system_failure(mysql_error()); |
| ... | ... |
@@ -90,6 +94,7 @@ function delete_mysql_account($username) |
| 90 | 94 |
{
|
| 91 | 95 |
$username = mysql_real_escape_string($username); |
| 92 | 96 |
$uid = $_SESSION['userinfo']['uid']; |
| 97 |
+ logger("modules/mysql/include/mysql.php", "mysql", "deleting user »{$username}«");
|
|
| 93 | 98 |
mysql_query("DELETE FROM misc.mysql_accounts WHERE username='{$username}' AND useraccount='{$uid}' LIMIT 1;");
|
| 94 | 99 |
if (mysql_error()) |
| 95 | 100 |
system_failure(mysql_error()); |
| ... | ... |
@@ -100,11 +105,13 @@ function create_mysql_database($dbname) |
| 100 | 105 |
{
|
| 101 | 106 |
if (! validate_mysql_dbname($dbname)) |
| 102 | 107 |
{
|
| 108 |
+ logger("modules/mysql/include/mysql.php", "mysql", "illegal db-name »{$dbname}«");
|
|
| 103 | 109 |
input_error("Der eingegebene Datenbankname entspricht leider nicht der Konvention. Bitte tragen Sie einen passenden Namen ein.");
|
| 104 | 110 |
return NULL; |
| 105 | 111 |
} |
| 106 | 112 |
$dbname = mysql_real_escape_string($dbname); |
| 107 | 113 |
$uid = $_SESSION['userinfo']['uid']; |
| 114 |
+ logger("modules/mysql/include/mysql.php", "mysql", "creating database »{$dbname}«");
|
|
| 108 | 115 |
mysql_query("INSERT INTO misc.mysql_database (name, useraccount) VALUES ('$dbname', $uid);");
|
| 109 | 116 |
if (mysql_error()) |
| 110 | 117 |
system_failure(mysql_error()); |
| ... | ... |
@@ -115,6 +122,7 @@ function delete_mysql_database($dbname) |
| 115 | 122 |
{
|
| 116 | 123 |
$dbname = mysql_real_escape_string($dbname); |
| 117 | 124 |
$uid = $_SESSION['userinfo']['uid']; |
| 125 |
+ logger("modules/mysql/include/mysql.php", "mysql", "removing database »{$dbname}«");
|
|
| 118 | 126 |
mysql_query("DELETE FROM misc.mysql_database WHERE name='{$dbname}' AND useraccount='{$uid}' LIMIT 1;");
|
| 119 | 127 |
if (mysql_error()) |
| 120 | 128 |
system_failure(mysql_error()); |
| ... | ... |
@@ -141,6 +149,7 @@ function set_mysql_password($username, $password) |
| 141 | 149 |
$username = mysql_real_escape_string($username); |
| 142 | 150 |
$password = mysql_real_escape_string($password); |
| 143 | 151 |
$uid = $_SESSION['userinfo']['uid']; |
| 152 |
+ logger("modules/mysql/include/mysql.php", "mysql", "updating password for »{$username}«");
|
|
| 144 | 153 |
$query = "UPDATE misc.mysql_accounts SET password=PASSWORD('$password') WHERE username='$username' AND useraccount=$uid;";
|
| 145 | 154 |
DEBUG($query); |
| 146 | 155 |
mysql_query($query); |
| 147 | 156 |