PEEL Shopping
Open source ecommerce : PEEL Shopping
choixbase.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: choixbase.php 46935 2015-09-18 08:49:48Z gboussin $
14 define('IN_INSTALLATION', 3);
15 include("../configuration.inc.php");
16 
17 $GLOBALS['DOC_TITLE'] = $GLOBALS['STR_ADMIN_INSTALL_STEP3_TITLE'];
19 unset($_SESSION['session_install_finished']);
20 
21 if (isset($_POST['admin_force_ssl'])) $_SESSION['session_install_admin_force_ssl'] = $_POST['admin_force_ssl'];
22 if (isset($_POST['serveur'])) $_SESSION['session_install_serveur'] = $_POST['serveur'];
23 if (isset($_POST['utilisateur'])) $_SESSION['session_install_utilisateur'] = $_POST['utilisateur'];
24 if (isset($_POST['motdepasse'])) $_SESSION['session_install_motdepasse'] = $_POST['motdepasse'];
25 if (isset($_POST['langs'])) $_SESSION['session_install_langs'] = $_POST['langs'];
26 if (isset($_POST['site_name'])) $_SESSION['session_install_site_name'] = $_POST['site_name'];
27 if (isset($_POST['email_webmaster'])) $_SESSION['session_install_email_webmaster'] = $_POST['email_webmaster'];
28 
29 if ((isset($_POST['langs']) && empty($_POST['langs'])) || (isset($_POST['site_name']) && empty($_POST['site_name'])) || (isset($_POST['email_webmaster']) && empty($_POST['email_webmaster'])) || (isset($_POST['serveur']) && empty($_POST['serveur'])) || (isset($_POST['utilisateur']) && empty($_POST['utilisateur']))) {
30  redirect_and_die("bdd.php?err=empty");
31 }
32 // On accepte wwwroot vide : dans ce cas, c'est une configuration pour multisite.
33 // Elle marche aussi pour les sites seuls, mais cela permet moins de vérifications par rapport à la détection automatique de chemin
34 if (isset($_POST['wwwroot'])) {
35  while (!empty($_POST['wwwroot']) && String::substr($_POST['wwwroot'], - 1) == '/') {
36  // Suppression du / à la fin le cas si nécessaire
37  $_POST['wwwroot'] = String::substr($_POST['wwwroot'], 0, strlen($_POST['wwwroot']) - 1);
38  }
39  $_SESSION['session_install_wwwroot'] = $_POST['wwwroot'];
40 }
41 
42 if (empty($_SESSION['session_install_serveur']) || empty($_SESSION['session_install_utilisateur'])) {
43  redirect_and_die("bdd.php?err=1");
44 }
45 $GLOBALS['serveur_mysql'] = $_SESSION['session_install_serveur'];
46 $GLOBALS['utilisateur_mysql'] = $_SESSION['session_install_utilisateur'];
47 $GLOBALS['mot_de_passe_mysql'] = $_SESSION['session_install_motdepasse'];
48 db_connect($GLOBALS['database_object'], false);
49 if (!$GLOBALS['database_object']) {
50  redirect_and_die("bdd.php?err=1");
51 }
52 
54 if (isset($_GET['err']) && $_GET['err']) {
55  $error_message .= $GLOBALS['tplEngine']->createTemplate('global_error.tpl', array('message' => $GLOBALS['STR_ADMIN_INSTALL_DATABASE_NO_ACCESS']))->fetch();
56 }
57 
58 $tpl = $GLOBALS['tplEngine']->createTemplate('installation_choixbase.tpl');
59 $tpl->assign('step_title', $GLOBALS['DOC_TITLE']);
60 $tpl->assign('available_databases', $available_databases);
61 $tpl->assign('error_message', $error_message);
62 $tpl->assign('selected_database', vb($_SESSION['session_install_choixbase']));
63 $tpl->assign('STR_ADMIN_INSTALL_DATABASE_ADVISE_SPECIFIC', $GLOBALS['STR_ADMIN_INSTALL_DATABASE_ADVISE_SPECIFIC']);
64 $tpl->assign('STR_ADMIN_INSTALL_DATABASE_ADVISE_HOW_TO_CREATE', $GLOBALS['STR_ADMIN_INSTALL_DATABASE_ADVISE_HOW_TO_CREATE']);
65 $tpl->assign('STR_ADMIN_INSTALL_DATABASE_SELECT', $GLOBALS['STR_ADMIN_INSTALL_DATABASE_SELECT']);
66 $tpl->assign('STR_ADMIN_INSTALL_DATABASE_PLEASE_CLEAN_BEFORE_INSTALL', $GLOBALS['STR_ADMIN_INSTALL_DATABASE_PLEASE_CLEAN_BEFORE_INSTALL']);
67 $tpl->assign('STR_ADMIN_INSTALL_DATABASE_ADVISE_SPECIFIC', $GLOBALS['STR_ADMIN_INSTALL_DATABASE_ADVISE_SPECIFIC']);
68 $tpl->assign('STR_CONTINUE', $GLOBALS['STR_CONTINUE']);
69 $tpl->assign('step_title', $GLOBALS['DOC_TITLE']);
70 $output = $tpl->fetch();
71 
72 include($GLOBALS['repertoire_modele'] . "/admin_haut.php");
73 echo $output;
74 include($GLOBALS['repertoire_modele'] . "/admin_bas.php");
$error_message
Definition: choixbase.php:18
& list_dbs($name_part=null)
Renvoie un tableau avec la liste des bases de données accessibles.
Definition: database.php:584
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
if(!$GLOBALS['database_object']) $available_databases
Definition: choixbase.php:53
if(!defined('IN_PEEL')) db_connect(&$database_object, $database_name=null, $serveur_mysql=null, $utilisateur_mysql=null, $mot_de_passe_mysql=null, $continue_if_error=false)
db_connect()
Definition: database.php:31
if(isset($_GET['err'])&&$_GET['err']) $tpl
Definition: choixbase.php:58
$GLOBALS['DOC_TITLE']
Definition: choixbase.php:17
vb(&$var, $default=null)
Variable blanche if $var n'est pas défini, retourne $default, sinon retourne $var.
Definition: format.php:97
$output
Definition: choixbase.php:70
static substr($string, $start, $length=null)
Returns the portion of string specified by the start and length parameters.
Definition: String.php:112
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:29:54 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.