Changeset 9345
- Timestamp:
- Feb 22, 2011, 11:32:59 AM (13 years ago)
- Location:
- extensions/AdditionalPages
- Files:
-
- 5 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 } -
extensions/AdditionalPages/admin/config.inc.php
r9323 r9345 74 74 75 75 // Parametrage du template 76 $template->assign('ap_conf', $conf['AP']); 76 $template->assign(array( 77 'ap_conf' => $conf['AP'], 78 'SHOW_MENU' => (!isset($mb_conf['mbAdditionalPages']) or $mb_conf['mbAdditionalPages'] > 0), 79 'AMM_INSTALLED' => defined('AMM_PATH'), 80 ) 81 ); 77 82 78 if ( !isset($mb_conf['mbAdditionalPages']) or $mb_conf['mbAdditionalPages'] == abs($mb_conf['mbAdditionalPages']))83 if (defined('AMM_PATH')) 79 84 { 80 $template->assign('SHOW_MENU', true); 85 load_language('plugin.lang', AMM_PATH); 86 $template->assign('AMM_URI', get_admin_plugin_menu_link(AMM_PATH.'admin/plugin_admin.php')); 81 87 } 82 88 -
extensions/AdditionalPages/admin/template/config.tpl
r9310 r9345 69 69 </li> 70 70 71 {if !$AMM_INSTALLED} 71 72 <li> 72 73 <label> 73 74 <span class="property">{'ap_show_menu'|@translate}</span> 74 <input type="checkbox" name="show_menu" id="show_menu" value="on" {if isset($SHOW_MENU)}checked="checked"{/if}/>75 <input type="checkbox" name="show_menu" id="show_menu" value="on" {if $SHOW_MENU}checked="checked"{/if}/> 75 76 </label> 76 77 </li> 78 {/if} 77 79 78 <li id="menu_name" {if ! isset($SHOW_MENU)}style="display:none;{/if}">80 <li id="menu_name" {if !$AMM_INSTALLED and !$SHOW_MENU}style="display:none;{/if}"> 79 81 <span class="property">{'ap_menu_name'|@translate} : 80 82 <select name="lang_desc_select" style="margin-left:30px;"> … … 88 90 </span> 89 91 </li> 92 93 {if $AMM_INSTALLED} 94 <li style="margin-top:40px;"> 95 <span class="property"><a href="{$AMM_URI}">{'g002_setmenu_nfo'|@translate}</a></span> 96 </li> 97 {/if} 90 98 </ul> 91 99 </fieldset> -
extensions/AdditionalPages/main.inc.php
r9323 r9345 22 22 if (!isset($conf['AP']['level_perm'])) 23 23 include(AP_PATH.'admin/upgrade.inc.php'); 24 25 // Unset $conf['random_index_redirect'] if homepage is defined 26 if (!empty($conf['random_index_redirect']) and !is_null($conf['AP']['homepage'])) 27 { 28 $conf['ap_random_index_redirect'] = $conf['random_index_redirect']; 29 $conf['random_index_redirect'] = array(); 30 } 24 31 25 32 // Admin menu -
extensions/AdditionalPages/maintain.inc.php
r9323 r9345 23 23 INDEX (pos) , 24 24 INDEX (lang)) 25 DEFAULT CHARACTER SET utf8;'; 26 pwg_query($query); 25 DEFAULT CHARACTER SET utf8'; 26 if ('mysql' == $conf['dblayer']) 27 { 28 $query .= ' ENGINE=MYISAM'; 29 } 30 pwg_query($query.';'); 27 31 } 28 32
Note: See TracChangeset
for help on using the changeset viewer.