Ejemplo n.º 1
0
 /**
  * Constructor
  */
 function XoopsModule()
 {
     parent::__construct();
     $this->_deprecated = icms_core_Debug::setDeprecated('icms_module_Object', sprintf(_CORE_REMOVE_IN_VERSION, '1.4'));
 }
Ejemplo n.º 2
0
 /**
  * Checks if the current user can access the specified module
  * @param icms_module_Object $module
  * @param bool $inAdmin
  * @return bool
  */
 protected static function checkModuleAccess($module, $inAdmin = FALSE)
 {
     if ($inAdmin && !icms::$user) {
         return FALSE;
     }
     /* @var $perm_handler icms_member_groupperm_Handler */
     $perm_handler = icms::handler('icms_member_groupperm');
     if ($inAdmin) {
         if (!$module) {
             // We are in /admin.php
             return icms::$user->isAdmin(-1);
         } else {
             return $perm_handler->checkRight('module_admin', $module->getVar('mid'), icms::$user->getGroups());
         }
     } elseif ($module) {
         $groups = icms::$user ? icms::$user->getGroups() : ICMS_GROUP_ANONYMOUS;
         return $perm_handler->checkRight('module_read', $module->getVar('mid'), $groups);
     }
     // We are in /something.php: let the page handle permissions
     return TRUE;
 }