$fields[] = $key;
}
if ($current == 'valid' && Env::has('csv_valid')) {
- if (!Session::has_xsrf_token()) {
+ if (!S::has_xsrf_token()) {
$page->kill("L'opération n'a pas pu être effectuée, merci de réessayer.");
}
$this->run($_SESSION['csv_action'], $insert, $update);
$page->changeTpl('core/table-editor.tpl');
$list = true;
- if ($action == 'delete' && Session::has_xsrf_token()) {
+ if ($action == 'delete' && S::has_xsrf_token()) {
if (!isset($this->delete_action)) {
foreach ($this->jtables as $table => $j)
XDB::execute("DELETE FROM {$table} WHERE {$j['joinid']} = {?}{$j['joinextra']}", $id);
}
$list = false;
}
- if ($action == 'update' && Session::has_xsrf_token()) {
+ if ($action == 'update' && S::has_xsrf_token()) {
$values = "";
$cancel = false;
foreach ($this->vars as $field => $descr) {
// Check if there was a submission
foreach($_POST as $key => $val) {
- if (!Session::has_xsrf_token()) {
+ if (!S::has_xsrf_token()) {
$page->kill("L'opération de modification de l'utilisateur a échouée, merci de réessayer.");
}
switch ($key) {
$page->assign('promo',$promo);
- if ($validate && Session::has_xsrf_token()) {
+ if ($validate && S::has_xsrf_token()) {
$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()) {
if(Env::has('uid') && Env::has('type') && Env::has('stamp')) {
$req = Validate::get_typed_request(Env::v('uid'), Env::v('type'), Env::v('stamp'));
- if($req && Session::has_xsrf_token()) {
+ if($req && S::has_xsrf_token()) {
$req->handle_formu();
} else if ($req) {
$page->trig("L'opération a échoué, merci de réessayer.");
switch (Post::v('action')) {
case 'create':
if (trim(Post::v('ipN')) != '') {
- if (!Session::has_xsrf_token()) {
+ if (!S::has_xsrf_token()) {
$page->trig("L'ajout d'une IP à surveiller a échoué, merci de réessayer.");
break;
}
break;
case 'edit':
- if (!Session::has_xsrf_token()) {
+ if (!S::has_xsrf_token()) {
$page->trig("L'édition de l'IP a échoué, merci de réessayer.");
break;
}
default:
if ($action == 'delete' && !is_null($ip)) {
- if (Session::has_xsrf_token()) {
+ if (S::has_xsrf_token()) {
Xdb::execute('DELETE FROM ip_watch WHERE ip = {?}', ip_to_uint($ip));
} else {
$page->trig("La suppression de l'adresse IP a échouée, merci de réssayer.");
WHERE uid = {?} AND diminutif = {?}",
S::v('uid'), $_GET['group']);
$perms = $res->fetchOneCell();
- if (Session::has_perms()) {
+ if (S::has_perms()) {
$perms = 'admin';
}
} else {
// if no group asked, return main rights
- $perms = Session::has_perms()?'admin':'membre';
+ $perms = S::has_perms() ? 'admin' : 'membre';
}
$params .= gpex_prepare_param($val, $perms, $tohash, $charset);
}
$redirect->modify_one_email_redirect($email, $rewrite);
}
- if (Env::has('emailop') && Session::has_xsrf_token()) {
+ if (Env::has('emailop') && S::has_xsrf_token()) {
$actifs = Env::v('emails_actifs', Array());
print_r(Env::v('emails_rewrite'));
if (Env::v('emailop') == "ajouter" && Env::has('email')) {
} else if ($subaction == 'nosync') {
$account->set_password_sync(false);
} else if (Post::has('response2') && !$account->sync_password) {
- if (Session::has_xsrf_token()) {
+ if (S::has_xsrf_token()) {
$account->set_password(Post::v('response2'));
} else {
$page->trig("Le changement de ton mot de passe Google Apps a échoué, merci de réessayer.");
}
if ($action == 'suspend' && Post::has('suspend') && $account->active()) {
- if (!Session::has_xsrf_token()) {
+ if (!S::has_xsrf_token()) {
$page->trig("La demande de suspension de ton compte a échouée, merci de réessayer.");
} else if ($account->pending_update_suspension) {
$page->trig("Ton compte est déjà en cours de désactivation.");
$password = Post::v('response2');
}
- if (Session::has_xsrf_token()) {
+ if (S::has_xsrf_token()) {
$account->create($password_sync, $password, $redirect_mails);
$page->trig("La demande de création de ton compte Google Apps a bien été enregistrée.");
} else {
{
global $globals;
- if (Post::has('response2') && Session::has_xsrf_token()) {
+ if (Post::has('response2') && S::has_xsrf_token()) {
require_once 'secure_hash.inc.php';
$_SESSION['password'] = $password = Post::v('response2');
Get::v('del'));
list($id, $nom, $domain) = $res->fetchOneRow();
$page->assign('nom', $nom);
- if ($id && Post::has('del') && Session::has_xsrf_token()) {
+ if ($id && Post::has('del') && S::has_xsrf_token()) {
XDB::query('DELETE FROM groupex.membres WHERE asso_id={?}', $id);
$page->trig('membres supprimés');
}
}
- if (Post::has('diminutif') && Session::has_xsrf_token()) {
+ if (Post::has('diminutif') && S::has_xsrf_token()) {
XDB::query('INSERT INTO groupex.asso (id,diminutif)
VALUES(NULL,{?})', Post::v('diminutif'));
pl_redirect('../'.Post::v('diminutif').'/edit');
global $globals;
$page->changeTpl('xnetgrp/edit.tpl');
- if (Post::has('submit') && Session::has_xsrf_token()) {
+ if (Post::has('submit') && S::has_xsrf_token()) {
if (S::has_perms()) {
if (Post::v('mail_domain') && (strstr(Post::v('mail_domain'), '.') === false)) {
$page->trig("le domaine doit être un FQDN (aucune modif effectuée) !!!");
***************************************************************************/
function smarty_function_xsrf_token($params, &$smarty) {
- return Session::v('xsrf_token', '');
+ return S::v('xsrf_token', '');
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
***************************************************************************/
function smarty_function_xsrf_token_field($params, &$smarty) {
- if (Session::has('xsrf_token')) {
- return '<input type="hidden" name="token" value="' . Session::v('xsrf_token') . '" />';
+ if (S::has('xsrf_token')) {
+ return '<input type="hidden" name="token" value="' . S::v('xsrf_token') . '" />';
}
return '';
}