예제 #1
0
 function permissions($internal = '')
 {
     global $db;
     $s = $db->selectObject('section', 'id=' . $internal);
     if ($s && !navigationmodule::isPublic($s)) {
         return array('administrate' => 'Administrate', 'view' => 'View Section', 'manage' => 'Manage Section');
     } else {
         return array('administrate' => 'Administrate', 'manage' => 'Manage Section');
     }
 }
예제 #2
0
// Initialize the Flow Subsystem.
if (!defined('SYS_FLOW')) {
    require_once BASE . 'subsystems/flow.php';
}
// Validate session
exponent_sessions_validate();
// Initialize permissions variables
exponent_permissions_initialize();
#$section = (exponent_sessions_isset('last_section') ? exponent_sessions_get('last_section') : SITE_DEFAULT_SECTION);
if (isset($_REQUEST['action']) && isset($_REQUEST['module'])) {
    $section = exponent_sessions_isset('last_section') ? exponent_sessions_get('last_section') : SITE_DEFAULT_SECTION;
} else {
    $section = isset($_REQUEST['section']) ? $_REQUEST['section'] : SITE_DEFAULT_SECTION;
}
$section = $db->selectObject('section', 'id=' . intval($section));
if (!navigationmodule::canView($section)) {
    define('AUTHORIZED_SECTION', 0);
} else {
    define('AUTHORIZED_SECTION', 1);
}
if (!navigationmodule::isPublic(intval($section))) {
    define('PUBLIC_SECTION', 0);
} else {
    define('PUBLIC_SECTION', 1);
}
function eDebug($var)
{
    echo "<xmp>";
    print_r($var);
    echo "</xmp>";
}
예제 #3
0
require_once BASE . 'subsystems/core.php';
// Initialize the Database Subsystem
require_once BASE . 'subsystems/database.php';
$db = pathos_database_connect(DB_USER, DB_PASS, DB_HOST . ':' . DB_PORT, DB_NAME);
// Initialize the Modules Subsystem.
require_once BASE . 'subsystems/modules.php';
pathos_modules_initialize();
// Initialize the Template Subsystem.
require_once BASE . 'subsystems/template.php';
// Initialize the Permissions Subsystem.
require_once BASE . 'subsystems/permissions.php';
// Initialize the Flow Subsystem.
if (!defined('SYS_FLOW')) {
    require_once BASE . 'subsystems/flow.php';
}
// Validate session
pathos_sessions_validate();
// Initialize permissions variables
pathos_permissions_initialize();
$section = pathos_sessions_isset('last_section') ? pathos_sessions_get('last_section') : SITE_DEFAULT_SECTION;
$section = $db->selectObject('section', 'id=' . $section);
if (!navigationmodule::canView($section)) {
    define('AUTHORIZED_SECTION', 0);
} else {
    define('AUTHORIZED_SECTION', 1);
}
if (!navigationmodule::isPublic($section)) {
    define('PUBLIC_SECTION', 0);
} else {
    define('PUBLIC_SECTION', 1);
}
예제 #4
0
 public function getSectionObj($section)
 {
     global $db;
     if ($section == "*") {
         $action = $this->params['controller'] . "Controller";
         $sectionObj = call_user_func($action . "::getSection", $this->params);
     } else {
         $sectionObj = $db->selectObject('section', 'id=' . intval($section));
     }
     //        $sectionObj = $db->selectObject('section','id='. intval($section));
     if (!navigationmodule::canView($sectionObj)) {
         define('AUTHORIZED_SECTION', 0);
     } else {
         define('AUTHORIZED_SECTION', 1);
     }
     if (!navigationmodule::isPublic($sectionObj)) {
         define('PUBLIC_SECTION', 0);
     } else {
         define('PUBLIC_SECTION', 1);
     }
     if (isset($_REQUEST['section'])) {
         expSession::set('last_section', intval($_REQUEST['section']));
     } else {
         //expSession::unset('last_section');
     }
     return $sectionObj;
 }