bernd commited on 2010-12-30 10:32:44
Zeige 2 geänderte Dateien mit 9 Einfügungen und 4 Löschungen.
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1865 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -80,10 +80,12 @@ if (isset($_POST['accesseditor'])) |
80 | 80 |
if (isset($_POST['access']['new'])) |
81 | 81 |
{ |
82 | 82 |
$_POST['access'][$_POST['new_db']] = array(); |
83 |
- foreach ($users as $user) |
|
83 |
+ foreach ($users as $user) { |
|
84 | 84 |
$user = $user['username']; |
85 |
- if (in_array($user, $_POST['access']['new'])) |
|
85 |
+ if (in_array($user, $_POST['access']['new'])) { |
|
86 | 86 |
array_push($_POST['access'][$_POST['new_db']], $user); |
87 |
+ } |
|
88 |
+ } |
|
87 | 89 |
if (($_POST['new_user'] != '') and (in_array('new', $_POST['access']['new']))) |
88 | 90 |
array_push($_POST['access'][$_POST['new_db']], $_POST['new_user']); |
89 | 91 |
} |
... | ... |
@@ -93,11 +95,13 @@ if (isset($_POST['accesseditor'])) |
93 | 95 |
if ($_POST['new_user'] != '') |
94 | 96 |
{ |
95 | 97 |
create_mysql_account($_POST['new_user']); |
96 |
- foreach ($dbs as $db) |
|
98 |
+ foreach ($dbs as $db) { |
|
97 | 99 |
$db = $db['name']; |
98 |
- if (isset($_POST['access'][$db]) and (in_array('new', $_POST['access'][$db]))) |
|
100 |
+ if (isset($_POST['access'][$db]) and (in_array('new', $_POST['access'][$db]))) { |
|
99 | 101 |
array_push($_POST['access'][$db], $_POST['new_user']); |
100 | 102 |
} |
103 |
+ } |
|
104 |
+ } |
|
101 | 105 |
|
102 | 106 |
if (($_POST['new_user'] != '') or ($_POST['new_db'] != '')) |
103 | 107 |
{ |
... | ... |
@@ -63,6 +63,7 @@ function set_mysql_access($db, $account, $status) |
63 | 63 |
$uid = $_SESSION['userinfo']['uid']; |
64 | 64 |
$db = mysql_real_escape_string($db); |
65 | 65 |
$account = mysql_real_escape_string($account); |
66 |
+ DEBUG("User »{$account}« soll ".($status ? "" : "NICHT ")."auf die Datenbank »{$db}« zugreifen"); |
|
66 | 67 |
$query = ''; |
67 | 68 |
if ($status) |
68 | 69 |
{ |
69 | 70 |