コード例 #1
0
ファイル: GlobalLanguage.php プロジェクト: rbarraud/nagvis
 /**
  * Checks if the user requested a language by the url
  *
  * @return  String
  * @author  Lars Michelsen <*****@*****.**>
  */
 private function getUserLanguage()
 {
     $sLang = '';
     $UHANDLER = new CoreUriHandler();
     // Load the specific params to the UriHandler
     $UHANDLER->parseModSpecificUri(array('lang' => MATCH_LANGUAGE_EMPTY));
     if ($UHANDLER->isSetAndNotEmpty('lang') && $this->checkLanguageAvailable($UHANDLER->get('lang'), false)) {
         // Get given language
         $sLang = $UHANDLER->get('lang');
     }
     return $sLang;
 }
コード例 #2
0
ファイル: index.php プロジェクト: rlugojr/nagvis
    $AUTHORISATION = null;
}
// Make the AA information available to whole NagVis for permission checks
$CORE->setAA($AUTH, $AUTHORISATION);
// Re-set the language to handle the user individual language
$_LANG->setLanguage(HANDLE_USERCFG);
/*
* Module handling 1: Choose modules
*/
// Register valid modules
// Unregistered modules can not be accessed
foreach ($_modules as $mod) {
    $MHANDLER->regModule($mod);
}
// Load the module
$MODULE = $MHANDLER->loadModule($UHANDLER->get('mod'));
if ($MODULE == null) {
    throw new NagVisException(l('The module [MOD] is not known', array('MOD' => htmlentities($UHANDLER->get('mod'), ENT_COMPAT, 'UTF-8'))));
}
$MODULE->setAction($UHANDLER->get('act'));
$MODULE->initObject();
/*
* Authorisation 2: Check if the user is permitted to use this module/action
*                  If not redirect to Msg/401 (Unauthorized) page
*/
// Only check the permissions for modules which require an authorization.
// For example the info page and the login page don't need a special authorization
if ($MODULE->actionRequiresAuthorisation()) {
    $MODULE->isPermitted();
}
/*