PEEL Shopping
Open source ecommerce : PEEL Shopping
verifdroits.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: verifdroits.php 46935 2015-09-18 08:49:48Z gboussin $
14 define('IN_INSTALLATION', 4);
15 include("../configuration.inc.php");
16 
17 
18 $GLOBALS['DOC_TITLE'] = $GLOBALS['STR_ADMIN_INSTALL_STEP4_TITLE'];
19 
20 unset($_SESSION['session_peel_sql']);
21 unset($_SESSION['session_peel_sql_premium']);
22 unset($_SESSION['session_install_finished']);
23 
24 if (empty($_POST['choixbase'])) {
25  redirect_and_die("choixbase.php?err=1");
26 }
27 
28 $_SESSION['session_install_choixbase'] = $_POST['choixbase'];
29 
30 if (!select_db($_SESSION['session_install_choixbase'], $GLOBALS['database_object'], true)) {
31  redirect_and_die("choixbase.php?err=1");
32 }
33 $error = 0;
35 $liste = array($GLOBALS['dirroot'] . "/lib/setup", $GLOBALS['dirroot'] . "/upload", $GLOBALS['dirroot'] . "/upload/thumbs", $GLOBALS['dirroot'] . "/download", $GLOBALS['dirroot'] . "/comparateur", $GLOBALS['dirroot'] . "/cache", $GLOBALS['dirroot'] . "/lib/templateEngines/smarty/compile", $GLOBALS['dirroot'] . "/modules/captcha/security_codes");
36 for($i = 0; $i < count($liste); $i++) {
37  if (!is_writable($liste[$i])) {
38  $directories_checkup_messages .= $GLOBALS['tplEngine']->createTemplate('global_error.tpl', array('message' => sprintf($GLOBALS['STR_ADMIN_INSTALL_DIRECTORY_NOK'], $liste[$i])))->fetch();
39  $error = 1;
40  } else {
41  $directories_checkup_messages .= $GLOBALS['tplEngine']->createTemplate('global_success.tpl', array('message' => sprintf($GLOBALS['STR_ADMIN_INSTALL_DIRECTORY_OK'], $liste[$i])))->fetch();
42  }
43 }
44 
46 $liste = array("../lib/setup/info.inc.php", "../sitemap.xml", "../urllist.txt");
47 for($i = 0; $i < count($liste); $i++) {
48  if (!is_writable($liste[$i])) {
49  $files_checkup_messages .= $GLOBALS['tplEngine']->createTemplate('global_error.tpl', array('message' => sprintf($GLOBALS['STR_ADMIN_INSTALL_FILE_NOK'], $liste[$i])))->fetch();
50  $error = 1;
51  } else {
52  $files_checkup_messages .= $GLOBALS['tplEngine']->createTemplate('global_success.tpl', array('message' => sprintf($GLOBALS['STR_ADMIN_INSTALL_FILE_OK'], $liste[$i])))->fetch();
53  }
54 }
55 // Check tables
56 $sql = "SHOW TABLES FROM `" . word_real_escape_string($_SESSION['session_install_choixbase']) . "` LIKE 'peel_%'";
59 if (num_rows($result) > 0) {
60  while ($row = fetch_row($result)) {
61  $tables_checkup_messages .= $row[0] . "<br />";
62  }
63  $tables_checkup_messages .= $GLOBALS['tplEngine']->createTemplate('global_error.tpl', array('message' => $GLOBALS['STR_ADMIN_INSTALL_EXPLAIN_RENAME_TABLES']))->fetch();
64  $error = 1;
65 } else {
66  $tables_checkup_messages .= $GLOBALS['tplEngine']->createTemplate('global_success.tpl', array('message' => sprintf($GLOBALS['STR_ADMIN_INSTALL_DATABASE_OK_PREFIX'], $_SESSION['session_install_choixbase'])))->fetch();
67 }
68 $tpl = $GLOBALS['tplEngine']->createTemplate('installation_verifdroits.tpl');
69 $tpl->assign('step_title', $GLOBALS['DOC_TITLE']);
70 $tpl->assign('configuration_url', 'configuration.php');
71 $tpl->assign('choixbase_value', $_SESSION['session_install_choixbase']);
72 $tpl->assign('directories_checkup_messages', $directories_checkup_messages);
73 $tpl->assign('files_checkup_messages', $files_checkup_messages);
74 $tpl->assign('tables_checkup_messages', $tables_checkup_messages);
75 $tpl->assign('error', $error);
76 $tpl->assign('STR_BEFORE_TWO_POINTS', $GLOBALS['STR_BEFORE_TWO_POINTS']);
77 $tpl->assign('STR_REFRESH', $GLOBALS['STR_REFRESH']);
78 $tpl->assign('STR_CONTINUE', $GLOBALS['STR_CONTINUE']);
79 $tpl->assign('STR_ADMIN_INSTALL_CHECK_ACCESS_RIGHTS', $GLOBALS['STR_ADMIN_INSTALL_CHECK_ACCESS_RIGHTS']);
80 $tpl->assign('STR_ADMIN_INSTALL_RIGHTS_OK', $GLOBALS['STR_ADMIN_INSTALL_RIGHTS_OK']);
81 $tpl->assign('STR_ADMIN_INSTALL_RIGHTS_NOK', $GLOBALS['STR_ADMIN_INSTALL_RIGHTS_NOK']);
82 $tpl->assign('STR_ADMIN_INSTALL_EXISTING_TABLES', $GLOBALS['STR_ADMIN_INSTALL_EXISTING_TABLES']);
83 $tpl->assign('STR_ADMIN_INSTALL_EXPLAIN_RENAME_TABLES', $GLOBALS['STR_ADMIN_INSTALL_EXPLAIN_RENAME_TABLES']);
84 $tpl->assign('STR_ADMIN_INSTALL_STEP_5_LINK_EXPLAIN', $GLOBALS['STR_ADMIN_INSTALL_STEP_5_LINK_EXPLAIN']);
85 $tpl->assign('STR_ADMIN_INSTALL_CONTINUE_WITH_ERRORS_BUTTON', $GLOBALS['STR_ADMIN_INSTALL_CONTINUE_WITH_ERRORS_BUTTON']);
86 $output = $tpl->fetch();
87 
88 include($GLOBALS['repertoire_modele'] . "/admin_haut.php");
89 echo $output;
90 include($GLOBALS['repertoire_modele'] . "/admin_bas.php");
91 
fetch_row($query_result)
fetch_row()
Definition: database.php:264
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(!select_db($_SESSION['session_install_choixbase'], $GLOBALS['database_object'], true)) $error
Definition: verifdroits.php:33
word_real_escape_string($value)
Applique real_escape_string dans le cas où on n'insère qu'un seul mot, de moins de 30 caractères...
Definition: database.php:424
select_db($database_name, &$database_object, $continue_if_error=false)
select_db()
Definition: database.php:110
$liste
Definition: verifdroits.php:35
$tables_checkup_messages
Definition: verifdroits.php:58
query($query, $die_if_error=false, $database_object=null, $silent_if_error=false, $security_sql_filter=true)
The query() function is meant to be called anywhere you want to make a query.
Definition: database.php:158
$output
Definition: verifdroits.php:86
$tpl
Definition: verifdroits.php:68
num_rows($query_result)
num_rows()
Definition: database.php:321
$GLOBALS['DOC_TITLE']
Definition: verifdroits.php:18
for($i=0;$i< count($liste);$i++) $sql
Definition: verifdroits.php:56
if(empty($_POST['choixbase'])) $_SESSION['session_install_choixbase']
Definition: verifdroits.php:28
for($i=0;$i< count($liste);$i++) $files_checkup_messages
Definition: verifdroits.php:45
$result
Definition: verifdroits.php:57
$directories_checkup_messages
Definition: verifdroits.php:34

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