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
16b1955
..
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,7
+46,7
@@
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();
@@
-267,9
+267,7
@@
abstract class Platal
}
}
if ($hook['auth'] != AUTH_PUBLIC && !$this->check_perms($hook['perms'])) {
}
}
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;
}
}
return PL_FORBIDDEN;
}
}
@@
-330,6
+328,16
@@
abstract class Platal
$page->run();
}
$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;
public static function load($modname, $include = null)
{
global $platal;