<?php
/***************************************************************************
- * Copyright (C) 2003-2008 Polytechnique.org *
+ * Copyright (C) 2003-2011 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
return self::workDir() . '/cache_' . $this->name . '.tpl';
}
+ /** Remove the cache for the current page.
+ */
+ public function removePageCache()
+ {
+ @unlink($this->cacheFilename());
+ global $globals;
+ $page = glob($globals->spoolroot . '/spool/templates_c/*cache_' . $this->name . '.tpl.php');
+ if (count($page) > 0) {
+ @unlink($page[0]);
+ }
+ }
+
/** Fetch the content of the wiki page.
*/
private function fetchContent()
case 'public':
return true;
case 'logged':
- case 'mdp':
return S::logged();
+ case 'mdp':
+ return S::identified();
case 'admin':
- return S::has_perms();
+ return S::admin();
default:
return false;
}
case 'public':
return;
case 'logged':
- Platal::session()->start(AUTH_PUBLIC + 1);
- return;
+ $ok = Platal::session()->start(AUTH_PUBLIC + 1);
+ break;
default:
- Platal::session()->start(Platal::session()->sureLevel());
- return;
+ $ok = Platal::session()->start(Platal::session()->sureLevel());
+ break;
+ }
+ if (!$ok) {
+ global $platal;
+ $page =& Platal::page();
+ $platal->force_login($page);
+ } else if ($perm == 'admin' && !S::admin()) {
+ global $platal;
+ $platal->error403();
}
}
}
}
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
?>