From 39a25de5b9e72a998e11f65e99859e070fce09d0 Mon Sep 17 00:00:00 2001 From: Kilian Saffran Date: Wed, 9 Oct 2019 18:08:45 +0200 Subject: [PATCH] v20191009 --- backoffice/api/lib/session.pm | 12 ++++++------ backoffice/tmpl/block/sidebar.tt | 12 ++++++++++++ backoffice/tmpl/module/applications/index.js | 2 +- backoffice/tmpl/module/applications/index.tt | 2 +- backoffice/tmpl/module/billjee/form_billet.js | 19 +++++++++++++++---- backoffice/tmpl/module/billjee/form_billet.tt | 8 ++++---- .../tmpl/module/billjee/form_settings.js | 8 +++++++- backoffice/tmpl/module/billjee/index.js | 2 +- backoffice/tmpl/module/billjee/mybookings.js | 2 +- backoffice/tmpl/module/billjee/mytickets.js | 2 +- .../tmpl/module/billjee/privatetickets.js | 2 +- backoffice/tmpl/module/dashboard/index.js | 4 ++-- tmpl/page/lieu/index.tt | 6 +++--- 13 files changed, 55 insertions(+), 26 deletions(-) diff --git a/backoffice/api/lib/session.pm b/backoffice/api/lib/session.pm index 6756691..9407139 100644 --- a/backoffice/api/lib/session.pm +++ b/backoffice/api/lib/session.pm @@ -28,7 +28,7 @@ sub checklogin(){ $ret->{message} = "Mot de passe ou nom d'utilisateur inconnue!"; $ret->{messagetype} = "danger"; $ret->{sid} = undef; - my $user = $self->{db}->dbquerysorted("select id from users where username= '".$self->{db}->securetext($login)."' and userpassword = '".$pwd."' and \"blocked\" is null;"); + my $user = $self->{db}->dbquerysorted("select id from users where username=LOWER(''".$self->{db}->securetext($login)."') and userpassword = '".$pwd."' and \"blocked\" is null;"); if (keys(%{$user}) > 0){ $ret->{sid} = $self->randomstring(40); $self->{db}->dbexec("DELETE FROM sessions where id_user=".$user->{0}->{id}." and remote_addr='".$ENV{REMOTE_ADDR}."' and user_agent='".$ENV{HTTP_USER_AGENT}."';"); @@ -42,7 +42,7 @@ sub passwordforgotten(){ my $email = shift; my $ret->{messagetype} ='danger'; $ret->{message} = "Email inconnue!"; - my $sql = "select id,userpassword from users where username='".$self->{db}->securetext($email)."';"; + my $sql = "select id,userpassword from users where username=LOWER(''".$self->{db}->securetext($email)."');"; my $ex = $self->{db}->dbquerysorted($sql); if (keys(%{$ex}) > 0){ my $newpwd = $self->randomstring(12); @@ -79,7 +79,7 @@ sub registeruser(){ # $usergroup = 'avocat'; # # } - my $user = $self->{db}->dbquerysorted("select id from users where username='".$data->{email}."';"); + my $user = $self->{db}->dbquerysorted("select id from users where username=LOWER('".$data->{email}."');"); if (keys(%{$user}) > 0){ $ret->{message} = "Un utilisateur avec la même adresse e-mail existe déjà!"; return $ret; @@ -87,14 +87,14 @@ sub registeruser(){ my $newpwd = $self->randomstring(12); my $pwd = sha256_hex($newpwd); my $usergroup = $self->{db}->dbquerysorted("select id from usergroups where usergroup ='avocat';"); - my $newuserid = $self->{db}->dbquerysorted("INSERT INTO users (surname, prename, id_usergroup, username,userpassword) values ('".$data->{surname}."', '".$data->{prename}."','".$usergroup->{0}->{id}."','".$data->{email}."','".$pwd."') returning id;"); + my $newuserid = $self->{db}->dbquerysorted("INSERT INTO users (surname, prename, id_usergroup, username,userpassword) values ('".$data->{surname}."', '".$data->{prename}."','".$usergroup->{0}->{id}."',LOWER(''".$data->{email}."'),'".$pwd."') returning id;"); $self->{db}->dbexec("insert into appaccess (id_user) values (".$newuserid->{0}->{id}.");"); my $maildata->{password} = $newpwd; my $eml = sendemail->new(); - my $mret = $eml->sendemail('user_registration',$newuserid->{0}->{id},$data->{email},$maildata,undef); + my $mret = $eml->sendemail('user_registration',$newuserid->{0}->{id},lc($data->{email}),$maildata,undef); if ($mret == 0){ - $ret->{message} = "Merci pour votre régistration,
nous vous avons envoyé un e-mail, avec les coordonnées de connection nécessaires!"; + $ret->{message} = "Merci pour votre inscription,
nous vous avons envoyé un e-mail, avec les coordonnées de connection nécessaires!"; $ret->{messagetype} = "success"; } return $ret; diff --git a/backoffice/tmpl/block/sidebar.tt b/backoffice/tmpl/block/sidebar.tt index 7ee73c2..4b1901a 100644 --- a/backoffice/tmpl/block/sidebar.tt +++ b/backoffice/tmpl/block/sidebar.tt @@ -9,12 +9,24 @@ Dashboard --> + + [% FOREACH myapps = viewapps.execute(session.id) %] [% IF myapps.id %]