* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-// {{{ class Env
-
class Env
{
// {{{ function _get
{
return isset($_REQUEST[$key]) ? $_REQUEST[$key] : $default;
}
-
+
// }}}
// {{{ function has
{
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;
// }}}
}
-// }}}
-// {{{ class Post
class Post
{
{
return isset($_POST[$key]) ? $_POST[$key] : $default;
}
-
+
// }}}
// {{{ function has
{
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;
// }}}
}
-// }}}
-// {{{ class Get
-
class Get
{
// {{{ function _get
{
return isset($_GET[$key]) ? $_GET[$key] : $default;
}
-
+
// }}}
// {{{ function has
{
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;
// }}}
}
-// }}}
-// {{{ class Cookie
-
class Cookie
{
// {{{ function _get
{
return isset($_COOKIE[$key]) ? $_COOKIE[$key] : $default;
}
-
+
// }}}
// {{{ function has
{
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;
// }}}
}
-// }}}
-
function fix_gpc_magic(&$item, $key) {
if (is_array($item)) {
array_walk($item, 'fix_gpc_magic');
}
}
-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');
$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();
$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;
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
WHERE user_id = {?}", $uid);
list($forlife, $promo) = $q->fetchOneRow();
-switch (Env::get('action')) {
+switch (Env::v('action')) {
case "ecole":
header("Content-type: image/jpeg");
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;
$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");
$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]
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":
$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')) {
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");
$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");
}
* 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');
* 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');
* 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');
* 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');
* 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');
$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);
}
}
* 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');
* 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');
* 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');
$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)) {
* 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');
* 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');
$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);
}
* 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');
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 !");
}
* 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');
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;
}
"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();
}
}
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;
}
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 {
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":
// 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',
$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
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(); }
}
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;
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);
}
}
-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);
$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
$j = strpos($wikiAll, "<!--/PageLeftFmt-->", $i);
}
-if (Env::get('action')) {
+if (Env::v('action')) {
$page->assign('xorg_extra_header', substr($wikiAll, 0, $i));
$wikiAll = substr($wikiAll, $j);
} else {
{
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();
"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())
{
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;
$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();
}
$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();
}
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;
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)
{
function replace_ifset(&$var,$req) {
if (Env::has($req)){
- $var = Env::get($req);
+ $var = Env::v($req);
}
}
}
//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);
***************************************************************************/
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);
}
}
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';
$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);
}
}
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);
}
}
//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', '');
}
?>
/************* 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));
}
}
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', ''));
}
}
}
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;
}
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;
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
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)
//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);
}
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;
}
//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.");
// {{{ 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()
{
* 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));
}
// }}}
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);
// 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;
$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));
}
if (Env::has('refuse')) {
- if (Env::get('comm')) {
+ if (Env::v('comm')) {
$this->sendmail(false);
$this->clean();
$this->trig('mail envoyé');
$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));
$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));
***************************************************************************/
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);
}
static $aid = null;
if (is_null($aid)) {
- $gp = Get::get('p');
+ $gp = Get::v('p');
$gp = substr($gp, 0, strpos($gp, '/'));
if ($gp) {
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 !");
}
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');
Get::kill('auth');
Get::kill('uid');
$args = array();
- $path = Get::get('p');
+ $path = Get::v('p');
Get::kill('p');
Get::kill('PHPSESSID');
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');
*/
function get_value($key)
{
- return Get::get($this->_prefix.$key);
+ return Get::v($this->_prefix.$key);
}
// }}}
$get[] = urlencode($key) . '=' . urlencode($args[$key]);
}
} elseif (Get::has('key')) {
- $get[] = urlencode($key) . '=' . urlencode(Get::get($key));
+ $get[] = urlencode($key) . '=' . urlencode(Get::v($key));
}
}
// 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
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);
$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) {
*/
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 {
function handler_redirect(&$page)
{
- http_redirect(Env::get('dest', '/'));
+ http_redirect(Env::v('dest', '/'));
}
function handler_groupex(&$page)
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'),
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' : '')
);
}
}
$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');
}
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();
}
$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',
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("
$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
$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',
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,
// 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
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);
}
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())));
}
}
$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());
}
$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.");
$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);
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
{
$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);
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);
}
$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);
$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();
}
$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);
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 {
{
$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 <enter>
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 <enter>, 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 <enter>, 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;
}
}
// 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;
}
}
return;
}
- $liste = Post::get('liste');
+ $liste = Post::v('liste');
if (empty($liste)) {
$page->trig('champs «addresse souhaitée» vide');
$page->trig('cet alias est déjà pris');
}
- if (!Post::get(desc)) {
+ if (!Post::v(desc)) {
$page->trig('le sujet est vide');
}
$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();
}
$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);
{
$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 {
$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 = '';
} 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')) {
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;
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;
}
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);
}
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) {;
}
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);
}
$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);
}
$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
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é");
}
"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(
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);
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();
}
}
$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);
$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'
}
if (Post::has('rss')) {
- $this->__set_rss_state(Post::getBool('rss'));
+ $this->__set_rss_state(Post::b('rss'));
}
}
$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 <a href='http://$url'>$url</a>");
- } elseif (Env::get('submit') == "Supprimer") {
+ } elseif (Env::v('submit') == "Supprimer") {
XDB::execute("UPDATE auth_user_quick
SET redirecturl = ''
WHERE user_id = {?}",
{
$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é.");
}
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={?}
$log =& S::v('log');
$log->log('passwd', '');
- if (Cookie::get('ORGaccess')) {
+ if (Cookie::v('ORGaccess')) {
setcookie('ORGaccess', hash_encrypt($password), (time()+25920000), '/', '' ,0);
}
$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é');
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
--
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
$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")',
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();
}
XorgSession::destroy();
if (Get::has('redirect')) {
- http_redirect(rawurldecode(Get::get('redirect')));
+ http_redirect(rawurldecode(Get::v('redirect')));
} else {
$page->changeTpl('exit.tpl');
}
/* XXX COMPAT */
function handler_fiche(&$page)
{
- return $this->handler_profile($page, Env::get('user'));
+ return $this->handler_profile($page, Env::v('user'));
}
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();
$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'));
$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(
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);
$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');
}
// 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,
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');
$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);
$nb_max_res_total = 100;
$nb_max_res_ppage = 10;
- $curpage = Env::getInt('curpage', 1);
+ $curpage = Env::i('curpage', 1);
$personnes = array();
$i = 0;
$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);
$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();
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) {
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 {
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; }
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.";
}
if (isset($err)) {
$err = join('<br />', $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);
}
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)
$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,
$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);
}
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';
}
//| 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";
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')) {
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');
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)
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 = {?}",
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) {
$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));
$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)
$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;
}
$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);
}
// 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();
}
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);
$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,
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) {
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 = '';
}
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;
}
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(
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']) {
$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()) {
$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);
}
$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;
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) {
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(
$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 {
$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();
}
}
$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);
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={?}',
$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') {
}
}
- 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) {
$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(
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();
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');
$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"));
$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);
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 {
"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);
}
$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');
function smarty_insert_getName()
{
- $uid = Cookie::get('ORGuid', -1);
+ $uid = Cookie::v('ORGuid', -1);
if ($uid < 0) {
return "";
}
{
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();