function make_admin_menu() { global $dirs, $futurebb_user, $base_config; if (!file_exists(FORUM_ROOT . '/app_config/cache/admin_pages.php')) { CacheEngine::CacheAdminPages(); } include FORUM_ROOT . '/app_config/cache/admin_pages.php'; ?> <div class="forum_content leftmenu"> <h2 class="boxtitle">Administration</h2> <ul class="leftnavlist"> <?php if ($futurebb_user['g_admin_privs']) { $p = $admin_pages; } else { $p = $mod_pages; } foreach ($p as $key => $val) { echo '<li'; if ($dirs[2] == $key) { echo ' class="active"'; } echo '><a href="' . $base_config['baseurl'] . '/admin/' . $key . '">' . htmlspecialchars(translate($val)) . '</a></li>'; } ?> </ul> </div> <?php }
} return $text; } if (isset($_POST['form_sent'])) { if (futurebb_hash($_POST['confirmpwd']) == $futurebb_user['password']) { if (proper_line_breaks($_POST['mod_pages']) != base64_decode($futurebb_config['mod_pages'])) { $q = new DBInsert('interface_history', array('action' => 'edit', 'area' => 'interface', 'field' => 'mod_pages', 'user' => $futurebb_user['id'], 'time' => time(), 'old_value' => base64_decode($futurebb_config['mod_pages'])), 'Failed to update interface editing history'); $q->commit(); set_config('mod_pages', base64_encode(proper_line_breaks($_POST['mod_pages']))); } if (proper_line_breaks($_POST['admin_pages']) != base64_decode($futurebb_config['admin_pages'])) { $q = new DBInsert('interface_history', array('action' => 'edit', 'area' => 'interface', 'field' => 'admin_pages', 'user' => $futurebb_user['id'], 'time' => time(), 'old_value' => base64_decode($futurebb_config['admin_pages'])), 'Failed to update interface editing history'); $q->commit(); set_config('admin_pages', base64_encode(proper_line_breaks($_POST['admin_pages']))); } CacheEngine::CacheAdminPages(); } else { echo '<p>Your password was incorrect. Please try again.</p>'; } } ?> <form action="<?php echo $base_config['baseurl']; ?> /admin/interface/admin_pages" method="post" enctype="multipart/form-data"> <p>Enter in the following format:<br /><code>url=>text</code></p> <p>The URL is simply the part that goes after <code><?php echo $base_config['baseurl']; ?> /admin/</code>, and the text is the language key to display in the link.</p> <h3>Administrator link list</h3>
static function remove_admin_menu($url) { global $futurebb_config; $lines = explode("\n", base64_decode($futurebb_config['admin_pages'])); foreach ($lines as $key => $line) { if (strpos($line, $url . '=>') === 0) { unset($lines[$key]); } } set_config('admin_pages', base64_encode(implode("\n", $lines))); $lines = explode("\n", base64_decode($futurebb_config['mod_pages'])); foreach ($lines as $key => $line) { if (strpos($line, $url . '=>') === 0) { unset($lines[$key]); } } set_config('mod_pages', base64_encode(implode("\n", $lines))); if (file_exists(FORUM_ROOT . '/cache/admin_pages.php')) { //clear the cache unlink(FORUM_ROOT . '/cache/admin_pages.php'); } CacheEngine::CacheAdminPages(); }