PEEL Shopping
Open source ecommerce : PEEL Shopping
membre.php
Go to the documentation of this file.
1 <?php
2 // This file should be in UTF8 without BOM - Accents examples: éèê
3 // +----------------------------------------------------------------------+
4 // | Copyright (c) 2004-2015 Advisto SAS, service PEEL - contact@peel.fr |
5 // +----------------------------------------------------------------------+
6 // | This file is part of PEEL Shopping 8.0.0, which is subject to an |
7 // | opensource GPL license: you are allowed to customize the code |
8 // | for your own needs, but must keep your changes under GPL |
9 // | More information: https://www.peel.fr/lire/licence-gpl-70.html |
10 // +----------------------------------------------------------------------+
11 // | Author: Advisto SAS, RCS 479 205 452, France, https://www.peel.fr/ |
12 // +----------------------------------------------------------------------+
13 // $Id: membre.php 46935 2015-09-18 08:49:48Z gboussin $
14 define('IN_ACCES_ACCOUNT', true);
15 include("configuration.inc.php");
16 
17 if (est_identifie()) {
18  redirect_and_die(get_account_url(false, false));
19 }
20 
21 $GLOBALS['page_name'] = 'membre';
22 $GLOBALS['DOC_TITLE'] = $GLOBALS['STR_ACCES_ACCOUNT'];
23 
25 $frm = array();
26 $output = '';
27 
28 /* Le formulaire a été soumis, vérification des paramètres de connexion */
29 if (!empty($_POST)) {
30  $_POST['email'] = trim(vb($_POST['email']));
31  $_POST['mot_passe'] = trim(vb($_POST['mot_passe']));
32  // On ne garde que l'email pour préremplir le formulaire si une erreur intervient
33  $frm['email'] = $_POST['email'];
34  if (!verify_token('membre.php', 120, false)) {
35  $form_error_object->add('token', $GLOBALS['STR_INVALID_TOKEN']);
36  }
37  $form_error_object->valide_form($_POST,
38  array('mot_passe' => $GLOBALS['STR_ERR_PASSWORD_EMPTY'],
39  'email' => $GLOBALS['STR_ERR_EMAIL_VIDE']));
40  $output .= call_module_hook('user_login_check_form', array('email' => vb($_POST['email'])), 'output');
41 
42  if (!$form_error_object->count()) {
43  $utilisateur = user_login_now($_POST['email'], $_POST['mot_passe']);
44  if ($utilisateur) {
45  if (!empty($_SESSION['session_redirect_after_login']) && strpos($_SESSION['session_redirect_after_login'], $GLOBALS['wwwroot']) === 0) {
46  // Pour éviter que des spammeurs n'utilisent referer, on vérifie que l'URL de redirection contient wwwroot
47  $goto = $_SESSION['session_redirect_after_login'];
48  unset($_SESSION['session_redirect_after_login']);
49  } elseif ($_SESSION['session_caddie']->count_products() > 0) {
50  $goto = get_url('caddie_affichage');
51  } else {
52  $goto = get_account_url(false, false);
53  }
54  redirect_and_die($goto);
55  } else {
56  $form_error_object->add('email', $GLOBALS['STR_ERR_BAD_EMAIL_OR_PASSWORD']);
57  }
58  }
59 }
60 
61 if (!empty($_GET['error'])) {
62  if ($_GET['error'] == 'admin_rights') {
63  $output .= $GLOBALS['tplEngine']->createTemplate('global_error.tpl', array('message' => $GLOBALS['STR_NO_RIGHTS_TO_ACCESS_ADMIN']))->fetch();
64  } elseif ($_GET['error'] == 'login_rights') {
65  $output .= $GLOBALS['tplEngine']->createTemplate('global_error.tpl', array('message' => $GLOBALS['STR_INSERT_LOGIN_AND_PASSWORD']))->fetch();
66  }
67 }
68 if ($form_error_object->has_error('token')) {
69  $output .= $form_error_object->text('token');
70 }
71 $output .= '
72 ' . get_access_account_form($frm, $form_error_object);
73 
74 include($GLOBALS['repertoire_modele'] . "/haut.php");
75 echo $output;
76 include($GLOBALS['repertoire_modele'] . "/bas.php");
$frm
Definition: membre.php:25
if(est_identifie()) $GLOBALS['page_name']
Definition: membre.php:21
redirect_and_die($url, $permanent_redirection=false, $avoid_loop=false)
Redirige vers l'URL demandée et arrête le programme.
Definition: fonctions.php:1551
$output
Definition: membre.php:26
$form_error_object
Definition: membre.php:24
if(!defined('IN_PEEL')) est_identifie()
Retourne true si l'utilisateur est identifié
Definition: user.php:23
vb(&$var, $default=null)
Variable blanche if $var n'est pas défini, retourne $default, sinon retourne $var.
Definition: format.php:97
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
Definition: chart-data.php:160
call_module_hook($hook, $params, $mode= 'boolean')
Appelle la fonction correspondant au $hook pour chaque module installé La fonction doit s'appeler : [...
verify_token($name= 'general', $delay_in_minutes=60, $check_referer_if_set_by_server=true, $cancel_token=true, $minimum_wait_in_seconds_before_use=0)
Vérification de la validité d'un token Par défaut, un token est valide 1h, et utilisable 1 seule fois...
Definition: fonctions.php:118
user_login_now($email_or_pseudo, $mot_passe, $check_password=true, $password_given_as_first_password_hash=false, $password_length_if_given_as_first_password_hash=null)
user_login_now()
Definition: user.php:694
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:41:20 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.