Index: extensions/AdditionalPages/additional_page.php
===================================================================
--- extensions/AdditionalPages/additional_page.php	(revision 9344)
+++ extensions/AdditionalPages/additional_page.php	(revision 9345)
@@ -2,4 +2,26 @@
 
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+function check_random_index_redirect()
+{
+  global $conf;
+
+  if (!empty($conf['ap_random_index_redirect']))
+  {
+    $random_index_redirect = array();
+    foreach ($conf['ap_random_index_redirect'] as $random_url => $random_url_condition)
+    {
+      if (empty($random_url_condition) or eval($random_url_condition))
+      {
+        $random_index_redirect[] = $random_url;
+      }
+    }
+    if (!empty($random_index_redirect))
+    {
+      redirect($random_index_redirect[mt_rand(0, count($random_index_redirect)-1)]);
+    }
+  }
+  return true;
+}
 
 global $template, $user;
@@ -39,4 +61,5 @@
   if ($user['level'] < $row['level'])
   {
+    if ($page['ap_homepage'] and check_random_index_redirect()) return;
     page_forbidden(l10n('You are not authorized to access the requested page'));
   }
@@ -48,5 +71,5 @@
     if (!in_array($user['status'], $authorized_users))
     {
-      if ($page['ap_homepage']) return;
+      if ($page['ap_homepage'] and check_random_index_redirect()) return;
       page_forbidden(l10n('You are not authorized to access the requested page'));
     }
@@ -64,5 +87,5 @@
     if (empty($groups))
     {
-      if ($page['ap_homepage']) return;
+      if ($page['ap_homepage'] and check_random_index_redirect()) return;
       page_forbidden(l10n('You are not authorized to access the requested page'));
     }
Index: extensions/AdditionalPages/admin/config.inc.php
===================================================================
--- extensions/AdditionalPages/admin/config.inc.php	(revision 9344)
+++ extensions/AdditionalPages/admin/config.inc.php	(revision 9345)
@@ -74,9 +74,15 @@
 
 // Parametrage du template
-$template->assign('ap_conf', $conf['AP']);
+$template->assign(array(
+  'ap_conf' => $conf['AP'],
+  'SHOW_MENU' => (!isset($mb_conf['mbAdditionalPages']) or $mb_conf['mbAdditionalPages'] > 0),
+  'AMM_INSTALLED' => defined('AMM_PATH'),
+  )
+);
 
-if (!isset($mb_conf['mbAdditionalPages']) or $mb_conf['mbAdditionalPages'] == abs($mb_conf['mbAdditionalPages']))
+if (defined('AMM_PATH'))
 {
-  $template->assign('SHOW_MENU', true);
+  load_language('plugin.lang', AMM_PATH);
+  $template->assign('AMM_URI', get_admin_plugin_menu_link(AMM_PATH.'admin/plugin_admin.php'));
 }
 
Index: extensions/AdditionalPages/admin/template/config.tpl
===================================================================
--- extensions/AdditionalPages/admin/template/config.tpl	(revision 9344)
+++ extensions/AdditionalPages/admin/template/config.tpl	(revision 9345)
@@ -69,12 +69,14 @@
     </li>
 
+    {if !$AMM_INSTALLED}
     <li>
       <label>
         <span class="property">{'ap_show_menu'|@translate}</span>
-        <input type="checkbox" name="show_menu" id="show_menu" value="on" {if isset($SHOW_MENU)}checked="checked"{/if}/>
+        <input type="checkbox" name="show_menu" id="show_menu" value="on" {if $SHOW_MENU}checked="checked"{/if}/>
       </label>
     </li>
+    {/if}
 
-    <li id="menu_name" {if !isset($SHOW_MENU)}style="display:none;{/if}">
+    <li id="menu_name" {if !$AMM_INSTALLED and !$SHOW_MENU}style="display:none;{/if}">
       <span class="property">{'ap_menu_name'|@translate} :
         <select name="lang_desc_select" style="margin-left:30px;">
@@ -88,4 +90,10 @@
       </span>
     </li>
+
+    {if $AMM_INSTALLED}
+    <li style="margin-top:40px;">
+      <span class="property"><a href="{$AMM_URI}">{'g002_setmenu_nfo'|@translate}</a></span>
+    </li>
+    {/if}
   </ul>
 </fieldset>
Index: extensions/AdditionalPages/main.inc.php
===================================================================
--- extensions/AdditionalPages/main.inc.php	(revision 9344)
+++ extensions/AdditionalPages/main.inc.php	(revision 9345)
@@ -22,4 +22,11 @@
 if (!isset($conf['AP']['level_perm']))
   include(AP_PATH.'admin/upgrade.inc.php');
+
+// Unset $conf['random_index_redirect'] if homepage is defined
+if (!empty($conf['random_index_redirect']) and !is_null($conf['AP']['homepage']))
+{
+  $conf['ap_random_index_redirect'] = $conf['random_index_redirect'];
+  $conf['random_index_redirect'] = array();
+}
 
 // Admin menu
Index: extensions/AdditionalPages/maintain.inc.php
===================================================================
--- extensions/AdditionalPages/maintain.inc.php	(revision 9344)
+++ extensions/AdditionalPages/maintain.inc.php	(revision 9345)
@@ -23,6 +23,10 @@
 INDEX (pos) ,
 INDEX (lang))
-DEFAULT CHARACTER SET utf8;';
-    pwg_query($query);
+DEFAULT CHARACTER SET utf8';
+    if ('mysql' == $conf['dblayer'])
+    {
+      $query .= ' ENGINE=MYISAM';
+    }
+    pwg_query($query.';');
   }
 
