Exemplo n.º 1
0
 /**
  * Returns the single instance
  *
  * @access static
  * @return PMF_Helper_Administration
  */
 public static function getInstance()
 {
     if (null == self::$instance) {
         $className = __CLASS__;
         self::$instance = new $className();
     }
     return self::$instance;
 }
Exemplo n.º 2
0
 * @category  phpMyFAQ
 * @package   Administraion
 * @author    Thorsten Rinne <*****@*****.**>
 * @copyright 2003-2010 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
 * @link      http://www.phpmyfaq.de
 * @since     2003-02-26
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
if (isset($auth)) {
    $user = new PMF_User();
    $groupSupport = $user->perm instanceof PMF_Perm_PermMedium;
    $adminHelper = PMF_Helper_Administration::getInstance();
    $adminHelper->setPermission($permission);
    $menuGroup = $secLevelEntries = '';
    $dashboardPage = true;
    $contentPage = false;
    $userPage = false;
    $statisticsPage = false;
    $exportsPage = false;
    $backupPage = false;
    $configurationPage = false;
    switch ($action) {
        case 'user':
        case 'group':
        case 'passwd':
        case 'cookies':
            $menuGroup = 'user';
    header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$httpHeader = new PMF_Helper_Http();
$httpHeader->setContentType('text/html');
$httpHeader->addHeader();
$secLevelEntries = '';
$dashboardPage = true;
$contentPage = false;
$userPage = false;
$statisticsPage = false;
$exportsPage = false;
$backupPage = false;
$configurationPage = false;
$edAutosave = 'editentry' === $action && $faqConfig->get('records.autosaveActive');
$adminHelper = new PMF_Helper_Administration();
$adminHelper->setPermission($permission);
switch ($action) {
    case 'user':
    case 'group':
    case 'passwd':
    case 'cookies':
        $secLevelHeader = $PMF_LANG['admin_mainmenu_users'];
        $secLevelEntries .= $adminHelper->addMenuEntry('adduser+edituser+deluser', 'user', 'ad_menu_user_administration', $action);
        if ($faqConfig->get('security.permLevel') != 'basic') {
            $secLevelEntries .= $adminHelper->addMenuEntry('addgroup+editgroup+delgroup', 'group', 'ad_menu_group_administration', $action);
        }
        $secLevelEntries .= $adminHelper->addMenuEntry('passwd', 'passwd', 'ad_menu_passwd', $action);
        $dashboardPage = false;
        $userPage = true;
        break;