Changeset 9345 for extensions/AdditionalPages/additional_page.php
- Timestamp:
- Feb 22, 2011, 11:32:59 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AdditionalPages/additional_page.php
r9323 r9345 2 2 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 5 function check_random_index_redirect() 6 { 7 global $conf; 8 9 if (!empty($conf['ap_random_index_redirect'])) 10 { 11 $random_index_redirect = array(); 12 foreach ($conf['ap_random_index_redirect'] as $random_url => $random_url_condition) 13 { 14 if (empty($random_url_condition) or eval($random_url_condition)) 15 { 16 $random_index_redirect[] = $random_url; 17 } 18 } 19 if (!empty($random_index_redirect)) 20 { 21 redirect($random_index_redirect[mt_rand(0, count($random_index_redirect)-1)]); 22 } 23 } 24 return true; 25 } 4 26 5 27 global $template, $user; … … 39 61 if ($user['level'] < $row['level']) 40 62 { 63 if ($page['ap_homepage'] and check_random_index_redirect()) return; 41 64 page_forbidden(l10n('You are not authorized to access the requested page')); 42 65 } … … 48 71 if (!in_array($user['status'], $authorized_users)) 49 72 { 50 if ($page['ap_homepage'] ) return;73 if ($page['ap_homepage'] and check_random_index_redirect()) return; 51 74 page_forbidden(l10n('You are not authorized to access the requested page')); 52 75 } … … 64 87 if (empty($groups)) 65 88 { 66 if ($page['ap_homepage'] ) return;89 if ($page['ap_homepage'] and check_random_index_redirect()) return; 67 90 page_forbidden(l10n('You are not authorized to access the requested page')); 68 91 }
Note: See TracChangeset
for help on using the changeset viewer.