<?php
/***************************************************************************
- * Copyright (C) 2003-2004 Polytechnique.org *
+ * Copyright (C) 2003-2006 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
***************************************************************************/
require_once('platal.inc.php');
-require_once('xnet/globals.inc.php');
+require_once('globals.inc.php');
require_once('xnet/session.inc.php');
-XnetGlobals::init();
-XnetGlobals::setlocale();
+$globals = new PlatalGlobals('XnetSession');
XnetSession::init();
// {{{ function new_skinned_page()
-function new_page($tpl_name, $min_auth)
+function new_page($tpl_name, $type = SKINNED)
{
- global $page,$globals;
+ global $page, $globals;
require_once("xnet/page.inc.php");
- switch($min_auth) {
- case AUTH_PUBLIC:
- $page = new XnetPage($tpl_name, $type);
- break;
-
- default:
- $page = new XnetAuth($tpl_name, $type);
- }
+ $page = new XnetPage($tpl_name, $type);
$page->assign('xorg_tpl', $tpl_name);
}
-// }}}
-function new_identification_page()
+function new_skinned_page($tpl_name)
{
- new_page('', AUTH_MDP);
- global $page;
- $page->useMenu();
+ return new_page($tpl_name);
}
+// }}}
// {{{ function new_group_page()
function new_group_page($tpl_name)
{
- global $page,$globals;
- require_once("xnet/page.inc.php");
- $page = new XnetGroupPage($tpl_name);
- $page->assign('xorg_tpl', $tpl_name);
+ global $page, $globals;
+
+ new_page($tpl_name);
+
+ if (!is_member() && !S::has_perms()) {
+ $page->kill("You have not sufficient credentials");
+ }
+
+ $page->useMenu();
+ $page->assign('asso', $globals->asso());
+ $page->setType($globals->asso('cat'));
}
// }}}
function new_groupadmin_page($tpl_name)
{
- global $page,$globals;
- require_once("xnet/page.inc.php");
- $page = new XnetGroupAdmin($tpl_name);
- $page->assign('xorg_tpl', $tpl_name);
+ global $page, $globals;
+
+ new_page($tpl_name);
+
+ if (!may_update()) {
+ $page->kill("You have not sufficient credentials");
+ }
+
+ $page->useMenu();
+ $page->assign('asso', $globals->asso());
+ $page->setType($globals->asso('cat'));
}
// }}}
function new_admin_page($tpl_name)
{
- global $page,$globals;
- require_once("xnet/page.inc.php");
- $page = new XnetAdmin($tpl_name);
- $page->assign('xorg_tpl', $tpl_name);
-}
+ global $page, $globals;
-// }}}
-// {{{ function new_nonhtml_page()
+ new_page($tpl_name);
-function new_nonhtml_page($tpl_name)
-{
- global $page, $globals;
- require_once("xnet/page.inc.php");
- $page = new XnetGroupPage($tpl_name, NO_SKIN);
- $page->assign('xorg_tpl', $tpl_name);
+ check_perms();
+
+ $page->useMenu();
+ if ($globals->asso('cat')) {
+ $page->assign('asso', $globals->asso());
+ $page->setType($globals->asso('cat'));
+ }
}
// }}}