PEEL Shopping
Open source ecommerce : PEEL Shopping
fin.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: fin.php 46935 2015-09-18 08:49:48Z gboussin $
14 define('IN_INSTALLATION', 6);
15 include("../configuration.inc.php");
16 
17 $GLOBALS['DOC_TITLE'] = $GLOBALS['STR_ADMIN_INSTALL_STEP6_TITLE'];
18 $messages = '';
19 
20 if(empty($_SESSION['session_install_finished'])) {
21  if (empty($_POST['email'])) {
22  $error[] = 'error_mail=1';
23  }
24  if (empty($_POST['motdepasse'])) {
25  $error[] = 'error_motdepasse=1';
26  }
27  if (empty($_POST['pseudo']) || String::strpos($_POST['pseudo'], '@') !== false) {
28  $error[] = 'error_pseudo=1';
29  }
30  if (!empty($error)) {
31  redirect_and_die("configuration.php?" . implode('&', $error));
32  }
33 
34  unset($_SESSION['session_peel_sql']);
35  unset($_SESSION['session_peel_sql_premium']);
36 
37  ob_start();
38  $new_user_infos = array('priv' => 'admin',
39  'email' => $_POST['email'],
40  'pseudo' => $_POST['pseudo'],
41  'prenom' => $_POST['prenom'],
42  'nom_famille' => $_POST['nom'],
43  'societe' => '',
44  'telephone' => $_POST['telephone'],
45  'adresse' => $_POST['adresse'],
46  'code_postal' => $_POST['code_postal'],
47  'ville' => $_POST['ville'],
48  'pays' => '1',
49  'site_id' => '0',
50  'mot_passe' => $_POST['motdepasse']);
51  $id_utilisateur = insere_utilisateur($new_user_infos, false, true, false);
52  foreach($_SESSION['session_install_langs'] as $this_lang) {
53  // Le nom du site est inséré pour toutes les langues par défaut. L'administrateur peut changer les noms des langues par la suite dans le back office.
54  set_configuration_variable(array('technical_code' => 'nom_' . $this_lang, 'string' => $_SESSION['session_install_site_name'], 'type' => 'string', 'site_id' => 1), true);
55  }
56  set_configuration_variable(array('technical_code' => 'site_id_showed_by_default_if_domain_not_found', 'string' => "1", 'type' => 'integer', 'origin' => 'core', 'explain' => 'For multisite : to allow any alias on a hosting to reach the main site - Put 0 if you want to only allow configured domains', 'site_id' => 0), true);
57  set_configuration_variable(array('technical_code' => 'email_webmaster', 'string' => $_SESSION['session_install_email_webmaster'], 'type' => 'string', 'site_id' => 1), true);
58  set_configuration_variable(array('technical_code' => 'wwwroot', 'string' => $GLOBALS['wwwroot'], 'type' => 'string', 'site_id' => 1), true);
59  set_configuration_variable(array('technical_code' => 'email_commande', 'string' => $_POST['email'], 'type' => 'string', 'site_id' => 1), true);
60  set_configuration_variable(array('technical_code' => 'email_webmaster', 'string' => $_POST['email'], 'type' => 'string', 'site_id' => 1), true);
61  set_configuration_variable(array('technical_code' => 'email_client', 'string' => $_POST['email'], 'type' => 'string', 'site_id' => 1), true);
62  set_configuration_variable(array('technical_code' => 'admin_force_ssl', 'string' => vn($_SESSION['session_install_admin_force_ssl']), 'type' => 'string', 'site_id' => 1), true);
63  set_configuration_variable(array('technical_code' => 'display_errors_for_ips', 'string' => $_SERVER['REMOTE_ADDR'], 'type' => 'string', 'site_id' => 1), true);
64  set_configuration_variable(array('technical_code' => 'peel_database_version', 'string' => PEEL_VERSION, 'type' => 'string', 'site_id' => 0), true);
65 
66  $error_msg = ob_get_contents();
67  ob_end_clean();
68 
69  if(!empty($error_msg)) {
70  $messages .= $GLOBALS['tplEngine']->createTemplate('global_error.tpl', array('message_to_escape' => $error_msg))->fetch();
71  }
72 }
73 
74 $_SESSION['session_install_site_name'] = "";
75 $_SESSION['session_install_email_webmaster'] = "";
76 $_SESSION['session_install_wwwroot'] = "";
77 $_SESSION['session_install_admin_force_ssl'] = "";
78 $_SESSION['session_install_serveur'] = "";
79 $_SESSION['session_install_utilisateur'] = "";
80 $_SESSION['session_install_motdepasse'] = "";
81 $_SESSION['session_install_choixbase'] = "";
82 $_SESSION['session_install_langs'] = "";
83 $_SESSION['session_install_finished'] = true;
84 
85 $tpl = $GLOBALS['tplEngine']->createTemplate('installation_fin.tpl');
86 $tpl->assign('step_title', $GLOBALS['DOC_TITLE']);
87 $tpl->assign('email', vb($_POST['email']));
88 $tpl->assign('motdepasse', vb($_POST['motdepasse']));
89 $tpl->assign('pseudo', vb($_POST['pseudo']));
90 $tpl->assign('messages', $messages);
91 $tpl->assign('STR_EMAIL', $GLOBALS['STR_EMAIL']);
92 $tpl->assign('STR_PASSWORD', $GLOBALS['STR_PASSWORD']);
93 $tpl->assign('STR_PSEUDO', $GLOBALS['STR_PSEUDO']);
94 $tpl->assign('STR_BEFORE_TWO_POINTS', $GLOBALS['STR_BEFORE_TWO_POINTS']);
95 $tpl->assign('STR_ADMIN_INSTALL_NOW_INSTALLED', $GLOBALS['STR_ADMIN_INSTALL_NOW_INSTALLED']);
96 $tpl->assign('STR_ADMIN_INSTALL_YOU_CAN_LOGIN_ADMIN', $GLOBALS['STR_ADMIN_INSTALL_YOU_CAN_LOGIN_ADMIN']);
97 $tpl->assign('STR_ADMIN_INSTALL_ADMIN_LINK_INFOS', $GLOBALS['STR_ADMIN_INSTALL_ADMIN_LINK_INFOS']);
98 $tpl->assign('STR_ADMIN_INSTALL_FINISHED_INFOS', $GLOBALS['STR_ADMIN_INSTALL_FINISHED_INFOS']);
99 $tpl->assign('STR_ADMIN_INSTALL_FINISHED_INFOS_DELETE_INSTALL', $GLOBALS['STR_ADMIN_INSTALL_FINISHED_INFOS_DELETE_INSTALL']);
100 $tpl->assign('STR_ADMIN_INSTALL_FINISHED_INFOS_RENAME_ADMIN', $GLOBALS['STR_ADMIN_INSTALL_FINISHED_INFOS_RENAME_ADMIN']);
101 $tpl->assign('STR_ADMIN_INSTALL_FINISHED_INFOS_PHP_ERRORS_DISPLAY', $GLOBALS['STR_ADMIN_INSTALL_FINISHED_INFOS_PHP_ERRORS_DISPLAY']);
102 $tpl->assign('STR_ADMIN_INSTALL_FINISHED_INFOS_UTF8_WARNING', $GLOBALS['STR_ADMIN_INSTALL_FINISHED_INFOS_UTF8_WARNING']);
103 $tpl->assign('STR_ADMIN_INSTALL_FINISH_BUTTON', $GLOBALS['STR_ADMIN_INSTALL_FINISH_BUTTON']);
104 $output = $tpl->fetch();
105 
106 include($GLOBALS['repertoire_modele'] . "/admin_haut.php");
107 echo $output;
108 include($GLOBALS['repertoire_modele'] . "/admin_bas.php");
static strpos($haystack, $needle, $offset=0)
Returns the numeric position of the first occurrence of needle in the haystack string.
Definition: String.php:54
$tpl
Definition: fin.php:85
insere_utilisateur(&$frm, $password_already_encoded=false, $send_user_confirmation=false, $warn_admin_if_template_active=true, $skip_existing_account_tests=false)
Ajout d'un utilisateur.
Definition: user.php:134
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: fin.php:104
if(!select_db($_SESSION['session_install_choixbase'], $GLOBALS['database_object'], true)) $error
Definition: verifdroits.php:33
$GLOBALS['DOC_TITLE']
Definition: fin.php:17
$messages
Definition: fin.php:18
vb(&$var, $default=null)
Variable blanche if $var n'est pas défini, retourne $default, sinon retourne $var.
Definition: format.php:97
$id_utilisateur
Definition: rpc.php:32
const PEEL_VERSION(version_compare(PHP_VERSION, '5.1.2', '<'))
vn(&$var, $default=0)
Variable nulle if $var n'est pas défini, retourne $default, sinon retourne $var.
Definition: format.php:110
set_configuration_variable($frm, $update_if_technical_code_exists=false, $allow_create=true)
Ajoute la zone HTML dans la table peel_configuration.
Definition: fonctions.php:4199
$error_msg
if(empty($_SESSION['session_install_finished'])) $_SESSION['session_install_site_name']
Definition: fin.php:74

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