***************************************************************************/
require_once 'smarty/libs/Smarty.class.php';
-require_once 'platal/smarty.plugins.inc.php';
class PlatalPage extends Smarty
{
// }}}
}
+// {{{ function escape_html ()
+
+/**
+ * default smarty plugin, used to auto-escape dangerous html.
+ *
+ * < --> <
+ * > --> >
+ * " --> "
+ * & not followed by some entity --> &
+ */
+function escape_html($string)
+{
+ if (is_string($string)) {
+ $transtbl = Array('<' => '<', '>' => '>', '"' => '"', '\'' => ''');
+ return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,4};)/", "&" , strtr($string, $transtbl));
+ } else {
+ return $string;
+ }
+}
+
+// }}}
+// {{{ function at_to_globals()
+
+/**
+ * helper
+ */
+
+function _to_globals($s) {
+ global $globals;
+ $t = explode('.',$s);
+ if (count($t) == 1) {
+ return var_export($globals->$t[0],true);
+ } else {
+ return var_export($globals->$t[0]->$t[1],true);
+ }
+}
+
+/**
+ * compilation plugin used to import $globals confing through #globals.foo.bar# directives
+ */
+
+function at_to_globals($tpl_source, &$smarty)
+{
+ return preg_replace('/#globals\.([a-zA-Z0-9_.]+?)#/e', '_to_globals(\'\\1\')', $tpl_source);
+}
+
+// }}}
+// {{{ function trimwhitespace
+
+function trimwhitespace($source, &$smarty)
+{
+ $tags = array('script', 'pre', 'textarea');
+
+ foreach ($tags as $tag) {
+ preg_match_all("!<{$tag}[^>]+>.*?</{$tag}>!is", $source, ${$tag});
+ $source = preg_replace("!<{$tag}[^>]+>.*?</{$tag}>!is", "&&&{$tag}&&&", $source);
+ }
+
+ // remove all leading spaces, tabs and carriage returns NOT
+ // preceeded by a php close tag.
+ $source = preg_replace('/((?<!\?>)\n)[\s]+/m', '\1', $source);
+
+ foreach ($tags as $tag) {
+ $source = preg_replace("!&&&{$tag}&&&!e", 'array_shift(${$tag}[0])', $source);
+ }
+
+ return $source;
+}
+
+// }}}
+
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
?>
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
+require_once 'diogenes/diogenes.misc.inc.php';
+require_once 'diogenes/diogenes.core.logger.inc.php';
+
class Session
{
function init()
class S extends Session { }
+// {{{ function check_perms()
+
+/** verifie si un utilisateur a les droits pour voir une page
+ ** si ce n'est pas le cas, on affiche une erreur
+ * @return void
+ */
+function check_perms()
+{
+ global $page;
+ if (!S::has_perms()) {
+ if ($_SESSION['log']) {
+ $_SESSION['log']->log("noperms",$_SERVER['PHP_SELF']);
+ }
+ $page->kill("Tu n'as pas les permissions nécessaires pour accéder à cette page.");
+ }
+}
+
+// }}}
+
?>
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- ***************************************************************************/
-
-require_once 'diogenes/diogenes.misc.inc.php';
-require_once 'diogenes/diogenes.core.logger.inc.php';
-
-require_once dirname(__FILE__).'/../../classes/Session.php';
-
-// {{{ function check_perms()
-
-/** verifie si un utilisateur a les droits pour voir une page
- ** si ce n'est pas le cas, on affiche une erreur
- * @return void
- */
-function check_perms()
-{
- global $page;
- if (!S::has_perms()) {
- if ($_SESSION['log']) {
- $_SESSION['log']->log("noperms",$_SERVER['PHP_SELF']);
- }
- $page->kill("Tu n'as pas les permissions nécessaires pour accéder à cette page.");
- }
-}
-
-// }}}
-
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
-?>
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- ***************************************************************************/
-
-// {{{ function escape_html ()
-
-/**
- * default smarty plugin, used to auto-escape dangerous html.
- *
- * < --> <
- * > --> >
- * " --> "
- * & not followed by some entity --> &
- */
-function escape_html($string)
-{
- if(is_string($string)) {
- $transtbl = Array('<' => '<', '>' => '>', '"' => '"', '\'' => ''');
- return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,4};)/", "&" , strtr($string, $transtbl));
- } else {
- return $string;
- }
-}
-
-// }}}
-// {{{ function at_to_globals()
-
-/**
- * helper
- */
-
-function _to_globals($s) {
- global $globals;
- $t = explode('.',$s);
- if (count($t) == 1) {
- return var_export($globals->$t[0],true);
- } else {
- return var_export($globals->$t[0]->$t[1],true);
- }
-}
-
-/**
- * compilation plugin used to import $globals confing through #globals.foo.bar# directives
- */
-
-function at_to_globals($tpl_source, &$smarty)
-{
- return preg_replace('/#globals\.([a-zA-Z0-9_.]+?)#/e', '_to_globals(\'\\1\')', $tpl_source);
-}
-
-// }}}
-// {{{ function trimwhitespace
-
-function trimwhitespace($source, &$smarty)
-{
- $tags = array('script', 'pre', 'textarea');
-
- foreach ($tags as $tag) {
- preg_match_all("!<{$tag}[^>]+>.*?</{$tag}>!is", $source, ${$tag});
- $source = preg_replace("!<{$tag}[^>]+>.*?</{$tag}>!is", "&&&{$tag}&&&", $source);
- }
-
- // remove all leading spaces, tabs and carriage returns NOT
- // preceeded by a php close tag.
- $source = preg_replace('/((?<!\?>)\n)[\s]+/m', '\1', $source);
-
- foreach ($tags as $tag) {
- $source = preg_replace("!&&&{$tag}&&&!e", 'array_shift(${$tag}[0])', $source);
- }
-
- return $source;
-}
-
-// }}}
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
-?>
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-require_once('platal/page.inc.php');
-require_once('xnet/smarty.plugins.inc.php');
+require_once dirname(__FILE__).'/../../classes/Page.php';
class XnetPage extends PlatalPage
{
// }}}
}
+// {{{ function list_all_my_groups
+
+function list_all_my_groups($params)
+{
+ if (!S::logged()) {
+ return;
+ }
+ $res = XDB::iterRow(
+ "SELECT a.nom, a.diminutif
+ FROM groupex.asso AS a
+ INNER JOIN groupex.membres AS m ON m.asso_id = a.id
+ WHERE m.uid={?}", S::v('uid'));
+ $html = '<div>Mes groupes :</div>';
+ while (list($nom, $mini) = $res->next()) {
+ $html .= "<a class='gp' href='$mini/'>• $nom</a>";
+ }
+ return $html;
+}
+
+// }}}
+// {{{ cat_pp
+
+function cat_pp($cat)
+{
+ $trans = array(
+ 'groupesx' => 'Groupes X' ,
+ 'binets' => 'Binets' ,
+ 'institutions' => 'Institutions' ,
+ 'promotions' => 'Promotions'
+ );
+
+ return $trans[strtolower($cat)];
+}
+
+// }}}
+
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
?>
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-require_once('platal/session.inc.php');
+require_once dirname(__FILE__).'/../../classes/Session.php';
class XnetSession
{
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- ***************************************************************************/
-
-// {{{ function list_all_my_groups
-
-function list_all_my_groups($params)
-{
- if (!S::logged()) {
- return;
- }
- $res = XDB::iterRow(
- "SELECT a.nom, a.diminutif
- FROM groupex.asso AS a
- INNER JOIN groupex.membres AS m ON m.asso_id = a.id
- WHERE m.uid={?}", S::v('uid'));
- $html = '<div>Mes groupes :</div>';
- while (list($nom, $mini) = $res->next()) {
- $html .= "<a class='gp' href='$mini/'>• $nom</a>";
- }
- return $html;
-}
-
-// }}}
-// {{{ cat_pp
-
-function cat_pp($cat)
-{
- $trans = array(
- 'groupesx' => 'Groupes X' ,
- 'binets' => 'Binets' ,
- 'institutions' => 'Institutions' ,
- 'promotions' => 'Promotions'
- );
-
- return $trans[strtolower($cat)];
-}
-
-// }}}
-
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
-?>
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
+
require_once('platal.inc.php');
require_once('xorg/globals.inc.php');
require_once('xorg/session.inc.php');
XorgGlobals::setlocale();
XorgSession::init();
-require_once('platal/page.inc.php');
+require_once dirname(__FILE__).'/../classes/Page.php';
// {{{ class XorgPage
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-require_once 'platal/session.inc.php';
+require_once dirname(__FILE__).'/../../classes/Session.php';
// {{{ class XorgSession