projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make PlSet PHP-compatible...
[platal.git]
/
classes
/
platal.php
diff --git
a/classes/platal.php
b/classes/platal.php
index
97b2e42
..
6a5c8b6
100644
(file)
--- a/
classes/platal.php
+++ b/
classes/platal.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-200
8
Polytechnique.org *
+ * Copyright (C) 2003-200
9
Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-46,11
+46,11
@@
abstract class Platal
$sessionclass = PL_SESSION_CLASS;
$session = new $sessionclass();
if (!$session->startAvailableAuth()) {
$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();
}
$modules = func_get_args();
- if (is_array($modules[0])) {
+ if (is
set($modules[0]) && is
_array($modules[0])) {
$modules = $modules[0];
}
$this->path = trim(Get::_get('n', null), '/');
$modules = $modules[0];
}
$this->path = trim(Get::_get('n', null), '/');
@@
-62,7
+62,7
@@
abstract class Platal
foreach ($modules as $module) {
$module = strtolower($module);
$this->__mods[$module] = $m = PLModule::factory($module);
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 ($globals->mode == '') {
@@
-267,13
+267,15
@@
abstract class Platal
}
}
if ($hook['auth'] != AUTH_PUBLIC && !$this->check_perms($hook['perms'])) {
}
}
if ($hook['auth'] != AUTH_PUBLIC && !$this->check_perms($hook['perms'])) {
- return PL_FORBIDDEN;
+ if (self::notAllowed()) {
+ return PL_FORBIDDEN;
+ }
}
$val = call_user_func_array($hook['hook'], $args);
if ($val == PL_DO_AUTH) {
// The handler need a better auth with the current args
}
$val = call_user_func_array($hook['hook'], $args);
if ($val == PL_DO_AUTH) {
// The handler need a better auth with the current args
- if (!$session->start($
hook['auth']
)) {
+ if (!$session->start($
session->loggedLevel()
)) {
$this->force_login($page);
}
$val = call_user_func_array($hook['hook'], $args);
$this->force_login($page);
}
$val = call_user_func_array($hook['hook'], $args);
@@
-326,13
+328,13
@@
abstract class Platal
$page->run();
}
$page->run();
}
- public
function on_subscribe($forlife, $uid, $promo, $pass
)
+ public
static function notAllowed(
)
{
{
- $args = func_get_args();
- foreach ($this->__mods as $mod) {
- if (!is_callable($mod, 'on_subscribe'))
- continue;
-
call_user_func_array(array($mod, 'on_subscribe'), $args)
;
+ if (S::admin()) {
+ self::page()->trigWarning('Tu accèdes à cette page car tu es administrateur du site.');
+ return false;
+ } else {
+
return true
;
}
}
}
}