From 5e2307dcebc38ebb0ffe469967a377eb3baed571 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Sun, 23 Jul 2006 12:12:08 +0000 Subject: [PATCH] remove getMixed, make get be v, getInt be i, and getBool be b. move Env into classes git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@582 839d8a87-29fc-0310-9880-83ba4fa771e5 --- include/platal/env.inc.php => classes/Env.php | 142 ++++++++------------------ htdocs.net/groupe/dynamap.php | 2 +- htdocs.net/groupe/getData.php | 2 +- htdocs/admin/admin_trombino.php | 4 +- htdocs/admin/deces_promo.php | 6 +- htdocs/admin/emails_bounces_re.php | 2 +- htdocs/admin/evenements.php | 8 +- htdocs/admin/geoloc.php | 4 +- htdocs/admin/geoloc_dynamap.php | 8 +- htdocs/admin/gerer_applis.php | 2 + htdocs/admin/gerer_auth-groupex.php | 2 + htdocs/admin/gerer_binets.php | 2 + htdocs/admin/gerer_coupure.php | 2 + htdocs/admin/gerer_decos.php | 16 +-- htdocs/admin/gerer_groupesx.php | 2 + htdocs/admin/gerer_paiement.php | 2 + htdocs/admin/gerer_skins.php | 2 + htdocs/admin/homonymes.php | 4 +- htdocs/admin/logger_actions.php | 2 + htdocs/admin/newsletter_cats.php | 2 + htdocs/admin/newsletter_edit.php | 24 ++--- htdocs/admin/postfix_blacklist.php | 2 + htdocs/admin/postfix_delayed.php | 4 +- htdocs/admin/postfix_whitelist.php | 2 + htdocs/admin/synchro_ax.php | 4 +- htdocs/admin/utilisateurs.php | 28 ++--- htdocs/admin/valider.php | 2 +- htdocs/wiki.php | 10 +- include/banana.inc.php | 2 +- include/geoloc.inc.php | 4 +- include/homonymes.inc.php | 4 +- include/notifs.inc.php | 2 +- include/platal.inc.php | 2 +- include/profil.func.inc.php | 2 +- include/profil/get_adresses.inc.php | 2 +- include/profil/get_deco.inc.php | 10 +- include/profil/get_general.inc.php | 2 +- include/profil/get_mentor.inc.php | 30 +++--- include/profil/get_poly.inc.php | 16 +-- include/profil/get_skill.inc.php | 20 ++-- include/profil/verif_adresses.inc.php | 18 ++-- include/profil/verif_emploi.inc.php | 2 +- include/profil/verif_mentor.inc.php | 2 +- include/search.inc.php | 2 +- include/search/classes.inc.php | 4 +- include/validations.inc.php | 8 +- include/validations/homonymes.inc.php | 2 +- include/wiki.inc.php | 4 +- include/xnet/globals.inc.php | 2 +- include/xnet/session.inc.php | 6 +- include/xorg.inc.php | 4 - include/xorg.plugin.inc.php | 4 +- include/xorg/session.inc.php | 22 ++-- modules/auth.php | 2 +- modules/banana.php | 10 +- modules/carnet.php | 24 ++--- modules/email.php | 36 +++---- modules/events.php | 24 ++--- modules/geoloc.php | 6 +- modules/lists.php | 68 ++++++------ modules/marketing.php | 12 +-- modules/payment.php | 6 +- modules/platal.php | 50 ++++----- modules/profile.php | 42 ++++---- modules/register.php | 30 +++--- modules/search.php | 2 +- modules/trezo.php | 4 +- modules/xnet.php | 8 +- modules/xnetevents.php | 76 +++++++------- modules/xnetevents/xnetevents.inc.php | 2 +- modules/xnetgrp.php | 78 +++++++------- modules/xnetlists.php | 24 ++--- plugins/insert.getName.php | 2 +- plugins/insert.getUserName.php | 4 +- 74 files changed, 473 insertions(+), 505 deletions(-) rename include/platal/env.inc.php => classes/Env.php (71%) diff --git a/include/platal/env.inc.php b/classes/Env.php similarity index 71% rename from include/platal/env.inc.php rename to classes/Env.php index 4c35b98..6a7b2ac 100644 --- a/include/platal/env.inc.php +++ b/classes/Env.php @@ -19,8 +19,6 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -// {{{ class Env - class Env { // {{{ function _get @@ -29,7 +27,7 @@ class Env { return isset($_REQUEST[$key]) ? $_REQUEST[$key] : $default; } - + // }}} // {{{ function has @@ -37,43 +35,35 @@ class Env { return isset($_REQUEST[$key]); } - + // }}} // {{{ function kill - + function kill($key) { unset($_REQUEST[$key]); } // }}} - // {{{ function get - - function get($key, $default='') - { - return (string)Env::_get($key, $default); - } + // {{{ function v - // }}} - // {{{ function &getMixed - - function &getMixed($key, $default=null) + function v($key, $default = null) { return Env::_get($key, $default); } // }}} - // {{{ function getBool - - function getBool($key, $default=false) + // {{{ function b + + function b($key, $default = false) { return (bool)Env::_get($key, $default); } // }}} - // {{{ function getInt - - function getInt($key, $default=0) + // {{{ function i + + function i($key, $default = 0) { $i = Env::_get($key, $default); return preg_match(',^[0-9]+$,', $i) ? intval($i) : $default; @@ -82,8 +72,6 @@ class Env // }}} } -// }}} -// {{{ class Post class Post { @@ -93,7 +81,7 @@ class Post { return isset($_POST[$key]) ? $_POST[$key] : $default; } - + // }}} // {{{ function has @@ -101,43 +89,35 @@ class Post { return isset($_POST[$key]); } - + // }}} // {{{ function kill - + function kill($key) { unset($_POST[$key]); } // }}} - // {{{ function get - - function get($key, $default='') - { - return (string)Post::_get($key, $default); - } + // {{{ function v - // }}} - // {{{ function &getMixed - - function &getMixed($key, $default=null) + function v($key, $default = null) { return Post::_get($key, $default); } // }}} - // {{{ function getBool - - function getBool($key, $default=false) + // {{{ function b + + function b($key, $default = false) { return (bool)Post::_get($key, $default); } // }}} - // {{{ function getInt - - function getInt($key, $default=0) + // {{{ function i + + function i($key, $default = 0) { $i = Post::_get($key, $default); return preg_match(',^[0-9]+$,', $i) ? intval($i) : $default; @@ -146,9 +126,6 @@ class Post // }}} } -// }}} -// {{{ class Get - class Get { // {{{ function _get @@ -157,7 +134,7 @@ class Get { return isset($_GET[$key]) ? $_GET[$key] : $default; } - + // }}} // {{{ function has @@ -165,43 +142,35 @@ class Get { return isset($_GET[$key]); } - + // }}} // {{{ function kill - + function kill($key) { unset($_GET[$key]); } // }}} - // {{{ function get - - function get($key, $default='') - { - return (string)Get::_get($key, $default); - } + // {{{ function v - // }}} - // {{{ function &getMixed - - function &getMixed($key, $default=null) + function v($key, $default = null) { return Get::_get($key, $default); } // }}} - // {{{ function getBool - - function getBool($key, $default=false) + // {{{ function b + + function b($key, $default = false) { return (bool)Get::_get($key, $default); } // }}} - // {{{ function getInt - - function getInt($key, $default=0) + // {{{ function i + + function i($key, $default = 0) { $i = Get::_get($key, $default); return preg_match(',^[0-9]+$,', $i) ? intval($i) : $default; @@ -210,9 +179,6 @@ class Get // }}} } -// }}} -// {{{ class Cookie - class Cookie { // {{{ function _get @@ -221,7 +187,7 @@ class Cookie { return isset($_COOKIE[$key]) ? $_COOKIE[$key] : $default; } - + // }}} // {{{ function has @@ -229,43 +195,35 @@ class Cookie { return isset($_COOKIE[$key]); } - + // }}} // {{{ function kill - + function kill($key) { unset($_COOKIE[$key]); } // }}} - // {{{ function get - - function get($key, $default='') - { - return (string)Cookie::_get($key, $default); - } + // {{{ function v - // }}} - // {{{ function &getMixed - - function &getMixed($key, $default=null) + function v($key, $default = null) { return Cookie::_get($key, $default); } // }}} - // {{{ function getBool - - function getBool($key, $default=false) + // {{{ function b + + function b($key, $default = false) { return (bool)Cookie::_get($key, $default); } // }}} - // {{{ function getInt - - function getInt($key, $default=0) + // {{{ function i + + function i($key, $default = 0) { $i = Cookie::_get($key, $default); return preg_match(',^[0-9]+$,', $i) ? intval($i) : $default; @@ -274,8 +232,6 @@ class Cookie // }}} } -// }}} - function fix_gpc_magic(&$item, $key) { if (is_array($item)) { array_walk($item, 'fix_gpc_magic'); @@ -284,15 +240,7 @@ function fix_gpc_magic(&$item, $key) { } } -function unfix_gpc_magic(&$item, $key) { - if (is_array($item)) { - array_walk($item, 'unfix_gpc_magic'); - } else { - $item = addslashes($item); - } -} - -if (ini_get("magic_quotes_gpc")) { +if (ini_get('magic_quotes_gpc') && empty($DONT_FIX_GPC)) { array_walk($_GET, 'fix_gpc_magic'); array_walk($_POST, 'fix_gpc_magic'); array_walk($_COOKIE, 'fix_gpc_magic'); diff --git a/htdocs.net/groupe/dynamap.php b/htdocs.net/groupe/dynamap.php index ed7b7db..2b0cfb8 100644 --- a/htdocs.net/groupe/dynamap.php +++ b/htdocs.net/groupe/dynamap.php @@ -28,7 +28,7 @@ foreach ($_GET as $v => $a) $querystring .= '&'.urlencode($v).'='.urlencode($a); $initfile = urlencode('geolocInit.php?'.$querystring); -if (urlencode(Env::get('initfile')) != $initfile) +if (urlencode(Env::v('initfile')) != $initfile) { header("Location: dynamap.php?initfile=$initfile{$querystring}"); die(); diff --git a/htdocs.net/groupe/getData.php b/htdocs.net/groupe/getData.php index b8f3d82..62203a3 100644 --- a/htdocs.net/groupe/getData.php +++ b/htdocs.net/groupe/getData.php @@ -35,7 +35,7 @@ foreach ($_GET as $v => $a) $querystring .= urlencode($v).'='.urlencode($a).'&'; $page->assign('searchvars', $querystring); if (Env::has('mapid')) - $mapid = Env::getInt('mapid', -2); + $mapid = Env::i('mapid', -2); else $mapid = false; diff --git a/htdocs/admin/admin_trombino.php b/htdocs/admin/admin_trombino.php index 4261842..0974548 100644 --- a/htdocs/admin/admin_trombino.php +++ b/htdocs/admin/admin_trombino.php @@ -23,7 +23,7 @@ require_once("xorg.inc.php"); new_admin_page('admin/admin_trombino.tpl'); $page->assign('xorg_title','Polytechnique.org - Administration - Trombino'); -$uid = Env::getInt('uid'); +$uid = Env::i('uid'); $q = XDB::query( "SELECT a.alias,promo FROM auth_user_md5 AS u @@ -31,7 +31,7 @@ $q = XDB::query( WHERE user_id = {?}", $uid); list($forlife, $promo) = $q->fetchOneRow(); -switch (Env::get('action')) { +switch (Env::v('action')) { case "ecole": header("Content-type: image/jpeg"); diff --git a/htdocs/admin/deces_promo.php b/htdocs/admin/deces_promo.php index debfe55..1a0a098 100644 --- a/htdocs/admin/deces_promo.php +++ b/htdocs/admin/deces_promo.php @@ -23,7 +23,7 @@ require_once("xorg.inc.php"); new_admin_page('admin/deces_promo.tpl'); $page->assign('xorg_title','Polytechnique.org - Administration - Deces'); -$promo = Env::getInt('promo'); +$promo = Env::i('promo'); if (Env::has('sub10')) $promo -= 10; if (Env::has('sub01')) $promo -= 1; if (Env::has('add01')) $promo += 1; @@ -31,11 +31,11 @@ if (Env::has('add10')) $promo += 10; $page->assign('promo',$promo); -if (Env::get('valider') == "Valider") { +if (Env::v('valider') == "Valider") { $new_deces = array(); $res = XDB::iterRow("SELECT user_id,matricule,nom,prenom,deces FROM auth_user_md5 WHERE promo = {?}", $promo); while (list($uid,$mat,$nom,$prenom,$deces) = $res->next()) { - $val = Env::get($mat); + $val = Env::v($mat); if($val == $deces || empty($val)) continue; XDB::execute('UPDATE auth_user_md5 SET deces={?} WHERE matricule = {?}', $val, $mat); $new_deces[] = array('name' => "$prenom $nom", 'date' => "$val"); diff --git a/htdocs/admin/emails_bounces_re.php b/htdocs/admin/emails_bounces_re.php index 8a934b1..fbddca7 100644 --- a/htdocs/admin/emails_bounces_re.php +++ b/htdocs/admin/emails_bounces_re.php @@ -24,7 +24,7 @@ new_admin_page('admin/emails_bounces_re.tpl'); $page->assign('xorg_title','Polytechnique.org - Administration - Postfix : Regexps Bounces'); if (Post::has('submit')) { - foreach (Env::getMixed('lvl') as $id=>$val) { + foreach (Env::v('lvl') as $id=>$val) { XDB::query( "REPLACE INTO emails_bounces_re (id,pos,lvl,re,text) VALUES ({?}, {?}, {?}, {?}, {?})", $id, $_POST['pos'][$id], $_POST['lvl'][$id], $_POST['re'][$id], $_POST['text'][$id] diff --git a/htdocs/admin/evenements.php b/htdocs/admin/evenements.php index dc27ecd..17791ef 100644 --- a/htdocs/admin/evenements.php +++ b/htdocs/admin/evenements.php @@ -23,14 +23,14 @@ require_once("xorg.inc.php"); new_admin_page('admin/evenements.tpl'); $page->assign('xorg_title','Polytechnique.org - Administration - Evenements'); -$arch = Env::get('arch', 0); -$evid = Post::getInt('evt_id'); +$arch = Env::v('arch', 0); +$evid = Post::i('evt_id'); $page->assign('arch', $arch); -switch(Post::get('action')) { +switch(Post::v('action')) { case "Proposer": XDB::execute('UPDATE evenements SET titre={?}, texte={?}, peremption={?}, promo_min={?}, promo_max={?} WHERE id = {?}', - Post::get('titre'), Post::get('texte'), Post::get('peremption'), Post::get('promo_min'), Post::get('promo_max'), $evid); + Post::v('titre'), Post::v('texte'), Post::v('peremption'), Post::v('promo_min'), Post::v('promo_max'), $evid); break; case "Valider": diff --git a/htdocs/admin/geoloc.php b/htdocs/admin/geoloc.php index fa027b7..dc92555 100644 --- a/htdocs/admin/geoloc.php +++ b/htdocs/admin/geoloc.php @@ -26,8 +26,8 @@ $page->assign('xorg_title','Polytechnique.org - Administration - Geolocalisation $nb_synchro = 0; -if (Env::has('id') && is_numeric(Env::get('id'))) { - if (synchro_city(Env::get('id'))) $nb_synchro ++; +if (Env::has('id') && is_numeric(Env::v('id'))) { + if (synchro_city(Env::v('id'))) $nb_synchro ++; } if (Env::has('missinglat')) { diff --git a/htdocs/admin/geoloc_dynamap.php b/htdocs/admin/geoloc_dynamap.php index 22841de..e95eab0 100644 --- a/htdocs/admin/geoloc_dynamap.php +++ b/htdocs/admin/geoloc_dynamap.php @@ -22,7 +22,7 @@ require_once("xorg.inc.php"); new_admin_page('admin/geoloc_dynamap.tpl'); -if (Env::get('fix') == 'cities_not_on_map') { +if (Env::v('fix') == 'cities_not_on_map') { require_once('geoloc.inc.php'); if (!fix_cities_not_on_map(20)) $page->trig("Impossible d'accéder au webservice"); @@ -30,18 +30,18 @@ if (Env::get('fix') == 'cities_not_on_map') { $refresh = true; } -if (Env::get('fix') == 'smallest_maps') { +if (Env::v('fix') == 'smallest_maps') { require_once('geoloc.inc.php'); set_smallest_levels(); } -if (Env::get('fix') == 'precise_coordinates') { +if (Env::v('fix') == 'precise_coordinates') { XDB::execute("UPDATE adresses AS a INNER JOIN geoloc_city AS c ON(a.cityid = c.id) SET a.glat = c.lat / 100000, a.glng = c.lon / 100000"); } if (Env::has('new_maps')) { require_once('geoloc.inc.php'); - if (!get_new_maps(Env::get('url'))) + if (!get_new_maps(Env::v('url'))) $page->trig("Impossible d'accéder aux nouvelles cartes"); } diff --git a/htdocs/admin/gerer_applis.php b/htdocs/admin/gerer_applis.php index 8ed9501..db36e85 100644 --- a/htdocs/admin/gerer_applis.php +++ b/htdocs/admin/gerer_applis.php @@ -19,6 +19,8 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ +$DONT_FIX_GPC = 1; + require_once('xorg.inc.php'); new_admin_table_editor('applis_def','id'); $page->assign('xorg_title','Polytechnique.org - Administration - Formations'); diff --git a/htdocs/admin/gerer_auth-groupex.php b/htdocs/admin/gerer_auth-groupex.php index 7b565ce..7b8d6c6 100644 --- a/htdocs/admin/gerer_auth-groupex.php +++ b/htdocs/admin/gerer_auth-groupex.php @@ -19,6 +19,8 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ +$DONT_FIX_GPC = 1; + require_once('xorg.inc.php'); new_admin_table_editor('groupesx_auth','id'); $page->assign('xorg_title','Polytechnique.org - Administration - Auth groupes X'); diff --git a/htdocs/admin/gerer_binets.php b/htdocs/admin/gerer_binets.php index ed8c85b..26fb8b0 100644 --- a/htdocs/admin/gerer_binets.php +++ b/htdocs/admin/gerer_binets.php @@ -19,6 +19,8 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ +$DONT_FIX_GPC = 1; + require_once('xorg.inc.php'); new_admin_table_editor('binets_def','id'); $page->assign('xorg_title','Polytechnique.org - Administration - Groupes X'); diff --git a/htdocs/admin/gerer_coupure.php b/htdocs/admin/gerer_coupure.php index 15c4c22..809f6cf 100644 --- a/htdocs/admin/gerer_coupure.php +++ b/htdocs/admin/gerer_coupure.php @@ -19,6 +19,8 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ +$DONT_FIX_GPC = 1; + require_once('xorg.inc.php'); new_admin_table_editor('coupures','id'); $page->assign('xorg_title','Polytechnique.org - Administration - Coupures'); diff --git a/htdocs/admin/gerer_decos.php b/htdocs/admin/gerer_decos.php index ec90d95..ecd4f07 100644 --- a/htdocs/admin/gerer_decos.php +++ b/htdocs/admin/gerer_decos.php @@ -19,6 +19,8 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ +$DONT_FIX_GPC = 1; + require_once('xorg.inc.php'); new_admin_table_editor('profile_medals', 'id'); $page->assign('xorg_title','Polytechnique.org - Administration - Distinctions'); @@ -29,18 +31,18 @@ $editor->describe('img', 'nom de l\'image', false); $editor->assign('title', 'Gestion des Distinctions'); -if (Post::get('frm_id')) { +if (Post::v('frm_id')) { $page->changeTpl('admin/gerer_decos.tpl'); - $mid = Post::getInt('frm_id'); + $mid = Post::i('frm_id'); - if (Post::get('act') == 'del') { - XDB::execute('DELETE FROM profile_medals_grades WHERE mid={?} AND gid={?}', $mid, Post::getInt('gid')); - } elseif (Post::get('act') == 'new') { + if (Post::v('act') == 'del') { + XDB::execute('DELETE FROM profile_medals_grades WHERE mid={?} AND gid={?}', $mid, Post::i('gid')); + } elseif (Post::v('act') == 'new') { XDB::execute('INSERT INTO profile_medals_grades (mid,gid) VALUES({?},{?})', - $mid, max(array_keys(Post::getMixed('grades', Array(0))))+1); + $mid, max(array_keys(Post::v('grades', array(0))))+1); } else { - foreach (Post::getMixed('grades', Array()) as $gid=>$text) { + foreach (Post::v('grades', array()) as $gid=>$text) { XDB::execute('UPDATE profile_medals_grades SET pos={?}, text={?} WHERE gid={?}', $_POST['pos'][$gid], $text, $gid); } } diff --git a/htdocs/admin/gerer_groupesx.php b/htdocs/admin/gerer_groupesx.php index cd9b635..79479bc 100644 --- a/htdocs/admin/gerer_groupesx.php +++ b/htdocs/admin/gerer_groupesx.php @@ -19,6 +19,8 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ +$DONT_FIX_GPC = 1; + require_once('xorg.inc.php'); new_admin_table_editor('groupesx_def','id'); $page->assign('xorg_title','Polytechnique.org - Administration - Groupes X'); diff --git a/htdocs/admin/gerer_paiement.php b/htdocs/admin/gerer_paiement.php index f1e58b6..d27149b 100644 --- a/htdocs/admin/gerer_paiement.php +++ b/htdocs/admin/gerer_paiement.php @@ -19,6 +19,8 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ +$DONT_FIX_GPC = 1; + require_once('xorg.inc.php'); new_admin_table_editor('paiement.paiements','id'); $page->assign('xorg_title','Polytechnique.org - Administration - Paiements'); diff --git a/htdocs/admin/gerer_skins.php b/htdocs/admin/gerer_skins.php index 16b049e..075a3f0 100644 --- a/htdocs/admin/gerer_skins.php +++ b/htdocs/admin/gerer_skins.php @@ -19,6 +19,8 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ +$DONT_FIX_GPC = 1; + require_once('xorg.inc.php'); new_admin_table_editor('skins','id'); $page->assign('xorg_title','Polytechnique.org - Administration - Skins'); diff --git a/htdocs/admin/homonymes.php b/htdocs/admin/homonymes.php index 455546e..5871b6d 100644 --- a/htdocs/admin/homonymes.php +++ b/htdocs/admin/homonymes.php @@ -24,8 +24,8 @@ new_admin_page('admin/homonymes.tpl'); $page->assign('xorg_title','Polytechnique.org - Administration - Homonymes'); require_once("homonymes.inc.php"); -$op = Env::get('op', 'list'); -$target = Env::getInt('target'); +$op = Env::v('op', 'list'); +$target = Env::i('target'); if ($target) { if (! list($prenom,$nom,$forlife,$loginbis) = select_if_homonyme($target)) { diff --git a/htdocs/admin/logger_actions.php b/htdocs/admin/logger_actions.php index 76ecf78..326a920 100644 --- a/htdocs/admin/logger_actions.php +++ b/htdocs/admin/logger_actions.php @@ -19,6 +19,8 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ +$DONT_FIX_GPC = 1; + require_once('xorg.inc.php'); new_admin_table_editor('logger.actions','id'); $page->assign('xorg_title','Polytechnique.org - Administration - Actions'); diff --git a/htdocs/admin/newsletter_cats.php b/htdocs/admin/newsletter_cats.php index 5f8219c..6ad9a59 100644 --- a/htdocs/admin/newsletter_cats.php +++ b/htdocs/admin/newsletter_cats.php @@ -19,6 +19,8 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ +$DONT_FIX_GPC = 1; + require_once('xorg.inc.php'); new_admin_table_editor('newsletter_cat','cid'); $page->assign('xorg_title','Polytechnique.org - Administration - Newsletter : Catégories'); diff --git a/htdocs/admin/newsletter_edit.php b/htdocs/admin/newsletter_edit.php index f740486..c7dd3ac 100644 --- a/htdocs/admin/newsletter_edit.php +++ b/htdocs/admin/newsletter_edit.php @@ -24,33 +24,33 @@ new_admin_page('admin/newsletter_edit.tpl'); $page->assign('xorg_title','Polytechnique.org - Administration - Newsletter : Edition'); require_once("newsletter.inc.php"); -$nid = Get::get('nid', 'last'); +$nid = Get::v('nid', 'last'); $nl = new NewsLetter($nid); if(Get::has('del_aid')) { - $nl->delArticle(Get::get('del_aid')); + $nl->delArticle(Get::v('del_aid')); http_redirect("{$_SERVER['PHP_SELF']}?nid=$nid"); } -if(Post::get('update')) { - $nl->_title = Post::get('title'); - $nl->_date = Post::get('date'); - $nl->_head = Post::get('head'); +if(Post::v('update')) { + $nl->_title = Post::v('title'); + $nl->_date = Post::v('date'); + $nl->_head = Post::v('head'); $nl->save(); } -if(Post::get('save')) { - $art = new NLArticle(Post::get('title'), Post::get('body'), Post::get('append'), - Get::get('edit_aid'), Post::get('cid'), Post::get('pos')); +if(Post::v('save')) { + $art = new NLArticle(Post::v('title'), Post::v('body'), Post::v('append'), + Get::v('edit_aid'), Post::v('cid'), Post::v('pos')); $nl->saveArticle($art); http_redirect("{$_SERVER['PHP_SELF']}?nid=$nid"); } if(Get::has('edit_aid')) { - $eaid = Get::get('edit_aid'); + $eaid = Get::v('edit_aid'); if(Post::has('aid')) { - $art = new NLArticle(Post::get('title'), Post::get('body'), Post::get('append'), - $eaid, Post::get('cid'), Post::get('pos')); + $art = new NLArticle(Post::v('title'), Post::v('body'), Post::v('append'), + $eaid, Post::v('cid'), Post::v('pos')); } else { $art = $eaid<0 ? new NLArticle() : $nl->getArt($eaid); } diff --git a/htdocs/admin/postfix_blacklist.php b/htdocs/admin/postfix_blacklist.php index 610852e..6592a74 100644 --- a/htdocs/admin/postfix_blacklist.php +++ b/htdocs/admin/postfix_blacklist.php @@ -19,6 +19,8 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ +$DONT_FIX_GPC = 1; + require_once('xorg.inc.php'); new_admin_table_editor('postfix_blacklist','email',true); $page->assign('xorg_title','Polytechnique.org - Administration - Postfix : Blacklist'); diff --git a/htdocs/admin/postfix_delayed.php b/htdocs/admin/postfix_delayed.php index 0277ddb..82160dc 100644 --- a/htdocs/admin/postfix_delayed.php +++ b/htdocs/admin/postfix_delayed.php @@ -25,11 +25,11 @@ $page->assign('xorg_title','Polytechnique.org - Administration - Postfix : Retar if (Env::has('del')) { - $crc = Env::get('crc'); + $crc = Env::v('crc'); XDB::execute("UPDATE postfix_mailseen SET release = 'del' WHERE crc = {?}", $crc); $page->trig($crc." verra tous ses mails supprimés !"); } elseif (Env::has('ok')) { - $crc = Env::get('crc'); + $crc = Env::v('crc'); XDB::execute("UPDATE postfix_mailseen SET release = 'ok' WHERE crc = {?}", $crc); $page->trig($crc." a le droit de passer !"); } diff --git a/htdocs/admin/postfix_whitelist.php b/htdocs/admin/postfix_whitelist.php index 8e87c39..d157dbc 100644 --- a/htdocs/admin/postfix_whitelist.php +++ b/htdocs/admin/postfix_whitelist.php @@ -19,6 +19,8 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ +$DONT_FIX_GPC = 1; + require_once('xorg.inc.php'); new_admin_table_editor('postfix_whitelist','email',true); $page->assign('xorg_title','Polytechnique.org - Administration - Postfix : Whitelist'); diff --git a/htdocs/admin/synchro_ax.php b/htdocs/admin/synchro_ax.php index abb437a..559fc04 100644 --- a/htdocs/admin/synchro_ax.php +++ b/htdocs/admin/synchro_ax.php @@ -34,7 +34,7 @@ if (is_ax_key_missing()) { require_once('user.func.inc.php'); if (Env::has('user')) { - $login = get_user_forlife(Env::get('user')); + $login = get_user_forlife(Env::v('user')); if ($login === false) { exit; } @@ -45,7 +45,7 @@ if (Env::has('mat')) { "SELECT alias FROM aliases AS a INNER JOIN auth_user_md5 AS u ON (a.id=u.user_id AND a.type='a_vie') - WHERE matricule={?}", Env::getInt('mat')); + WHERE matricule={?}", Env::i('mat')); $login = $res->fetchOneCell(); } diff --git a/htdocs/admin/utilisateurs.php b/htdocs/admin/utilisateurs.php index 2b81fd9..03b81d5 100644 --- a/htdocs/admin/utilisateurs.php +++ b/htdocs/admin/utilisateurs.php @@ -30,9 +30,9 @@ if (S::has('suid')) { } if (Env::has('user_id')) { - $login = get_user_login(Env::getInt('user_id')); + $login = get_user_login(Env::i('user_id')); } elseif (Env::has('login')) { - $login = get_user_login(Env::get('login')); + $login = get_user_login(Env::v('login')); } else { $login = false; } @@ -67,7 +67,7 @@ if ($login) { foreach($_POST as $key => $val) { switch ($key) { case "add_fwd": - $email = trim(Env::get('email')); + $email = trim(Env::v('email')); if (!isvalid_email_redirection($email)) { $page->trig("invalid email $email"); } else { @@ -102,7 +102,7 @@ if ($login) { break; case "add_alias": XDB::execute("INSERT INTO aliases (id,alias,type) VALUES ({?}, {?}, 'alias')", - $mr['user_id'], Env::get('email')); + $mr['user_id'], Env::v('email')); break; case "best": @@ -118,14 +118,14 @@ if ($login) { // Editer un profil case "u_edit": require_once('secure_hash.inc.php'); - $pass_encrypted = Env::get('newpass_clair') != "********" ? hash_encrypt(Env::get('newpass_clair')) : Env::get('passw'); - $naiss = Env::get('naissanceN'); - $perms = Env::get('permsN'); - $prenm = Env::get('prenomN'); - $nom = Env::get('nomN'); - $promo = Env::getInt('promoN'); - $sexe = Env::get('sexeN'); - $comm = Env::get('commentN'); + $pass_encrypted = Env::v('newpass_clair') != "********" ? hash_encrypt(Env::v('newpass_clair')) : Env::v('passw'); + $naiss = Env::v('naissanceN'); + $perms = Env::v('permsN'); + $prenm = Env::v('prenomN'); + $nom = Env::v('nomN'); + $promo = Env::i('promoN'); + $sexe = Env::v('sexeN'); + $comm = Env::v('commentN'); $query = "UPDATE auth_user_md5 SET naissance = '$naiss', @@ -150,9 +150,9 @@ if ($login) { $page->trig("updaté correctement."); } - if (Env::get('nomusageN') != $mr['nom_usage']) { + if (Env::v('nomusageN') != $mr['nom_usage']) { require_once('nomusage.inc.php'); - set_new_usage($mr['user_id'], Env::get('nomusageN'), make_username(Env::get('prenomN'), Env::get('nomusageN'))); + set_new_usage($mr['user_id'], Env::v('nomusageN'), make_username(Env::v('prenomN'), Env::v('nomusageN'))); } $r = XDB::query("SELECT *, a.alias AS forlife, u.flags AS sexe FROM auth_user_md5 AS u diff --git a/htdocs/admin/valider.php b/htdocs/admin/valider.php index d018ce5..162a7fa 100644 --- a/htdocs/admin/valider.php +++ b/htdocs/admin/valider.php @@ -25,7 +25,7 @@ $page->assign('xorg_title','Polytechnique.org - Administration - Valider une dem require_once("validations.inc.php"); if(Env::has('uid') && Env::has('type') && Env::has('stamp')) { - $req = Validate::get_request(Env::get('uid'), Env::get('type'), Env::get('stamp')); + $req = Validate::get_request(Env::v('uid'), Env::v('type'), Env::v('stamp')); if($req) { $req->handle_formu(); } } diff --git a/htdocs/wiki.php b/htdocs/wiki.php index 6406a25..33697b1 100644 --- a/htdocs/wiki.php +++ b/htdocs/wiki.php @@ -33,7 +33,7 @@ if (!$n) { new_skinned_page('wiki.tpl'); $perms = wiki_get_perms($n); -switch (Env::get('action')) { +switch (Env::v('action')) { case '': wiki_apply_perms($perms[0]); break; @@ -47,7 +47,7 @@ switch (Env::get('action')) { break; } -if ($p = Post::get('setrperms')) { +if ($p = Post::v('setrperms')) { wiki_apply_perms('admin'); if (wiki_set_perms($n, $p, $perms[1])) { $perms = wiki_get_perms($n); @@ -55,7 +55,7 @@ if ($p = Post::get('setrperms')) { } } -if ($p = Post::get('setwperms')) { +if ($p = Post::v('setwperms')) { wiki_apply_perms('admin'); if (wiki_set_perms($n, $perms[0], $p)) { $perms = wiki_get_perms($n); @@ -66,7 +66,7 @@ if ($p = Post::get('setwperms')) { $wiki_cache = wiki_work_dir().'/cache_'.$n.'.tpl'; $cache_exists = file_exists($wiki_cache); -if (Env::get('action') || !$cache_exists) { +if (Env::v('action') || !$cache_exists) { @unlink($wiki_cache); // we leave pmwiki do whatever it wants and store everything @@ -79,7 +79,7 @@ if (Env::get('action') || !$cache_exists) { $j = strpos($wikiAll, "", $i); } -if (Env::get('action')) { +if (Env::v('action')) { $page->assign('xorg_extra_header', substr($wikiAll, 0, $i)); $wikiAll = substr($wikiAll, $j); } else { diff --git a/include/banana.inc.php b/include/banana.inc.php index 19dff94..6fc4052 100644 --- a/include/banana.inc.php +++ b/include/banana.inc.php @@ -156,7 +156,7 @@ class PlatalBanana extends Banana { global $banana; - if (Get::get('banana') == 'updateall' + if (Get::v('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'), S::v('uid')); $_SESSION['banana_last'] = time(); diff --git a/include/geoloc.inc.php b/include/geoloc.inc.php index 915ce5d..e06a051 100644 --- a/include/geoloc.inc.php +++ b/include/geoloc.inc.php @@ -349,7 +349,7 @@ function geoloc_getData_subcountries($mapid, $SFields, $minentities) { "SELECT gm.map_id AS id, gm.name, gm.x, gm.y, gm.xclip, gm.yclip, gm.width, gm.height, gm.scale, 1 AS rat FROM geoloc_maps AS gm - ".$wheremapid, Env::get('mapid','')); + ".$wheremapid, Env::v('mapid','')); while ($c = $submapres->next()) { @@ -362,7 +362,7 @@ function geoloc_getData_subcountries($mapid, $SFields, $minentities) { if ($mapid === false) return array($countries, $cities); - geoloc_getData_subcities(Env::getInt('mapid'), $SFields, $cities); + geoloc_getData_subcities(Env::i('mapid'), $SFields, $cities); $nbcities = count($cities); $nocity = $nbcities == 0; diff --git a/include/homonymes.inc.php b/include/homonymes.inc.php index 5b37d7c..6ebb4d1 100644 --- a/include/homonymes.inc.php +++ b/include/homonymes.inc.php @@ -37,7 +37,7 @@ function send_warning_homonyme($prenom, $nom, $forlife, $loginbis) { $mymail->setSubject("Dans 2 semaines, suppression de $loginbis@polytechnique.org"); $mymail->addTo("$prenom $nom <$forlife@polytechnique.org>"); $mymail->addCc($cc); - $mymail->setTxtBody(Env::get('mailbody')); + $mymail->setTxtBody(Env::v('mailbody')); $mymail->send(); } @@ -50,7 +50,7 @@ function send_robot_homonyme($prenom, $nom, $forlife, $loginbis) { $mymail->setSubject("Mise en place du robot $loginbis@polytechnique.org"); $mymail->addTo("$prenom $nom <$forlife@polytechnique.org>"); $mymail->addCc($cc); - $mymail->setTxtBody(Env::get('mailbody')); + $mymail->setTxtBody(Env::v('mailbody')); $mymail->send(); } diff --git a/include/notifs.inc.php b/include/notifs.inc.php index ba3775b..3c99ede 100644 --- a/include/notifs.inc.php +++ b/include/notifs.inc.php @@ -285,7 +285,7 @@ class WatchSub { function update($ind) { $this->_data = Array(); XDB::execute('DELETE FROM watch_sub WHERE uid={?}', $this->_uid); - foreach(Env::getMixed($ind) as $key=>$val) { + foreach (Env::v($ind) as $key=>$val) { XDB::query('INSERT INTO watch_sub SELECT {?},id FROM watch_cat WHERE id={?}', $this->_uid, $key); if(mysql_affected_rows()) { $this->_data[$key] = $key; diff --git a/include/platal.inc.php b/include/platal.inc.php index f3fbe94..8ad7bf9 100644 --- a/include/platal.inc.php +++ b/include/platal.inc.php @@ -38,7 +38,7 @@ define('SKINNED', 0); define('SIMPLE', 1); define('NO_SKIN', 2); -require_once('platal/env.inc.php'); +require_once dirname(__FILE__).'/../classes/Env.php'; function pl_url($path, $query = null, $fragment = null) { diff --git a/include/profil.func.inc.php b/include/profil.func.inc.php index a20ce4c..04d7f3a 100644 --- a/include/profil.func.inc.php +++ b/include/profil.func.inc.php @@ -24,7 +24,7 @@ require_once('applis.func.inc.php'); function replace_ifset(&$var,$req) { if (Env::has($req)){ - $var = Env::get($req); + $var = Env::v($req); } } diff --git a/include/profil/get_adresses.inc.php b/include/profil/get_adresses.inc.php index 71293a7..928e4e7 100644 --- a/include/profil/get_adresses.inc.php +++ b/include/profil/get_adresses.inc.php @@ -50,7 +50,7 @@ function delete_address($adrid, $in_request_array = false){ } //on verifie si on nous a demande une suppression -$req_adrid_del = Env::getMixed('adrid_del', Array()); +$req_adrid_del = Env::v('adrid_del', Array()); for ($i = 1; $i <= $nb_adr_max; $i++) { if (isset($req_adrid_del[$i])) { delete_address($i,true); diff --git a/include/profil/get_deco.inc.php b/include/profil/get_deco.inc.php index 59c4e19..eeea483 100644 --- a/include/profil/get_deco.inc.php +++ b/include/profil/get_deco.inc.php @@ -20,16 +20,16 @@ ***************************************************************************/ 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 = {?}", S::v('uid', -1), Env::getInt('medal_id', -1)); + if (Env::v('medal_op')=='retirer' && Env::i('medal_id')) { + XDB::execute("DELETE FROM profile_medals_sub WHERE uid = {?} AND mid = {?}", S::v('uid', -1), Env::i('medal_id', -1)); } - if (Env::get('medal_op')=='ajouter' && Env::getInt('medal_id')) { - XDB::execute("INSERT INTO profile_medals_sub (uid,mid) VALUES ({?}, {?})", S::v('uid', -1), Env::getInt('medal_id')); + if (Env::v('medal_op')=='ajouter' && Env::i('medal_id')) { + XDB::execute("INSERT INTO profile_medals_sub (uid,mid) VALUES ({?}, {?})", S::v('uid', -1), Env::i('medal_id')); } } if (Post::has('grade')) { - foreach (Post::getMixed('grade') as $mid=>$gid) { + foreach (Post::v('grade') as $mid=>$gid) { XDB::execute('UPDATE profile_medals_sub SET gid={?} WHERE uid={?} AND mid={?}', $gid, S::v('uid'), $mid); } } diff --git a/include/profil/get_general.inc.php b/include/profil/get_general.inc.php index 12e293f..0d3f11c 100644 --- a/include/profil/get_general.inc.php +++ b/include/profil/get_general.inc.php @@ -57,7 +57,7 @@ replace_ifset($appli_type2,"appli_type2"); replace_ifset($nickname,"nickname"); if(Env::has('modifier') || Env::has('suivant') && $opened_tab == 'general') { - $mobile_pub = Env::get('mobile_pub'); + $mobile_pub = Env::v('mobile_pub'); $web_pub = Env::has('web_pub')?'public':'private'; $freetext_pub = Env::has('freetext_pub')?'public':'private'; $photo_pub = Env::has('photo_pub')?'public':'private'; diff --git a/include/profil/get_mentor.inc.php b/include/profil/get_mentor.inc.php index 0034c12..74a1f10 100644 --- a/include/profil/get_mentor.inc.php +++ b/include/profil/get_mentor.inc.php @@ -32,9 +32,9 @@ $mentor_expertise = $res->fetchOneCell(); $mentor_expertise_bd = $mentor_expertise; //suppression eventuelle d'un pays -if(Post::get('mentor_pays_op', '') == 'retirer') { +if(Post::v('mentor_pays_op', '') == 'retirer') { if(Post::has('mentor_pays_id')) { - $id_supprimee = Post::get('mentor_pays_id', '00'); + $id_supprimee = Post::v('mentor_pays_id', '00'); XDB::execute("DELETE FROM mentor_pays WHERE uid = {?} AND pid = {?} LIMIT 1", S::v('uid', -1), $id_supprimee); } } @@ -48,22 +48,22 @@ $mentor_pid = $mentor_pays = Array(); for($i = 1; $i <= $nb_mentor_pays ; $i++) list($mentor_pid[$i], $mentor_pays[$i]) = $res->next(); //ajout eventuel d'un pays -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'); +if((Post::v('mentor_pays_op', '') == 'ajouter') && ($nb_mentor_pays < $max_mentor_pays)) { + if(Post::v('mentor_pays_id', '00') != '00') { + $id_ajoutee = Post::v('mentor_pays_id', '00'); 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', ''); + $mentor_pays[$nb_mentor_pays] = Post::v('mentor_pays_name', ''); } } //suppression d'un secteur / ss-secteur -if(Post::get('mentor_secteur_op', '') == 'retirer') { +if(Post::v('mentor_secteur_op', '') == 'retirer') { if(Post::has('mentor_secteur_id')) { - $id_supprimee = Post::get('mentor_secteur_id', ''); + $id_supprimee = Post::v('mentor_secteur_id', ''); XDB::execute("DELETE FROM mentor_secteurs WHERE uid = {?} AND secteur = {?} LIMIT 1", S::v('uid', -1), $id_supprimee); } } @@ -82,21 +82,21 @@ for($i = 1; $i <= $nb_mentor_secteurs ; $i++) //ajout d'un secteur $mentor_secteur_id_new = ''; -if((Post::get('mentor_secteur_op', '')== 'ajouter') && ($nb_mentor_secteurs < $max_mentor_secteurs)) { - if(Post::get('mentor_secteur_id', '') != '') +if((Post::v('mentor_secteur_op', '')== 'ajouter') && ($nb_mentor_secteurs < $max_mentor_secteurs)) { + if(Post::v('mentor_secteur_id', '') != '') { - $sid_ajoutee = Post::get('mentor_secteur_id', ''); + $sid_ajoutee = Post::v('mentor_secteur_id', ''); if(Post::has('mentor_ss_secteur_id')) - $ssid_ajoutee = Post::get('mentor_ss_secteur_id', ''); + $ssid_ajoutee = Post::v('mentor_ss_secteur_id', ''); XDB::execute("INSERT INTO mentor_secteurs (uid, secteur, ss_secteur) 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', ''); + $mentor_secteur[$nb_mentor_secteurs] = Post::v('mentor_secteur_name', ''); $mentor_ssid[$nb_mentor_secteurs] = $ssid_ajoutee; - $mentor_ss_secteur[$nb_mentor_secteurs] = Post::get('mentor_ss_secteur_name', ''); + $mentor_ss_secteur[$nb_mentor_secteurs] = Post::v('mentor_ss_secteur_name', ''); } } elseif(Post::has('mentor_secteur_id_new')){ - $mentor_secteur_id_new = Post::get('mentor_secteur_id_new', ''); + $mentor_secteur_id_new = Post::v('mentor_secteur_id_new', ''); } ?> diff --git a/include/profil/get_poly.inc.php b/include/profil/get_poly.inc.php index e72c3b0..07ea266 100644 --- a/include/profil/get_poly.inc.php +++ b/include/profil/get_poly.inc.php @@ -34,23 +34,23 @@ replace_ifset($section,'section'); /************* gestion des binets ************/ 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 = {?}", S::v('uid', -1), Env::getInt('binet_id', -1)); + if( (Env::v('binet_op', '')=='retirer')&&(Env::i('binet_id', 0) != 0)) { + XDB::execute("DELETE FROM binets_ins WHERE user_id = {?} AND binet_id = {?}", S::v('uid', -1), Env::i('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({?}, {?})", S::v('uid', -1), Env::getInt('binet_id', -1)); + if (Env::v('binet_op')=="ajouter" && (Env::i('binet_id', 0) != 0)) { + XDB::execute("INSERT INTO binets_ins (user_id,binet_id) VALUES({?}, {?})", S::v('uid', -1), Env::i('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 = {?}", S::v('uid', -1), Env::getInt('groupex_id', -1)); + if (Env::v('groupex_op')=="retirer" && (Env::i('groupex_id', 0) != 0)) { + XDB::execute("DELETE FROM groupesx_ins WHERE guid = {?} AND gid = {?}", S::v('uid', -1), Env::i('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 ({?}, {?})", S::v('uid', -1), Env::getInt('groupex_id', -1)); + if (Env::v('groupex_op')=="ajouter" && (Env::i('groupex_id', 0) != 0)) { + XDB::execute("INSERT INTO groupesx_ins (guid, gid) VALUES ({?}, {?})", S::v('uid', -1), Env::i('groupex_id', -1)); } } diff --git a/include/profil/get_skill.inc.php b/include/profil/get_skill.inc.php index c28577a..d735ac2 100644 --- a/include/profil/get_skill.inc.php +++ b/include/profil/get_skill.inc.php @@ -21,20 +21,20 @@ if(Env::has('langue_op')){ - if(Env::get('langue_op', '')=='retirer'){ - 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 ({?}, {?}, {?})", S::v('uid', -1), Env::get('langue_id', ''), Env::get('langue_level', '')); + if(Env::v('langue_op', '')=='retirer'){ + XDB::execute("DELETE FROM langues_ins WHERE uid = {?} AND lid = {?}", S::v('uid', -1), Env::v('langue_id', '')); + } elseif(Env::v('langue_op', '') == 'ajouter'){ + if(Env::v('langue_id', '') != '') + XDB::execute("INSERT INTO langues_ins (uid,lid,level) VALUES ({?}, {?}, {?})", S::v('uid', -1), Env::v('langue_id', ''), Env::v('langue_level', '')); } } if(Env::has('comppros_op')){ - if(Env::get('comppros_op', '')=='retirer'){ - 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({?}, {?}, {?})", S::v('uid', -1), Env::get('comppros_id', ''), Env::get('comppros_level', '')); + if(Env::v('comppros_op', '')=='retirer'){ + XDB::execute("DELETE FROM competences_ins WHERE uid = {?} AND cid = {?}", S::v('uid', -1), Env::v('comppros_id', '')); + } elseif(Env::v('comppros_op', '') == 'ajouter') { + if(Env::v('comppros_id', '') != '') + XDB::execute("INSERT INTO competences_ins (uid,cid,level) VALUES({?}, {?}, {?})", S::v('uid', -1), Env::v('comppros_id', ''), Env::v('comppros_level', '')); } } diff --git a/include/profil/verif_adresses.inc.php b/include/profil/verif_adresses.inc.php index df30cbe..6c4495d 100644 --- a/include/profil/verif_adresses.inc.php +++ b/include/profil/verif_adresses.inc.php @@ -62,24 +62,24 @@ function generate_new_telid($adr){ } function replace_ifset_adr($varname, $i){ - $tab = Env::getMixed($varname, Array()); + $tab = Env::v($varname, Array()); if (isset($tab[$i])) $GLOBALS['adresses'][$i][$varname] = $tab[$i]; } function replace_ifset_tel($varname, $i, $t){ - $tab = Env::getMixed($varname.$t, Array()); + $tab = Env::v($varname.$t, Array()); if (isset($tab[$i])) $GLOBALS['adresses'][$i]['tels'][$t][$varname] = $tab[$i]; } function get_adr_arg($varname, $i) { - $tab = Env::getMixed($varname, Array()); + $tab = Env::v($varname, Array()); return $tab[$i]; } function set_flag_adr($varname,$i){ - $tab = Env::getMixed($varname, Array()); + $tab = Env::v($varname, Array()); if (isset($tab[$i])){ $GLOBALS['adresses'][$i][$varname] = 1; } @@ -105,7 +105,7 @@ function replace_address($i){ replace_ifset_adr('secondaire', $i); set_flag_adr('courrier', $i); replace_ifset_adr('temporaire', $i); - if(Env::getInt('adrid_active', $i+1) == $i) + if(Env::i('adrid_active', $i+1) == $i) $adresses[$i]['active'] = 1; else $adresses[$i]['active'] = 0; @@ -120,14 +120,14 @@ function replace_address($i){ replace_ifset_adr('pub', $i); for ($telid = 0; $telid <= $nb_tel_max; $telid++) { - $tab = Env::getMixed('telid'.$telid, Array()); + $tab = Env::v('telid'.$telid, Array()); if(isset($tab[$i])){ //ce telid etait donc present dans le formulaire replace_tel($i, $telid); } } if (!get_adr_arg('parsevalid', $i)) replace_ifset_adr('txt', $i); - $tab = Env::getMixed('numero_formulaire', Array()); + $tab = Env::v('numero_formulaire', Array()); if($tab[$i]) $adresses[$i]['numero_formulaire'] = $tab[$i]; else @@ -136,7 +136,7 @@ function replace_address($i){ function geoloc_adresse($i) { global $adresses; - $change = Env::get('change'.$i); + $change = Env::v('change'.$i); if (get_adr_arg('parsevalid', $i) || ($adresses[$i]['txt'] && $change) || (!$adresses[$i]['cityid'])) { require_once('geoloc.inc.php'); // erases the previous address (but not the phone or pub) @@ -156,7 +156,7 @@ function geoloc_adresse($i) { //remplace par les eventuelles nouvelles valeurs : for ($adrid = 1; $adrid <= $nb_adr_max; $adrid++) { - $tab = Env::getMixed('adrid', Array()); + $tab = Env::v('adrid', Array()); if(isset($tab[$adrid])){ //cet adrid etait donc present dans le formulaire replace_address($adrid); } diff --git a/include/profil/verif_emploi.inc.php b/include/profil/verif_emploi.inc.php index 6d50c17..9057adf 100644 --- a/include/profil/verif_emploi.inc.php +++ b/include/profil/verif_emploi.inc.php @@ -22,7 +22,7 @@ include_once('xorg.misc.inc.php'); function set_flag_i(&$var,$var_name,$i){ - $tab = Env::getMixed($var_name, Array()); + $tab = Env::v($var_name, array()); if(isset($tab[$i])){ $var[$i] = 1; } diff --git a/include/profil/verif_mentor.inc.php b/include/profil/verif_mentor.inc.php index a5c1150..4fcd5e9 100644 --- a/include/profil/verif_mentor.inc.php +++ b/include/profil/verif_mentor.inc.php @@ -22,7 +22,7 @@ //au cas ou le submit du formulaire vient d'un changement du nouveau secteur if(Post::has('mentor_expertise')){ - $mentor_expertise = Post::get('mentor_expertise'); + $mentor_expertise = Post::v('mentor_expertise'); if(!empty($mentor_expertise)){ if (strlen(strtok($mentor_expertise,"<>{}~§`|%$^")) < strlen($mentor_expertise)){//TODO: affiner la liste $page->trig("L'expertise contient un caractère interdit."); diff --git a/include/search.inc.php b/include/search.inc.php index 296eaa1..97bc11e 100644 --- a/include/search.inc.php +++ b/include/search.inc.php @@ -24,7 +24,7 @@ require_once("search/classes.inc.php"); // {{{ function advancedSearchFromInput function getadr_join($table) { - return 'u.user_id='.$table.'.uid'.(Env::get('only_current',false)?' AND FIND_IN_SET(\'active\','.$table.'.statut)':''); + return 'u.user_id='.$table.'.uid'.(Env::v('only_current',false)?' AND FIND_IN_SET(\'active\','.$table.'.statut)':''); } function advancedSearchFromInput() { diff --git a/include/search/classes.inc.php b/include/search/classes.inc.php index 3a7ef89..9ed011c 100644 --- a/include/search/classes.inc.php +++ b/include/search/classes.inc.php @@ -146,7 +146,7 @@ class SField * on met une chaîne vide si le champ n'a pas été complété */ function get_request() { - $this->value = trim(Env::get($this->fieldFormName)); + $this->value = trim(Env::v($this->fieldFormName)); } // }}} @@ -449,7 +449,7 @@ class MapSField extends RefSField function MapSField($_fieldFormName, $_fieldDbName='', $_refTable, $_refAlias, $_refCondition, $_mapId=false) { if ($_mapId === false) - $this->mapId = Env::get($_fieldFormName, ''); + $this->mapId = Env::v($_fieldFormName, ''); else $this->mapId = $_mapId; $this->RefSField($_fieldFormName, $_fieldDbName, $_refTable, $_refAlias, $_refCondition, true, false); diff --git a/include/validations.inc.php b/include/validations.inc.php index 03e82ff..dc97259 100644 --- a/include/validations.inc.php +++ b/include/validations.inc.php @@ -158,7 +158,7 @@ class Validate // ajout d'un commentaire if (Env::has('hold') && Env::has('comm')) { - $this->comments[] = Array(S::v('bestalias'), Env::get('comm')); + $this->comments[] = Array(S::v('bestalias'), Env::v('comm')); // envoi d'un mail à hotliners global $globals; @@ -170,7 +170,7 @@ class Validate $body = "Validation {$this->type} pour {$this->prenom} {$this->nom}\n\n" . S::v('bestalias')." a ajouté le commentaire :\n\n" - . Env::get('comm')."\n\n" + . Env::v('comm')."\n\n" . "cf la discussion sur : ".$globals->baseurl."/admin/valider.php"; $mailer->setTxtBody(wordwrap($body)); @@ -194,7 +194,7 @@ class Validate } if (Env::has('refuse')) { - if (Env::get('comm')) { + if (Env::v('comm')) { $this->sendmail(false); $this->clean(); $this->trig('mail envoyé'); @@ -222,7 +222,7 @@ class Validate $body = "Cher(e) camarade,\n\n" . $this->_mail_body($isok) - . (Env::has('comm') ? "\n\n".Env::get('comm') : '') + . (Env::has('comm') ? "\n\n".Env::v('comm') : '') . "\n\nCordialement,\nL'équipe Polytechnique.org\n"; $mailer->setTxtBody(wordwrap($body)); diff --git a/include/validations/homonymes.inc.php b/include/validations/homonymes.inc.php index 0ff23b9..742ff5d 100644 --- a/include/validations/homonymes.inc.php +++ b/include/validations/homonymes.inc.php @@ -118,7 +118,7 @@ est ambigu pour des raisons d'homonymie et signalera ton email exact."; $body = $this->prenom.",\n\n" . $this->_mail_body($isok) - . (Env::has('comm') ? "\n\n".Env::get('comm') : '') + . (Env::has('comm') ? "\n\n".Env::v('comm') : '') . "\n\nCordialement,\nL'équipe Polytechnique.org\n"; $mailer->setTxtBody(wordwrap($body)); diff --git a/include/wiki.inc.php b/include/wiki.inc.php index 3b441bc..6ad7cbc 100644 --- a/include/wiki.inc.php +++ b/include/wiki.inc.php @@ -20,11 +20,11 @@ ***************************************************************************/ function wiki_pagename() { - if (!Get::get('n')) { + if (!Get::v('n')) { return null; } - $words = explode('/', trim(Get::get('n'), '/')); + $words = explode('/', trim(Get::v('n'), '/')); if (count($words) == 2) { return join('.', $words); } diff --git a/include/xnet/globals.inc.php b/include/xnet/globals.inc.php index 1a537b3..aa6c21e 100644 --- a/include/xnet/globals.inc.php +++ b/include/xnet/globals.inc.php @@ -54,7 +54,7 @@ class XnetGlobals extends PlatalGlobals static $aid = null; if (is_null($aid)) { - $gp = Get::get('p'); + $gp = Get::v('p'); $gp = substr($gp, 0, strpos($gp, '/')); if ($gp) { diff --git a/include/xnet/session.inc.php b/include/xnet/session.inc.php index a85780a..d146084 100644 --- a/include/xnet/session.inc.php +++ b/include/xnet/session.inc.php @@ -81,7 +81,7 @@ class XnetSession function doAuthX() { global $globals, $page; - if (md5('1'.S::v('challenge').$globals->xnet->secret.Get::getInt('uid').'1') != Get::get('auth')) { + if (md5('1'.S::v('challenge').$globals->xnet->secret.Get::i('uid').'1') != Get::v('auth')) { $page->kill("Erreur d'authentification avec polytechnique.org !"); } @@ -93,7 +93,7 @@ class XnetSession INNER JOIN aliases AS a ON (u.user_id = a.id AND a.type='a_vie') INNER JOIN aliases AS a2 ON (u.user_id = a2.id AND FIND_IN_SET('bestalias',a2.flags)) WHERE u.user_id = {?} AND u.perms IN('admin','user') - LIMIT 1", Get::getInt('uid')); + LIMIT 1", Get::i('uid')); $_SESSION = array_merge($_SESSION, $res->fetchOneAssoc()); $_SESSION['auth'] = AUTH_MDP; S::kill('challenge'); @@ -101,7 +101,7 @@ class XnetSession Get::kill('auth'); Get::kill('uid'); $args = array(); - $path = Get::get('p'); + $path = Get::v('p'); Get::kill('p'); Get::kill('PHPSESSID'); diff --git a/include/xorg.inc.php b/include/xorg.inc.php index 3d84c05..52cd829 100644 --- a/include/xorg.inc.php +++ b/include/xorg.inc.php @@ -97,10 +97,6 @@ function new_admin_page($tpl_name) function new_admin_table_editor($table, $idfield, $idedit=false) { - array_walk($_GET, 'unfix_gpc_magic'); - array_walk($_POST, 'unfix_gpc_magic'); - array_walk($_REQUEST, 'unfix_gpc_magic'); - global $editor; new_admin_page('table-editor.tpl'); require_once('xorg.table-editor.inc.php'); diff --git a/include/xorg.plugin.inc.php b/include/xorg.plugin.inc.php index 445e340..971d5a1 100644 --- a/include/xorg.plugin.inc.php +++ b/include/xorg.plugin.inc.php @@ -63,7 +63,7 @@ class XOrgPlugin */ function get_value($key) { - return Get::get($this->_prefix.$key); + return Get::v($this->_prefix.$key); } // }}} @@ -97,7 +97,7 @@ class XOrgPlugin $get[] = urlencode($key) . '=' . urlencode($args[$key]); } } elseif (Get::has('key')) { - $get[] = urlencode($key) . '=' . urlencode(Get::get($key)); + $get[] = urlencode($key) . '=' . urlencode(Get::v($key)); } } diff --git a/include/xorg/session.inc.php b/include/xorg/session.inc.php index a9e751e..8b041a1 100644 --- a/include/xorg/session.inc.php +++ b/include/xorg/session.inc.php @@ -61,9 +61,9 @@ class XorgSession // si on vient de recevoir une identification par passwordpromptscreen.tpl // ou passwordpromptscreenlogged.tpl - $uname = Env::get('username'); + $uname = Env::v('username'); - if (Env::get('domain') == "alias") { + if (Env::v('domain') == "alias") { $res = XDB::query( "SELECT redirect @@ -92,16 +92,16 @@ class XorgSession require_once('secure_hash.inc.php'); $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); + if (Env::v('response') != $expected_response) { + $new_password = hash_xor(Env::v('xorpass'), $password); $expected_response = hash_encrypt("$uname:$new_password:".S::v('challenge')); - if (Env::get('response') == $expected_response) { + if (Env::v('response') == $expected_response) { XDB::execute("UPDATE auth_user_md5 SET password = {?} WHERE user_id = {?}", $new_password, $uid); } } - if (Env::get('response') == $expected_response) { + if (Env::v('response') == $expected_response) { if (Env::has('domain')) { - if (($domain = Env::get('domain', 'login')) == 'alias') { + if (($domain = Env::v('domain', 'login')) == 'alias') { setcookie('ORGdomain', "alias", (time()+25920000), '/', '', 0); } else { setcookie('ORGdomain', '', (time()-3600), '/', '', 0); @@ -115,7 +115,7 @@ class XorgSession $logger->log('auth_ok'); } start_connexion($uid, true); - if (Env::get('remember', 'false') == 'true') { + if (Env::v('remember', 'false') == 'true') { $cookie = hash_encrypt(S::v('password')); setcookie('ORGaccess',$cookie,(time()+25920000),'/','',0); if ($logger) { @@ -175,19 +175,19 @@ class XorgSession */ function try_cookie() { - if (Cookie::get('ORGaccess') == '' or !Cookie::has('ORGuid')) { + if (Cookie::v('ORGaccess') == '' or !Cookie::has('ORGuid')) { return -1; } $res = @XDB::query( "SELECT user_id,password FROM auth_user_md5 WHERE user_id = {?} AND perms IN('admin','user')", - Cookie::getInt('ORGuid') + Cookie::i('ORGuid') ); if ($res->numRows() != 0) { list($uid, $password) = $res->fetchOneRow(); require_once('secure_hash.inc.php'); $expected_value = hash_encrypt($password); - if ($expected_value == Cookie::get('ORGaccess')) { + if ($expected_value == Cookie::v('ORGaccess')) { start_connexion($uid, false); return 0; } else { diff --git a/modules/auth.php b/modules/auth.php index e3571c0..b5f3509 100644 --- a/modules/auth.php +++ b/modules/auth.php @@ -119,7 +119,7 @@ class AuthModule extends PLModule function handler_redirect(&$page) { - http_redirect(Env::get('dest', '/')); + http_redirect(Env::v('dest', '/')); } function handler_groupex(&$page) diff --git a/modules/banana.php b/modules/banana.php index 3dab3d1..eecfc2c 100644 --- a/modules/banana.php +++ b/modules/banana.php @@ -66,7 +66,7 @@ class BananaModule extends PLModule if (!(Post::has('action') && Post::has('banananame') && Post::has('bananasig') && Post::has('bananadisplay') && Post::has('bananamail') - && Post::has('bananaupdate') && Post::get('action')=="OK" )) + && Post::has('bananaupdate') && Post::v('action')=="OK" )) { $req = XDB::query(" SELECT nom,mail,sig,if(FIND_IN_SET('threads',flags),'1','0'), @@ -89,10 +89,10 @@ class BananaModule extends PLModule XDB::execute( 'REPLACE INTO forums.profils (uid,sig,mail,nom,flags) VALUES ({?},{?},{?},{?},{?})', - S::v('uid'), Post::get('bananasig'), - Post::get('bananamail'), Post::get('banananame'), - (Post::getBool('bananadisplay') ? 'threads,' : '') . - (Post::getBool('bananaupdate') ? 'automaj' : '') + S::v('uid'), Post::v('bananasig'), + Post::v('bananamail'), Post::v('banananame'), + (Post::b('bananadisplay') ? 'threads,' : '') . + (Post::b('bananaupdate') ? 'automaj' : '') ); } } diff --git a/modules/carnet.php b/modules/carnet.php index c13d1a9..69b29b9 100644 --- a/modules/carnet.php +++ b/modules/carnet.php @@ -60,7 +60,7 @@ class CarnetModule extends PLModule $page->changeTpl('carnet/panel.tpl'); if (Get::has('read')) { - $_SESSION['watch_last'] = Get::get('read'); + $_SESSION['watch_last'] = Get::v('read'); pl_redirect('carnet/panel'); } @@ -138,11 +138,11 @@ class CarnetModule extends PLModule if (Env::has('subs')) $watch->_subs->update('sub'); if (Env::has('flags_contacts')) { - $watch->watch_contacts = Env::getBool('contacts'); + $watch->watch_contacts = Env::b('contacts'); $watch->saveFlags(); } if (Env::has('flags_mail')) { - $watch->watch_mail = Env::getBool('mail'); + $watch->watch_mail = Env::b('mail'); $watch->saveFlags(); } @@ -154,7 +154,7 @@ class CarnetModule extends PLModule $res = XDB::query("SELECT COUNT(*) FROM contacts WHERE uid = {?}", $uid); $total = $res->fetchOneCell(); - $order = Get::get('order'); + $order = Get::v('order'); $orders = Array( 'nom' => 'nom DESC, u.prenom, u.promo', 'promo' => 'promo DESC, nom, u.prenom', @@ -162,7 +162,7 @@ class CarnetModule extends PLModule if ($order != 'promo' && $order != 'last') $order = 'nom'; $order = $orders[$order]; - if (Get::get('inv') == '') + if (Get::v('inv') == '') $order = str_replace(" DESC,", ",", $order); $res = XDB::query(" @@ -185,9 +185,9 @@ class CarnetModule extends PLModule $page->assign('xorg_title','Polytechnique.org - Mes contacts'); $uid = S::v('uid'); - $user = Env::get('user'); + $user = Env::v('user'); - switch (Env::get('action')) { + switch (Env::v('action')) { case 'retirer': if (is_numeric($user)) { if (XDB::execute('DELETE FROM contacts @@ -231,15 +231,15 @@ class CarnetModule extends PLModule $trombi->setNbRows(4); $page->assign_by_ref('trombi',$trombi); - $order = Get::get('order'); + $order = Get::v('order'); if ($order != 'promo' && $order != 'last') $order = 'nom'; $page->assign('order', $order); - $page->assign('inv', Get::get('inv')); + $page->assign('inv', Get::v('inv')); } else { - $order = Get::get('order'); + $order = Get::v('order'); $orders = Array( 'nom' => 'sortkey DESC, a.prenom, a.promo', 'promo' => 'promo DESC, sortkey, a.prenom', @@ -247,9 +247,9 @@ class CarnetModule extends PLModule if ($order != 'promo' && $order != 'last') $order = 'nom'; $page->assign('order', $order); - $page->assign('inv', Get::get('inv')); + $page->assign('inv', Get::v('inv')); $order = $orders[$order]; - if (Get::get('inv') == '') + if (Get::v('inv') == '') $order = str_replace(" DESC,", ",", $order); $sql = "SELECT contact AS id, diff --git a/modules/email.php b/modules/email.php index 5bd2046..22abcf5 100644 --- a/modules/email.php +++ b/modules/email.php @@ -47,7 +47,7 @@ class EmailModule extends PLModule // there will be maximum 8 bits in flags : 255 XDB::execute("UPDATE aliases SET flags=flags & (255 - 1) WHERE id={?}", $uid); XDB::execute("UPDATE aliases SET flags=flags | 1 WHERE id={?} AND alias={?}", - $uid, Post::get('best')); + $uid, Post::v('best')); } // on regarde si on a affaire à un homonyme @@ -116,9 +116,9 @@ class EmailModule extends PLModule if ($action == 'ask' && Env::has('alias') and Env::has('raison')) { //Si l'utilisateur vient de faire une damande - $alias = Env::get('alias'); - $raison = Env::get('raison'); - $public = (Env::get('public', 'off') == 'on')?"public":"private"; + $alias = Env::v('alias'); + $raison = Env::v('raison'); + $public = (Env::v('public', 'off') == 'on')?"public":"private"; $page->assign('r_alias', $alias); $page->assign('r_raison', $raison); @@ -195,14 +195,14 @@ class EmailModule extends PLModule } if (Env::has('emailop')) { - $actifs = Env::getMixed('emails_actifs', Array()); - if (Env::get('emailop') == "ajouter" && Env::has('email')) { - $page->assign('retour', $redirect->add_email(Env::get('email'))); + $actifs = Env::v('emails_actifs', Array()); + if (Env::v('emailop') == "ajouter" && Env::has('email')) { + $page->assign('retour', $redirect->add_email(Env::v('email'))); } elseif (empty($actifs)) { $page->assign('retour', ERROR_INACTIVE_REDIRECTION); } elseif (is_array($actifs)) { $page->assign('retour', $redirect->modify_email($actifs, - Env::getMixed('emails_rewrite',Array()))); + Env::v('emails_rewrite',Array()))); } } @@ -236,7 +236,7 @@ class EmailModule extends PLModule $bogo = new Bogo(S::v('uid')); if (Env::has('statut_filtre')) { - $bogo->change(S::v('uid'), Env::getInt('statut_filtre')); + $bogo->change(S::v('uid'), Env::i('statut_filtre')); } $page->assign('filtre',$bogo->level()); } @@ -250,15 +250,15 @@ class EmailModule extends PLModule $page->assign('xorg_title','Polytechnique.org - Envoyer un email'); // action si on recoit un formulaire - if (Env::get('submit') == 'Envoyer') + if (Env::v('submit') == 'Envoyer') { - $to2 = join(', ', Env::getMixed('contacts', Array())); - $txt = str_replace('^M', '', Env::get('contenu')); - $to = Env::get('to'); - $subj = Env::get('sujet'); - $from = Env::get('from'); - $cc = Env::get('cc'); - $bcc = Env::get('bcc'); + $to2 = join(', ', Env::v('contacts', Array())); + $txt = str_replace('^M', '', Env::v('contenu')); + $to = Env::v('to'); + $subj = Env::v('sujet'); + $from = Env::v('from'); + $cc = Env::v('cc'); + $bcc = Env::v('bcc'); if (empty($to) && empty($cc) && empty($to2)) { $page->trig("Indique au moins un destinataire."); @@ -344,7 +344,7 @@ L' $page->trig("Mail envoyé ! :o)"); } } elseif (Post::has('email')) { - $email = valide_email(Post::get('email')); + $email = valide_email(Post::v('email')); list(,$fqdn) = explode('@', $email); $fqdn = strtolower($fqdn); diff --git a/modules/events.php b/modules/events.php index 87b9e17..4fd1290 100644 --- a/modules/events.php +++ b/modules/events.php @@ -102,13 +102,13 @@ class EventsModule extends PLModule INNER JOIN evenements AS e ON e.id = ev.evt_id WHERE peremption < NOW)'); XDB::execute('REPLACE INTO evenements_vus VALUES({?},{?})', - Env::get('lu'), S::v('uid')); + Env::v('lu'), S::v('uid')); } if (Env::has('nonlu')){ XDB::execute('DELETE FROM evenements_vus WHERE evt_id = {?} AND user_id = {?}', - Env::get('nonlu'), S::v('uid')); + Env::v('nonlu'), S::v('uid')); } // affichage des evenements @@ -147,13 +147,13 @@ class EventsModule extends PLModule { $page->changeTpl('evenements.tpl'); - $titre = Post::get('titre'); - $texte = Post::get('texte'); - $promo_min = Post::getInt('promo_min'); - $promo_max = Post::getInt('promo_max'); - $peremption = Post::getInt('peremption'); - $valid_mesg = Post::get('valid_mesg'); - $action = Post::get('action'); + $titre = Post::v('titre'); + $texte = Post::v('texte'); + $promo_min = Post::i('promo_min'); + $promo_max = Post::i('promo_max'); + $peremption = Post::i('peremption'); + $valid_mesg = Post::v('valid_mesg'); + $action = Post::v('action'); $page->assign('titre', $titre); $page->assign('texte', $texte); @@ -232,12 +232,12 @@ class EventsModule extends PLModule require_once 'newsletter.inc.php'; if (Post::has('see')) { - $art = new NLArticle(Post::get('title'), Post::get('body'), Post::get('append')); + $art = new NLArticle(Post::v('title'), Post::v('body'), Post::v('append')); $page->assign('art', $art); } elseif (Post::has('valid')) { require_once('validations.inc.php'); - $art = new NLReq(S::v('uid'), Post::get('title'), - Post::get('body'), Post::get('append')); + $art = new NLReq(S::v('uid'), Post::v('title'), + Post::v('body'), Post::v('append')); $art->submit(); $page->assign('submited', true); } diff --git a/modules/geoloc.php b/modules/geoloc.php index 370a121..49f3895 100644 --- a/modules/geoloc.php +++ b/modules/geoloc.php @@ -60,7 +60,7 @@ class GeolocModule extends PLModule $fields = new SFieldGroup(true, advancedSearchFromInput()); $search = $fields->get_url(); - if (Env::has('only_current') && Env::get('only_current') != 'on') { + if (Env::has('only_current') && Env::v('only_current') != 'on') { $search .= '&only_current='; } $search = preg_replace('/(^|&)mapid=([0-9]+)(&|$)/','\1\3', $search); @@ -92,7 +92,7 @@ class GeolocModule extends PLModule $querystring = $this->_make_qs(); $initfile = urlencode('geolocInit.php?'.$querystring); - if (urlencode(Env::get('initfile')) != $initfile) { + if (urlencode(Env::v('initfile')) != $initfile) { header("Location: dynamap.php?initfile=$initfile{$querystring}"); die(); } @@ -163,7 +163,7 @@ class GeolocModule extends PLModule $querystring = $this->_make_qs(); $page->assign('searchvars', $querystring); - $mapid = Env::has('mapid') ? Env::getInt('mapid', -2) : false; + $mapid = Env::has('mapid') ? Env::i('mapid', -2) : false; list($countries, $cities) = geoloc_getData_subcountries($mapid, advancedSearchFromInput(), 10); diff --git a/modules/lists.php b/modules/lists.php index b16dc93..343fb2c 100644 --- a/modules/lists.php +++ b/modules/lists.php @@ -59,15 +59,15 @@ class ListsModule extends PLModule if (Get::has('del')) { - $this->client->unsubscribe(Get::get('del')); + $this->client->unsubscribe(Get::v('del')); pl_redirect('lists'); } if (Get::has('add')) { - $this->client->subscribe(Get::get('add')); + $this->client->subscribe(Get::v('add')); pl_redirect('lists'); } if (Post::has('promo_add')) { - $promo = Post::getInt('promo_add'); + $promo = Post::i('promo_add'); if ($promo >= 1900 and $promo < 2100) { $this->client->subscribe("promo$promo"); } else { @@ -82,22 +82,22 @@ class ListsModule extends PLModule { $page->changeTpl('listes/create.tpl'); - $owners = preg_split("/[\s]+/", Post::get('owners'), -1, PREG_SPLIT_NO_EMPTY); - $members = preg_split("/[\s]+/", Post::get('members'), -1, PREG_SPLIT_NO_EMPTY); + $owners = preg_split("/[\s]+/", Post::v('owners'), -1, PREG_SPLIT_NO_EMPTY); + $members = preg_split("/[\s]+/", Post::v('members'), -1, PREG_SPLIT_NO_EMPTY); // click on validate button 'add_owner_sub' or type if (Post::has('add_owner_sub') && Post::has('add_owner')) { require_once('user.func.inc.php'); // if we want to add an owner and then type , then both // add_owner_sub and add_owner are filled. - if (Post::get('add_owner') != "") { - if (($forlife = get_user_forlife(Post::get('add_owner'))) !== false) { + if (Post::v('add_owner') != "") { + if (($forlife = get_user_forlife(Post::v('add_owner'))) !== false) { $owners [] = $forlife; } // if we want to add a member and then type , then // add_owner_sub is filled, whereas add_owner is empty. } else if (Post::has('add_member')) { - if (($forlife = get_user_forlife(Post::get('add_member'))) !== false) { + if (($forlife = get_user_forlife(Post::v('add_member'))) !== false) { $members[] = $forlife; } } @@ -106,7 +106,7 @@ class ListsModule extends PLModule // click on validate button 'add_member_sub' if (Post::has('add_member_sub') && Post::has('add_member')) { require_once('user.func.inc.php'); - if (($forlife = get_user_forlife(Post::get('add_member'))) !== false) { + if (($forlife = get_user_forlife(Post::v('add_member'))) !== false) { $members[] = $forlife; } } @@ -121,7 +121,7 @@ class ListsModule extends PLModule return; } - $liste = Post::get('liste'); + $liste = Post::v('liste'); if (empty($liste)) { $page->trig('champs «addresse souhaitée» vide'); @@ -137,7 +137,7 @@ class ListsModule extends PLModule $page->trig('cet alias est déjà pris'); } - if (!Post::get(desc)) { + if (!Post::v(desc)) { $page->trig('le sujet est vide'); } @@ -153,8 +153,8 @@ class ListsModule extends PLModule $page->assign('created', true); require_once 'validations.inc.php'; $req = new ListeReq(S::v('uid'), $liste, - Post::get('desc'), Post::getInt('advertise'), - Post::getInt('modlevel'), Post::getInt('inslevel'), + Post::v('desc'), Post::i('advertise'), + Post::i('modlevel'), Post::i('inslevel'), $owners, $members); $req->submit(); } @@ -182,7 +182,7 @@ class ListsModule extends PLModule $members = $this->client->get_members($liste); - $tri_promo = !Env::getBool('alpha'); + $tri_promo = !Env::b('alpha'); if (list($det,$mem,$own) = $members) { $membres = list_sort_members($mem, $tri_promo); @@ -273,8 +273,8 @@ class ListsModule extends PLModule { $page->kill("La liste n'existe pas ou tu n'as pas le droit de la consulter"); } elseif (Get::has('file')) { - $file = Get::get('file'); - $rep = Get::get('rep'); + $file = Get::v('file'); + $rep = Get::v('rep'); if (strstr('/', $file)!==false || !preg_match(',^\d+/\d+$,', $rep)) { $page->kill("La liste n'existe pas ou tu n'as pas le droit de la consulter"); } else { @@ -311,16 +311,16 @@ class ListsModule extends PLModule $page->register_modifier('qpd', 'quoted_printable_decode'); if (Env::has('sadd')) { /* 4 = SUBSCRIBE */ - $this->client->handle_request($liste,Env::get('sadd'),4,''); + $this->client->handle_request($liste,Env::v('sadd'),4,''); pl_redirect('lists/moderate/'.$liste); } if (Post::has('sdel')) { /* 2 = REJECT */ - $this->client->handle_request($liste,Post::get('sdel'),2,Post::get('reason')); + $this->client->handle_request($liste,Post::v('sdel'),2,Post::v('reason')); } if (Env::has('mid')) { - $mid = Env::get('mid'); + $mid = Env::v('mid'); $mail = $this->client->get_pending_mail($liste, $mid); $reason = ''; @@ -334,7 +334,7 @@ class ListsModule extends PLModule } elseif (Env::has('mno')) { $action = 2; /** 2 = REJECT **/ $subject = "Message refusé"; - $reason = Post::get('reason'); + $reason = Post::v('reason'); $append = "a été refusé par $prenom $nom avec la raison :\n\n" . $reason; } elseif (Env::has('mdel')) { @@ -379,7 +379,7 @@ class ListsModule extends PLModule if (list($subs,$mails) = $this->client->get_pending_ops($liste)) { foreach($subs as $user) { - if ($user['id'] == Env::get('sid')) { + if ($user['id'] == Env::v('sid')) { $page->changeTpl('listes/moderate_sub.tpl'); $page->assign('del_user', $user); return; @@ -412,7 +412,7 @@ class ListsModule extends PLModule if (Env::has('add_member')) { require_once('user.func.inc.php'); - $members = explode(' ', Env::get('add_member')); + $members = explode(' ', Env::v('add_member')); if ($members) foreach ($members as $i => $alias) { if (($login = get_user_forlife($alias)) !== false) {; $members[$i] = $login; @@ -428,11 +428,11 @@ class ListsModule extends PLModule } if (Env::has('del_member')) { - if (strpos(Env::get('del_member'), '@') === false) { + if (strpos(Env::v('del_member'), '@') === false) { $this->client->mass_unsubscribe( - $liste, array(Env::get('del_member').'@'.$globals->mail->domain)); + $liste, array(Env::v('del_member').'@'.$globals->mail->domain)); } else { - $this->client->mass_unsubscribe($liste, array(Env::get('del_member'))); + $this->client->mass_unsubscribe($liste, array(Env::v('del_member'))); } pl_redirect('lists/admin/'.$liste); } @@ -440,7 +440,7 @@ class ListsModule extends PLModule if (Env::has('add_owner')) { require_once('user.func.inc.php'); - $owners = explode(' ', Env::get('add_owner')); + $owners = explode(' ', Env::v('add_owner')); if ($owners) foreach ($owners as $alias) { if (($login = get_user_forlife($alias)) === false) {; @@ -454,10 +454,10 @@ class ListsModule extends PLModule } if (Env::has('del_owner')) { - if (strpos(Env::get('del_owner'), '@') === false) { - $this->client->del_owner($liste, Env::get('del_owner').'@'.$globals->mail->domain); + if (strpos(Env::v('del_owner'), '@') === false) { + $this->client->del_owner($liste, Env::v('del_owner').'@'.$globals->mail->domain); } else { - $this->client->del_owner($liste, Env::get('del_owner')); + $this->client->del_owner($liste, Env::v('del_owner')); } pl_redirect('lists/admin/'.$liste); } @@ -512,10 +512,10 @@ class ListsModule extends PLModule $values['subject_prefix'] = trim($values['subject_prefix']).' '; } $this->client->set_owner_options($liste, $values); - } elseif (isvalid_email(Post::get('atn_add'))) { - $this->client->add_to_wl($liste, Post::get('atn_add')); + } elseif (isvalid_email(Post::v('atn_add'))) { + $this->client->add_to_wl($liste, Post::v('atn_add')); } elseif (Get::has('atn_del')) { - $this->client->del_from_wl($liste, Get::get('atn_del')); + $this->client->del_from_wl($liste, Get::v('atn_del')); pl_redirect('lists/options/'.$liste); } @@ -538,8 +538,8 @@ class ListsModule extends PLModule $page->changeTpl('listes/delete.tpl'); - if (Post::get('valid') == 'OUI' - && $this->client->delete_list($liste, Post::getBool('del_archive'))) + if (Post::v('valid') == 'OUI' + && $this->client->delete_list($liste, Post::b('del_archive'))) { foreach (array('', '-owner', '-admin', '-bounces') as $app) { XDB::execute("DELETE FROM aliases diff --git a/modules/marketing.php b/modules/marketing.php index ae2ad4a..7ae45ad 100644 --- a/modules/marketing.php +++ b/modules/marketing.php @@ -122,8 +122,8 @@ class MarketingModule extends PLModule if ($action == 'relforce') { require_once('marketing.inc.php'); - mark_send_mail($uid, $value, Post::get('from'), Post::get('to'), - Post::get('title'), Post::get('message')); + mark_send_mail($uid, $value, Post::v('from'), Post::v('to'), + Post::v('title'), Post::v('message')); $page->trig("Mail envoyé"); } @@ -139,7 +139,7 @@ class MarketingModule extends PLModule "INSERT INTO register_marketing SET uid = {?}, sender = {?}, email = {?}, date = NOW(), type = {?}", - $uid, S::v('uid'), Post::get('email'), Post::get('type')); + $uid, S::v('uid'), Post::v('email'), Post::v('type')); } $res = XDB::iterator( @@ -197,7 +197,7 @@ class MarketingModule extends PLModule if (Post::has('valide')) { require_once('xorg.misc.inc.php'); - $email = trim(Post::get('mail')); + $email = trim(Post::v('mail')); $res = XDB::query('SELECT COUNT(*) FROM register_marketing WHERE uid={?} AND email={?}', $uid, $email); @@ -210,10 +210,10 @@ class MarketingModule extends PLModule XDB::execute( "INSERT INTO register_marketing (uid,sender,email,date,last,nb,type,hash) VALUES ({?}, {?}, {?}, NOW(), 0, 0, {?}, '')", - $uid, S::v('uid'), $email, Post::get('origine')); + $uid, S::v('uid'), $email, Post::v('origine')); require_once('validations.inc.php'); $req = new MarkReq(S::v('uid'), $uid, $email, - Post::get('origine')=='user'); + Post::v('origine')=='user'); $req->submit(); } } diff --git a/modules/payment.php b/modules/payment.php index 07199aa..3f88a01 100644 --- a/modules/payment.php +++ b/modules/payment.php @@ -93,15 +93,15 @@ class PaymentModule extends PLModule $page->assign('xorg_title','Polytechnique.org - Télépaiements'); // initialisation - $op = Env::get('op', 'select'); - $meth = new PayMethod(Env::getInt('methode', -1)); + $op = Env::v('op', 'select'); + $meth = new PayMethod(Env::i('methode', -1)); $pay = new Payment($ref); if($pay->flags->hasflag('old')){ $page->trig("La transaction selectionnée est périmée."); $pay = new Payment(); } - $val = Env::get('montant') != 0 ? Env::get('montant') : $pay->montant_def; + $val = Env::v('montant') != 0 ? Env::v('montant') : $pay->montant_def; if (($e = $pay->check($val)) !== true) { $page->trig($e); diff --git a/modules/platal.php b/modules/platal.php index b5dfe4a..55e55cb 100644 --- a/modules/platal.php +++ b/modules/platal.php @@ -107,7 +107,7 @@ class PlatalModule extends PLModule $page->assign('xorg_title','Polytechnique.org - Mes préférences'); if (Post::has('mail_fmt')) { - $fmt = Post::get('mail_fmt'); + $fmt = Post::v('mail_fmt'); if ($fmt != 'texte') $fmt = 'html'; XDB::execute("UPDATE auth_user_quick SET core_mail_fmt = '$fmt' @@ -117,7 +117,7 @@ class PlatalModule extends PLModule } if (Post::has('rss')) { - $this->__set_rss_state(Post::getBool('rss')); + $this->__set_rss_state(Post::b('rss')); } } @@ -128,15 +128,15 @@ class PlatalModule extends PLModule $page->assign('xorg_title','Polytechnique.org - Redirection de page WEB'); $log =& S::v('log'); - $url = Env::get('url'); + $url = Env::v('url'); - if (Env::get('submit') == 'Valider' and Env::has('url')) { + if (Env::v('submit') == 'Valider' and Env::has('url')) { XDB::execute('UPDATE auth_user_quick SET redirecturl = {?} WHERE user_id = {?}', $url, S::v('uid')); - $log->log('carva_add', 'http://'.Env::get('url')); + $log->log('carva_add', 'http://'.Env::v('url')); $page->trig("Redirection activée vers $url"); - } elseif (Env::get('submit') == "Supprimer") { + } elseif (Env::v('submit') == "Supprimer") { XDB::execute("UPDATE auth_user_quick SET redirecturl = '' WHERE user_id = {?}", @@ -157,9 +157,9 @@ class PlatalModule extends PLModule { $page->changeTpl('filrss.tpl'); - $page->assign('goback', Env::get('referer', 'login')); + $page->assign('goback', Env::v('referer', 'login')); - if (Env::get('act_rss') == 'Activer') { + if (Env::v('act_rss') == 'Activer') { $this->__set_rss_state(true); $page->trig("Ton Fil RSS est activé."); } @@ -170,7 +170,7 @@ class PlatalModule extends PLModule if (Post::has('response2')) { require_once 'secure_hash.inc.php'; - $_SESSION['password'] = $password = Post::get('response2'); + $_SESSION['password'] = $password = Post::v('response2'); XDB::execute('UPDATE auth_user_md5 SET password={?} @@ -180,7 +180,7 @@ class PlatalModule extends PLModule $log =& S::v('log'); $log->log('passwd', ''); - if (Cookie::get('ORGaccess')) { + if (Cookie::v('ORGaccess')) { setcookie('ORGaccess', hash_encrypt($password), (time()+25920000), '/', '' ,0); } @@ -199,17 +199,17 @@ class PlatalModule extends PLModule $page->assign('xorg_title','Polytechnique.org - Acces SMTP/NNTP'); $uid = S::v('uid'); - $pass = Env::get('smtppass1'); + $pass = Env::v('smtppass1'); $log = S::v('log'); - if (Env::get('op') == "Valider" && strlen($pass) >= 6 - && Env::get('smtppass1') == Env::get('smtppass2')) + if (Env::v('op') == "Valider" && strlen($pass) >= 6 + && Env::v('smtppass1') == Env::v('smtppass2')) { XDB::execute('UPDATE auth_user_md5 SET smtppass = {?} WHERE user_id = {?}', $pass, $uid); $page->trig('Mot de passe enregistré'); $log->log("passwd_ssl"); - } elseif (Env::get('op') == "Supprimer") { + } elseif (Env::v('op') == "Supprimer") { XDB::execute('UPDATE auth_user_md5 SET smtppass = "" WHERE user_id = {?}', $uid); $page->trig('Compte SMTP et NNTP supprimé'); @@ -232,17 +232,17 @@ class PlatalModule extends PLModule return; } - if (!ereg('[0-3][0-9][0-1][0-9][1][9]([0-9]{2})', Env::get('birth'))) { + if (!ereg('[0-3][0-9][0-1][0-9][1][9]([0-9]{2})', Env::v('birth'))) { $page->trig('Date de naissance incorrecte ou incohérente'); return; } $birth = sprintf('%s-%s-%s', - substr(Env::get('birth'), 4, 4), - substr(Env::get('birth'), 2, 2), - substr(Env::get('birth'), 0, 2)); + substr(Env::v('birth'), 4, 4), + substr(Env::v('birth'), 2, 2), + substr(Env::v('birth'), 0, 2)); - $mailorg = strtok(Env::get('login'), '@'); + $mailorg = strtok(Env::v('login'), '@'); // paragraphe rajouté : si la date de naissance dans la base n'existe pas, on l'update // avec celle fournie ici en espérant que c'est la bonne @@ -274,12 +274,12 @@ Si en cliquant dessus tu n'y arrives pas, copie int -- Polytechnique.org -\"Le portail des élèves & anciens élèves de l'Ecole polytechnique\"".(Post::get('email') ? " +\"Le portail des élèves & anciens élèves de l'Ecole polytechnique\"".(Post::v('email') ? " Adresse de secours : - ".Post::get('email') : "")." + ".Post::v('email') : "")." -Mail envoyé à ".Env::get('login')); +Mail envoyé à ".Env::v('login')); $mymail->send(); // on cree un objet logger et on log l'evenement @@ -304,7 +304,7 @@ Mail envoy $uid = $ligne["uid"]; if (Post::has('response2')) { - $password = Post::get('response2'); + $password = Post::v('response2'); $logger = new DiogenesCoreLogger($uid); XDB::query('UPDATE auth_user_md5 SET password={?} WHERE user_id={?} AND perms IN("admin","user")', @@ -328,7 +328,7 @@ Mail envoy if (Env::has('newskin')) { // formulaire soumis, traitons les données envoyées XDB::execute('UPDATE auth_user_quick SET skin={?} WHERE user_id={?}', - Env::getInt('newskin'), S::v('uid')); + Env::i('newskin'), S::v('uid')); S::kill('skin'); set_skin(); } @@ -382,7 +382,7 @@ Mail envoy XorgSession::destroy(); if (Get::has('redirect')) { - http_redirect(rawurldecode(Get::get('redirect'))); + http_redirect(rawurldecode(Get::v('redirect'))); } else { $page->changeTpl('exit.tpl'); } diff --git a/modules/profile.php b/modules/profile.php index 0727241..02b6ee0 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -45,7 +45,7 @@ class ProfileModule extends PLModule /* XXX COMPAT */ function handler_fiche(&$page) { - return $this->handler_profile($page, Env::get('user')); + return $this->handler_profile($page, Env::v('user')); } @@ -118,7 +118,7 @@ class ProfileModule extends PLModule if (Env::has('upload')) { $file = isset($_FILES['userfile']['tmp_name']) ? $_FILES['userfile']['tmp_name'] - : Env::get('photo'); + : Env::v('photo'); if ($data = file_get_contents($file)) { if ($myphoto = new PhotoReq(S::v('uid'), $data)) { $myphoto->submit(); @@ -133,13 +133,13 @@ class ProfileModule extends PLModule $myphoto->commit(); $myphoto->clean(); } - } elseif (Env::get('suppr')) { + } elseif (Env::v('suppr')) { XDB::execute('DELETE FROM photo WHERE uid = {?}', S::v('uid')); XDB::execute('DELETE FROM requests WHERE user_id = {?} AND type="photo"', S::v('uid')); - } elseif (Env::get('cancel')) { + } elseif (Env::v('cancel')) { $sql = XDB::query('DELETE FROM requests WHERE user_id={?} AND type="photo"', S::v('uid')); @@ -164,8 +164,8 @@ class ProfileModule extends PLModule $page->changeTpl('fiche.tpl', SIMPLE); $view = 'private'; - if (!S::logged() || Env::get('view') == 'public') $view = 'public'; - if (S::logged() && Env::get('view') == 'ax') $view = 'ax'; + if (!S::logged() || Env::v('view') == 'public') $view = 'public'; + if (S::logged() && Env::v('view') == 'ax') $view = 'ax'; if (is_numeric($x)) { $res = XDB::query( @@ -182,7 +182,7 @@ class ProfileModule extends PLModule return PL_NOT_FOUND; } - $new = Env::get('modif') == 'new'; + $new = Env::v('modif') == 'new'; $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); @@ -256,7 +256,7 @@ class ProfileModule extends PLModule $page->assign('no_private_key', true); } - if (Env::get('synchro_ax') == 'confirm' && !is_ax_key_missing()) { + if (Env::v('synchro_ax') == 'confirm' && !is_ax_key_missing()) { ax_synchronize(S::v('bestalias'), S::v('uid')); $page->trig('Ton profil a été synchronisé avec celui du site polytechniciens.com'); } @@ -274,16 +274,16 @@ class ProfileModule extends PLModule // la date de naissance n'existait pas et vient d'être soumise dans la variable if (Env::has('birth')) { //en cas d'erreur : - if (!ereg('[0-3][0-9][0-1][0-9][1][9]([0-9]{2})', Env::get('birth'))) { + if (!ereg('[0-3][0-9][0-1][0-9][1][9]([0-9]{2})', Env::v('birth'))) { $page->assign('etat_naissance', 'query'); $page->trig('Date de naissance incorrecte ou incohérente.'); return; } //sinon - $birth = sprintf("%s-%s-%s", substr(Env::get('birth'), 4, 4), - substr(Env::get('birth'), 2, 2), - substr(Env::get('birth'), 0, 2)); + $birth = sprintf("%s-%s-%s", substr(Env::v('birth'), 4, 4), + substr(Env::v('birth'), 2, 2), + substr(Env::v('birth'), 0, 2)); XDB::execute("UPDATE auth_user_md5 SET naissance={?} WHERE user_id={?}", $birth, @@ -364,7 +364,7 @@ class ProfileModule extends PLModule return; } - $promo_sortie = Env::getInt('promo_sortie'); + $promo_sortie = Env::i('promo_sortie'); if ($promo_sortie < 1000 || $promo_sortie > 9999) { $page->trig('L\'année de sortie doit être un nombre de quatre chiffres'); @@ -464,10 +464,10 @@ class ProfileModule extends PLModule $page->assign('xorg_title', 'Polytechnique.org - Conseil Pro'); - $secteur_sel = Post::get('secteur'); - $ss_secteur_sel = Post::get('ss_secteur'); - $pays_sel = Post::get('pays', '00'); - $expertise_champ = Post::get('expertise'); + $secteur_sel = Post::v('secteur'); + $ss_secteur_sel = Post::v('ss_secteur'); + $pays_sel = Post::v('pays', '00'); + $expertise_champ = Post::v('expertise'); $page->assign('pays_sel', $pays_sel); $page->assign('expertise_champ', $expertise_champ); @@ -551,7 +551,7 @@ class ProfileModule extends PLModule $nb_max_res_total = 100; $nb_max_res_ppage = 10; - $curpage = Env::getInt('curpage', 1); + $curpage = Env::i('curpage', 1); $personnes = array(); $i = 0; @@ -589,7 +589,7 @@ class ProfileModule extends PLModule $page->assign('usage_old', $usage_old); $page->assign('alias_old', $alias_old); - $nom_usage = replace_accent(trim(Env::get('nom_usage'))); + $nom_usage = replace_accent(trim(Env::v('nom_usage'))); $nom_usage = strtoupper($nom_usage); $page->assign('usage_req', $nom_usage); @@ -599,9 +599,9 @@ class ProfileModule extends PLModule $page->assign('same', true); } else { // le nom de mariage est distinct du nom à l'X // on calcule l'alias pour l'afficher - $reason = Env::get('reason'); + $reason = Env::v('reason'); if ($reason == 'other') { - $reason = Env::get('other_reason'); + $reason = Env::v('other_reason'); } $myusage = new UsageReq(S::v('uid'), $nom_usage, $reason); $myusage->submit(); diff --git a/modules/register.php b/modules/register.php index d2ca34f..b67c5bc 100644 --- a/modules/register.php +++ b/modules/register.php @@ -37,13 +37,13 @@ class RegisterModule extends PLModule if (!isset($sub_state['step'])) { $sub_state['step'] = 0; } - if (Get::has('back') && Get::getInt('back') < $sub_state['step']) { - $sub_state['step'] = max(0,Get::getInt('back')); + if (Get::has('back') && Get::i('back') < $sub_state['step']) { + $sub_state['step'] = max(0,Get::i('back')); } // Compatibility with old sources, keep it atm if (!$hash && Env::has('hash')) { - $hash = Env::get('hash'); + $hash = Env::v('hash'); } if ($hash) { @@ -82,7 +82,7 @@ class RegisterModule extends PLModule case 1: if (Post::has('promo')) { - $promo = Post::getInt('promo'); + $promo = Post::i('promo'); if ($promo < 1900 || $promo > date('Y')) { $err = "La promotion saisie est incorrecte !"; } else { @@ -100,9 +100,9 @@ class RegisterModule extends PLModule case 2: if (count($_POST)) { require_once('register.inc.php'); - $sub_state['prenom'] = Post::get('prenom'); - $sub_state['nom'] = Post::get('nom'); - $sub_state['mat'] = Post::get('mat'); + $sub_state['prenom'] = Post::v('prenom'); + $sub_state['nom'] = Post::v('nom'); + $sub_state['mat'] = Post::v('mat'); $err = check_new_user($sub_state); if ($err !== true) { break; } @@ -117,14 +117,14 @@ class RegisterModule extends PLModule case 3: if (count($_POST)) { require_once('register.inc.php'); - if (!isvalid_email(Post::get('email'))) { + if (!isvalid_email(Post::v('email'))) { $err[] = "Le champ 'E-mail' n'est pas valide."; - } elseif (!isvalid_email_redirection(Post::get('email'))) { + } elseif (!isvalid_email_redirection(Post::v('email'))) { $err[] = $sub_state['forlife']." doit renvoyer vers un email existant ". "valide, en particulier, il ne peut pas être renvoyé vers lui-même."; } if (!preg_match('/^[0-3][0-9][01][0-9][12][90][0-9][0-9]$/', - Post::get('naissance'))) + Post::v('naissance'))) { $err[] = "La 'Date de naissance' n'est pas correcte."; } @@ -132,12 +132,12 @@ class RegisterModule extends PLModule if (isset($err)) { $err = join('
', $err); } else { - $birth = Env::get('naissance'); + $birth = Env::v('naissance'); $sub_state['naissance'] = sprintf("%s-%s-%s", substr($birth,4,4), substr($birth,2,2), substr($birth,0,2)); - $sub_state['email'] = Post::get('email'); + $sub_state['email'] = Post::v('email'); $sub_state['step'] = 4; finish_ins($sub_state); } @@ -154,7 +154,7 @@ class RegisterModule extends PLModule function handler_end_old(&$page) { - return $this->handler_end($page, Env::get('hash')); + return $this->handler_end($page, Env::v('hash')); } function handler_end(&$page, $hash = null) @@ -277,7 +277,7 @@ class RegisterModule extends PLModule $page->changeTpl('register/success.tpl'); if (Env::has('response2')) { - $_SESSION['password'] = $password = Post::get('response2'); + $_SESSION['password'] = $password = Post::v('response2'); XDB::execute('UPDATE auth_user_md5 SET password={?} WHERE user_id={?}', $password, @@ -286,7 +286,7 @@ class RegisterModule extends PLModule $log =& S::v('log'); $log->log('passwd', ''); - if (Cookie::get('ORGaccess')) { + if (Cookie::v('ORGaccess')) { require_once('secure_hash.inc.php'); setcookie('ORGaccess', hash_encrypt($password), (time()+25920000), '/', '' ,0); } diff --git a/modules/search.php b/modules/search.php index e48af11..2234e06 100644 --- a/modules/search.php +++ b/modules/search.php @@ -90,7 +90,7 @@ class SearchModule extends PLModule XDB::iterator('SELECT id,label FROM emploi_secteur ORDER BY label')); if (Env::has('school')) { - $sql = 'SELECT type FROM applis_def WHERE id='.Env::getInt('school'); + $sql = 'SELECT type FROM applis_def WHERE id='.Env::i('school'); } else { $sql = 'DESCRIBE applis_def type'; } diff --git a/modules/trezo.php b/modules/trezo.php index ee966f5..6181ce0 100644 --- a/modules/trezo.php +++ b/modules/trezo.php @@ -46,8 +46,8 @@ class TrezoModule extends PLModule //| debit | decimal(10,2) | | | 0.00 | | //+--------+---------------+------+-----+------------+----------------+ - $annee_sel = Env::get('annee', date('y')); - $mois_sel = Env::get('mois', sprintf('%02u', date('m') - (intval(date('m') - 1) % 3))); + $annee_sel = Env::v('annee', date('y')); + $mois_sel = Env::v('mois', sprintf('%02u', date('m') - (intval(date('m') - 1) % 3))); $mois_sel_fin = sprintf('%02u',$mois_sel + 2); $from_date = "$annee_sel-$mois_sel-01"; diff --git a/modules/xnet.php b/modules/xnet.php index 85835ea..ae19482 100644 --- a/modules/xnet.php +++ b/modules/xnet.php @@ -97,7 +97,7 @@ class XnetModule extends PLModule if (Get::has('del')) { $res = XDB::query('SELECT id, nom, mail_domain FROM groupex.asso WHERE diminutif={?}', - Get::get('del')); + Get::v('del')); list($id, $nom, $domain) = $res->fetchOneRow(); $page->assign('nom', $nom); if ($id && Post::has('del')) { @@ -132,8 +132,8 @@ class XnetModule extends PLModule if (Post::has('diminutif')) { XDB::query('INSERT INTO groupex.asso (id,diminutif) - VALUES(NULL,{?})', Post::get('diminutif')); - pl_redirect('../'.Post::get('diminutif').'/edit'); + VALUES(NULL,{?})', Post::v('diminutif')); + pl_redirect('../'.Post::v('diminutif').'/edit'); } $res = XDB::query('SELECT nom,diminutif FROM groupex.asso ORDER by NOM'); @@ -183,7 +183,7 @@ class XnetModule extends PLModule function handler_groups2(&$page) { - $this->handler_groups(&$page, Get::get('cat'), Get::get('dom')); + $this->handler_groups(&$page, Get::v('cat'), Get::v('dom')); } function handler_groups(&$page, $cat = null, $dom = null) diff --git a/modules/xnetevents.php b/modules/xnetevents.php index 24f1182..de4fb21 100644 --- a/modules/xnetevents.php +++ b/modules/xnetevents.php @@ -45,7 +45,7 @@ class XnetEventsModule extends PLModule return PL_NOT_ALLOWED; } - $eid = Post::get('del'); + $eid = Post::v('del'); $res = XDB::query("SELECT asso_id, short_name FROM groupex.evenements WHERE eid = {?} AND asso_id = {?}", @@ -157,8 +157,8 @@ class XnetEventsModule extends PLModule return; } - $moments = Post::getMixed('moment', array()); - $pers = Post::getMixed('personnes', array()); + $moments = Post::v('moment', array()); + $pers = Post::v('personnes', array()); $subs = array(); foreach ($moments as $j => $v) { @@ -227,7 +227,7 @@ class XnetEventsModule extends PLModule $admin = may_update(); - $tri = (Env::get('order') == 'alpha' ? 'promo, nom, prenom' : 'nom, prenom, promo'); + $tri = (Env::v('order') == 'alpha' ? 'promo, nom, prenom' : 'nom, prenom, promo'); $page->assign('participants', get_event_participants($evt, $item_id, $tri)); @@ -235,7 +235,7 @@ class XnetEventsModule extends PLModule $page->assign('admin', $admin); $page->assign('moments', $evt['moments']); $page->assign('money', $evt['money']); - $page->assign('tout', !Env::get('item_id', false)); + $page->assign('tout', !Env::v('item_id', false)); } function handler_edit(&$page, $eid = null) @@ -258,35 +258,35 @@ class XnetEventsModule extends PLModule $moments = range(1, 4); $page->assign('moments', $moments); - if (Post::get('intitule')) { + if (Post::v('intitule')) { require_once dirname(__FILE__).'/xnetevents/xnetevents.inc.php'; $short_name = event_change_shortname($page, $infos['short_name'], - Env::get('short_name', '')); + Env::v('short_name', '')); $evt = array( 'eid' => $eid, 'asso_id' => $globals->asso('id'), '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') - .':'.Post::get('deb_Minute').':00', - 'fin' => Post::get('fin_Year').'-'.Post::get('fin_Month') - .'-'.Post::get('fin_Day').' '.Post::get('fin_Hour') - .':'.Post::get('fin_Minute').':00', + 'paiement_id' => Post::v('paiement_id') > 0 ? Post::v('paiement_id') : null, + 'debut' => Post::v('deb_Year').'-'.Post::v('deb_Month') + .'-'.Post::v('deb_Day').' '.Post::v('deb_Hour') + .':'.Post::v('deb_Minute').':00', + 'fin' => Post::v('fin_Year').'-'.Post::v('fin_Month') + .'-'.Post::v('fin_Day').' '.Post::v('fin_Hour') + .':'.Post::v('fin_Minute').':00', 'short_name' => $short_name, ); $trivial = array('intitule', 'descriptif', 'noinvite', 'show_participants'); foreach ($trivial as $k) { - $evt[$k] = Post::get($k); + $evt[$k] = Post::v($k); } - if (Post::get('deadline')) { - $evt['deadline_inscription'] = Post::get('inscr_Year').'-' - . Post::get('inscr_Month').'-' - . Post::get('inscr_Day'); + if (Post::v('deadline')) { + $evt['deadline_inscription'] = Post::v('inscr_Year').'-' + . Post::v('inscr_Month').'-' + . Post::v('inscr_Day'); } else { $evt['deadline_inscription'] = null; } @@ -312,16 +312,16 @@ class XnetEventsModule extends PLModule $money_defaut = 0; foreach ($moments as $i) { - if (Post::get('titre'.$i)) { + if (Post::v('titre'.$i)) { $nb_moments++; - $montant = strtr(Post::get('montant'.$i), ',', '.'); + $montant = strtr(Post::v('montant'.$i), ',', '.'); $money_defaut += (float)$montant; XDB::execute(" REPLACE INTO groupex.evenements_items VALUES ({?}, {?}, {?}, {?}, {?})", - $eid, $i, Post::get('titre'.$i), - Post::get('details'.$i), $montant); + $eid, $i, Post::v('titre'.$i), + Post::v('details'.$i), $montant); } else { XDB::execute("DELETE FROM groupex.evenements_items WHERE eid = {?} AND item_id = {?}", $eid, $i); @@ -329,12 +329,12 @@ class XnetEventsModule extends PLModule } // request for a new payment - if (Post::get('paiement_id') == -1 && $money_defaut >= 0) { + if (Post::v('paiement_id') == -1 && $money_defaut >= 0) { require_once 'validations.inc.php'; $p = new PayReq(S::v('uid'), - Post::get('intitule')." - ".$globals->asso('nom'), - Post::get('site'), $money_defaut, - Post::get('confirmation'), 0, 999, + Post::v('intitule')." - ".$globals->asso('nom'), + Post::v('site'), $money_defaut, + Post::v('confirmation'), 0, 999, $globals->asso('id'), $eid); $p->submit(); } @@ -411,31 +411,31 @@ class XnetEventsModule extends PLModule new_groupadmin_page('xnetevents/admin.tpl'); } - if (may_update() && Post::get('adm')) { - $member = get_infos(Post::get('mail')); + if (may_update() && Post::v('adm')) { + $member = get_infos(Post::v('mail')); if (!$member) { $page->trig("Membre introuvable"); } // change the price paid by a participant - if (Env::get('adm') == 'prix' && $member) { + if (Env::v('adm') == 'prix' && $member) { XDB::execute("UPDATE groupex.evenements_participants SET paid = IF(paid + {?} > 0, paid + {?}, 0) WHERE uid = {?} AND eid = {?}", - strtr(Env::get('montant'), ',', '.'), - strtr(Env::get('montant'), ',', '.'), + strtr(Env::v('montant'), ',', '.'), + strtr(Env::v('montant'), ',', '.'), $member['uid'], $eid); } // change the number of personns coming with a participant - if (Env::get('adm') == 'nbs' && $member) { + if (Env::v('adm') == 'nbs' && $member) { $res = XDB::query("SELECT paid FROM groupex.evenements_participants WHERE uid = {?} AND eid = {?}", $member['uid'], $eid); $paid = intval($res->fetchOneCell()); - $nbs = Post::getMixed('nb', array()); + $nbs = Post::v('nb', array()); foreach ($nbs as $id => $nb) { $nb = max(intval($nb), 0); @@ -469,7 +469,7 @@ class XnetEventsModule extends PLModule $page->assign('moments', $evt['moments']); } - $tri = (Env::get('order') == 'alpha' ? 'promo, nom, prenom' : 'nom, prenom, promo'); + $tri = (Env::v('order') == 'alpha' ? 'promo, nom, prenom' : 'nom, prenom, promo'); $whereitemid = is_null($item_id) ? '' : "AND ep.item_id = $item_id"; $res = XDB::iterRow( 'SELECT UPPER(SUBSTRING(IF(u.nom IS NULL, m.nom, @@ -487,15 +487,15 @@ class XnetEventsModule extends PLModule while (list($char, $nb) = $res->next()) { $alphabet[ord($char)] = $char; $nb_tot += $nb; - if (Env::has('initiale') && $char == strtoupper(Env::get('initiale'))) { + if (Env::has('initiale') && $char == strtoupper(Env::v('initiale'))) { $tot = $nb; } } ksort($alphabet); $page->assign('alphabet', $alphabet); - $ofs = Env::getInt('offset'); - $tot = Env::get('initiale') ? $tot : $nb_tot; + $ofs = Env::i('offset'); + $tot = Env::v('initiale') ? $tot : $nb_tot; $nbp = intval(($tot-1)/NB_PER_PAGE); $links = array(); if ($ofs) { diff --git a/modules/xnetevents/xnetevents.inc.php b/modules/xnetevents/xnetevents.inc.php index e9cddbd..ce2a838 100644 --- a/modules/xnetevents/xnetevents.inc.php +++ b/modules/xnetevents/xnetevents.inc.php @@ -105,7 +105,7 @@ function get_event_participants($evt, $item_id, $tri, $limit = '') { if (Env::has('initiale')) { $where = 'AND IF(u.nom IS NULL, m.nom, IF(u.nom_usage<>"", u.nom_usage, u.nom)) - LIKE "'.addslashes(Env::get('initiale')).'%"'; + LIKE "'.addslashes(Env::v('initiale')).'%"'; } else { $where = ''; } diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php index 95b356f..2e1e563 100644 --- a/modules/xnetgrp.php +++ b/modules/xnetgrp.php @@ -139,7 +139,7 @@ class XnetGrpModule extends PLModule if (Post::has('submit')) { if (S::has_perms()) { - if (Post::get('mail_domain') && (strstr(Post::get('mail_domain'), '.') === false)) { + if (Post::v('mail_domain') && (strstr(Post::v('mail_domain'), '.') === false)) { $page->trig("le domaine doit être un FQDN (aucune modif effectuée) !!!"); return; } @@ -150,17 +150,17 @@ class XnetGrpModule extends PLModule forum={?}, mail_domain={?}, ax={?}, pub={?}, sub_url={?}, inscriptible={?} WHERE id={?}", - Post::get('nom'), Post::get('diminutif'), - Post::get('cat'), Post::getInt('dom'), - Post::get('descr'), Post::get('site'), - Post::get('mail'), Post::get('resp'), - Post::get('forum'), Post::get('mail_domain'), + Post::v('nom'), Post::v('diminutif'), + Post::v('cat'), Post::i('dom'), + Post::v('descr'), Post::v('site'), + Post::v('mail'), Post::v('resp'), + Post::v('forum'), Post::v('mail_domain'), Post::has('ax'), Post::has('pub')?'private':'public', - Post::get('sub_url'), Post::get('inscriptible'), + Post::v('sub_url'), Post::v('inscriptible'), $globals->asso('id')); - if (Post::get('mail_domain')) { + if (Post::v('mail_domain')) { XDB::execute('INSERT INTO virtual_domains (domain) VALUES({?})', - Post::get('mail_domain')); + Post::v('mail_domain')); } } else { XDB::execute( @@ -168,11 +168,11 @@ class XnetGrpModule extends PLModule SET descr={?}, site={?}, mail={?}, resp={?}, forum={?}, ax={?}, pub= {?}, sub_url={?} WHERE id={?}", - Post::get('descr'), Post::get('site'), - Post::get('mail'), Post::get('resp'), - Post::get('forum'), Post::has('ax'), + Post::v('descr'), Post::v('site'), + Post::v('mail'), Post::v('resp'), + Post::v('forum'), Post::has('ax'), Post::has('pub')?'private':'public', - Post::get('sub_url'), $globals->asso('id')); + Post::v('sub_url'), $globals->asso('id')); } if ($_FILES['logo']['name']) { @@ -184,7 +184,7 @@ class XnetGrpModule extends PLModule $globals->asso('id')); } - pl_redirect('../'.Post::get('diminutif', $globals->asso('diminutif')).'/edit'); + pl_redirect('../'.Post::v('diminutif', $globals->asso('diminutif')).'/edit'); } if (S::has_perms()) { @@ -207,15 +207,15 @@ class XnetGrpModule extends PLModule $page->assign('listes', $client->get_lists()); if (Post::has('send')) { - $from = Post::get('from'); - $sujet = Post::get('sujet'); - $body = Post::get('body'); + $from = Post::v('from'); + $sujet = Post::v('sujet'); + $body = Post::v('body'); - $mls = array_keys(Env::getMixed('ml', array())); + $mls = array_keys(Env::v('ml', array())); require_once 'xnet/mail.inc.php'; $tos = get_all_redirects(Post::has('membres'), $mls, $client); - send_xnet_mails($from, $sujet, $body, $tos, Post::get('replyto')); + send_xnet_mails($from, $sujet, $body, $tos, Post::v('replyto')); $page->kill("Mail envoyé !"); $page->assign('sent', true); } @@ -235,7 +235,7 @@ class XnetGrpModule extends PLModule $page->assign('admin', may_update()); - switch (Env::get('order')) { + switch (Env::v('order')) { case 'promo' : $group = 'promo'; $tri = 'promo_o DESC, nom, prenom'; break; case 'promo_inv': $group = 'promo'; $tri = 'promo_o, nom, prenom'; break; case 'alpha_inv': $group = 'initiale'; $tri = 'nom DESC, prenom DESC, promo'; break; @@ -267,17 +267,17 @@ class XnetGrpModule extends PLModule while (list($char, $nb) = $res->next()) { $alphabet[] = $char; $nb_tot += $nb; - if (Env::has($group) && $char == strtoupper(Env::get($group))) { + if (Env::has($group) && $char == strtoupper(Env::v($group))) { $tot = $nb; } } $page->assign('group', $group); - $page->assign('request_group', Env::get($group)); + $page->assign('request_group', Env::v($group)); $page->assign('alphabet', $alphabet); $page->assign('nb_tot', $nb_tot); - $ofs = Env::getInt('offset'); - $tot = Env::get($group) ? $tot : $nb_tot; + $ofs = Env::i('offset'); + $tot = Env::v($group) ? $tot : $nb_tot; $nbp = intval(($tot-1)/NB_PER_PAGE); $links = array(); if ($ofs) { @@ -297,10 +297,10 @@ class XnetGrpModule extends PLModule if (Env::has('initiale')) { $ini = 'AND IF(m.origine="X", IF(u.nom_usage<>"", u.nom_usage, u.nom), - m.nom) LIKE "'.addslashes(Env::get('initiale')).'%"'; + m.nom) LIKE "'.addslashes(Env::v('initiale')).'%"'; } elseif (Env::has('promo')) { $ini = 'AND IF(m.origine="X", u.promo, "extérieur") = "' - .addslashes(Env::get('promo')).'"'; + .addslashes(Env::v('promo')).'"'; } $ann = XDB::iterator( @@ -389,7 +389,7 @@ class XnetGrpModule extends PLModule $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->setTxtBody(Env::v('motif')); $mailer->send(); $page->kill("la demande $prenom $nom a bien été refusée"); } else { @@ -448,7 +448,7 @@ class XnetGrpModule extends PLModule $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->setTxtBody(Post::v('message').$append); $mailer->send(); } } @@ -467,12 +467,12 @@ class XnetGrpModule extends PLModule $tit = $res->fetchAllAssoc(); $page->assign('titres', $tit); - $order = Env::get('order', 'timestamp'); + $order = Env::v('order', 'timestamp'); $orders = array('timestamp', 'nom', 'promo', 'montant'); if (!in_array($order, $orders)) { $order = 'timestamp'; } - $inv_order = Env::get('order_inv', 0); + $inv_order = Env::v('order_inv', 0); $page->assign('order', $order); $page->assign('order_inv', !$inv_order); @@ -686,16 +686,16 @@ class XnetGrpModule extends PLModule XDB::query('UPDATE groupex.membres SET prenom={?}, nom={?}, email={?} WHERE uid={?} AND asso_id={?}', - Post::get('prenom'), Post::get('nom'), - Post::get('email'), $user['uid'], + Post::v('prenom'), Post::v('nom'), + Post::v('email'), $user['uid'], $globals->asso('id')); - $user['nom'] = Post::get('nom'); - $user['prenom'] = Post::get('prenom'); - $user['email'] = Post::get('email'); - $user['email2'] = Post::get('email'); + $user['nom'] = Post::v('nom'); + $user['prenom'] = Post::v('prenom'); + $user['email'] = Post::v('email'); + $user['email2'] = Post::v('email'); } - $perms = Post::getInt('is_admin'); + $perms = Post::i('is_admin'); if ($user['perms'] != $perms) { XDB::query('UPDATE groupex.membres SET perms={?} WHERE uid={?} AND asso_id={?}', @@ -705,7 +705,7 @@ class XnetGrpModule extends PLModule $page->trig('permissions modifiées'); } - foreach (Env::getMixed('ml1', array()) as $ml => $state) { + foreach (Env::v('ml1', array()) as $ml => $state) { $ask = empty($_REQUEST['ml2'][$ml]) ? 0 : 2; if ($ask == $state) continue; if ($state == '1') { @@ -721,7 +721,7 @@ class XnetGrpModule extends PLModule } } - foreach (Env::getMixed('ml3', array()) as $ml => $state) { + foreach (Env::v('ml3', array()) as $ml => $state) { $ask = !empty($_REQUEST['ml4'][$ml]); if($state == $ask) continue; if($ask) { diff --git a/modules/xnetlists.php b/modules/xnetlists.php index 1201fbf..f99c4cb 100644 --- a/modules/xnetlists.php +++ b/modules/xnetlists.php @@ -74,16 +74,16 @@ class XnetListsModule extends ListsModule $page->changeTpl('xnetlists/index.tpl'); if (Get::has('del')) { - $this->client->unsubscribe(Get::get('del')); + $this->client->unsubscribe(Get::v('del')); pl_redirect('lists'); } if (Get::has('add')) { - $this->client->subscribe(Get::get('add')); + $this->client->subscribe(Get::v('add')); pl_redirect('lists'); } if (Post::has('del_alias') && may_update()) { - $alias = Post::get('del_alias'); + $alias = Post::v('del_alias'); // prevent group admin from erasing aliases from other groups $alias = substr($alias, 0, strpos($alias, '@')).'@'.$globals->asso('mail_domain'); XDB::query( @@ -91,7 +91,7 @@ class XnetListsModule extends ListsModule USING x4dat.virtual AS v LEFT JOIN x4dat.virtual_redirect USING(vid) WHERE v.alias={?}', $alias); - $page->trig(Post::get('del_alias')." supprimé !"); + $page->trig(Post::v('del_alias')." supprimé !"); } $listes = $this->client->get_lists(); @@ -126,7 +126,7 @@ class XnetListsModule extends ListsModule return; } - $liste = Post::get('liste'); + $liste = Post::v('liste'); if (!preg_match("/^[a-zA-Z0-9\-]*$/", $liste)) { $page->trig('le nom de la liste ne doit contenir que des lettres, chiffres et tirets'); @@ -141,15 +141,15 @@ class XnetListsModule extends ListsModule $page->trig('cet alias est déjà pris'); return; } - if (!Post::get('desc')) { + if (!Post::v('desc')) { $page->trig('le sujet est vide'); return; } require_once 'lists.inc.php'; $ret = $this->client->create_list( - $liste, Post::get('desc'), Post::get('advertise'), - Post::get('modlevel'), Post::get('inslevel'), + $liste, Post::v('desc'), Post::v('advertise'), + Post::v('modlevel'), Post::v('inslevel'), array(S::v('forlife')), array()); $dom = strtolower($globals->asso("mail_domain")); @@ -193,7 +193,7 @@ class XnetListsModule extends ListsModule $page->changeTpl('xnetlists/sync.tpl'); if (Env::has('add')) { - $this->client->mass_subscribe($liste, array_keys(Env::getMixed('add'))); + $this->client->mass_subscribe($liste, array_keys(Env::v('add'))); } list(,$members) = $this->client->get_members($liste); @@ -236,7 +236,7 @@ class XnetListsModule extends ListsModule new_groupadmin_page('xnet/groupe/alias-admin.tpl'); if (Env::has('add_member')) { - $add = Env::get('add_member'); + $add = Env::v('add_member'); if (strstr($add, '@')) { list($mbox,$dom) = explode('@', strtolower($add)); } else { @@ -275,7 +275,7 @@ class XnetListsModule extends ListsModule "DELETE FROM x4dat.virtual_redirect USING x4dat.virtual_redirect INNER JOIN x4dat.virtual USING(vid) - WHERE redirect={?} AND alias={?}", Env::get('del_member'), $lfull); + WHERE redirect={?} AND alias={?}", Env::v('del_member'), $lfull); pl_redirect('alias/admin/'.$lfull); } @@ -302,7 +302,7 @@ class XnetListsModule extends ListsModule $page->trig('champs «addresse souhaitée» vide'); return; } - $liste = Post::get('liste'); + $liste = Post::v('liste'); if (!preg_match("/^[a-zA-Z0-9\-\.]*$/", $liste)) { $page->trig('le nom de l\'alias ne doit contenir que des lettres,' .' chiffres, tirets et points'); diff --git a/plugins/insert.getName.php b/plugins/insert.getName.php index 78a1285..996ebfc 100644 --- a/plugins/insert.getName.php +++ b/plugins/insert.getName.php @@ -21,7 +21,7 @@ function smarty_insert_getName() { - $uid = Cookie::get('ORGuid', -1); + $uid = Cookie::v('ORGuid', -1); if ($uid < 0) { return ""; } diff --git a/plugins/insert.getUserName.php b/plugins/insert.getUserName.php index fc17ee8..0c530ff 100644 --- a/plugins/insert.getUserName.php +++ b/plugins/insert.getUserName.php @@ -23,14 +23,14 @@ function smarty_insert_getUsername() { global $globals; - $id = Cookie::getInt('ORGuid', -1); + $id = Cookie::i('ORGuid', -1); $id = S::v($_SESSION['uid'], $id); if ($id<0) { return ""; } - if (Cookie::get('ORGdomain', 'login') != 'alias') { + if (Cookie::v('ORGdomain', 'login') != 'alias') { $res = XDB::query("SELECT alias FROM aliases WHERE id={?} AND (type IN ('a_vie','alias') AND FIND_IN_SET('bestalias', flags))", $id); return $res->fetchOneCell(); -- 2.1.4