root/ip/tags/release_1_3_0_53/adm/admin_ug_auth.php
| 111 | 163 | ||
|---|---|---|---|
263 | else | 263 | else |
264 | { | 264 | { |
265 | $change_acl_list = array(); | 265 | $change_acl_list = array(); |
266 | $used_forums = array(); | 266 | $forums_processed = array(); |
267 | for($j = 0; $j < count($forum_auth_fields); $j++) | 267 | for($j = 0; $j < count($forum_auth_fields); $j++) |
268 | { | 268 | { |
269 | $auth_field = $forum_auth_fields[$j]; | 269 | $auth_field = $forum_auth_fields[$j]; |
270 | while(list($forum_id, $value) = @each($_POST['private_' . $auth_field])) | 270 | while(list($forum_id, $value) = @each($_POST['private_' . $auth_field])) |
271 | { | 271 | { |
272 | $change_acl_list[$forum_id][$auth_field] = $value; | 272 | // Mighty Gorgon: I have moved this part of code in this cycle to be able to use $forum_id var, otherwhise it was not assigned... |
273 | } | 273 | // FORUMS AUTH MOVED CODE - BEGIN |
274 | 274 | if (!isset($forums_processed[$forum_id])) | |
275 | if (!isset($used_forums[$forum_id])) | ||
276 | { | 275 | { |
277 | $sql = ($mode == 'user') ? ("SELECT aa.*, g.group_single_user FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug,
" . GROUPS_TABLE. " g WHERE ug.user_id = $user_id AND g.group_id = ug.group_id AND aa.group_id = ug.group_id AND aa.forum_id = $forum_id AND
g.group_single_user = 1") : ("SELECT * FROM " . AUTH_ACCESS_TABLE . " WHERE group_id = $group_id AND forum_id = $forum_id"); | 276 | $sql = ($mode == 'user') ? ("SELECT aa.*, g.group_single_user FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug,
" . GROUPS_TABLE. " g WHERE ug.user_id = $user_id AND g.group_id = ug.group_id AND aa.group_id = ug.group_id AND aa.forum_id = $forum_id AND
g.group_single_user = 1") : ("SELECT * FROM " . AUTH_ACCESS_TABLE . " WHERE group_id = $group_id AND forum_id = $forum_id"); |
278 | if (!($result = $db->sql_query($sql))) | 277 | if (!($result = $db->sql_query($sql))) |
... | ... | ||
286 | $change_acl_list[$forum_id][$forum_auth_fields[$k]] = $row[$forum_auth_fields[$k]]; | 285 | $change_acl_list[$forum_id][$forum_auth_fields[$k]] = $row[$forum_auth_fields[$k]]; |
287 | } | 286 | } |
288 | } | 287 | } |
289 | $used_forums[$forum_id] = 1; | 288 | $forums_processed[$forum_id] = 1; |
289 | } | ||
290 | /* | ||
291 | */ | ||
292 | // FORUMS AUTH MOVED CODE - END | ||
293 | $change_acl_list[$forum_id][$auth_field] = $value; | ||
290 | } | 294 | } |
291 | } | 295 | } |
292 | } | 296 | } |
... | ... | ||
350 | { | 354 | { |
351 | $auth_field = $forum_auth_fields[$j]; | 355 | $auth_field = $forum_auth_fields[$j]; |
352 | 356 | ||
353 | if($forum_access[$i][$auth_field] == AUTH_ACL && isset($change_acl_list[$forum_id][$auth_field])) | 357 | if(($forum_access[$i][$auth_field] == AUTH_ACL) && isset($change_acl_list[$forum_id][$auth_field])) |
354 | { | 358 | { |
355 | if ((empty($auth_access[$forum_id]['auth_mod']) && | 359 | if ((empty($auth_access[$forum_id]['auth_mod']) && |
356 | (isset($auth_access[$forum_id][$auth_field]) && $change_acl_list[$forum_id][$auth_field] != $auth_access[$forum_id][$auth_field]) || | 360 | (isset($auth_access[$forum_id][$auth_field]) && ($change_acl_list[$forum_id][$auth_field] != $auth_access[$forum_id][$auth_field])) || |
357 | (!isset($auth_access[$forum_id][$auth_field]) && !empty($change_acl_list[$forum_id][$auth_field]))) || | 361 | (!isset($auth_access[$forum_id][$auth_field]) && !empty($change_acl_list[$forum_id][$auth_field]))) || |
358 | !empty($update_mod_status[$forum_id]) | 362 | !empty($update_mod_status[$forum_id]) |
359 | ) | 363 | ) |
... | ... | ||
374 | } | 378 | } |
375 | } | 379 | } |
376 | elseif ((empty($auth_access[$forum_id]['auth_mod']) && | 380 | elseif ((empty($auth_access[$forum_id]['auth_mod']) && |
377 | (isset($auth_access[$forum_id][$auth_field]) && $change_acl_list[$forum_id][$auth_field] == $auth_access[$forum_id][$auth_field])) && $forum_auth_action[$forum_id] == 'delete') | 381 | (isset($auth_access[$forum_id][$auth_field]) && ($change_acl_list[$forum_id][$auth_field] == $auth_access[$forum_id][$auth_field]))) && ($forum_auth_action[$forum_id] == 'delete')) |
378 | { | 382 | { |
379 | $forum_auth_action[$forum_id] = 'update'; | 383 | $forum_auth_action[$forum_id] = 'update'; |
380 | } | 384 | } |
... | ... | ||
1031 | 1035 | ||
1032 | 'U_USER_OR_GROUP' => append_sid('admin_ug_auth.' . PHP_EXT), | 1036 | 'U_USER_OR_GROUP' => append_sid('admin_ug_auth.' . PHP_EXT), |
1033 | 'U_SWITCH_MODE' => $u_switch_mode, | 1037 | 'U_SWITCH_MODE' => $u_switch_mode, |
1034 | 'SPACER' => './../' . $images['spacer'], | ||
1035 | 'INC_SPAN' => $max_level + 1, | 1038 | 'INC_SPAN' => $max_level + 1, |
1036 | 'S_COLUMN_SPAN' => $s_column_span + $max_level+2, | 1039 | 'S_COLUMN_SPAN' => $s_column_span + $max_level+2, |
1037 | 'S_AUTH_ACTION' => append_sid('admin_ug_auth.' . PHP_EXT), | 1040 | 'S_AUTH_ACTION' => append_sid('admin_ug_auth.' . PHP_EXT), |
Download diff