예제 #1
0
 /**
  * Checks whether a menu option is within the users access level
  * @param int Item id number
  * @param string The menu option
  * @param int The users group ID number
  * @param database A database connector object
  * @return boolean True if the visitor's group at least equal to the menu access
  */
 function menuCheck($Itemid, $menu_option, $task, $gid)
 {
     // Construct a link to this component - if no menu for it, assume it is OK
     $dblink = "index.php?option={$menu_option}";
     if ($this->getIDLikeLink($dblink) == 0) {
         return true;
     }
     if ($Itemid) {
         $menu =& $this->getMenuByID($Itemid);
         if (!$menu) {
             return false;
         }
         if (strpos($menu->link, $dblink) === 0) {
             $access = $menu->access;
         } elseif ($menu_option == 'com_content' and $Itemid == 1) {
             return true;
         }
     }
     if (!isset($access)) {
         if ($task != '') {
             $dblink .= "&task={$task}";
         }
         $menu =& $this->maxAccessLink($dblink);
         if (isset($menu)) {
             $access = $menu->access;
             mamboCore::set('Itemid', $menu->id);
         }
     }
     return isset($access) ? $access <= $gid : false;
 }
예제 #2
0
파일: index.php 프로젝트: jwest00724/mambo
        require_once $path;
        $configuration->doGzip();
    }
} else {
    $option = $configuration->determineOptionAndItemid();
    $Itemid = $configuration->get('Itemid');
    $mainframe =& new mosMainFrame($database, $option, '.');
    if ($option == 'login') {
        $configuration->handleLogin();
    } elseif ($option == 'logout') {
        $configuration->handleLogout();
    }
    $session =& mosSession::getCurrent();
    $my =& new mosUser();
    $my->getSessionData();
    mamboCore::set('currentUser', $my);
    $configuration->offlineCheck($my, $database);
    $gid = intval($my->gid);
    // gets template for page
    $cur_template = $mainframe->getTemplate();
    require_once $configuration->rootPath() . '/includes/frontend.php';
    require_once $configuration->rootPath() . '/includes/mambo.php';
    require_once $configuration->rootPath() . '/includes/mambofunc.php';
    require_once $configuration->rootPath() . '/includes/mamboHTML.php';
    if ($indextype == 2 and $do_pdf == 1) {
        include_once 'includes/pdf.php';
        exit;
    }
    /** detect first visit */
    $mainframe->detect();
    /** @global mosPlugin $_MAMBOTS */
예제 #3
0
파일: sef.php 프로젝트: jwest00724/mambo
 function default_revert($specialname)
 {
     $request = explode($specialname . '/', $_SERVER['REQUEST_URI']);
     if (isset($request[1])) {
         $parmset = explode("/", $request[1]);
     } else {
         $parmset = array();
     }
     $QUERY_STRING = '';
     $menuhandler =& mosMenuHandler::getInstance();
     foreach ($parmset as $values) {
         $parts = explode(",", $values);
         if (count($parts) > 1) {
             $_REQUEST[$parts[0]] = $_GET[$parts[0]] = $parts[1];
             if ($parts[0] == 'option') {
                 $_REQUEST['Itemid'] = $_GET['Itemid'] = $Itemid = $menuhandler->getIDLikeLink("index.php?option={$parts['1']}");
                 mamboCore::set('Itemid', $Itemid);
                 $QUERY_STRING .= "{$parts['0']}={$parts['1']}&Itemid={$Itemid}";
             }
             $QUERY_STRING .= "&{$parts['0']}={$parts['1']}";
         }
     }
     return $QUERY_STRING;
 }