$args = $this->argv;
$args[0] = &$page;
- if ($hook['auth'] > Session::get('auth', AUTH_PUBLIC)) {
+ if ($hook['auth'] > S::v('auth', AUTH_PUBLIC)) {
+ // FIXME: don't use 'session' object anymore
$_SESSION['session']->doAuth($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 *
+ ***************************************************************************/
+
+class Session
+{
+ function init()
+ {
+ @session_start();
+ if (empty($_SESSION['challenge'])) {
+ $_SESSION['challenge'] = sha1(uniqid(rand(), true));
+ }
+ }
+
+ function destroy()
+ {
+ @session_destroy();
+ unset($_SESSION);
+ }
+
+
+
+ function has($key)
+ {
+ return isset($_SESSION[$key]);
+ }
+
+ function kill($key)
+ {
+ unset($_SESSION[$key]);
+ }
+
+ function v($key, $default = null)
+ {
+ return isset($_SESSION[$key]) ? $_SESSION[$key] : $default;
+ }
+
+
+ function has_perms()
+ {
+ return Session::logged() && Session::v('perms') == PERMS_ADMIN;
+ }
+
+ function logged()
+ {
+ return Session::v('auth', AUTH_PUBLIC) >= AUTH_COOKIE;
+ }
+
+ function identified()
+ {
+ return Session::v('auth', AUTH_PUBLIC) >= AUTH_MDP;
+ }
+}
+
+class S extends Session { }
+
+?>
function tmp_prefs()
{
- $fmt = Session::get('mail_fmt', 'html') == 'html' ? 'texte' : 'html';
- $fmt2 = Session::get('mail_fmt', 'html') == 'html' ? 'texte' : 'HTML';
+ $fmt = S::v('mail_fmt', 'html') == 'html' ? 'texte' : 'html';
+ $fmt2 = S::v('mail_fmt', 'html') == 'html' ? 'texte' : 'HTML';
return Array(
Array(
'url' => 'prefs?mail_fmt='.$fmt,
'title' => 'Recevoir les mails en format '.$fmt2,
'text' => 'Tu recois les mails envoyés par le site (lettre mensuelle, carnet, ...) de préférence <strong>sous forme de '
- .Session::get('mail_fmt', 'html').'</strong>',
+ .S::v('mail_fmt', 'html').'</strong>',
'weight' => 80
),
Array(
- 'url' => 'prefs?rss='.(intval(Session::get('core_rss_hash')=='')),
- 'title' => (Session::get('core_rss_hash') ? 'Désactiver' : 'Activer').' les fils rss',
+ 'url' => 'prefs?rss='.(intval(S::v('core_rss_hash')=='')),
+ 'title' => (S::v('core_rss_hash') ? 'Désactiver' : 'Activer').' les fils rss',
'text' => 'Ceci te permet d\'utiliser les fils rss du site. Attention, désactiver puis réactiver les fils en change les URL !',
'weight' => 90
)
function webredirect_prefs()
{
- $text = "Tu peux configurer tes redirections WEB http://www.carva.org/" . Session::get('bestalias');
- if (Session::get('forlife') != Session::get('bestalias')) {
- $text .= ' et http://www.carva.org/'.Session::get('forlife');
+ $text = "Tu peux configurer tes redirections WEB http://www.carva.org/" . S::v('bestalias');
+ if (S::v('forlife') != S::v('bestalias')) {
+ $text .= ' et http://www.carva.org/'.S::v('forlife');
}
return Array(
GROUP BY u.user_id LIMIT 11",
$id);
-if ($globals->asso('pub') == 'public' || has_perms())
+if ($globals->asso('pub') == 'public' || S::has_perms())
$page->assign('users', $users);
$page->run();
require 'xnet.inc.php';
new_nonhtml_page('geoloc/getData.tpl');
-$nodata = ($globals->asso('pub') != 'public') && !has_perms();
+$nodata = ($globals->asso('pub') != 'public') && !S::has_perms();
header("Content-type: text/xml");
require_once('platal/xmlrpc-client.inc.php');
require_once('lists.inc.php');
-$client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'));
+$client =& lists_xmlrpc(S::v('uid'), S::v('password'));
$listes = $client->get_all_lists();
$page->assign_by_ref('listes',$listes);
$page->run();
if ($login) {
if (Env::has('importe')) {
- ax_synchronize($login, Session::getInt('uid'));
+ ax_synchronize($login, S::v('uid'));
}
// get details from user, but looking only info that can be seen by ax
- $user = get_user_details($login, Session::getInt('uid'), 'ax');
+ $user = get_user_details($login, S::v('uid'), 'ax');
$userax= get_user_ax($user['matricule_ax']);
require_once 'profil.func.inc.php';
$diff = diff_user_details($userax, $user, 'ax');
require_once("emails.inc.php");
require_once("user.func.inc.php");
-if (Session::has('suid')) {
+if (S::has('suid')) {
$page->kill("déjà en SUID !!!");
}
}
if(Env::has('suid_button') && $login) {
- $_SESSION['log']->log("suid_start", "login by ".Session::get('forlife'));
+ $_SESSION['log']->log("suid_start", "login by ".S::v('forlife'));
$_SESSION['suid'] = $_SESSION;
$r = XDB::query("SELECT id FROM aliases WHERE alias={?}", $login);
if($uid = $r->fetchOneCell()) {
$mailer = new HermesMailer();
$mailer->setFrom("webmaster@polytechnique.org");
$mailer->addTo("web@polytechnique.org");
- $mailer->setSubject("INTERVENTION de ".Session::get('forlife'));
+ $mailer->setSubject("INTERVENTION de ".S::v('forlife'));
$mailer->setTxtBody(preg_replace("/[ \t]+/", ' ', $query));
$mailer->send();
$mailer = new HermesMailer();
$mailer->setFrom("webmaster@polytechnique.org");
$mailer->addTo("web@polytechnique.org");
- $mailer->setSubject("INTERVENTION de ".Session::get('forlife'));
+ $mailer->setSubject("INTERVENTION de ".S::v('forlife'));
$mailer->setTxtBody("\nUtilisateur $login effacé");
$mailer->send();
break;
}
function hook_checkcancel($_headers) {
- return ($_headers['x-org-id'] == Session::get('forlife') or has_perms());
+ return ($_headers['x-org-id'] == S::v('forlife') or S::has_perms());
}
function hook_shortcuts()
{
global $globals;
- $uid = Session::getInt('uid');
+ $uid = S::v('uid');
$req = XDB::query(
"SELECT nom, mail, sig, FIND_IN_SET('threads',flags), FIND_IN_SET('automaj',flags)
FROM {$globals->banana->table_prefix}profils
WHERE uid={?}", $uid);
if (!(list($nom,$mail,$sig,$disp,$maj) = $req->fetchOneRow())) {
- $nom = Session::get('prenom')." ".Session::get('nom');
- $mail = Session::get('forlife')."@polytechnique.org";
- $sig = $nom." (".Session::getInt('promo').")";
+ $nom = S::v('prenom')." ".S::v('nom');
+ $mail = S::v('forlife')."@polytechnique.org";
+ $sig = $nom." (".S::v('promo').")";
$disp = 0;
$maj = 1;
}
$this->profile['sig'] = $sig;
$this->profile['display'] = $disp;
$this->profile['autoup'] = $maj;
- $this->profile['lastnews'] = Session::get('banana_last');
+ $this->profile['lastnews'] = S::v('banana_last');
if ($maj) {
XDB::execute("UPDATE auth_user_quick SET banana_last={?} WHERE user_id={?}", gmdate("YmdHis"), $uid);
array_splice($this->show_hdr, count($this->show_hdr) - 2, 0);
array_splice($this->parse_hdr, count($this->parse_hdr) - 2, 0, 'x-org-id');
- $this->host = 'news://web_'.Session::get('forlife')
+ $this->host = 'news://web_'.S::v('forlife')
.":{$globals->banana->password}@{$globals->banana->server}:{$globals->banana->port}/";
parent::Banana();
if (Get::get('banana') == 'updateall'
|| (!is_null($params) && isset($params['banana']) && $params['banana'] == 'updateall')) {
- XDB::execute('UPDATE auth_user_quick SET banana_last={?} WHERE user_id={?}', gmdate('YmdHis'), Session::getInt('uid'));
+ XDB::execute('UPDATE auth_user_quick SET banana_last={?} WHERE user_id={?}', gmdate('YmdHis'), S::v('uid'));
$_SESSION['banana_last'] = time();
}
return Banana::run('PlatalBanana', $params);
function action_saveSubs()
{
global $globals;
- $uid = Session::getInt('uid');
+ $uid = S::v('uid');
$this->profile['subscribe'] = Array();
XDB::execute("DELETE FROM {$globals->banana->table_prefix}abos WHERE uid={?}", $uid);
if (!$this->active) {
XDB::execute("UPDATE emails SET flags = 'active'
WHERE uid={?} AND email={?}", $uid, $this->email);
- $_SESSION['log']->log("email_on", $this->email.($uid!=Session::getInt('uid') ? "(admin on $uid)" : ""));
+ $_SESSION['log']->log("email_on", $this->email.($uid!=S::v('uid') ? "(admin on $uid)" : ""));
$this->active = true;
}
}
if ($this->active) {
XDB::execute("UPDATE emails SET flags =''
WHERE uid={?} AND email={?}", $uid, $this->email);
- $_SESSION['log']->log("email_off",$this->email.($uid!=Session::getInt('uid') ? "(admin on $uid)" : "") );
+ $_SESSION['log']->log("email_off",$this->email.($uid!=S::v('uid') ? "(admin on $uid)" : "") );
$this->active = false;
}
}
return ERROR_INACTIVE_REDIRECTION;
}
XDB::execute('DELETE FROM emails WHERE uid={?} AND email={?}', $this->uid, $email);
- $_SESSION['log']->log('email_del',$email.($this->uid!=Session::getInt('uid') ? " (admin on {$this->uid})" : ""));
+ $_SESSION['log']->log('email_del',$email.($this->uid!=S::v('uid') ? " (admin on {$this->uid})" : ""));
foreach ($this->emails as $i=>$mail) {
if ($email==$mail->email) {
unset($this->emails[$i]);
return ERROR_LOOP_EMAIL;
}
XDB::execute('REPLACE INTO emails (uid,email,flags) VALUES({?},{?},"active")', $this->uid, $email);
- if ($logger = Session::getMixed('log', null)) { // may be absent --> step4.php
- $logger->log('email_add',$email.($this->uid!=Session::getInt('uid') ? " (admin on {$this->uid})" : ""));
+ if ($logger = S::v('log', null)) { // may be absent --> step4.php
+ $logger->log('email_add',$email.($this->uid!=S::v('uid') ? " (admin on {$this->uid})" : ""));
}
foreach ($this->emails as $mail) {
if ($mail->email == $email_stripped) {
global $globals;
$roboturl = str_replace("https://","http://",$globals->baseurl)
- ."/payment/cyber_return/".Session::getInt('uid')."?CHAMPBPX";
+ ."/payment/cyber_return/".S::v('uid')."?CHAMPBPX";
if (Cookie::has(session_name())) {
$returnurl .= "?".SID;
}
- $req = XDB::query("SELECT IF(nom_usage!='', nom_usage, nom) AS nom FROM auth_user_md5 WHERE user_id = {?}",Session::get('uid'));
+ $req = XDB::query("SELECT IF(nom_usage!='', nom_usage, nom) AS nom FROM auth_user_md5 WHERE user_id = {?}",S::v('uid'));
$name = $req->fetchOneCell();
// on constuit la reference de la transaction
'CHAMP008' => $pay->mail);
$this->infos['client'] = Array(
'CHAMP100' => $name,
- 'CHAMP101' => Session::get('prenom'),
+ 'CHAMP101' => S::v('prenom'),
'CHAMP102' => '.',
'CHAMP103' => '.',
- 'CHAMP104' => Session::get('bestalias').'@polytechnique.org',
+ 'CHAMP104' => S::v('bestalias').'@polytechnique.org',
'CHAMP106' => '.',
'CHAMP107' => '.',
'CHAMP108' => '.',
global $globals;
$this->urlform = 'https://'.$globals->money->paypal_site.'/cgi-bin/webscr';
- $req = XDB::query("SELECT IF(nom_usage!='', nom_usage, nom) AS nom FROM auth_user_md5 WHERE user_id = {?}",Session::get('uid'));
+ $req = XDB::query("SELECT IF(nom_usage!='', nom_usage, nom) AS nom FROM auth_user_md5 WHERE user_id = {?}",S::v('uid'));
$name = $req->fetchOneCell();
$roboturl = str_replace("https://","http://",$globals->baseurl)
- ."/payment/paypal_return/".Session::getInt('uid');
+ ."/payment/paypal_return/".S::v('uid');
$this->infos = Array();
'cbt' => 'Revenir sur polytechnique.org');
$info_client = Array(
- 'first_name' => Session::get('prenom'),
+ 'first_name' => S::v('prenom'),
'last_name' => $name,
- 'email' => Session::get('bestalias').'@polytechnique.org');
+ 'email' => S::v('bestalias').'@polytechnique.org');
$res = XDB::query(
"SELECT a.adr1 AS address1, a.adr2 AS address2,
LEFT JOIN adresses AS a ON (q.user_id = a.uid)
LEFT JOIN tels AS t ON (t.uid = a.uid AND t.adrid = a.adrid)
WHERE q.user_id = {?} AND FIND_IN_SET('active', a.statut)
- LIMIT 1", Session::getInt('uid'));
+ LIMIT 1", S::v('uid'));
$this->infos['client']=array_merge($info_client, $res->fetchOneAssoc());
// on constuit la reference de la transaction
function get_nl_state()
{
- $res = XDB::query('SELECT 1 FROM newsletter_ins WHERE user_id={?}', Session::getInt('uid'));
+ $res = XDB::query('SELECT 1 FROM newsletter_ins WHERE user_id={?}', S::v('uid'));
return $res->fetchOneCell();
}
function unsubscribe_nl()
{
- XDB::execute('DELETE FROM newsletter_ins WHERE user_id={?}', Session::getInt('uid'));
+ XDB::execute('DELETE FROM newsletter_ins WHERE user_id={?}', S::v('uid'));
}
function subscribe_nl($uid=-1)
{
- $user = ($uid == -1) ? Session::getInt('uid') : $uid;
+ $user = ($uid == -1) ? S::v('uid') : $uid;
XDB::execute('REPLACE INTO newsletter_ins (user_id,last)
VALUES ({?}, 0)', $user);
}
function getNbNotifs() {
global $globals;
- if (!Session::has('uid')) {
+ if (!S::has('uid')) {
return 0;
}
- $uid = Session::getInt('uid', -1);
- $watchlast = Session::get('watch_last');
+ $uid = S::v('uid', -1);
+ $watchlast = S::v('watch_last');
// selectionne les notifs de uid, sans detail sur le watcher, depuis
// $watchlast, meme ceux sans surveillance, non ordonnés
}
// }}}
-// {{{ class Session
-
-class Session
-{
- // {{{ function _get
-
- function _get($key, $default)
- {
- return isset($_SESSION[$key]) ? $_SESSION[$key] : $default;
- }
-
- // }}}
- // {{{ function has
-
- function has($key)
- {
- return isset($_SESSION[$key]);
- }
-
- // }}}
- // {{{ function kill
-
- function kill($key)
- {
- unset($_SESSION[$key]);
- }
-
- // }}}
- // {{{ function get
-
- function get($key, $default='')
- {
- return (string)Session::_get($key, $default);
- }
-
- // }}}
- // {{{ function &getMixed
-
- function &getMixed($key, $default=null)
- {
- return Session::_get($key, $default);
- }
-
- // }}}
- // {{{ function getBool
-
- function getBool($key, $default=false)
- {
- return (bool)Session::_get($key, $default);
- }
-
- // }}}
- // {{{ function getInt
-
- function getInt($key, $default=0)
- {
- $i = Session::_get($key, $default);
- return preg_match(',^[0-9]+$,', $i) ? intval($i) : $default;
- }
-
- // }}}
-}
-
-// }}}
// {{{ class Cookie
class Cookie
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
function check_perms()
{
global $page;
- if (!has_perms()) {
+ if (!S::has_perms()) {
if ($_SESSION['log']) {
$_SESSION['log']->log("noperms",$_SERVER['PHP_SELF']);
}
}
// }}}
-// {{{ function has_perms()
-
-/** verifie si un utilisateur a les droits pour voir une page
- ** soit parce qu'il est admin, soit il est dans une liste
- ** supplementaire de personnes utilisées
- * @return BOOL
- */
-
-function has_perms()
-{
- return logged() && Session::get('perms') == PERMS_ADMIN;
-}
-
-// }}}
-// {{{ function logged()
-
-/** renvoie true si la session existe et qu'on est loggué correctement
- * false sinon
- * @return bool vrai si loggué
- * @see header2.inc.php
- */
-function logged ()
-{
- return Session::get('auth', AUTH_PUBLIC) >= AUTH_COOKIE;
-}
-
-// }}}
-// {{{ function identified()
-
-/** renvoie true si la session existe et qu'on est loggué correctement
- * et qu'on a été identifié par un mot de passe depuis le début de la session
- * false sinon
- * @return bool vrai si loggué
- * @see header2.inc.php
- */
-function identified ()
-{
- return Session::get('auth', AUTH_PUBLIC) >= AUTH_MDP;
-}
-
-// }}}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
?>
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-$uid = Session::getInt('uid');
+$uid = S::v('uid');
$res = XDB::query(
"SELECT text,id
function delete_address($adrid, $in_request_array = false){
XDB::execute("DELETE FROM adresses WHERE uid = {?} AND adrid = {?}",
- Session::getInt('uid', -1), $adrid);
+ S::v('uid', -1), $adrid);
XDB::execute("DELETE FROM tels WHERE uid = {?} AND adrid = {?}",
- Session::getInt('uid', -1), $adrid);
+ S::v('uid', -1), $adrid);
if ($in_request_array == true){
unset($_REQUEST['adrid'][$adrid]);
} else{
$sql_order = '';
//recuperation des adrid
-$res = XDB::query("SELECT adrid FROM adresses WHERE uid = {?} AND NOT FIND_IN_SET('pro', statut) ".$sql_order, Session::getInt('uid', -1));
+$res = XDB::query("SELECT adrid FROM adresses WHERE uid = {?} AND NOT FIND_IN_SET('pro', statut) ".$sql_order, S::v('uid', -1));
$adrids = $res->fetchColumn();
//recuperation des donnees de la bd
gp.pays AS countrytxt, gp.display
FROM adresses AS a INNER JOIN geoloc_pays AS gp ON(gp.a2 = a.country)
WHERE uid = {?} AND NOT FIND_IN_SET('pro',statut) ".$sql_order
-, Session::getInt('uid', -1)
+, S::v('uid', -1)
);
$nb_adr = $res->total();
t.adrid, telid, tel_type, t.tel_pub, t.tel
FROM tels AS t INNER JOIN adresses AS a ON(t.uid = a.uid AND t.adrid = a.adrid)
WHERE t.uid = {?} AND NOT FIND_IN_SET('pro',statut) ORDER BY t.adrid, tel_type DESC, telid"
-, Session::getInt('uid', -1)
+, S::v('uid', -1)
);
while ($tel = $restels->next()) {
$adrid = $tel['adrid'];
if (Env::has('medal_op')) {
if (Env::get('medal_op')=='retirer' && Env::getInt('medal_id')) {
- XDB::execute("DELETE FROM profile_medals_sub WHERE uid = {?} AND mid = {?}", Session::getInt('uid', -1), Env::getInt('medal_id', -1));
+ XDB::execute("DELETE FROM profile_medals_sub WHERE uid = {?} AND mid = {?}", S::v('uid', -1), Env::getInt('medal_id', -1));
}
if (Env::get('medal_op')=='ajouter' && Env::getInt('medal_id')) {
- XDB::execute("INSERT INTO profile_medals_sub (uid,mid) VALUES ({?}, {?})", Session::getInt('uid', -1), Env::getInt('medal_id'));
+ XDB::execute("INSERT INTO profile_medals_sub (uid,mid) VALUES ({?}, {?})", S::v('uid', -1), Env::getInt('medal_id'));
}
}
if (Post::has('grade')) {
foreach (Post::getMixed('grade') as $mid=>$gid) {
- XDB::execute('UPDATE profile_medals_sub SET gid={?} WHERE uid={?} AND mid={?}', $gid, Session::getInt('uid'), $mid);
+ XDB::execute('UPDATE profile_medals_sub SET gid={?} WHERE uid={?} AND mid={?}', $gid, S::v('uid'), $mid);
}
}
"SELECT m.id, m.text AS medal, m.type, m.img, s.gid
FROM profile_medals_sub AS s
INNER JOIN profile_medals AS m ON ( s.mid = m.id )
- WHERE s.uid = {?}", Session::getInt('uid', -1));
+ WHERE s.uid = {?}", S::v('uid', -1));
$medals = $res->fetchAllAssoc();
-$res = XDB::query("SELECT profile_medals_pub FROM auth_user_quick WHERE user_id = {?}", Session::getInt('uid', -1));
+$res = XDB::query("SELECT profile_medals_pub FROM auth_user_quick WHERE user_id = {?}", S::v('uid', -1));
$medals_pub = $res->fetchOneCell();
if(Env::has('modifier') || Env::has('suivant')) {
adr1, adr2, adr3, postcode, city, country, region, tel, fax, mobile,
pub, adr_pub, tel_pub, email, email_pub, web
FROM entreprises
- WHERE uid = {?} ORDER BY entrid",Session::getInt('uid', -1));
+ WHERE uid = {?} ORDER BY entrid",S::v('uid', -1));
$nb_res = $res->total();
for($i = 0; $i < $nb_res ; $i++){
}
//recuperation du CV
-$res = XDB::query("SELECT cv FROM auth_user_md5 WHERE user_id = {?}", Session::getInt('uid', -1));
+$res = XDB::query("SELECT cv FROM auth_user_md5 WHERE user_id = {?}", S::v('uid', -1));
$cv = $res->fetchOneCell();
?>
LEFT JOIN applis_ins AS a2 ON(a2.uid = u.user_id and a2.ordre = 1)
WHERE u.user_id = {?}";
-$result = XDB::query($sql, Session::getInt('uid', -1));
+$result = XDB::query($sql, S::v('uid', -1));
list($nom, $prenom, $nom_ini, $prenom_ini, $promo, $promo_sortie, $nom_usage, $nationalite,
$mobile, $mobile_pub, $web, $web_pub, $freetext, $freetext_pub, $nickname,
$synchro_ax, $matricule_ax,
$appli_id1,$appli_type1, $appli_id2,$appli_type2) = $result->fetchOneRow();
-$result = XDB::query("SELECT pub FROM photo WHERE uid = {?}", Session::getInt('uid', -1));
+$result = XDB::query("SELECT pub FROM photo WHERE uid = {?}", S::v('uid', -1));
$photo_pub = $result->fetchOneCell();
$nom_anc = $nom;
$prenom_anc_comp = replace_accent($prenom_anc);
// Y a-t-il une photo en attente de confirmation ?
-$sql = XDB::query("SELECT COUNT(*) FROM requests WHERE type='photo' AND user_id = {?}", Session::getInt('uid', -1));
+$sql = XDB::query("SELECT COUNT(*) FROM requests WHERE type='photo' AND user_id = {?}", S::v('uid', -1));
$nouvellephoto=$sql->fetchOneCell();
// vim:set et sws=4 sw=4 sts=4:
$max_mentor_secteurs = 10;
//recuperation de l'expertise
-$res = XDB::query("SELECT expertise FROM mentor WHERE uid = {?}", Session::getInt('uid',-1));
+$res = XDB::query("SELECT expertise FROM mentor WHERE uid = {?}", S::v('uid',-1));
$mentor_expertise = $res->fetchOneCell();
$mentor_expertise_bd = $mentor_expertise;
if(Post::get('mentor_pays_op', '') == 'retirer') {
if(Post::has('mentor_pays_id')) {
$id_supprimee = Post::get('mentor_pays_id', '00');
- XDB::execute("DELETE FROM mentor_pays WHERE uid = {?} AND pid = {?} LIMIT 1", Session::getInt('uid', -1), $id_supprimee);
+ XDB::execute("DELETE FROM mentor_pays WHERE uid = {?} AND pid = {?} LIMIT 1", S::v('uid', -1), $id_supprimee);
}
}
//recuperation des pays
$res = XDB::iterRow("SELECT m.pid, p.pays
FROM mentor_pays AS m
- LEFT JOIN geoloc_pays AS p ON(m.pid = p.a2) WHERE m.uid = {?} LIMIT {?}", Session::getInt('uid', -1), $max_mentor_pays);
+ LEFT JOIN geoloc_pays AS p ON(m.pid = p.a2) WHERE m.uid = {?} LIMIT {?}", S::v('uid', -1), $max_mentor_pays);
$nb_mentor_pays = $res->total();
$mentor_pid = $mentor_pays = Array();
for($i = 1; $i <= $nb_mentor_pays ; $i++) list($mentor_pid[$i], $mentor_pays[$i]) = $res->next();
if((Post::get('mentor_pays_op', '') == 'ajouter') && ($nb_mentor_pays < $max_mentor_pays)) {
if(Post::get('mentor_pays_id', '00') != '00') {
$id_ajoutee = Post::get('mentor_pays_id', '00');
- XDB::execute("INSERT INTO mentor_pays(uid, pid) VALUES({?}, {?})", Session::getInt('uid', -1), $id_ajoutee);
+ XDB::execute("INSERT INTO mentor_pays(uid, pid) VALUES({?}, {?})", S::v('uid', -1), $id_ajoutee);
$nb_mentor_pays++;
$mentor_pid[$nb_mentor_pays] = $id_ajoutee;
$mentor_pays[$nb_mentor_pays] = Post::get('mentor_pays_name', '');
if(Post::get('mentor_secteur_op', '') == 'retirer') {
if(Post::has('mentor_secteur_id')) {
$id_supprimee = Post::get('mentor_secteur_id', '');
- XDB::execute("DELETE FROM mentor_secteurs WHERE uid = {?} AND secteur = {?} LIMIT 1", Session::getInt('uid', -1), $id_supprimee);
+ XDB::execute("DELETE FROM mentor_secteurs WHERE uid = {?} AND secteur = {?} LIMIT 1", S::v('uid', -1), $id_supprimee);
}
}
LEFT JOIN emploi_secteur AS s ON(m.secteur = s.id)
LEFT JOIN emploi_ss_secteur AS ss ON(s.id = ss.secteur AND m.ss_secteur = ss.id)
WHERE m.uid = {?}
- LIMIT {?}", Session::getInt('uid', -1), $max_mentor_pays);
+ LIMIT {?}", S::v('uid', -1), $max_mentor_pays);
$nb_mentor_secteurs = $res->total();
$mentor_sid = $mentor_secteur = $mentor_ssid = $mentor_ss_secteur = Array();
for($i = 1; $i <= $nb_mentor_secteurs ; $i++)
if(Post::has('mentor_ss_secteur_id'))
$ssid_ajoutee = Post::get('mentor_ss_secteur_id', '');
XDB::execute("INSERT INTO mentor_secteurs (uid, secteur, ss_secteur)
- VALUES({?}, {?}, {?})", Session::getInt('uid', -1), $sid_ajoutee, ($ssid_ajoutee == '')?null:$ssid_ajoutee);
+ VALUES({?}, {?}, {?})", S::v('uid', -1), $sid_ajoutee, ($ssid_ajoutee == '')?null:$ssid_ajoutee);
$nb_mentor_secteurs++;
$mentor_sid[$nb_mentor_secteurs] = $sid_ajoutee;
$mentor_secteur[$nb_mentor_secteurs] = Post::get('mentor_secteur_name', '');
" FROM auth_user_md5 AS u".
" WHERE user_id = {?}";
-$result = XDB::query($sql, Session::getInt('uid', -1));
+$result = XDB::query($sql, S::v('uid', -1));
$section = $result->fetchOneCell();
replace_ifset($section,'section');
if (Env::has('binet_op')) {
// retrait binet
if( (Env::get('binet_op', '')=='retirer')&&(Env::getInt('binet_id', 0) != 0)) {
- XDB::execute("DELETE FROM binets_ins WHERE user_id = {?} AND binet_id = {?}", Session::getInt('uid', -1), Env::getInt('binet_id', -1));
+ XDB::execute("DELETE FROM binets_ins WHERE user_id = {?} AND binet_id = {?}", S::v('uid', -1), Env::getInt('binet_id', -1));
}
// ajout binet
if (Env::get('binet_op')=="ajouter" && (Env::getInt('binet_id', 0) != 0)) {
- XDB::execute("INSERT INTO binets_ins (user_id,binet_id) VALUES({?}, {?})", Session::getInt('uid', -1), Env::getInt('binet_id', -1));
+ XDB::execute("INSERT INTO binets_ins (user_id,binet_id) VALUES({?}, {?})", S::v('uid', -1), Env::getInt('binet_id', -1));
}
}
/************* gestion des groupes X ************/
if (Env::has('groupex_op')) {
// retrait groupe X
if (Env::get('groupex_op')=="retirer" && (Env::getInt('groupex_id', 0) != 0)) {
- XDB::execute("DELETE FROM groupesx_ins WHERE guid = {?} AND gid = {?}", Session::getInt('uid', -1), Env::getInt('groupex_id', -1));
+ XDB::execute("DELETE FROM groupesx_ins WHERE guid = {?} AND gid = {?}", S::v('uid', -1), Env::getInt('groupex_id', -1));
}
// ajout groupe X
if (Env::get('groupex_op')=="ajouter" && (Env::getInt('groupex_id', 0) != 0)) {
- XDB::execute("INSERT INTO groupesx_ins (guid, gid) VALUES ({?}, {?})", Session::getInt('uid', -1), Env::getInt('groupex_id', -1));
+ XDB::execute("INSERT INTO groupesx_ins (guid, gid) VALUES ({?}, {?})", S::v('uid', -1), Env::getInt('groupex_id', -1));
}
}
if(Env::has('langue_op')){
if(Env::get('langue_op', '')=='retirer'){
- XDB::execute("DELETE FROM langues_ins WHERE uid = {?} AND lid = {?}", Session::getInt('uid', -1), Env::get('langue_id', ''));
+ XDB::execute("DELETE FROM langues_ins WHERE uid = {?} AND lid = {?}", S::v('uid', -1), Env::get('langue_id', ''));
} elseif(Env::get('langue_op', '') == 'ajouter'){
if(Env::get('langue_id', '') != '')
- XDB::execute("INSERT INTO langues_ins (uid,lid,level) VALUES ({?}, {?}, {?})", Session::getInt('uid', -1), Env::get('langue_id', ''), Env::get('langue_level', ''));
+ XDB::execute("INSERT INTO langues_ins (uid,lid,level) VALUES ({?}, {?}, {?})", S::v('uid', -1), Env::get('langue_id', ''), Env::get('langue_level', ''));
}
}
if(Env::has('comppros_op')){
if(Env::get('comppros_op', '')=='retirer'){
- XDB::execute("DELETE FROM competences_ins WHERE uid = {?} AND cid = {?}", Session::getInt('uid', -1), Env::get('comppros_id', ''));
+ XDB::execute("DELETE FROM competences_ins WHERE uid = {?} AND cid = {?}", S::v('uid', -1), Env::get('comppros_id', ''));
} elseif(Env::get('comppros_op', '') == 'ajouter') {
if(Env::get('comppros_id', '') != '')
- XDB::execute("INSERT INTO competences_ins (uid,cid,level) VALUES({?}, {?}, {?})", Session::getInt('uid', -1), Env::get('comppros_id', ''), Env::get('comppros_level', ''));
+ XDB::execute("INSERT INTO competences_ins (uid,cid,level) VALUES({?}, {?}, {?})", S::v('uid', -1), Env::get('comppros_id', ''), Env::get('comppros_level', ''));
}
}
$nb_cpro_max = 20;
$res = XDB::iterRow("SELECT ld.id, ld.langue_fr, li.level FROM langues_ins AS li, langues_def AS ld "
- ."WHERE (li.lid=ld.id AND li.uid= {?}) LIMIT $nb_lg_max", Session::getInt('uid', -1));
+ ."WHERE (li.lid=ld.id AND li.uid= {?}) LIMIT $nb_lg_max", S::v('uid', -1));
$nb_lg = $res->total();
}
$res = XDB::iterRow("SELECT cd.id, cd.text_fr, ci.level FROM competences_ins AS ci, competences_def AS cd "
- ."WHERE (ci.cid=cd.id AND ci.uid={?}) LIMIT $nb_cpro_max", Session::getInt('uid', -1));
+ ."WHERE (ci.cid=cd.id AND ci.uid={?}) LIMIT $nb_cpro_max", S::v('uid', -1));
$nb_cpro = $res->total();
XDB::execute( "INSERT INTO tels SET tel_type = {?}, tel_pub = {?},
tel = {?}, uid = {?}, adrid = {?}, telid = {?}",
$tel['tel_type'], $tel['tel_pub'], $tel['tel'],
- Session::getInt('uid', -1), $adrid, $tel['telid']);
+ S::v('uid', -1), $adrid, $tel['telid']);
}
foreach ($adresses as $adrid => $adr) {
$adr['adr3'], $adr['postcode'], $adr['city'],
$adr['cityid'], $adr['country'], $adr['region'],
$adr['regiontxt'], $adr['pub'], $statut,
- Session::getInt('uid', -1), $adrid);
+ S::v('uid', -1), $adrid);
$telsvalues = "";
foreach ($adr['tels'] as $tel) {
insert_new_tel($adrid, $tel);
$adr['adr2'], $adr['adr3'], $adr['postcode'],
$adr['city'], $adr['cityid'], $adr['country'],
$adr['region'], $adr['regiontxt'], $adr['pub'],
- $statut, Session::getInt('uid', -1), $adrid);
+ $statut, S::v('uid', -1), $adrid);
foreach ($adr['tels'] as $tel) {
if ($tel['new_tel']) {
insert_new_tel($adrid, $tel);
$tel['tel_type'],
$tel['tel_pub'],
$tel['tel'],
- Session::getInt('uid', -1),
+ S::v('uid', -1),
$adrid,
$tel['telid']);
} else {
uid = {?} AND
adrid = {?} AND
telid = {?}",
- Session::getInt('uid', -1),
+ S::v('uid', -1),
$adrid,
$tel['telid']);
}
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-XDB::execute("UPDATE auth_user_quick SET profile_medals_pub = {?} WHERE user_id = {?}", $medals_pub, Session::getInt('uid', -1));
+XDB::execute("UPDATE auth_user_quick SET profile_medals_pub = {?} WHERE user_id = {?}", $medals_pub, S::v('uid', -1));
// vim:set et sws=4 sw=4 sts=4:
?>
"{?}, {?}, {?}, {?}, ".
"{?}, {?}, {?}, ".
"{?}, {?}, {?})",
- Session::getInt('uid', -1) , $i , $entreprise[$i] ,
+ S::v('uid', -1) , $i , $entreprise[$i] ,
( ($secteur[$i] == "") ? null : $secteur[$i]), //sinon un faux 0 est rentre dans la base
( ($ss_secteur[$i] == "") ? null : $ss_secteur[$i]),
$poste[$i], $fonction[$i],
$pubpro[$i], $adr_pubpro[$i], $tel_pubpro[$i],
$emailpro[$i], $email_pubpro[$i], $webpro[$i]);
}
-XDB::execute("UPDATE auth_user_md5 set cv= {?} WHERE user_id = {?}", $cv, Session::getInt('uid', -1));
+XDB::execute("UPDATE auth_user_md5 set cv= {?} WHERE user_id = {?}", $cv, S::v('uid', -1));
?>
***************************************************************************/
if ($appli_id1>0)
- XDB::execute("REPLACE INTO applis_ins SET uid= {?}, aid = {?}, type = {?}, ordre = 0", Session::getInt('uid', -1), $appli_id1, $appli_type1);
+ XDB::execute("REPLACE INTO applis_ins SET uid= {?}, aid = {?}, type = {?}, ordre = 0", S::v('uid', -1), $appli_id1, $appli_type1);
else
- XDB::execute("DELETE FROM applis_ins WHERE uid= {?} AND ordre=0", Session::getInt('uid', -1));
+ XDB::execute("DELETE FROM applis_ins WHERE uid= {?} AND ordre=0", S::v('uid', -1));
if ($appli_id2>0)
- XDB::execute("REPLACE INTO applis_ins SET uid= {?}, aid = {?}, type = {?}, ordre = 1", Session::getInt('uid', -1), $appli_id2, $appli_type2);
+ XDB::execute("REPLACE INTO applis_ins SET uid= {?}, aid = {?}, type = {?}, ordre = 1", S::v('uid', -1), $appli_id2, $appli_type2);
else
- XDB::execute("DELETE FROM applis_ins WHERE uid= {?} AND ordre=1", Session::getInt('uid', -1));
+ XDB::execute("DELETE FROM applis_ins WHERE uid= {?} AND ordre=1", S::v('uid', -1));
if ($nationalite != $nationalite_anc || $nom != $nom_anc || $prenom != $prenom_anc) {
$sql = "UPDATE auth_user_md5
SET nationalite= {?},
nom = {?},
prenom = {?} WHERE user_id= {?}";
- XDB::execute($sql, $nationalite, $nom, $prenom, Session::getInt('uid', -1));
+ XDB::execute($sql, $nationalite, $nom, $prenom, S::v('uid', -1));
}
XDB::execute(
"UPDATE auth_user_quick SET
$web, $web_pub,
$freetext, $freetext_pub,
$synchro_ax,
- Session::getInt('uid', -1));
+ S::v('uid', -1));
if ($nickname != $nickname_anc) {
require_once('user.func.inc.php');
- user_reindex(Session::getInt('uid', -1));
+ user_reindex(S::v('uid', -1));
}
-XDB::execute("UPDATE photo SET pub = {?} WHERE uid = {?}", $photo_pub, Session::getInt('uid', -1));
+XDB::execute("UPDATE photo SET pub = {?} WHERE uid = {?}", $photo_pub, S::v('uid', -1));
// vim:set et sws=4 sts=4 sw=4:
?>
//mise a jour d'expertise si nécessaire
if($mentor_expertise != $mentor_expertise_bd) {
- XDB::execute("REPLACE INTO mentor(uid, expertise) VALUES({?}, {?})", Session::getInt('uid', -1), $mentor_expertise);
+ XDB::execute("REPLACE INTO mentor(uid, expertise) VALUES({?}, {?})", S::v('uid', -1), $mentor_expertise);
}
$sql = "UPDATE auth_user_md5 set section= {?} WHERE user_id= {?}";
-XDB::execute($sql, $section, Session::getInt('uid', -1));
+XDB::execute($sql, $section, S::v('uid', -1));
?>
{
foreach ($this->orders as $key=>$o) {
if ($o[3] == AUTH_COOKIE) {
- $this->orders[$key][3] = logged();
+ $this->orders[$key][3] = S::logged();
} elseif ($o[3] == AUTH_PUBLIC) {
$this->orders[$key][3] = true;
} else {
- $this->orders[$key][3] = identified();
+ $this->orders[$key][3] = S::identified();
}
}
}
list($list, $total) = call_user_func($this->_callback, $offset, $this->limit, $sql_order);
$page_max = intval(($total-1)/$this->limit);
- if(!logged() && $page_max > $globals->search->public_max)
+ if(!S::logged() && $page_max > $globals->search->public_max)
$page_max = $globals->search->public_max;
$links = Array();
es.label AS secteur, ef.fonction_fr AS fonction,
IF(n.nat=\'\',n.pays,n.nat) AS nat, n.a2 AS iso3166,';
// hide private information if not logged
-if (logged())
+if (S::logged())
$globals->search->result_fields .='
q.profile_web AS web,
q.profile_mobile AS mobile,
include_once('lists.inc.php');
if (function_exists(lists_xmlrpc)) {
- $client =& lists_xmlrpc(Session::getInt('id'), Session::get('password'));
+ $client =& lists_xmlrpc(S::v('id'), S::v('password'));
$client->kill($alias, $really_del);
}
}
return $res->fetchOneCell();
default:
- if (has_perms()) {
+ if (S::has_perms()) {
$aliases = $res->fetchColumn();
$page->trig("Il y a $i utilisateurs avec cette adresse mail : ".join(', ', $aliases));
} else {
// ajout d'un commentaire
if (Env::has('hold') && Env::has('comm')) {
- $this->comments[] = Array(Session::get('bestalias'), Env::get('comm'));
+ $this->comments[] = Array(S::v('bestalias'), Env::get('comm'));
// envoi d'un mail à hotliners
global $globals;
$mailer->addTo("hotliners@{$globals->mail->domain}");
$body = "Validation {$this->type} pour {$this->prenom} {$this->nom}\n\n"
- . Session::get('bestalias')." a ajouté le commentaire :\n\n"
+ . S::v('bestalias')." a ajouté le commentaire :\n\n"
. Env::get('comm')."\n\n"
. "cf la discussion sur : ".$globals->baseurl."/admin/valider.php";
require_once('platal/xmlrpc-client.inc.php');
require_once('lists.inc.php');
- $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'));
+ $client =& lists_xmlrpc(S::v('uid'), S::v('password'));
$ret = $client->create_list($this->liste, $this->desc,
$this->advertise, $this->modlevel, $this->inslevel,
$this->owners, $this->members);
function wiki_assign_auth() {
global $page, $wiki_auths;
- $page->assign('logged', logged());
- $page->assign('identified', identified());
- $page->assign('has_perms', has_perms());
+ $page->assign('logged', S::logged());
+ $page->assign('identified', S::identified());
+ $page->assign('has_perms', S::has_perms());
$page->assign('public', true);
- $page->assign('wiki_admin', has_perms() && identified());
+ $page->assign('wiki_admin', S::has_perms() && S::identified());
}
// cannot be in a function because pmwiki use all vars as if it was globals
new_page($tpl_name);
$page->doAuth(true);
- if (!is_member() && !has_perms()) {
+ if (!is_member() && !S::has_perms()) {
$page->kill("You have not sufficient credentials");
}
new_page($tpl_name, NO_SKIN);
$page->doAuth(true);
- if (!is_member() && !has_perms()) {
+ if (!is_member() && !S::has_perms()) {
$page->kill("You have not sufficient credentials");
}
$sub = array();
$sub['accueil'] = '';
$sub['liste des groupes'] = 'plan';
- if (logged()) {
- if (has_perms()) {
+ if (S::logged()) {
+ if (S::has_perms()) {
$sub['admin X.net'] = 'admin';
}
$sub['déconnexion'] = 'exit';
}
$menu["Menu Principal"] = $sub;
- if (logged() && (is_member() || may_update())) {
+ if (S::logged() && (is_member() || may_update())) {
$sub = array();
$dim = $globals->asso('diminutif');
$sub['présentation'] = "$dim/";
$menu[$globals->asso('nom')] = $sub;
}
- if (logged() && may_update()) {
+ if (S::logged() && may_update()) {
$sub = array();
$sub['modifier l\'accueil'] = "$dim/edit";
if ($globals->asso('mail_domain')) {
$this->register_function('list_all_my_groups', 'list_all_my_groups');
$this->register_modifier('cat_pp', 'cat_pp');
$this->assign('it_is_xnet', true);
- if (!logged() && $force) {
- $_SESSION['session']->doLogin($this);
+ if (!S::logged() && $force) {
+ XnetSession::doLogin($this);
}
- if (!logged() && Get::has('auth')) {
- $_SESSION['session']->doAuthX($this);
+ if (!S::logged() && Get::has('auth')) {
+ XnetSession::doAuthX($this);
}
}
class XnetSession
{
- var $challenge;
-
- // {{{ function XnetSession()
-
- function XnetSession()
- {
- $this->challenge = md5(uniqid(rand(), 1));
- }
-
- // }}}
// {{{ function init
-
+
function init() {
global $globals;
- @session_start();
- if (!Session::has('session')) {
- $_SESSION['session'] = new XnetSession;
- }
- if (!logged()) {
+ S::init();
+
+ $_SESSION['session'] = new XnetSession;
+
+ if (!S::logged()) {
// prevent connexion to be linked to deconnexion
if (($i = strpos($_SERVER['REQUEST_URI'], 'exit')) !== false)
$returl = "http://{$_SERVER['SERVER_NAME']}".substr($_SERVER['REQUEST_URI'], 0, $i);
$returl = "http://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}";
$url = "https://www.polytechnique.org/auth-groupex.php";
$url .= "?session=" . session_id();
- $url .= "&challenge=" . $_SESSION['session']->challenge;
- $url .= "&pass=" . md5($_SESSION['session']->challenge . $globals->xnet->secret);
+ $url .= "&challenge=" . S::v('challenge');
+ $url .= "&pass=" . md5(S::v('challenge') . $globals->xnet->secret);
$url .= "&url=".urlencode($returl);
- $_SESSION['session']->loginX = $url;
+ $_SESSION['loginX'] = $url;
}
}
-
+
// }}}
// {{{ function destroy()
-
+
function destroy() {
- @session_destroy();
- unset($_SESSION);
+ S::destroy();
XnetSession::init();
}
-
+
// }}}
// {{{ function doAuth()
*/
function doAuth(&$page)
{
- if (identified()) { // ok, c'est bon, on n'a rien à faire
+ if (S::identified()) { // ok, c'est bon, on n'a rien à faire
return true;
}
if (Get::has('auth')) {
- return $this->doAuthX($page);
- } elseif (Post::has('challenge') && Post::has('username') && Post::has('response')) {
- return $this->doAuthOther($page);
+ return XnetSession::doAuthX($page);
} else {
- $this->doLogin($page);
+ XnetSession::doLogin($page);
}
}
function doAuthX(&$page) {
global $globals;
- if (md5('1'.$this->challenge.$globals->xnet->secret.Get::getInt('uid').'1') != Get::get('auth')) {
+ if (md5('1'.S::v('challenge').$globals->xnet->secret.Get::getInt('uid').'1') != Get::get('auth')) {
$page->kill("Erreur d'authentification avec polytechnique.org !");
}
LIMIT 1", Get::getInt('uid'));
$_SESSION = array_merge($_SESSION, $res->fetchOneAssoc());
$_SESSION['auth'] = AUTH_MDP;
- unset($this->challenge);
- unset($this->loginX);
+ S::kill('challenge');
+ S::kill('loginX');
Get::kill('auth');
Get::kill('uid');
$args = array();
}
// }}}
- // {{{ doAuthOther
-
- function doAuthOther(&$page) {
- if (Post::has('challenge') && Post::has('username') && Post::has('response')) {
- $username = Post::get('username');
- }
- $this->doLogin($page);
- }
-
- // }}}
// {{{ doLogin
function doLogin(&$page) {
- redirect($_SESSION['session']->loginX);
+ redirect(S::v('loginX'));
}
// }}}
function may_update() {
global $globals;
if (!$globals->asso('id')) { return false; }
- if (has_perms()) { return true; }
+ if (S::has_perms()) { return true; }
$res = XDB::query(
"SELECT perms
FROM groupex.membres
- WHERE uid={?} AND asso_id={?}", Session::getInt('uid'), $globals->asso('id'));
+ WHERE uid={?} AND asso_id={?}", S::v('uid'), $globals->asso('id'));
return $res->fetchOneCell() == 'admin';
}
if (!$asso_id) { return false; }
static $is_member;
if (!$is_member) $is_member = array();
- if (!isset($is_member[$asso_id]))
+ if (!isset($is_member[$asso_id]))
{
$res = XDB::query(
"SELECT COUNT(*)
FROM groupex.membres
WHERE uid={?} AND asso_id={?}",
- Session::getInt('uid'), $asso_id);
+ S::v('uid'), $asso_id);
$is_member[$asso_id] = $res->fetchOneCell() == 1;
}
return $is_member[$asso_id];
function list_all_my_groups($params)
{
- if (!logged()) {
+ 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={?}", Session::getInt('uid'));
+ WHERE m.uid={?}", S::v('uid'));
$html = '<div>Mes groupes :</div>';
while (list($nom, $mini) = $res->next()) {
$html .= "<a class='gp' href='".smarty_function_rel()."/$mini/'>• $nom</a>";
function menu()
{
- $res = logged() ? $this->_int : $this->_ext;
- if (identified()) {
+ $res = S::logged() ? $this->_int : $this->_ext;
+ if (S::identified()) {
$res[XOM_NO][] = Array(0, 'text' => 'Déconnexion', 'url' => 'exit');
} elseif (Cookie::has('ORGaccess')) {
$res[XOM_NO][] = Array(0, 'text' => 'Déconnexion totale', 'url' => 'exit/forget');
}
- if (!has_perms()) {
+ if (!S::has_perms()) {
unset($res[XOM_ADMIN]);
}
foreach (array_keys($res) as $key) {
if ($this->_page_type != NO_SKIN) {
$this->assign('menu', $globals->menu->menu());
}
- $this->_run('skin/'.Session::get('skin'));
+ $this->_run('skin/'.S::v('skin'));
}
// }}}
function doAuth()
{
- $_SESSION['session']->doAuth($this);
+ XorgSession::doAuth($this);
}
-
+
// }}}
}
class XorgCookie extends XorgPage
{
// {{{ function XorgCookie()
-
+
function XorgCookie($tpl, $type=SKINNED)
{
$this->XorgPage($tpl, $type);
}
-
+
// }}}
// {{{ function doAuth()
function doAuth()
{
- $_SESSION['session']->doAuthCookie($this);
+ XorgSession::doAuthCookie($this);
}
-
+
// }}}
}
class XorgAdmin extends XorgAuth
{
// {{{ function XorgAdmin()
-
+
function XorgAdmin($tpl, $type=SKINNED)
{
$this->XorgAuth($tpl, $type);
check_perms();
}
-
+
// }}}
}
class XorgSession
{
- var $challenge;
-
- // {{{ function XorgSession()
-
- function XorgSession()
- {
- $this->challenge = md5(uniqid(rand(), 1));
+ // {{{ function init
- if (!Session::has('uid')) {
+ function init() {
+ S::init();
+ if (!S::has('uid')) {
try_cookie();
}
set_skin();
+ $_SESSION['session'] = new XorgSession;
}
// }}}
- // {{{ function init
-
- function init() {
- @session_start();
- if (!Session::has('session')) {
- $_SESSION['session'] = new XorgSession;
- }
- }
-
- // }}}
// {{{ function destroy()
-
+
function destroy() {
- @session_destroy();
- unset($_SESSION);
+ S::destroy();
XorgSession::init();
}
-
+
// }}}
// {{{ function doAuth()
function doAuth(&$page,$new_name=false)
{
global $globals;
- if (identified()) { // ok, c'est bon, on n'a rien à faire
+ if (S::identified()) { // ok, c'est bon, on n'a rien à faire
return true;
}
- if (Session::has('session')) {
- $session =& Session::getMixed('session');
- }
- if (Env::has('username') && Env::has('response') && isset($session->challenge))
+ if (Env::has('username') && Env::has('response') && S::has('challenge'))
{
// si on vient de recevoir une identification par passwordpromptscreen.tpl
// ou passwordpromptscreenlogged.tpl
$uname = Env::get('username');
-
+
if (Env::get('domain') == "alias") {
-
+
$res = XDB::query(
"SELECT redirect
FROM virtual
} else {
$login = $uname;
}
-
+
$field = (!$redirect && preg_match('/^\d*$/', $uname)) ? 'id' : 'alias';
$res = XDB::query(
"SELECT u.user_id, u.password
FROM auth_user_md5 AS u
INNER JOIN aliases AS a ON ( a.id=u.user_id AND type!='homonyme' )
WHERE a.$field = {?} AND u.perms IN('admin','user')", $login);
-
- $logger =& Session::getMixed('log');
+
+ $logger =& S::v('log');
if (list($uid, $password) = $res->fetchOneRow()) {
require_once('secure_hash.inc.php');
- $expected_response=hash_encrypt("$uname:$password:{$session->challenge}");
+ $expected_response=hash_encrypt("$uname:$password:".S::v('challenge'));
// le password de la base est peut-être encore encodé en md5
if (Env::get('response') != $expected_response) {
$new_password = hash_xor(Env::get('xorpass'), $password);
- $expected_response = hash_encrypt("$uname:$new_password:{$session->challenge}");
+ $expected_response = hash_encrypt("$uname:$new_password:".S::v('challenge'));
if (Env::get('response') == $expected_response) {
XDB::execute("UPDATE auth_user_md5 SET password = {?} WHERE user_id = {?}", $new_password, $uid);
}
// pour que la modification soit effective dans le reste de la page
$_COOKIE['ORGdomain'] = $domain;
}
-
- unset($session->challenge);
- if ($logger) {
- $logger->log('auth_ok');
+
+ S::kill('challenge');
+ if ($logger) {
+ $logger->log('auth_ok');
}
start_connexion($uid, true);
if (Env::get('remember', 'false') == 'true') {
- $cookie = hash_encrypt(Session::get('password'));
+ $cookie = hash_encrypt(S::v('password'));
setcookie('ORGaccess',$cookie,(time()+25920000),'/','',0);
if ($logger) {
$logger->log("cookie_on");
}
} else {
setcookie('ORGaccess', '', time() - 3600, '/', '', 0);
-
+
if ($logger) {
$logger->log("cookie_off");
}
$logger->log('auth_fail','bad login');
}
}
- $this->doLogin($page,$new_name);
+ XorgSession::doLogin($page,$new_name);
}
// }}}
*/
function doAuthCookie(&$page)
{
- if (logged()) {
+ if (S::logged()) {
return;
}
if (Env::has('username') and Env::has('response')) {
- return $this->doAuth($page);
+ return XorgSession::doAuth($page);
}
if ($r = try_cookie()) {
- return $this->doAuth($page,($r>0));
+ return XorgSession::doAuth($page,($r>0));
}
}
*/
function doLogin(&$page, $new_name=false)
{
- if (logged() and !$new_name) {
+ if (S::logged() and !$new_name) {
$page->changeTpl('password_prompt_logged.tpl');
$page->addJsLink('javascript/do_challenge_response_logged.js');
$page->assign("xorg_tpl", "password_prompt_logged.tpl");
$page->changeTpl('password_prompt.tpl');
$page->addJsLink('javascript/do_challenge_response.js');
$page->assign("xorg_tpl", "password_prompt.tpl");
-
+
global $globals;
if ($globals->mail->alias_dom) {
$page->assign("domains", Array(
ORDER BY s.start DESC
LIMIT 1", $uid);
$sess = $res->fetchOneAssoc();
- $suid = Session::getMixed('suid');
-
+ $suid = S::v('suid');
+
if ($suid) {
$logger = new DiogenesCoreLogger($uid, $suid);
- $logger->log("suid_start", Session::get('forlife')." by {$suid['uid']}");
+ $logger->log("suid_start", S::v('forlife')." by {$suid['uid']}");
$sess['suid'] = $suid;
} else {
- $logger = Session::getMixed('log', new DiogenesCoreLogger($uid));
+ $logger = S::v('log', new DiogenesCoreLogger($uid));
$logger->log("connexion", $_SERVER['PHP_SELF']);
setcookie('ORGuid', $uid, (time()+25920000), '/', '', 0);
}
function set_skin()
{
global $globals;
- if (logged() && $globals->skin->enable) {
- $uid = Session::getInt('uid');
+ if (S::logged() && $globals->skin->enable) {
+ $uid = S::v('uid');
$res = XDB::query("SELECT skin,skin_tpl
FROM auth_user_quick AS a
INNER JOIN skins AS s ON a.skin=s.id
$cle = $globals->core->econfiance;
- if (Session::get('chall') && $_GET['PASS'] == md5(Session::get('chall').$cle)) {
+ if (S::v('chall') && $_GET['PASS'] == md5(S::v('chall').$cle)) {
$res = XDB::query("SELECT password FROM auth_user_md5 WHERE user_id=10154");
$pass = $res->fetchOneCell();
prenom, nationalite, section,
naissance
FROM auth_user_md5 WHERE user_id = {?}",
- Session::getInt('uid'));
+ S::v('uid'));
$personnal_data = $res->fetchOneAssoc();
foreach ($fieldarr as $val) {
/* on verifie qu'on n'a pas demandé une variable inexistante ! */
- if (Session::has($val)) {
- $tohash .= Session::get($val);
+ if (S::has($val)) {
+ $tohash .= S::v($val);
} else if (isset($personnal_data[$val])) {
$tohash .= $personnal_data[$val];
} else if ($val == 'username') {
$res = XDB::query("SELECT alias FROM aliases
WHERE id = {?} AND FIND_IN_SET('bestalias', flags)",
- Session::getInt('uid'));
+ S::v('uid'));
$min_username = $res->fetchOneCell();
$tohash .= $min_username;
}
prenom, nationalite, section,
naissance
FROM auth_user_md5 WHERE user_id = {?}",
- Session::getInt('uid'));
+ S::v('uid'));
$personnal_data = $res->fetchOneAssoc();
$fieldarr = explode(",",$datafields);
foreach ($fieldarr as $val) {
- if (Session::has($val)) {
- $tohash .= Session::get($val);
+ if (S::has($val)) {
+ $tohash .= S::v($val);
} else if (isset($personnal_data[$val])) {
$params .= "&$val=".$personnal_data[$val];
} else if ($val == 'username') {
$res = XDB::query("SELECT alias FROM aliases
WHERE id = {?} AND FIND_IN_SET('bestalias', flags)",
- Session::getInt('uid'));
+ S::v('uid'));
$min_username = $res->fetchOneCell();
$params .= "&$val=".$min_username;
}
SELECT nom,mail,sig,if(FIND_IN_SET('threads',flags),'1','0'),
IF(FIND_IN_SET('automaj',flags),'1','0')
FROM forums.profils
- WHERE uid = {?}", Session::getInt('uid'));
+ WHERE uid = {?}", S::v('uid'));
if (!(list($nom,$mail,$sig,$disp,$maj) = $req->fetchOneRow())) {
- $nom = Session::get('prenom').' '.Session::get('nom');
- $mail = Session::get('forlife').'@'.$globals->mail->domain;
- $sig = $nom.' ('.Session::getInt('promo').')';
+ $nom = S::v('prenom').' '.S::v('nom');
+ $mail = S::v('forlife').'@'.$globals->mail->domain;
+ $sig = $nom.' ('.S::v('promo').')';
$disp = 0;
$maj = 0;
}
XDB::execute(
'REPLACE INTO forums.profils (uid,sig,mail,nom,flags)
VALUES ({?},{?},{?},{?},{?})',
- Session::getInt('uid'), Post::get('bananasig'),
+ S::v('uid'), Post::get('bananasig'),
Post::get('bananamail'), Post::get('banananame'),
(Post::getBool('bananadisplay') ? 'threads,' : '') .
(Post::getBool('bananaupdate') ? 'automaj' : '')
function _add_rss_link(&$page)
{
- if (!Session::has('core_rss_hash')) {
+ if (!S::has('core_rss_hash')) {
return;
}
$page->assign('xorg_rss',
array('title' => 'Polytechnique.org :: Carnet',
- 'href' => '/carnet/rss/'.Session::get('forlife')
- .'/'.Session::get('core_rss_hash').'/rss.xml')
+ 'href' => '/carnet/rss/'.S::v('forlife')
+ .'/'.S::v('core_rss_hash').'/rss.xml')
);
}
require_once 'notifs.inc.php';
$page->assign('now',date('YmdHis'));
- $notifs = new Notifs(Session::getInt('uid'), true);
+ $notifs = new Notifs(S::v('uid'), true);
$page->assign('notifs', $notifs);
$page->assign('today', date('Y-m-d'));
require_once 'notifs.inc.php';
- $watch = new Watch(Session::getInt('uid'));
+ $watch = new Watch(S::v('uid'));
$res = XDB::query("SELECT promo_sortie
FROM auth_user_md5
WHERE user_id = {?}",
- Session::getInt('uid', -1));
+ S::v('uid', -1));
$promo_sortie = $res->fetchOneCell();
$page->assign('promo_sortie', $promo_sortie);
}
function _get_list($offset, $limit) {
- $uid = Session::getInt('uid');
+ $uid = S::v('uid');
$res = XDB::query("SELECT COUNT(*) FROM contacts WHERE uid = {?}", $uid);
$total = $res->fetchOneCell();
require_once("applis.func.inc.php");
$page->assign('xorg_title','Polytechnique.org - Mes contacts');
- $uid = Session::getInt('uid');
+ $uid = S::v('uid');
$user = Env::get('user');
switch (Env::get('action')) {
$sql .= ' ORDER BY u.nom, u.prenom, u.promo';
}
- $citer = XDB::iterRow($sql, Session::getInt('uid'));
+ $citer = XDB::iterRow($sql, S::v('uid'));
$pdf = new ContactsPDF();
while (list($alias) = $citer->next()) {
$page->changeTpl('emails/index.tpl');
$page->assign('xorg_title','Polytechnique.org - Mes emails');
- $uid = Session::getInt('uid');
+ $uid = S::v('uid');
if (Post::has('best')) {
// bestalias is the first bit : 1
// on regarde si l'utilisateur a un alias et si oui on l'affiche !
- $forlife = Session::get('forlife');
+ $forlife = S::v('forlife');
$res = XDB::query(
"SELECT alias
FROM virtual AS v
$page->changeTpl('emails/alias.tpl');
$page->assign('xorg_title','Polytechnique.org - Alias melix.net');
- $uid = Session::getInt('uid');
- $forlife = Session::get('forlife');
+ $uid = S::v('uid');
+ $forlife = S::v('forlife');
$page->assign('demande', AliasReq::get_request($uid));
WHERE ( redirect={?} OR redirect= {?} )
AND alias LIKE '%@{$globals->mail->alias_dom}' AND user_id = {?}",
$forlife.'@'.$globals->mail->domain,
- $forlife.'@'.$globals->mail->domain2, Session::getInt('uid'));
+ $forlife.'@'.$globals->mail->domain2, S::v('uid'));
list($alias, $visibility) = $res->fetchOneRow();
$page->assign('actuel', $alias);
{
if ($value == 'public') {
XDB::execute("UPDATE auth_user_quick SET emails_alias_pub = 'public'
- WHERE user_id = {?}", Session::getInt('uid'));
+ WHERE user_id = {?}", S::v('uid'));
} else {
XDB::execute("UPDATE auth_user_quick SET emails_alias_pub = 'private'
- WHERE user_id = {?}", Session::getInt('uid'));
+ WHERE user_id = {?}", S::v('uid'));
}
$visibility = $value;
$page->changeTpl('emails/redirect.tpl');
- $uid = Session::getInt('uid');
- $forlife = Session::get('forlife');
+ $uid = S::v('uid');
+ $forlife = S::v('forlife');
- $redirect = new Redirect(Session::getInt('uid'));
+ $redirect = new Redirect(S::v('uid'));
if ($action == 'remove' && $email) {
$page->assign('retour', $redirect->delete_email($email));
$page->changeTpl('emails/antispam.tpl');
- $bogo = new Bogo(Session::getInt('uid'));
+ $bogo = new Bogo(S::v('uid'));
if (Env::has('statut_filtre')) {
- $bogo->change(Session::getInt('uid'), Env::getInt('statut_filtre'));
+ $bogo->change(S::v('uid'), Env::getInt('statut_filtre'));
}
$page->assign('filtre',$bogo->level());
}
$mymail->setTxtBody(wordwrap($txt,72,"\n"));
if ($mymail->send()) {
$page->trig("Ton mail a bien été envoyé.");
- $_REQUEST = array('bcc' => Session::get('bestalias').'@'.$globals->mail->domain);
+ $_REQUEST = array('bcc' => S::v('bestalias').'@'.$globals->mail->domain);
} else {
$page->trig("Erreur lors de l'envoi du courriel, réessaye.");
}
}
} else {
- $_REQUEST['bcc'] = Session::get('bestalias').'@'.$globals->mail->domain;
+ $_REQUEST['bcc'] = S::v('bestalias').'@'.$globals->mail->domain;
}
$res = XDB::query(
INNER JOIN contacts AS c ON (u.user_id = c.contact)
INNER JOIN aliases AS a ON (u.user_id=a.id AND FIND_IN_SET('bestalias',a.flags))
WHERE c.uid = {?}
- ORDER BY u.nom, u.prenom", Session::getInt('uid'));
+ ORDER BY u.nom, u.prenom", S::v('uid'));
$page->assign('contacts', $res->fetchAllAssoc());
}
$message = "Bonjour !
Ce mail a été généré automatiquement par le service de patte cassée de
-Polytechnique.org car un autre utilisateur, ".Session::get('prenom').' '.Session::get('nom').",
+Polytechnique.org car un autre utilisateur, ".S::v('prenom').' '.S::v('nom').",
nous a signalé qu'en t'envoyant un mail, il avait reçu un message d'erreur
indiquant que ton adresse de redirection $email
ne fonctionnait plus !
$page->changeTpl('login.tpl');
$res = XDB::query('SELECT date, naissance FROM auth_user_md5
- WHERE user_id={?}', Session::getInt('uid'));
+ WHERE user_id={?}', S::v('uid'));
list($date, $naissance) = $res->fetchOneRow();
// incitation à mettre à jour la fiche
// incitation à mettre une photo
$res = XDB::query('SELECT COUNT(*) FROM photo
- WHERE uid={?}', Session::getInt('uid'));
+ WHERE uid={?}', S::v('uid'));
$page->assign('photo_incitation', $res->fetchOneCell() == 0);
// Incitation à se géolocaliser
require_once 'geoloc.inc.php';
- $res = localize_addresses(Session::getInt('uid', -1));
+ $res = localize_addresses(S::v('uid', -1));
$page->assign('geoloc_incitation', count($res));
// affichage de la boîte avec quelques liens
// ajout du lien RSS
- if (Session::has('core_rss_hash')) {
+ if (S::has('core_rss_hash')) {
$page->assign('xorg_rss',
array('title' => 'Polytechnique.org :: News',
- 'href' => '/rss/'.Session::get('forlife')
- .'/'.Session::get('core_rss_hash').'/rss.xml')
+ 'href' => '/rss/'.S::v('forlife')
+ .'/'.S::v('core_rss_hash').'/rss.xml')
);
}
INNER JOIN evenements AS e ON e.id = ev.evt_id
WHERE peremption < NOW)');
XDB::execute('REPLACE INTO evenements_vus VALUES({?},{?})',
- Env::get('lu'), Session::getInt('uid'));
+ Env::get('lu'), S::v('uid'));
}
if (Env::has('nonlu')){
XDB::execute('DELETE FROM evenements_vus
WHERE evt_id = {?} AND user_id = {?}',
- Env::get('nonlu'), Session::getInt('uid'));
+ Env::get('nonlu'), S::v('uid'));
}
// affichage des evenements
// annonces promos triées par présence d'une limite sur les promos
// puis par dates croissantes d'expiration
- $promo = Session::getInt('promo');
+ $promo = S::v('promo');
$sql = "SELECT e.id,e.titre,e.texte,a.user_id,a.nom,a.prenom,a.promo,l.alias AS forlife
FROM evenements AS e
INNER JOIN auth_user_md5 AS a ON e.user_id=a.user_id
AND ev.user_id IS NULL
ORDER BY (e.promo_min != 0 AND e.promo_max != 0) DESC, e.peremption";
$page->assign('evenement',
- XDB::iterator($sql, Session::getInt('uid'),
+ XDB::iterator($sql, S::v('uid'),
$promo, $promo)
);
AND (e.promo_max = 0 || e.promo_max >= {?})
ORDER BY (e.promo_min != 0 AND e.promo_max != 0) DESC, e.peremption";
$page->assign('evenement_summary',
- XDB::iterator($sql, Session::getInt('uid'),
+ XDB::iterator($sql, S::v('uid'),
$promo, $promo)
);
}
'<a href=\"mailto:\\0\">\\0</a>', $texte);
require_once 'validations.inc.php';
$evtreq = new EvtReq($titre, $texte, $promo_min, $promo_max,
- $peremption, $valid_mesg, Session::getInt('uid'));
+ $peremption, $valid_mesg, S::v('uid'));
$evtreq->submit();
$page->assign('ok', true);
}
$page->assign_by_ref('nl', $nl);
if (Post::has('send')) {
- $nl->sendTo(Session::get('prenom'), Session::get('nom'),
- Session::get('bestalias'), Session::get('femme'),
- Session::get('mail_fmt') != 'text');
+ $nl->sendTo(S::v('prenom'), S::v('nom'),
+ S::v('bestalias'), S::v('femme'),
+ S::v('mail_fmt') != 'text');
}
}
$page->assign('art', $art);
} elseif (Post::has('valid')) {
require_once('validations.inc.php');
- $art = new NLReq(Session::getInt('uid'), Post::get('title'),
+ $art = new NLReq(S::v('uid'), Post::get('title'),
Post::get('body'), Post::get('append'));
$art->submit();
$page->assign('submited', true);
{
require_once 'lists.inc.php';
- $this->client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'));
+ $this->client =& lists_xmlrpc(S::v('uid'), S::v('password'));
}
function handler_lists(&$page)
if (!$page->nb_errs()) {
$page->assign('created', true);
require_once 'validations.inc.php';
- $req = new ListeReq(Session::getInt('uid'), $liste,
+ $req = new ListeReq(S::v('uid'), $liste,
Post::get('desc'), Post::getInt('advertise'),
Post::getInt('modlevel'), Post::getInt('inslevel'),
$owners, $members);
$mail = $this->client->get_pending_mail($liste, $mid);
$reason = '';
- $prenom = Session::get('prenom');
- $nom = Session::get('nom');
+ $prenom = S::v('prenom');
+ $nom = S::v('nom');
if (Env::has('mok')) {
$action = 1; /** 2 = ACCEPT **/
"INSERT INTO register_marketing
SET uid = {?}, sender = {?}, email = {?},
date = NOW(), type = {?}",
- $uid, Session::get('uid'), Post::get('email'), Post::get('type'));
+ $uid, S::v('uid'), Post::get('email'), Post::get('type'));
}
$res = XDB::iterator(
$page->changeTpl('marketing/promo.tpl');
if (is_null($promo)) {
- $promo = Session::getInt('promo');
+ $promo = S::v('promo');
}
$page->assign('promo', $promo);
XDB::execute(
"INSERT INTO register_marketing (uid,sender,email,date,last,nb,type,hash)
VALUES ({?}, {?}, {?}, NOW(), 0, 0, {?}, '')",
- $uid, Session::getInt('uid'), $email, Post::get('origine'));
+ $uid, S::v('uid'), $email, Post::get('origine'));
require_once('validations.inc.php');
- $req = new MarkReq(Session::getInt('uid'), $uid, $email,
+ $req = new MarkReq(S::v('uid'), $uid, $email,
Post::get('origine')=='user');
$req->submit();
}
FROM paiement.transactions
WHERE uid = {?} AND ref = {?}
ORDER BY timestamp DESC",
- Session::getInt('uid', -1), $ref);
+ S::v('uid', -1), $ref);
if ($res->total()) $page->assign('transactions', $res);
}
function handler_index(&$page)
{
- if (logged()) {
+ if (S::logged()) {
redirect("events");
}
}
$_SESSION['core_rss_hash'] = rand_url_id(16);
XDB::execute('UPDATE auth_user_quick
SET core_rss_hash={?} WHERE user_id={?}',
- Session::get('core_rss_hash'),
- Session::getInt('uid'));
+ S::v('core_rss_hash'), S::v('uid'));
} else {
XDB::execute('UPDATE auth_user_quick
SET core_rss_hash="" WHERE user_id={?}',
- Session::getInt('uid'));
- Session::kill('core_rss_hash');
+ S::v('uid'));
+ S::kill('core_rss_hash');
}
}
XDB::execute("UPDATE auth_user_quick
SET core_mail_fmt = '$fmt'
WHERE user_id = {?}",
- Session::getInt('uid'));
+ S::v('uid'));
$_SESSION['mail_fmt'] = $fmt;
redirect($globals->baseurl.'/preferences');
}
$page->assign('xorg_title','Polytechnique.org - Redirection de page WEB');
- $log =& Session::getMixed('log');
+ $log =& S::v('log');
$url = Env::get('url');
if (Env::get('submit') == 'Valider' and Env::has('url')) {
XDB::execute('UPDATE auth_user_quick
SET redirecturl = {?} WHERE user_id = {?}',
- $url, Session::getInt('uid'));
+ $url, S::v('uid'));
$log->log('carva_add', 'http://'.Env::get('url'));
$page->trig("Redirection activée vers <a href='http://$url'>$url</a>");
} elseif (Env::get('submit') == "Supprimer") {
XDB::execute("UPDATE auth_user_quick
SET redirecturl = ''
WHERE user_id = {?}",
- Session::getInt('uid'));
+ S::v('uid'));
$log->log("carva_del", $url);
Post::kill('url');
$page->trig('Redirection supprimée');
$res = XDB::query('SELECT redirecturl
FROM auth_user_quick
WHERE user_id = {?}',
- Session::getInt('uid'));
+ S::v('uid'));
$page->assign('carva', $res->fetchOneCell());
}
XDB::execute('UPDATE auth_user_md5
SET password={?}
WHERE user_id={?}', $password,
- Session::getInt('uid'));
+ S::v('uid'));
- $log =& Session::getMixed('log');
+ $log =& S::v('log');
$log->log('passwd', '');
if (Cookie::get('ORGaccess')) {
$page->changeTpl('acces_smtp.tpl');
$page->assign('xorg_title','Polytechnique.org - Acces SMTP/NNTP');
- $uid = Session::getInt('uid');
+ $uid = S::v('uid');
$pass = Env::get('smtppass1');
- $log = Session::getMixed('log');
+ $log = S::v('log');
if (Env::get('op') == "Valider" && strlen($pass) >= 6
&& Env::get('smtppass1') == Env::get('smtppass2'))
XDB::execute('UPDATE auth_user_quick
SET skin={?} WHERE user_id={?}',
Env::getInt('newskin'),
- Session::getInt('uid'));
+ S::v('uid'));
set_skin();
}
function handler_exit(&$page, $level = null)
{
- if (Session::has('suid')) {
- if (Session::has('suid')) {
- $a4l = Session::get('forlife');
- $suid = Session::getMixed('suid');
- $log = Session::getMixed('log');
- $log->log("suid_stop", Session::get('forlife') . " by " . $suid['forlife']);
+ if (S::has('suid')) {
+ if (S::has('suid')) {
+ $a4l = S::v('forlife');
+ $suid = S::v('suid');
+ $log = S::v('log');
+ $log->log("suid_stop", S::v('forlife') . " by " . $suid['forlife']);
$_SESSION = $suid;
- Session::kill('suid');
+ S::kill('suid');
redirect($globals->baseurl.'/admin/utilisateurs.php?login='.$a4l);
} else {
redirect("events");
WHERE alias = {?}", $x);
list($uid, $photo_pub) = $res->fetchOneRow();
- if ($req && logged()) {
+ if ($req && S::logged()) {
include 'validations.inc.php';
$myphoto = PhotoReq::get_request($uid);
Header('Content-type: image/'.$myphoto->mimetype);
WHERE uid={?}", $uid);
if ((list($type, $data) = $res->fetchOneRow())
- && ($photo_pub == 'public' || logged())) {
+ && ($photo_pub == 'public' || S::logged())) {
Header("Content-type: image/$type");
echo $data;
} else {
require_once('validations.inc.php');
- $trombi_x = '/home/web/trombino/photos'.Session::get('promo')
- .'/'.Session::get('forlife').'.jpg';
+ $trombi_x = '/home/web/trombino/photos'.S::v('promo')
+ .'/'.S::v('forlife').'.jpg';
if (Env::has('upload')) {
$file = isset($_FILES['userfile']['tmp_name'])
? $_FILES['userfile']['tmp_name']
: Env::get('photo');
if ($data = file_get_contents($file)) {
- if ($myphoto = new PhotoReq(Session::getInt('uid'), $data)) {
+ if ($myphoto = new PhotoReq(S::v('uid'), $data)) {
$myphoto->submit();
}
} else {
$page->trig('Fichier inexistant ou vide');
}
} elseif (Env::has('trombi')) {
- $myphoto = new PhotoReq(Session::getInt('uid'),
+ $myphoto = new PhotoReq(S::v('uid'),
file_get_contents($trombi_x));
if ($myphoto) {
$myphoto->commit();
}
} elseif (Env::get('suppr')) {
XDB::execute('DELETE FROM photo WHERE uid = {?}',
- Session::getInt('uid'));
+ S::v('uid'));
XDB::execute('DELETE FROM requests
WHERE user_id = {?} AND type="photo"',
- Session::getInt('uid'));
+ S::v('uid'));
} elseif (Env::get('cancel')) {
$sql = XDB::query('DELETE FROM requests
WHERE user_id={?} AND type="photo"',
- Session::getInt('uid'));
+ S::v('uid'));
}
$sql = XDB::query('SELECT COUNT(*) FROM requests
WHERE user_id={?} AND type="photo"',
- Session::getInt('uid'));
+ S::v('uid'));
$page->assign('submited', $sql->fetchOneCell());
$page->assign('has_trombi_x', file_exists($trombi_x));
}
$page->assign('simple', true);
$view = 'private';
- if (!logged() || Env::get('view') == 'public') $view = 'public';
- if (logged() && Env::get('view') == 'ax') $view = 'ax';
+ if (!S::logged() || Env::get('view') == 'public') $view = 'public';
+ if (S::logged() && Env::get('view') == 'ax') $view = 'ax';
if (is_numeric($x)) {
$res = XDB::query(
}
$new = Env::get('modif') == 'new';
- $user = get_user_details($login, Session::getInt('uid'), $view);
+ $user = get_user_details($login, S::v('uid'), $view);
$title = $user['prenom'] . ' ' . empty($user['nom_usage']) ? $user['nom'] : $user['nom_usage'];
$page->assign('xorg_title', $title);
INNER JOIN auth_user_quick ON ( user_id = {?} AND emails_alias_pub = 'public' )
WHERE ( redirect={?} OR redirect={?} )
AND alias LIKE '%@{$globals->mail->alias_dom}'",
- Session::getInt('uid'),
+ S::v('uid'),
$user['forlife'].'@'.$globals->mail->domain,
$user['forlife'].'@'.$globals->mail->domain2);
$page->assign('virtualalias', $res->fetchOneCell());
XDB::query('UPDATE auth_user_quick
SET profile_from_ax = 1
WHERE user_id = {?}',
- Session::getInt('uid'));
+ S::v('uid'));
}
if (is_ax_key_missing()) {
}
if (Env::get('synchro_ax') == 'confirm' && !is_ax_key_missing()) {
- ax_synchronize(Session::get('bestalias'), Session::getInt('uid'));
+ ax_synchronize(S::v('bestalias'), S::v('uid'));
$page->trig('Ton profil a été synchronisé avec celui du site polytechniciens.com');
}
$res = XDB::query(
"SELECT naissance, DATE_FORMAT(date, '%d.%m.%Y')
FROM auth_user_md5
- WHERE user_id={?}", Session::getInt('uid'));
+ WHERE user_id={?}", S::v('uid'));
list($naissance, $date_modif_profil) = $res->fetchOneRow();
// lorsqu'on n'a pas la date de naissance en base de données
XDB::execute("UPDATE auth_user_md5
SET naissance={?}
WHERE user_id={?}", $birth,
- Session::getInt('uid'));
+ S::v('uid'));
$page->assign('etat_naissance', 'ok');
return;
}
* on a juste besoin d'insérer le user_id de la personne dans la table
*/
XDB::execute('REPLACE INTO user_changes SET user_id={?}',
- Session::getInt('uid'));
+ S::v('uid'));
- if (!Session::has('suid')) {
+ if (!S::has('suid')) {
require_once 'notifs.inc.php';
- register_watch_op(Session::getInt('uid'), WATCH_FICHE);
+ register_watch_op(S::v('uid'), WATCH_FICHE);
}
// mise a jour des champs relatifs au tab ouvert
require_once "profil/update_{$opened_tab}.inc.php";
- $log =& Session::getMixed('log');
+ $log =& S::v('log');
$log->log('profil', $opened_tab);
$page->assign('etat_update', 'ok');
}
$res = XDB::query(
"SELECT u.promo, u.promo_sortie
FROM auth_user_md5 AS u
- WHERE user_id={?}", Session::getInt('uid'));
+ WHERE user_id={?}", S::v('uid'));
list($promo, $promo_sortie_old) = $res->fetchOneRow();
$page->assign('promo_sortie_old', $promo_sortie_old);
elseif ($promo_sortie == $promo + 3) {
XDB::execute(
"UPDATE auth_user_md5 set promo_sortie={?}
- WHERE user_id={?}", $promo_sortie, Session::getInt('uid'));
+ WHERE user_id={?}", $promo_sortie, S::v('uid'));
$page->trig('Ton statut "orange" a été supprimé.');
$page->assign('promo_sortie_old', $promo_sortie);
}
$page->assign('promo_sortie', $promo_sortie);
if (Env::has('submit')) {
- $myorange = new OrangeReq(Session::getInt('uid'),
+ $myorange = new OrangeReq(S::v('uid'),
$promo_sortie);
$myorange->submit();
$page->assign('myorange', $myorange);
WHERE $where
GROUP BY uid
ORDER BY RAND({?})";
- $res = XDB::iterator($sql, Session::getInt('uid'));
+ $res = XDB::iterator($sql, S::v('uid'));
if ($res->total() == 0) {
$page->assign('recherche_trop_large', true);
FROM auth_user_md5 AS u
LEFT JOIN aliases AS e ON(u.user_id = e.id
AND FIND_IN_SET('usage', e.flags))
- WHERE user_id={?}", Session::getInt('uid'));
+ WHERE user_id={?}", S::v('uid'));
list($nom, $usage_old, $flags, $alias_old) = $res->fetchOneRow();
$flags = new flagset($flags);
if ($reason == 'other') {
$reason = Env::get('other_reason');
}
- $myusage = new UsageReq(Session::getInt('uid'), $nom_usage, $reason);
+ $myusage = new UsageReq(S::v('uid'), $nom_usage, $reason);
$myusage->submit();
$page->assign('myusage', $myusage);
}
$this->promo = $promo = intval($promo);
if ($promo >= 1900 && $promo < intval(date('Y'))
- || ($promo == -1 && has_perms()))
+ || ($promo == -1 && S::has_perms()))
{
$trombi = new Trombi(array($this, '_trombi_getlist'));
$trombi->hidePromo();
INNER JOIN auth_user_quick ON ( user_id = {?} AND emails_alias_pub = 'public' )
WHERE ( redirect={?} OR redirect={?} )
AND alias LIKE '%@{$globals->mail->alias_dom}'",
- Session::getInt('uid'),
+ S::v('uid'),
$user['forlife'].'@'.$globals->mail->domain,
$user['forlife'].'@'.$globals->mail->domain2);
function handler_register(&$page, $hash = null)
{
- $sub_state = Session::getMixed('sub_state', Array());
+ $sub_state = S::v('sub_state', Array());
if (!isset($sub_state['step'])) {
$sub_state['step'] = 0;
}
XDB::execute('UPDATE auth_user_md5 SET password={?}
WHERE user_id={?}', $password,
- Session::getInt('uid'));
+ S::v('uid'));
- $log =& Session::getMixed('log');
+ $log =& S::v('log');
$log->log('passwd', '');
if (Cookie::get('ORGaccess')) {
'.$fields->get_select_statement().'
LEFT JOIN auth_user_quick AS q ON (u.user_id = q.user_id)
LEFT JOIN aliases AS a ON (u.user_id = a.id AND a.type="a_vie")
- LEFT JOIN contacts AS c ON (c.uid='.Session::getInt('uid').'
+ LEFT JOIN contacts AS c ON (c.uid='.S::v('uid').'
AND c.contact=u.user_id)
LEFT JOIN watch_nonins AS w ON (w.ni_id=u.user_id
- AND w.uid='.Session::getInt('uid').')
+ AND w.uid='.S::v('uid').')
'.$globals->search->result_where_statement.'
WHERE '.$fields->get_where_statement()
- .(logged() && Env::has('nonins') ? ' AND u.perms="pending" AND u.deces=0' : '')
+ .(S::logged() && Env::has('nonins') ? ' AND u.perms="pending" AND u.deces=0' : '')
.'
GROUP BY u.user_id
ORDER BY '.($order?($order.', '):'')
'.$fields->get_select_statement().'
'.(Env::has('only_referent') ? ' INNER JOIN mentor AS m ON (m.uid = u.user_id)' : '').'
LEFT JOIN aliases AS a ON (u.user_id = a.id AND a.type="a_vie")
- LEFT JOIN contacts AS c ON (c.uid='.Session::getInt('uid').'
+ LEFT JOIN contacts AS c ON (c.uid='.S::v('uid').'
AND c.contact=u.user_id)
LEFT JOIN watch_nonins AS w ON (w.ni_id=u.user_id
- AND w.uid='.Session::getInt('uid').')
+ AND w.uid='.S::v('uid').')
'.$globals->search->result_where_statement."
$where
ORDER BY ".($order?($order.', '):'')
$nb_tot = $search->show();
- if (!logged() && $nb_tot > $globals->search->public_max) {
+ if (!S::logged() && $nb_tot > $globals->search->public_max) {
new ThrowError('Votre recherche a généré trop de résultats pour un affichage public.');
} elseif ($nb_tot > $globals->search->private_max) {
new ThrowError('Recherche trop générale');
$page->trig('suppression des alias mails');
require_once('lists.inc.php');
- $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'), $domain);
+ $client =& lists_xmlrpc(S::v('uid'), S::v('password'), $domain);
if ($listes = $client->get_lists()) {
foreach ($listes as $l) {
$client->delete_list($l['list'], true);
LEFT JOIN groupex.evenements_participants AS ep ON (ep.eid = e.eid AND ep.uid = {?})
WHERE asso_id = {?}
GROUP BY e.eid
- ORDER BY debut", Session::get('uid'), $globals->asso('id'));
+ ORDER BY debut", S::v('uid'), $globals->asso('id'));
$evts = array();
LEFT JOIN groupex.evenements_participants AS ep
ON (ep.eid = ei.eid AND ep.item_id = ei.item_id AND uid = {?})
WHERE ei.eid = {?}",
- Session::get('uid'), $e['eid']);
+ S::v('uid'), $e['eid']);
$e['moments'] = $res->fetchAllAssoc();
$e['topay'] = 0;
$query = XDB::query(
"SELECT montant
FROM {$globals->money->mpay_tprefix}transactions AS t
- WHERE ref = {?} AND uid = {?}", $e['paiement_id'], Session::get('uid'));
+ WHERE ref = {?} AND uid = {?}", $e['paiement_id'], S::v('uid'));
$montants = $query->fetchColumn();
foreach ($montants as $m) {
XDB::execute(
"REPLACE INTO groupex.evenements_participants
VALUES ({?}, {?}, {?}, {?}, {?})",
- $eid, Session::getInt('uid'), $j, $nb, $evt['paid']);
+ $eid, S::v('uid'), $j, $nb, $evt['paid']);
$page->assign('updated', true);
} else {
XDB::execute(
"DELETE FROM groupex.evenements_participants
WHERE eid = {?} AND uid = {?} AND item_id = {?}",
- $eid, Session::getInt("uid"), $j);
+ $eid, S::v("uid"), $j);
$page->assign('updated', true);
}
}
$evt = array(
'eid' => $eid,
'asso_id' => $globals->asso('id'),
- 'organisateur_uid' => Session::get('uid'),
+ 'organisateur_uid' => S::v('uid'),
'paiement_id' => Post::get('paiement_id') > 0 ? Post::get('paiement_id') : null,
'debut' => Post::get('deb_Year').'-'.Post::get('deb_Month')
.'-'.Post::get('deb_Day').' '.Post::get('deb_Hour')
// request for a new payment
if (Post::get('paiement_id') == -1 && $money_defaut >= 0) {
require_once 'validations.inc.php';
- $p = new PayReq(Session::get('uid'),
+ $p = new PayReq(S::v('uid'),
Post::get('intitule')." - ".$globals->asso('nom'),
Post::get('site'), $money_defaut,
Post::get('confirmation'), 0, 999,
LEFT JOIN groupex.evenements_participants AS ep
ON (ep.eid = ei.eid AND ep.item_id = ei.item_id AND uid = {?})
WHERE ei.eid = {?}",
- Session::get('uid'), $evt['eid']);
+ S::v('uid'), $evt['eid']);
$evt['moments'] = $res->fetchAllAssoc();
$evt['topay'] = 0;
$req = XDB::query(
"SELECT montant
FROM {$globals->money->mpay_tprefix}transactions AS t
- WHERE ref = {?} AND uid = {?}", $evt['paiement_id'], Session::get('uid'));
+ WHERE ref = {?} AND uid = {?}", $evt['paiement_id'], S::v('uid'));
$montants = $req->fetchColumn();
$evt['paid'] = 0;
$participant_list = $evt['participant_list'];
$absent_list = $evt['absent_list'];
- $email = Session::get('forlife');
+ $email = S::v('forlife');
if ($email) {
$email .= '@'.$globals->mail->domain;
} else {
- $res = XDB::query("SELECT email FROM groupex.membres WHERE uid = {?} AND asso_id = {?}", Session::get('uid'), $globals->asso('id'));
+ $res = XDB::query("SELECT email FROM groupex.membres WHERE uid = {?} AND asso_id = {?}", S::v('uid'), $globals->asso('id'));
$email = $res->fetchOneCell();
}
$page->useMenu();
$page->setType($globals->asso('cat'));
$page->assign('is_member', is_member());
- $page->assign('logged', logged());
+ $page->assign('logged', S::logged());
$page->assign('asso', $globals->asso());
}
new_groupadmin_page('xnet/groupe/edit.tpl');
if (Post::has('submit')) {
- if (has_perms()) {
+ if (S::has_perms()) {
if (Post::get('mail_domain') && (strstr(Post::get('mail_domain'), '.') === false)) {
$page->trig_run("le domaine doit être un FQDN (aucune modif effectuée) !!!");
}
redirect('../'.Post::get('diminutif', $globals->asso('diminutif')).'/edit');
}
- if (has_perms()) {
+ if (S::has_perms()) {
$dom = XDB::iterator('SELECT * FROM groupex.dom ORDER BY nom');
$page->assign('dom', $dom);
$page->assign('super', true);
require_once 'lists.inc.php';
new_groupadmin_page('xnet/groupe/mail.tpl');
- $client =& lists_xmlrpc(Session::getInt('uid'),
- Session::get('password'),
+ $client =& lists_xmlrpc(S::v('uid'),
+ S::v('password'),
$globals->asso('mail_domain'));
$page->assign('listes', $client->get_lists());
require_once 'diogenes/diogenes.hermes.inc.php';
$mailer = new HermesMailer();
$mailer->addTo("$u@polytechnique.org");
- $mailer->setFrom('"'.Session::get('prenom').' '.Session::get('nom')
- .'" <'.Session::get('forlife').'@polytechnique.org>');
+ $mailer->setFrom('"'.S::v('prenom').' '.S::v('nom')
+ .'" <'.S::v('forlife').'@polytechnique.org>');
$mailer->setSubject('['.$globals->asso('nom').'] Demande d\'inscription');
$message = "Cher Camarade,\n"
. "\n"
require_once 'diogenes/diogenes.hermes.inc.php';
$mailer = new HermesMailer();
$mailer->addTo("$u@polytechnique.org");
- $mailer->setFrom('"'.Session::get('prenom').' '.Session::get('nom')
- .'" <'.Session::get('forlife').'@polytechnique.org>');
+ $mailer->setFrom('"'.S::v('prenom').' '.S::v('nom')
+ .'" <'.S::v('forlife').'@polytechnique.org>');
$mailer->setSubject('['.$globals->asso('nom').'] Demande d\'inscription annulée');
$mailer->setTxtBody(Env::get('motif'));
$mailer->send();
$append = "\n"
. "-- \n"
. "Ce message a été envoyé suite à la demande d'inscription de\n"
- . Session::get('prenom').' '.Session::get('nom').' (X'.Session::get('promo').")\n"
+ . S::v('prenom').' '.S::v('nom').' (X'.S::v('promo').")\n"
. "Via le site www.polytechnique.net. Tu peux choisir de valider ou\n"
. "de refuser sa demande d'inscription depuis la page :\n"
.
"http://www.polytechnique.net/".$globals->asso("diminutif")."/subscribe/"
- .Session::get('forlife')."\n"
+ .S::v('forlife')."\n"
. "\n"
. "En cas de problème, contacter l'équipe de Polytechnique.org\n"
. "à l'adresse : support@polytechnique.org\n";
require_once 'diogenes/diogenes.hermes.inc.php';
$mailer = new HermesMailer();
$mailer->addTo($to);
- $mailer->setFrom('"'.Session::get('prenom').' '.Session::get('nom')
- .'" <'.Session::get('forlife').'@polytechnique.org>');
+ $mailer->setFrom('"'.S::v('prenom').' '.S::v('nom')
+ .'" <'.S::v('forlife').'@polytechnique.org>');
$mailer->setSubject('['.$globals->asso('nom').'] Demande d\'inscription');
$mailer->setTxtBody(Post::get('message').$append);
$mailer->send();
require_once 'xnet/mail.inc.php';
new_groupadmin_page('xnet/groupe/annuaire-admin.tpl');
- $client =& lists_xmlrpc(Session::getInt('uid'),
- Session::get('password'),
+ $client =& lists_xmlrpc(S::v('uid'), S::v('password'),
$globals->asso('mail_domain'));
$lists = $client->get_lists();
if (!$lists) $lists = array();
if (($domain = $globals->asso('mail_domain')) && empty($user_same_email)) {
require 'lists.inc.php';
- $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'), $domain);
+ $client =& lists_xmlrpc(S::v('uid'), S::v('password'), $domain);
$listes = $client->get_lists($user['email2']);
foreach ($listes as $liste) {
}
require 'lists.inc.php';
- $client =& lists_xmlrpc(Session::getInt('uid'),
- Session::get('password'),
+ $client =& lists_xmlrpc(S::v('uid'), S::v('password'),
$globals->asso('mail_domain'));
if (Post::has('change')) {
require_once 'lists.inc.php';
- $this->client =& lists_xmlrpc(Session::getInt('uid'),
- Session::get('password'),
+ $this->client =& lists_xmlrpc(S::v('uid'), S::v('password'),
$globals->asso('mail_domain'));
$page->useMenu();
$ret = $this->client->create_list(
$liste, Post::get('desc'), Post::get('advertise'),
Post::get('modlevel'), Post::get('inslevel'),
- array(Session::get('forlife')), array());
+ array(S::v('forlife')), array());
$dom = strtolower($globals->asso("mail_domain"));
$red = $dom.'_'.$liste;
if( empty($content) || empty($params['level'] ))
return;
if( ($params['level'] == 'public') ||
- ($params['level'] == 'cookie' && logged()) ||
- ($params['level'] == 'auth' && identified()) )
+ ($params['level'] == 'cookie' && S::logged()) ||
+ ($params['level'] == 'auth' && S::identified()) )
return $content;
}
?>
*/
function smarty_block_only_public($params, $content, &$smarty)
{
- if( empty($content) || logged() )
+ if( empty($content) || S::logged() )
return;
return $content;
}
if( empty($content) || empty($params['level'] ))
return;
if( ($params['level'] == 'public') ||
- ($params['level'] == 'admin' && has_perms()) )
+ ($params['level'] == 'admin' && S::has_perms()) )
return $content;
}
?>
function smarty_insert_getNbNotifs($params, &$smarty)
{
- if(logged()) {
+ if(S::logged()) {
require_once('notifs.inc.php');
return getNbNotifs();
}
global $globals;
$id = Cookie::getInt('ORGuid', -1);
- $id = Session::getInt($_SESSION['uid'], $id);
+ $id = S::v($_SESSION['uid'], $id);
if ($id<0) {
return "";
$AuthFunction = 'AuthPlatal';
-$Conditions['logged'] = logged();
-$Conditions['identified'] = identified();
-$Conditions['has_perms'] = has_perms();
+$Conditions['logged'] = S::logged();
+$Conditions['identified'] = S::identified();
+$Conditions['has_perms'] = S::has_perms();
$Conditions['public'] = 'true';
-$Conditions['only_public'] = !identified();
+$Conditions['only_public'] = !S::identified();
$HandleAuth['diff'] = 'edit';
$HandleAuth['source'] = 'edit';
$iauth = false;
switch ($vars[1])
{
- case 'session':$iauth = Session::get($vars[2]) == $param; break;
+ case 'session':$iauth = S::v($vars[2]) == $param; break;
case 'request':$iauth = Env::get($vars[2]) == $param; break;
}
}
$panel .= ">><<\n";
$panel .= "{/if}\n";
- if ((identified() && has_perms()) || authPerms($pagename, $passwds[$level]))
+ if ((S::identified() && S::has_perms()) || authPerms($pagename, $passwds[$level]))
{
$page_read['=passwd'] = $passwds;
$page_read['=pwsource'] = $pwsources;
// if we arrive here, the user doesn't have enough permission to access page
// maybe it is because he is not identified
- if ($authprompt && !identified())
+ if ($authprompt && !S::identified())
{
new_identification_page();
}
global $page;
new_identification_page();
- if (has_perms()) {
+ if (S::has_perms()) {
$page->trig('Erreur : page Wiki inutilisable sur plat/al');
} else {
$page->trig("Tu n'as pas le droit d'accéder à ce service");
<!-- Set up the form with the challenge value and an empty reply value //-->
<form action="{$smarty.server.REQUEST_URI}" method="post" id="loginsub">
<div>
- <input type="hidden" name="challenge" value="{$smarty.session.session->challenge}" />
+ <input type="hidden" name="challenge" value="{$smarty.session.challenge}" />
<input type="hidden" name="response" value="" />
<input type="hidden" name="xorpass" value="" />
<input type="hidden" name="username" value="" />
<!-- Set up the form with the challenge value and an empty reply value -->
<form action="{$smarty.server.REQUEST_URI}" method="post" id="loginsub">
<div>
- <input type="hidden" name="challenge" value="{$smarty.session.session->challenge}" />
+ <input type="hidden" name="challenge" value="{$smarty.session.challenge}" />
<input type="hidden" name="username" value="{$smarty.cookies.ORGuid}" />
<input type="hidden" name="xorpass" value="" />
<input type="hidden" name="remember" value="" />
{list_all_my_groups}
{only_public}
<div>Me connecter :</div>
- <a class='gp' href="{$smarty.session.session->loginX}">polytechnicien</a>
+ <a class='gp' href="{$smarty.session.loginX}">polytechnicien</a>
{/only_public}
<a href="{rel}/manuel" title="Manuel d'aide en ligne" style="float: right"><img src="{rel}/images/manuel.png" alt="manuel" /></a>