<?php
/***************************************************************************
- * Copyright (C) 2003-2008 Polytechnique.org *
+ * Copyright (C) 2003-2009 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
$sessionclass = PL_SESSION_CLASS;
$session = new $sessionclass();
if (!$session->startAvailableAuth()) {
- Platal::page()->trigError('Données d\'authentification invalide.');
+ Platal::page()->trigError("Données d'authentification invalides.");
}
$modules = func_get_args();
foreach ($modules as $module) {
$module = strtolower($module);
$this->__mods[$module] = $m = PLModule::factory($module);
- $this->__hooks += $m->handlers();
+ $this->__hooks = $m->handlers() + $this->__hooks;
}
if ($globals->mode == '') {
}
}
if ($hook['auth'] != AUTH_PUBLIC && !$this->check_perms($hook['perms'])) {
- if (S::admin()) {
- $page->trigWarning('Tu accèdes à cette page car tu es administrateur du site.');
- } else {
+ if (self::notAllowed()) {
return PL_FORBIDDEN;
}
}
$page->run();
}
+ public static function notAllowed()
+ {
+ if (S::admin()) {
+ self::page()->trigWarning('Tu accèdes à cette page car tu es administrateur du site.');
+ return false;
+ } else {
+ return true;
+ }
+ }
+
public static function load($modname, $include = null)
{
global $platal;