modifications 4105
This commit is contained in:
parent
5550accd83
commit
1a2f789209
|
@ -1,5 +1,10 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## Version 4.1.05 de Deltacms
|
||||||
|
- Modifications :
|
||||||
|
- Langues : RFM bilingue anglais / français et quelques compléments de traduction,
|
||||||
|
- Formulaire : avec le module Form possibilité de placer une pièce jointe dans le mail (jpg, jpeg, png ou gif)
|
||||||
|
|
||||||
## Version 4.1.04 de Deltacms
|
## Version 4.1.04 de Deltacms
|
||||||
- Modifications :
|
- Modifications :
|
||||||
- Langues : ajout de 4 langues régionales, corse, breton, catalan, basque.
|
- Langues : ajout de 4 langues régionales, corse, breton, catalan, basque.
|
||||||
|
@ -9,7 +14,7 @@
|
||||||
- Statislite : amèioration de l'affichage de la date initiale,
|
- Statislite : amèioration de l'affichage de la date initiale,
|
||||||
- Agenda : si la langue originale du site n'est pas reconnue, la langue d'administration est utilisée,
|
- Agenda : si la langue originale du site n'est pas reconnue, la langue d'administration est utilisée,
|
||||||
- Blog : dans les labels de Tinymce si la langue originale du site n'est pas reconnue, la langue d'administration est utilisée,
|
- Blog : dans les labels de Tinymce si la langue originale du site n'est pas reconnue, la langue d'administration est utilisée,
|
||||||
- Langues : si le dapeau correspondant au langage du site n'existe pas un drapeau paer défaut est affiché dans les pages de localisation.
|
- Langues : si le dapeau correspondant au langage du site n'existe pas un drapeau par défaut est affiché dans les pages de localisation.
|
||||||
- Correction :
|
- Correction :
|
||||||
- Statislite : modification de l'initialisation du filtrage primaire.
|
- Statislite : modification de l'initialisation du filtrage primaire.
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
# DeltaCMS 4.1.04
|
# DeltaCMS 4.1.05
|
||||||
|
|
||||||
DeltaCMS est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.
|
DeltaCMS est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.
|
||||||
L'administration du site est bilingue anglais ou français, le site peut être rédigé dans une des principales langues européennes.
|
L'administration du site est bilingue anglais ou français, le site peut être rédigé dans une des principales langues européennes.
|
||||||
|
|
|
@ -321,7 +321,11 @@ class helper {
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function filter($text, $filter) {
|
public static function filter($text, $filter) {
|
||||||
|
if( isset($text)){
|
||||||
$text = trim( $text);
|
$text = trim( $text);
|
||||||
|
} else {
|
||||||
|
$text = '';
|
||||||
|
}
|
||||||
switch($filter) {
|
switch($filter) {
|
||||||
case self::FILTER_BOOLEAN:
|
case self::FILTER_BOOLEAN:
|
||||||
$text = (bool) $text;
|
$text = (bool) $text;
|
||||||
|
@ -367,10 +371,12 @@ class helper {
|
||||||
$text = password_hash($text, PASSWORD_BCRYPT);
|
$text = password_hash($text, PASSWORD_BCRYPT);
|
||||||
break;
|
break;
|
||||||
case self::FILTER_STRING_LONG:
|
case self::FILTER_STRING_LONG:
|
||||||
$text = mb_substr(filter_var($text, FILTER_SANITIZE_STRING), 0, 500000);
|
// $text = mb_substr(filter_var($text, FILTER_SANITIZE_STRING), 0, 500000);
|
||||||
|
$text = mb_substr( strip_tags($text) , 0, 500000);
|
||||||
break;
|
break;
|
||||||
case self::FILTER_STRING_SHORT:
|
case self::FILTER_STRING_SHORT:
|
||||||
$text = mb_substr(filter_var($text, FILTER_SANITIZE_STRING), 0, 500);
|
// $text = mb_substr(filter_var($text, FILTER_SANITIZE_STRING), 0, 500);
|
||||||
|
$text = mb_substr( strip_tags($text) , 0, 500);
|
||||||
break;
|
break;
|
||||||
case self::FILTER_TIMESTAMP:
|
case self::FILTER_TIMESTAMP:
|
||||||
$text = date('Y-m-d H:i:s', $text);
|
$text = date('Y-m-d H:i:s', $text);
|
||||||
|
|
|
@ -12,8 +12,6 @@ use ArrayAccess;
|
||||||
*/
|
*/
|
||||||
class Dot implements ArrayAccess
|
class Dot implements ArrayAccess
|
||||||
{
|
{
|
||||||
|
|
||||||
/** @var array Data */
|
|
||||||
protected $data = [];
|
protected $data = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -271,21 +269,22 @@ class Dot implements ArrayAccess
|
||||||
/**
|
/**
|
||||||
* ArrayAccess abstract methods
|
* ArrayAccess abstract methods
|
||||||
*/
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
public function offsetSet($offset, $value)
|
public function offsetSet($offset, $value)
|
||||||
{
|
{
|
||||||
$this->set($offset, $value);
|
$this->set($offset, $value);
|
||||||
}
|
}
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
public function offsetExists($offset)
|
public function offsetExists($offset)
|
||||||
{
|
{
|
||||||
return $this->has($offset);
|
return $this->has($offset);
|
||||||
}
|
}
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
public function offsetGet($offset)
|
public function offsetGet($offset)
|
||||||
{
|
{
|
||||||
return $this->get($offset);
|
return $this->get($offset);
|
||||||
}
|
}
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
public function offsetUnset($offset)
|
public function offsetUnset($offset)
|
||||||
{
|
{
|
||||||
$this->delete($offset);
|
$this->delete($offset);
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPMailer Exception class.
|
* PHPMailer Exception class.
|
||||||
* PHP Version 5.5.
|
* PHP Version 5.5.
|
||||||
|
@ -9,7 +10,7 @@
|
||||||
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||||
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||||
* @author Brent R. Matzelle (original founder)
|
* @author Brent R. Matzelle (original founder)
|
||||||
* @copyright 2012 - 2017 Marcus Bointon
|
* @copyright 2012 - 2020 Marcus Bointon
|
||||||
* @copyright 2010 - 2012 Jim Jagielski
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
* @copyright 2004 - 2009 Andy Prevost
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||||
|
@ -34,6 +35,6 @@ class Exception extends \Exception
|
||||||
*/
|
*/
|
||||||
public function errorMessage()
|
public function errorMessage()
|
||||||
{
|
{
|
||||||
return '<strong>' . htmlspecialchars($this->getMessage()) . "</strong><br />\n";
|
return '<strong>' . htmlspecialchars($this->getMessage(), ENT_COMPAT | ENT_HTML401) . "</strong><br />\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPMailer RFC821 SMTP email transport class.
|
* PHPMailer RFC821 SMTP email transport class.
|
||||||
* PHP Version 5.5.
|
* PHP Version 5.5.
|
||||||
|
@ -9,7 +10,7 @@
|
||||||
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||||
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||||
* @author Brent R. Matzelle (original founder)
|
* @author Brent R. Matzelle (original founder)
|
||||||
* @copyright 2012 - 2019 Marcus Bointon
|
* @copyright 2012 - 2020 Marcus Bointon
|
||||||
* @copyright 2010 - 2012 Jim Jagielski
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
* @copyright 2004 - 2009 Andy Prevost
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||||
|
@ -34,7 +35,7 @@ class SMTP
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
const VERSION = '6.1.5';
|
const VERSION = '6.6.0';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SMTP line break constant.
|
* SMTP line break constant.
|
||||||
|
@ -185,6 +186,8 @@ class SMTP
|
||||||
'Amazon_SES' => '/[\d]{3} Ok (.*)/',
|
'Amazon_SES' => '/[\d]{3} Ok (.*)/',
|
||||||
'SendGrid' => '/[\d]{3} Ok: queued as (.*)/',
|
'SendGrid' => '/[\d]{3} Ok: queued as (.*)/',
|
||||||
'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/',
|
'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/',
|
||||||
|
'Haraka' => '/[\d]{3} Message Queued \((.*)\)/',
|
||||||
|
'Mailjet' => '/[\d]{3} OK queued as (.*)/',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -311,12 +314,6 @@ class SMTP
|
||||||
*/
|
*/
|
||||||
public function connect($host, $port = null, $timeout = 30, $options = [])
|
public function connect($host, $port = null, $timeout = 30, $options = [])
|
||||||
{
|
{
|
||||||
static $streamok;
|
|
||||||
//This is enabled by default since 5.0.0 but some providers disable it
|
|
||||||
//Check this once and cache the result
|
|
||||||
if (null === $streamok) {
|
|
||||||
$streamok = function_exists('stream_socket_client');
|
|
||||||
}
|
|
||||||
//Clear errors to avoid confusion
|
//Clear errors to avoid confusion
|
||||||
$this->setError('');
|
$this->setError('');
|
||||||
//Make sure we are __not__ connected
|
//Make sure we are __not__ connected
|
||||||
|
@ -335,12 +332,60 @@ class SMTP
|
||||||
(count($options) > 0 ? var_export($options, true) : 'array()'),
|
(count($options) > 0 ? var_export($options, true) : 'array()'),
|
||||||
self::DEBUG_CONNECTION
|
self::DEBUG_CONNECTION
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->smtp_conn = $this->getSMTPConnection($host, $port, $timeout, $options);
|
||||||
|
|
||||||
|
if ($this->smtp_conn === false) {
|
||||||
|
//Error info already set inside `getSMTPConnection()`
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->edebug('Connection: opened', self::DEBUG_CONNECTION);
|
||||||
|
|
||||||
|
//Get any announcement
|
||||||
|
$this->last_reply = $this->get_lines();
|
||||||
|
$this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER);
|
||||||
|
$responseCode = (int)substr($this->last_reply, 0, 3);
|
||||||
|
if ($responseCode === 220) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
//Anything other than a 220 response means something went wrong
|
||||||
|
//RFC 5321 says the server will wait for us to send a QUIT in response to a 554 error
|
||||||
|
//https://tools.ietf.org/html/rfc5321#section-3.1
|
||||||
|
if ($responseCode === 554) {
|
||||||
|
$this->quit();
|
||||||
|
}
|
||||||
|
//This will handle 421 responses which may not wait for a QUIT (e.g. if the server is being shut down)
|
||||||
|
$this->edebug('Connection: closing due to error', self::DEBUG_CONNECTION);
|
||||||
|
$this->close();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create connection to the SMTP server.
|
||||||
|
*
|
||||||
|
* @param string $host SMTP server IP or host name
|
||||||
|
* @param int $port The port number to connect to
|
||||||
|
* @param int $timeout How long to wait for the connection to open
|
||||||
|
* @param array $options An array of options for stream_context_create()
|
||||||
|
*
|
||||||
|
* @return false|resource
|
||||||
|
*/
|
||||||
|
protected function getSMTPConnection($host, $port = null, $timeout = 30, $options = [])
|
||||||
|
{
|
||||||
|
static $streamok;
|
||||||
|
//This is enabled by default since 5.0.0 but some providers disable it
|
||||||
|
//Check this once and cache the result
|
||||||
|
if (null === $streamok) {
|
||||||
|
$streamok = function_exists('stream_socket_client');
|
||||||
|
}
|
||||||
|
|
||||||
$errno = 0;
|
$errno = 0;
|
||||||
$errstr = '';
|
$errstr = '';
|
||||||
if ($streamok) {
|
if ($streamok) {
|
||||||
$socket_context = stream_context_create($options);
|
$socket_context = stream_context_create($options);
|
||||||
set_error_handler([$this, 'errorHandler']);
|
set_error_handler([$this, 'errorHandler']);
|
||||||
$this->smtp_conn = stream_socket_client(
|
$connection = stream_socket_client(
|
||||||
$host . ':' . $port,
|
$host . ':' . $port,
|
||||||
$errno,
|
$errno,
|
||||||
$errstr,
|
$errstr,
|
||||||
|
@ -348,7 +393,6 @@ class SMTP
|
||||||
STREAM_CLIENT_CONNECT,
|
STREAM_CLIENT_CONNECT,
|
||||||
$socket_context
|
$socket_context
|
||||||
);
|
);
|
||||||
restore_error_handler();
|
|
||||||
} else {
|
} else {
|
||||||
//Fall back to fsockopen which should work in more places, but is missing some features
|
//Fall back to fsockopen which should work in more places, but is missing some features
|
||||||
$this->edebug(
|
$this->edebug(
|
||||||
|
@ -356,17 +400,18 @@ class SMTP
|
||||||
self::DEBUG_CONNECTION
|
self::DEBUG_CONNECTION
|
||||||
);
|
);
|
||||||
set_error_handler([$this, 'errorHandler']);
|
set_error_handler([$this, 'errorHandler']);
|
||||||
$this->smtp_conn = fsockopen(
|
$connection = fsockopen(
|
||||||
$host,
|
$host,
|
||||||
$port,
|
$port,
|
||||||
$errno,
|
$errno,
|
||||||
$errstr,
|
$errstr,
|
||||||
$timeout
|
$timeout
|
||||||
);
|
);
|
||||||
restore_error_handler();
|
|
||||||
}
|
}
|
||||||
|
restore_error_handler();
|
||||||
|
|
||||||
//Verify we connected properly
|
//Verify we connected properly
|
||||||
if (!is_resource($this->smtp_conn)) {
|
if (!is_resource($connection)) {
|
||||||
$this->setError(
|
$this->setError(
|
||||||
'Failed to connect to server',
|
'Failed to connect to server',
|
||||||
'',
|
'',
|
||||||
|
@ -381,22 +426,19 @@ class SMTP
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$this->edebug('Connection: opened', self::DEBUG_CONNECTION);
|
|
||||||
//SMTP server can take longer to respond, give longer timeout for first read
|
//SMTP server can take longer to respond, give longer timeout for first read
|
||||||
//Windows does not have support for this timeout function
|
//Windows does not have support for this timeout function
|
||||||
if (strpos(PHP_OS, 'WIN') !== 0) {
|
if (strpos(PHP_OS, 'WIN') !== 0) {
|
||||||
$max = (int)ini_get('max_execution_time');
|
$max = (int)ini_get('max_execution_time');
|
||||||
// Don't bother if unlimited
|
//Don't bother if unlimited, or if set_time_limit is disabled
|
||||||
if (0 !== $max && $timeout > $max) {
|
if (0 !== $max && $timeout > $max && strpos(ini_get('disable_functions'), 'set_time_limit') === false) {
|
||||||
@set_time_limit($timeout);
|
@set_time_limit($timeout);
|
||||||
}
|
}
|
||||||
stream_set_timeout($this->smtp_conn, $timeout, 0);
|
stream_set_timeout($connection, $timeout, 0);
|
||||||
}
|
}
|
||||||
// Get any announcement
|
|
||||||
$announce = $this->get_lines();
|
|
||||||
$this->edebug('SERVER -> CLIENT: ' . $announce, self::DEBUG_SERVER);
|
|
||||||
|
|
||||||
return true;
|
return $connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -441,7 +483,7 @@ class SMTP
|
||||||
* @param string $username The user name
|
* @param string $username The user name
|
||||||
* @param string $password The password
|
* @param string $password The password
|
||||||
* @param string $authtype The auth type (CRAM-MD5, PLAIN, LOGIN, XOAUTH2)
|
* @param string $authtype The auth type (CRAM-MD5, PLAIN, LOGIN, XOAUTH2)
|
||||||
* @param OAuth $OAuth An optional OAuth instance for XOAUTH2 authentication
|
* @param OAuthTokenProvider $OAuth An optional OAuthTokenProvider instance for XOAUTH2 authentication
|
||||||
*
|
*
|
||||||
* @return bool True if successfully authenticated
|
* @return bool True if successfully authenticated
|
||||||
*/
|
*/
|
||||||
|
@ -511,7 +553,10 @@ class SMTP
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//Send encoded username and password
|
//Send encoded username and password
|
||||||
if (!$this->sendCommand(
|
if (
|
||||||
|
//Format from https://tools.ietf.org/html/rfc4616#section-2
|
||||||
|
//We skip the first field (it's forgery), so the string starts with a null byte
|
||||||
|
!$this->sendCommand(
|
||||||
'User & Password',
|
'User & Password',
|
||||||
base64_encode("\0" . $username . "\0" . $password),
|
base64_encode("\0" . $username . "\0" . $password),
|
||||||
235
|
235
|
||||||
|
@ -641,7 +686,7 @@ class SMTP
|
||||||
$this->server_caps = null;
|
$this->server_caps = null;
|
||||||
$this->helo_rply = null;
|
$this->helo_rply = null;
|
||||||
if (is_resource($this->smtp_conn)) {
|
if (is_resource($this->smtp_conn)) {
|
||||||
// close the connection and cleanup
|
//Close the connection and cleanup
|
||||||
fclose($this->smtp_conn);
|
fclose($this->smtp_conn);
|
||||||
$this->smtp_conn = null; //Makes for cleaner serialization
|
$this->smtp_conn = null; //Makes for cleaner serialization
|
||||||
$this->edebug('Connection: closed', self::DEBUG_CONNECTION);
|
$this->edebug('Connection: closed', self::DEBUG_CONNECTION);
|
||||||
|
@ -651,7 +696,7 @@ class SMTP
|
||||||
/**
|
/**
|
||||||
* Send an SMTP DATA command.
|
* Send an SMTP DATA command.
|
||||||
* Issues a data command and sends the msg_data to the server,
|
* Issues a data command and sends the msg_data to the server,
|
||||||
* finializing the mail transaction. $msg_data is the message
|
* finalizing the mail transaction. $msg_data is the message
|
||||||
* that is to be send with the headers. Each header needs to be
|
* that is to be send with the headers. Each header needs to be
|
||||||
* on a single line followed by a <CRLF> with the message headers
|
* on a single line followed by a <CRLF> with the message headers
|
||||||
* and the message body being separated by an additional <CRLF>.
|
* and the message body being separated by an additional <CRLF>.
|
||||||
|
@ -722,7 +767,8 @@ class SMTP
|
||||||
|
|
||||||
//Send the lines to the server
|
//Send the lines to the server
|
||||||
foreach ($lines_out as $line_out) {
|
foreach ($lines_out as $line_out) {
|
||||||
//RFC2821 section 4.5.2
|
//Dot-stuffing as per RFC5321 section 4.5.2
|
||||||
|
//https://tools.ietf.org/html/rfc5321#section-4.5.2
|
||||||
if (!empty($line_out) && $line_out[0] === '.') {
|
if (!empty($line_out) && $line_out[0] === '.') {
|
||||||
$line_out = '.' . $line_out;
|
$line_out = '.' . $line_out;
|
||||||
}
|
}
|
||||||
|
@ -756,7 +802,16 @@ class SMTP
|
||||||
public function hello($host = '')
|
public function hello($host = '')
|
||||||
{
|
{
|
||||||
//Try extended hello first (RFC 2821)
|
//Try extended hello first (RFC 2821)
|
||||||
return $this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host);
|
if ($this->sendHello('EHLO', $host)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Some servers shut down the SMTP service here (RFC 5321)
|
||||||
|
if (substr($this->helo_rply, 0, 3) == '421') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->sendHello('HELO', $host);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1058,8 +1113,10 @@ class SMTP
|
||||||
{
|
{
|
||||||
//If SMTP transcripts are left enabled, or debug output is posted online
|
//If SMTP transcripts are left enabled, or debug output is posted online
|
||||||
//it can leak credentials, so hide credentials in all but lowest level
|
//it can leak credentials, so hide credentials in all but lowest level
|
||||||
if (self::DEBUG_LOWLEVEL > $this->do_debug &&
|
if (
|
||||||
in_array($command, ['User & Password', 'Username', 'Password'], true)) {
|
self::DEBUG_LOWLEVEL > $this->do_debug &&
|
||||||
|
in_array($command, ['User & Password', 'Username', 'Password'], true)
|
||||||
|
) {
|
||||||
$this->edebug('CLIENT -> SERVER: [credentials hidden]', self::DEBUG_CLIENT);
|
$this->edebug('CLIENT -> SERVER: [credentials hidden]', self::DEBUG_CLIENT);
|
||||||
} else {
|
} else {
|
||||||
$this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT);
|
$this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT);
|
||||||
|
@ -1113,7 +1170,7 @@ class SMTP
|
||||||
if (!$this->server_caps) {
|
if (!$this->server_caps) {
|
||||||
$this->setError('No HELO/EHLO was sent');
|
$this->setError('No HELO/EHLO was sent');
|
||||||
|
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!array_key_exists($name, $this->server_caps)) {
|
if (!array_key_exists($name, $this->server_caps)) {
|
||||||
|
@ -1125,7 +1182,7 @@ class SMTP
|
||||||
}
|
}
|
||||||
$this->setError('HELO handshake was used; No information about server extensions available');
|
$this->setError('HELO handshake was used; No information about server extensions available');
|
||||||
|
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->server_caps[$name];
|
return $this->server_caps[$name];
|
||||||
|
@ -1166,13 +1223,41 @@ class SMTP
|
||||||
$selW = null;
|
$selW = null;
|
||||||
while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) {
|
while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) {
|
||||||
//Must pass vars in here as params are by reference
|
//Must pass vars in here as params are by reference
|
||||||
if (!stream_select($selR, $selW, $selW, $this->Timelimit)) {
|
//solution for signals inspired by https://github.com/symfony/symfony/pull/6540
|
||||||
|
set_error_handler([$this, 'errorHandler']);
|
||||||
|
$n = stream_select($selR, $selW, $selW, $this->Timelimit);
|
||||||
|
restore_error_handler();
|
||||||
|
|
||||||
|
if ($n === false) {
|
||||||
|
$message = $this->getError()['detail'];
|
||||||
|
|
||||||
|
$this->edebug(
|
||||||
|
'SMTP -> get_lines(): select failed (' . $message . ')',
|
||||||
|
self::DEBUG_LOWLEVEL
|
||||||
|
);
|
||||||
|
|
||||||
|
//stream_select returns false when the `select` system call is interrupted
|
||||||
|
//by an incoming signal, try the select again
|
||||||
|
if (stripos($message, 'interrupted system call') !== false) {
|
||||||
|
$this->edebug(
|
||||||
|
'SMTP -> get_lines(): retrying stream_select',
|
||||||
|
self::DEBUG_LOWLEVEL
|
||||||
|
);
|
||||||
|
$this->setError('');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$n) {
|
||||||
$this->edebug(
|
$this->edebug(
|
||||||
'SMTP -> get_lines(): select timed-out in (' . $this->Timelimit . ' sec)',
|
'SMTP -> get_lines(): select timed-out in (' . $this->Timelimit . ' sec)',
|
||||||
self::DEBUG_LOWLEVEL
|
self::DEBUG_LOWLEVEL
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Deliberate noise suppression - errors are handled afterwards
|
//Deliberate noise suppression - errors are handled afterwards
|
||||||
$str = @fgets($this->smtp_conn, self::MAX_REPLY_LENGTH);
|
$str = @fgets($this->smtp_conn, self::MAX_REPLY_LENGTH);
|
||||||
$this->edebug('SMTP INBOUND: "' . trim($str) . '"', self::DEBUG_LOWLEVEL);
|
$this->edebug('SMTP INBOUND: "' . trim($str) . '"', self::DEBUG_LOWLEVEL);
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* French PHPMailer language file: refer to English translation for definitive list
|
||||||
|
* @package PHPMailer
|
||||||
|
* Some French punctuation requires a thin non-breaking space (U+202F) character before it,
|
||||||
|
* for example before a colon or exclamation mark.
|
||||||
|
* There is one of these characters between these quotes: " "
|
||||||
|
* @see http://unicode.org/udhr/n/notes_fra.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
$PHPMAILER_LANG['authenticate'] = 'Erreur SMTP : échec de l’authentification.';
|
||||||
|
$PHPMAILER_LANG['buggy_php'] = 'Votre version de PHP est affectée par un bug qui peut entraîner des messages corrompus. Pour résoudre ce problème, passez à l’envoi par SMTP, désactivez l’option mail.add_x_header dans le fichier php.ini, passez à MacOS ou Linux, ou passez PHP à la version 7.0.17+ ou 7.1.3+.';
|
||||||
|
$PHPMAILER_LANG['connect_host'] = 'Erreur SMTP : impossible de se connecter au serveur SMTP.';
|
||||||
|
$PHPMAILER_LANG['data_not_accepted'] = 'Erreur SMTP : données incorrectes.';
|
||||||
|
$PHPMAILER_LANG['empty_message'] = 'Corps du message vide.';
|
||||||
|
$PHPMAILER_LANG['encoding'] = 'Encodage inconnu : ';
|
||||||
|
$PHPMAILER_LANG['execute'] = 'Impossible de lancer l’exécution : ';
|
||||||
|
$PHPMAILER_LANG['extension_missing'] = 'Extension manquante : ';
|
||||||
|
$PHPMAILER_LANG['file_access'] = 'Impossible d’accéder au fichier : ';
|
||||||
|
$PHPMAILER_LANG['file_open'] = 'Ouverture du fichier impossible : ';
|
||||||
|
$PHPMAILER_LANG['from_failed'] = 'L’adresse d’expéditeur suivante a échoué : ';
|
||||||
|
$PHPMAILER_LANG['instantiate'] = 'Impossible d’instancier la fonction mail.';
|
||||||
|
$PHPMAILER_LANG['invalid_address'] = 'Adresse courriel non valide : ';
|
||||||
|
$PHPMAILER_LANG['invalid_header'] = 'Nom ou valeur de l’en-tête non valide';
|
||||||
|
$PHPMAILER_LANG['invalid_hostentry'] = 'Entrée d’hôte non valide : ';
|
||||||
|
$PHPMAILER_LANG['invalid_host'] = 'Hôte non valide : ';
|
||||||
|
$PHPMAILER_LANG['mailer_not_supported'] = ' client de messagerie non supporté.';
|
||||||
|
$PHPMAILER_LANG['provide_address'] = 'Vous devez fournir au moins une adresse de destinataire.';
|
||||||
|
$PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP : les destinataires suivants ont échoué : ';
|
||||||
|
$PHPMAILER_LANG['signing'] = 'Erreur de signature : ';
|
||||||
|
$PHPMAILER_LANG['smtp_code'] = 'Code SMTP : ';
|
||||||
|
$PHPMAILER_LANG['smtp_code_ex'] = 'Informations supplémentaires SMTP : ';
|
||||||
|
$PHPMAILER_LANG['smtp_connect_failed'] = 'La fonction SMTP connect() a échouée.';
|
||||||
|
$PHPMAILER_LANG['smtp_detail'] = 'Détails : ';
|
||||||
|
$PHPMAILER_LANG['smtp_error'] = 'Erreur du serveur SMTP : ';
|
||||||
|
$PHPMAILER_LANG['variable_set'] = 'Impossible d’initialiser ou de réinitialiser une variable : ';
|
||||||
|
$PHPMAILER_LANG['extension_missing'] = 'Extension manquante : ';
|
|
@ -374,6 +374,21 @@ class template {
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ouvre un formulaire avec pièce jointe protégé par CSRF
|
||||||
|
* @param string $id Id du formulaire
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function formOpenFile($id) {
|
||||||
|
// Ouverture formulaire
|
||||||
|
$html = '<form id="' . $id . '" enctype="multipart/form-data" method="post">';
|
||||||
|
// Stock le token CSRF
|
||||||
|
$html .= self::hidden('csrf', [
|
||||||
|
'value' => $_SESSION['csrf']
|
||||||
|
]);
|
||||||
|
// Retourne le html
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -227,8 +227,7 @@ core.start = function() {
|
||||||
var samesite = "samesite=lax";
|
var samesite = "samesite=lax";
|
||||||
var getUrl = window.location;
|
var getUrl = window.location;
|
||||||
var domain = "domain=" + getUrl.host;
|
var domain = "domain=" + getUrl.host;
|
||||||
var path = "path=" + getUrl.pathname.split('/')[1];
|
// var path = "path=" + getUrl.pathname.split('/')[1];
|
||||||
var samesite = "samesite=lax";
|
|
||||||
var e = new Date();
|
var e = new Date();
|
||||||
e.setFullYear(e.getFullYear() + 1);
|
e.setFullYear(e.getFullYear() + 1);
|
||||||
var expires = "expires=" + e.toUTCString();
|
var expires = "expires=" + e.toUTCString();
|
||||||
|
@ -240,15 +239,18 @@ core.start = function() {
|
||||||
// Traitement du retour de la checkbox
|
// Traitement du retour de la checkbox
|
||||||
if ($("#cookiesExt").is(":checked")) {
|
if ($("#cookiesExt").is(":checked")) {
|
||||||
// L'URL du serveur faut TRUE
|
// L'URL du serveur faut TRUE
|
||||||
document.cookie = "DELTA_COOKIE_EXT_CONSENT=true;" + domain + ";" + path + ";" + samesite + ";" + expires;
|
//document.cookie = "DELTA_COOKIE_EXT_CONSENT=true;" + domain + ";" + path + ";" + samesite + ";" + expires;
|
||||||
|
document.cookie = "DELTA_COOKIE_EXT_CONSENT=true;" + domain + ";" + samesite + ";" + expires;
|
||||||
} else {
|
} else {
|
||||||
document.cookie = "DELTA_COOKIE_EXT_CONSENT=false;" + domain + ";" + path + ";" + samesite + ";" + expires;
|
//document.cookie = "DELTA_COOKIE_EXT_CONSENT=false;" + domain + ";" + path + ";" + samesite + ";" + expires;
|
||||||
|
document.cookie = "DELTA_COOKIE_EXT_CONSENT=false;" + domain + ";" + samesite + ";" + expires;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stocke le cookie d'acceptation
|
// Stocke le cookie d'acceptation
|
||||||
document.cookie = "DELTA_COOKIE_CONSENT=true;" + domain + ";" + path + ";" + samesite + ";" + expires;
|
//document.cookie = "DELTA_COOKIE_CONSENT=true;" + domain + ";" + path + ";" + samesite + ";" + expires;
|
||||||
|
document.cookie = "DELTA_COOKIE_CONSENT=true;" + domain + ";" + samesite + ";" + expires;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -362,13 +364,20 @@ core.start = function() {
|
||||||
* Check adresse email
|
* Check adresse email
|
||||||
*/
|
*/
|
||||||
$("[type=email]").on("change", function() {
|
$("[type=email]").on("change", function() {
|
||||||
|
var text = "";
|
||||||
|
<?php if( $this->getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){
|
||||||
|
echo 'text = "Format incorrect";' ;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
echo 'text = "Incorrect format";' ;
|
||||||
|
} ?>
|
||||||
var _this = $(this);
|
var _this = $(this);
|
||||||
var pattern = /^([a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.?$/i;
|
var pattern = /^([a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.?$/i;
|
||||||
if(pattern.test(_this.val())) {
|
if(pattern.test(_this.val())) {
|
||||||
core.noticeRemove(_this.attr("id"));
|
core.noticeRemove(_this.attr("id"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.noticeAdd(_this.attr("id"), "Format incorrect");
|
core.noticeAdd(_this.attr("id"), text);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ class common {
|
||||||
|
|
||||||
// Numéro de version
|
// Numéro de version
|
||||||
const DELTA_UPDATE_URL = 'https://update.deltacms.fr/master/';
|
const DELTA_UPDATE_URL = 'https://update.deltacms.fr/master/';
|
||||||
const DELTA_VERSION = '4.1.04';
|
const DELTA_VERSION = '4.1.05';
|
||||||
const DELTA_UPDATE_CHANNEL = "v4";
|
const DELTA_UPDATE_CHANNEL = "v4";
|
||||||
|
|
||||||
public static $actions = [];
|
public static $actions = [];
|
||||||
|
@ -435,17 +435,28 @@ class common {
|
||||||
* @param string $key Clef du champ
|
* @param string $key Clef du champ
|
||||||
*/
|
*/
|
||||||
public function addRequiredInputNotices($key) {
|
public function addRequiredInputNotices($key) {
|
||||||
|
// Lexique
|
||||||
|
$text = [];
|
||||||
|
$val = $this->getData(['config', 'i18n', 'langAdmin']);
|
||||||
|
switch ($val) {
|
||||||
|
case 'fr' :
|
||||||
|
$text[0] = 'Obligatoire';
|
||||||
|
break;
|
||||||
|
case 'en' :
|
||||||
|
$text[0] = 'Mandatory';
|
||||||
|
break;
|
||||||
|
}
|
||||||
// La clef est un tableau
|
// La clef est un tableau
|
||||||
if(preg_match('#\[(.*)\]#', $key, $secondKey)) {
|
if(preg_match('#\[(.*)\]#', $key, $secondKey)) {
|
||||||
$firstKey = explode('[', $key)[0];
|
$firstKey = explode('[', $key)[0];
|
||||||
$secondKey = $secondKey[1];
|
$secondKey = $secondKey[1];
|
||||||
if(empty($this->input['_POST'][$firstKey][$secondKey])) {
|
if(empty($this->input['_POST'][$firstKey][$secondKey])) {
|
||||||
common::$inputNotices[$firstKey . '_' . $secondKey] = 'Obligatoire';
|
common::$inputNotices[$firstKey . '_' . $secondKey] = $text[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// La clef est une chaine
|
// La clef est une chaine
|
||||||
elseif(empty($this->input['_POST'][$key])) {
|
elseif(empty($this->input['_POST'][$key])) {
|
||||||
common::$inputNotices[$key] = 'Obligatoire';
|
common::$inputNotices[$key] = $text[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1046,13 +1057,14 @@ class common {
|
||||||
* @param string $content Contenu
|
* @param string $content Contenu
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function sendMail($to, $subject, $content, $replyTo = null) {
|
public function sendMail($to, $subject, $content, $replyTo = null, $file_name = '') {
|
||||||
// Layout
|
// Layout
|
||||||
ob_start();
|
ob_start();
|
||||||
include 'core/layout/mail.php';
|
include 'core/layout/mail.php';
|
||||||
$layout = ob_get_clean();
|
$layout = ob_get_clean();
|
||||||
$mail = new PHPMailer\PHPMailer\PHPMailer;
|
$mail = new PHPMailer\PHPMailer\PHPMailer;
|
||||||
$mail->CharSet = 'UTF-8';
|
$mail->CharSet = 'UTF-8';
|
||||||
|
if( $this->getData(['config', 'i18n', 'langAdmin']) === 'fr')$mail->setLanguage('fr', 'core/class/phpmailer/phpmailer.lang-fr.php');
|
||||||
// Mail
|
// Mail
|
||||||
try{
|
try{
|
||||||
// Paramètres SMTP
|
// Paramètres SMTP
|
||||||
|
@ -1096,16 +1108,18 @@ class common {
|
||||||
$mail->Subject = $subject;
|
$mail->Subject = $subject;
|
||||||
$mail->Body = $layout;
|
$mail->Body = $layout;
|
||||||
$mail->AltBody = strip_tags($content);
|
$mail->AltBody = strip_tags($content);
|
||||||
|
if($file_name !== '') $mail->addAttachment( self::FILE_DIR.'uploads/'.$file_name);
|
||||||
|
|
||||||
if($mail->send()) {
|
if($mail->send()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return $mail->ErrorInfo;
|
return $mail->ErrorInfo;
|
||||||
}
|
}
|
||||||
} catch (phpmailerException $e) {
|
|
||||||
return $e->errorMessage();
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return $e->getMessage();
|
echo $e->errorMessage();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
echo $e->getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1238,7 +1252,8 @@ class common {
|
||||||
public function showSection() {
|
public function showSection() {
|
||||||
echo '<section>';
|
echo '<section>';
|
||||||
// Récupérer la config de la page courante
|
// Récupérer la config de la page courante
|
||||||
$blocks = explode('-',$this->getData(['page',$this->getUrl(0),'block']));
|
$blocks = [];
|
||||||
|
if( null !== $this->getData(['page',$this->getUrl(0),'block'])) $blocks = explode('-',$this->getData(['page',$this->getUrl(0),'block']));
|
||||||
// Initialiser
|
// Initialiser
|
||||||
$blockleft=$blockright="";
|
$blockleft=$blockright="";
|
||||||
switch (sizeof($blocks)) {
|
switch (sizeof($blocks)) {
|
||||||
|
@ -2662,9 +2677,9 @@ class core extends common {
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
// Journalisation
|
// Journalisation
|
||||||
$dataLog = mb_detect_encoding(strftime('%d/%m/%y',time()), 'UTF-8', true)
|
$dataLog = mb_detect_encoding(date('d\/m\/y',time()), 'UTF-8', true)
|
||||||
? strftime('%d/%m/%y',time()) . ';' . strftime('%R',time()) . ';'
|
? date('d\/m\/y',time()) . ';' . date('H\:i',time()) . ';'
|
||||||
: utf8_encode(strftime('%d/%m/%y',time())) . ';' . utf8_encode(strftime('%R',time())) . ';' ;
|
: utf8_encode(date('d\/m\/y',time())) . ';' . utf8_encode(date('H\:i',time())) . ';' ;
|
||||||
$dataLog .= helper::getIp($this->getData(['config','connect','anonymousIp'])) . ';';
|
$dataLog .= helper::getIp($this->getData(['config','connect','anonymousIp'])) . ';';
|
||||||
$dataLog .= $this->getUser('id') ? $this->getUser('id') . ';' : 'anonyme' . ';';
|
$dataLog .= $this->getUser('id') ? $this->getUser('id') . ';' : 'anonyme' . ';';
|
||||||
$dataLog .= $this->getUrl();
|
$dataLog .= $this->getUrl();
|
||||||
|
@ -2748,7 +2763,8 @@ class core extends common {
|
||||||
* - L'édition est ouverte depuis un temps dépassé, on considère que la page est restée ouverte et qu'elle ne sera pas validée
|
* - L'édition est ouverte depuis un temps dépassé, on considère que la page est restée ouverte et qu'elle ne sera pas validée
|
||||||
*/
|
*/
|
||||||
foreach($this->getData(['user']) as $userId => $userIds){
|
foreach($this->getData(['user']) as $userId => $userIds){
|
||||||
$t = explode('/',$this->getData(['user', $userId, 'accessUrl']));
|
$t = [];
|
||||||
|
if( null !== $this->getData(['user', $userId, 'accessUrl'])) $t = explode('/',$this->getData(['user', $userId, 'accessUrl']));
|
||||||
if ( $this->getUser('id') &&
|
if ( $this->getUser('id') &&
|
||||||
$userId !== $this->getUser('id') &&
|
$userId !== $this->getUser('id') &&
|
||||||
$this->getData(['user', $userId,'accessUrl']) === $this->getUrl() &&
|
$this->getData(['user', $userId,'accessUrl']) === $this->getUrl() &&
|
||||||
|
@ -2809,11 +2825,16 @@ class core extends common {
|
||||||
|
|
||||||
if($access AND $this->getData(['page', $this->getUrl(0), 'moduleId'])) {
|
if($access AND $this->getData(['page', $this->getUrl(0), 'moduleId'])) {
|
||||||
$moduleId = $this->getData(['page', $this->getUrl(0), 'moduleId']);
|
$moduleId = $this->getData(['page', $this->getUrl(0), 'moduleId']);
|
||||||
|
if( null === $this->getData(['module',$this->getUrl(0),'posts',$this->getUrl(1),'content'])){
|
||||||
|
$sub = '';
|
||||||
|
} else {
|
||||||
|
$sub = substr($this->getData(['module',$this->getUrl(0),'posts',$this->getUrl(1),'content']) ,0,159);
|
||||||
|
}
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'title' => $title,
|
'title' => $title,
|
||||||
// Meta description = 160 premiers caractères de l'article
|
// Meta description = 160 premiers caractères de l'article
|
||||||
'metaDescription' => $this->getData(['page',$this->getUrl(0),'moduleId']) === 'blog' && !empty($this->getUrl(1))
|
'metaDescription' => $this->getData(['page',$this->getUrl(0),'moduleId']) === 'blog' && !empty($this->getUrl(1))
|
||||||
? strip_tags(substr($this->getData(['module',$this->getUrl(0),'posts',$this->getUrl(1),'content']) ,0,159))
|
? strip_tags($sub)
|
||||||
: $this->getData(['page', $this->getUrl(0), 'metaDescription']),
|
: $this->getData(['page', $this->getUrl(0), 'metaDescription']),
|
||||||
'metaTitle' => $this->getData(['page', $this->getUrl(0), 'metaTitle']),
|
'metaTitle' => $this->getData(['page', $this->getUrl(0), 'metaTitle']),
|
||||||
'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']),
|
'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']),
|
||||||
|
@ -2844,6 +2865,7 @@ class core extends common {
|
||||||
// Check l'existence de l'action
|
// Check l'existence de l'action
|
||||||
$action = '';
|
$action = '';
|
||||||
$ignore = true;
|
$ignore = true;
|
||||||
|
if( null !== $this->getUrl(1)){
|
||||||
foreach(explode('-', $this->getUrl(1)) as $actionPart) {
|
foreach(explode('-', $this->getUrl(1)) as $actionPart) {
|
||||||
if($ignore) {
|
if($ignore) {
|
||||||
$action .= $actionPart;
|
$action .= $actionPart;
|
||||||
|
@ -2853,6 +2875,7 @@ class core extends common {
|
||||||
$action .= ucfirst($actionPart);
|
$action .= ucfirst($actionPart);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$action = array_key_exists($action, $module::$actions) ? $action : 'index';
|
$action = array_key_exists($action, $module::$actions) ? $action : 'index';
|
||||||
if(array_key_exists($action, $module::$actions)) {
|
if(array_key_exists($action, $module::$actions)) {
|
||||||
$module->$action();
|
$module->$action();
|
||||||
|
|
|
@ -53,5 +53,9 @@ if ($this->getData(['core', 'dataVersion']) < 4104) {
|
||||||
$this->setData(['core', 'dataVersion', 4104]);
|
$this->setData(['core', 'dataVersion', 4104]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->getData(['core', 'dataVersion']) < 4105) {
|
||||||
|
|
||||||
|
// Mise à jour
|
||||||
|
$this->setData(['core', 'dataVersion', 4105]);
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1354,6 +1354,11 @@ input[type='checkbox']:disabled+label:before {
|
||||||
margin: 5px 0 5px;
|
margin: 5px 0 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Paramètres de Input File dans form */
|
||||||
|
.formInputFile {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Grille
|
* Grille
|
||||||
|
|
|
@ -26,9 +26,11 @@ if( $this->getInput('DELTA_I18N_SITE') !== '' && $this->getInput('DELTA_I18N_SIT
|
||||||
<?php if (file_exists(self::DATA_DIR .'head.inc.html')) {
|
<?php if (file_exists(self::DATA_DIR .'head.inc.html')) {
|
||||||
include(self::DATA_DIR .'head.inc.html');
|
include(self::DATA_DIR .'head.inc.html');
|
||||||
}?>
|
}?>
|
||||||
<?php if( $_SESSION['screenshot'] === 'on'){ ?>
|
<?php
|
||||||
|
if( isset ($_SESSION['screenshot'] )){
|
||||||
|
if( $_SESSION['screenshot'] === 'on'){ ?>
|
||||||
<script src="./core/vendor/screenshot/html2canvas.min.js"></script>
|
<script src="./core/vendor/screenshot/html2canvas.min.js"></script>
|
||||||
<?php } ?>
|
<?php } }?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<!-- Barre d'administration -->
|
<!-- Barre d'administration -->
|
||||||
|
@ -64,9 +66,10 @@ if( $this->getInput('DELTA_I18N_SITE') !== '' && $this->getInput('DELTA_I18N_SIT
|
||||||
} ?>
|
} ?>
|
||||||
|
|
||||||
<!-- div screenshot -->
|
<!-- div screenshot -->
|
||||||
<?php if( $_SESSION['screenshot'] === 'on'){ ?>
|
<?php if( isset ($_SESSION['screenshot'] )){
|
||||||
|
if( $_SESSION['screenshot'] === 'on'){ ?>
|
||||||
<div id="main_screenshot">
|
<div id="main_screenshot">
|
||||||
<?php } ?>
|
<?php }} ?>
|
||||||
|
|
||||||
<!-- Menu dans le fond du site avant la bannière -->
|
<!-- Menu dans le fond du site avant la bannière -->
|
||||||
<?php if($this->getData(['theme', 'menu', 'position']) === 'body-first' || $this->getData(['theme', 'menu', 'position']) === 'top' ): ?>
|
<?php if($this->getData(['theme', 'menu', 'position']) === 'body-first' || $this->getData(['theme', 'menu', 'position']) === 'top' ): ?>
|
||||||
|
@ -217,10 +220,11 @@ if( $this->getInput('DELTA_I18N_SITE') !== '' && $this->getInput('DELTA_I18N_SIT
|
||||||
<?php echo $this->getData(['theme', 'footer', 'position']) === 'site'? '</div>' : '';?>
|
<?php echo $this->getData(['theme', 'footer', 'position']) === 'site'? '</div>' : '';?>
|
||||||
|
|
||||||
<!-- fin de la div main_screenshot et bouton screenshot -->
|
<!-- fin de la div main_screenshot et bouton screenshot -->
|
||||||
<?php if( $_SESSION['screenshot'] === 'on'){ ?>
|
<?php if( isset ($_SESSION['screenshot'] )){
|
||||||
|
if( $_SESSION['screenshot'] === 'on'){ ?>
|
||||||
</div>
|
</div>
|
||||||
<div><button id="screenshot" class="buttonScreenshot" type="button" ><img src="<?php echo helper::baseUrl(false); ?>core/vendor/screenshot/appareil_photo.png" width="100px"/></button></div>
|
<div><button id="screenshot" class="buttonScreenshot" type="button" ><img src="<?php echo helper::baseUrl(false); ?>core/vendor/screenshot/appareil_photo.png" width="100px"/></button></div>
|
||||||
<?php } ?>
|
<?php }}?>
|
||||||
|
|
||||||
<!-- Lien remonter en haut -->
|
<!-- Lien remonter en haut -->
|
||||||
<div id="backToTop"><?php echo template::ico('up'); ?></div>
|
<div id="backToTop"><?php echo template::ico('up'); ?></div>
|
||||||
|
|
|
@ -25,7 +25,6 @@ class config extends common {
|
||||||
'generateFiles' => self::GROUP_ADMIN,
|
'generateFiles' => self::GROUP_ADMIN,
|
||||||
'index' => self::GROUP_ADMIN,
|
'index' => self::GROUP_ADMIN,
|
||||||
'restore' => self::GROUP_ADMIN,
|
'restore' => self::GROUP_ADMIN,
|
||||||
'updateBaseUrl' => self::GROUP_ADMIN,
|
|
||||||
'script' => self::GROUP_ADMIN,
|
'script' => self::GROUP_ADMIN,
|
||||||
'logReset' => self::GROUP_ADMIN,
|
'logReset' => self::GROUP_ADMIN,
|
||||||
'logDownload'=> self::GROUP_ADMIN,
|
'logDownload'=> self::GROUP_ADMIN,
|
||||||
|
@ -405,62 +404,19 @@ class config extends common {
|
||||||
$files [] = ( basename( $stat['name'] ));
|
$files [] = ( basename( $stat['name'] ));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lire la dataversion
|
|
||||||
$tmpDir = uniqid(4);
|
|
||||||
$success = $zip->extractTo( self::TEMP_DIR . $tmpDir );
|
|
||||||
$data = file_get_contents( self::TEMP_DIR . $tmpDir . '/data/core.json');
|
|
||||||
$obj = json_decode($data);
|
|
||||||
$dataVersion = strval ($obj->core->dataVersion);
|
|
||||||
switch (strlen($dataVersion)) {
|
|
||||||
case 4:
|
|
||||||
if (substr($dataVersion,0,1) === '9' ) {
|
|
||||||
$version = 9;
|
|
||||||
} else {
|
|
||||||
$version = 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
$version = substr($dataVersion,0,2);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$version = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->removeDir(self::TEMP_DIR . $tmpDir );
|
|
||||||
|
|
||||||
if ($version >= 10 ) {
|
|
||||||
// Option active, les users sont stockées
|
// Option active, les users sont stockées
|
||||||
if ($this->getInput('configRestoreImportUser', helper::FILTER_BOOLEAN) === true ) {
|
if ($this->getInput('configRestoreImportUser', helper::FILTER_BOOLEAN) === true ) $users = $this->getData(['user']);
|
||||||
$users = $this->getData(['user']);
|
|
||||||
}
|
|
||||||
} elseif ($version === 0) { // Version invalide
|
|
||||||
// Valeurs en sortie erreur
|
|
||||||
$this->addOutput([
|
|
||||||
'title' => $text[0],
|
|
||||||
'view' => 'restore',
|
|
||||||
'notification' => $text[3],
|
|
||||||
'state' => false
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
// Préserver les comptes des utilisateurs d'une version 9 si option cochée
|
|
||||||
// Positionnement d'une variable de session lue au constructeurs
|
|
||||||
if ($version === 9) {
|
|
||||||
$_SESSION['KEEP_USERS'] = $this->getInput('configRestoreImportUser', helper::FILTER_BOOLEAN);
|
|
||||||
}
|
|
||||||
// Extraire le zip ou 'site/'
|
// Extraire le zip ou 'site/'
|
||||||
$this->removeDir(self::DATA_DIR);
|
$this->removeDir(self::DATA_DIR);
|
||||||
$success = $zip->extractTo( 'site/' );
|
$success = $zip->extractTo( 'site/' );
|
||||||
// Fermer l'archive
|
// Fermer l'archive
|
||||||
$zip->close();
|
$zip->close();
|
||||||
|
|
||||||
|
|
||||||
// Restaurer les users originaux d'une v10 si option cochée
|
// Restaurer les users originaux d'une v10 si option cochée
|
||||||
if (!empty($users) &&
|
if (!empty($users) && $this->getInput('configRestoreImportUser', helper::FILTER_BOOLEAN) === true) $this->setData(['user',$users]);
|
||||||
$version >= 10 &&
|
|
||||||
$this->getInput('configRestoreImportUser', helper::FILTER_BOOLEAN) === true) {
|
|
||||||
$this->setData(['user',$users]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Message de notification
|
// Message de notification
|
||||||
$notification = $success === true ? $text[4] : $text[5] ;
|
$notification = $success === true ? $text[4] : $text[5] ;
|
||||||
$redirect = $this->getInput('configRestoreImportUser', helper::FILTER_BOOLEAN) === true ? helper::baseUrl() . 'config/restore' : helper::baseUrl() . 'user/login/';
|
$redirect = $this->getInput('configRestoreImportUser', helper::FILTER_BOOLEAN) === true ? helper::baseUrl() . 'config/restore' : helper::baseUrl() . 'user/login/';
|
||||||
|
@ -757,75 +713,6 @@ class config extends common {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Met à jour les données de site avec l'adresse transmise
|
|
||||||
*/
|
|
||||||
public function updateBaseUrl () {
|
|
||||||
// Lexique
|
|
||||||
$text = [];
|
|
||||||
$val = $this->getData(['config', 'i18n', 'langAdmin']);
|
|
||||||
switch ($val) {
|
|
||||||
case 'fr' :
|
|
||||||
$text[0] = 'Restaurer';
|
|
||||||
$text[1] = ' conversion';
|
|
||||||
$text[2] = ' effectuée';
|
|
||||||
$text[3] = 'Aucune conversion';
|
|
||||||
break;
|
|
||||||
case 'en' :
|
|
||||||
$text[0] = 'Restore';
|
|
||||||
$text[1] = ' conversion';
|
|
||||||
$text[2] = ' performed';
|
|
||||||
$text[3] = 'No conversion';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
// Supprimer l'information de redirection
|
|
||||||
$old = str_replace('?','',$this->getData(['core', 'baseUrl']));
|
|
||||||
$new = helper::baseUrl(false,false);
|
|
||||||
$c3 = 0;
|
|
||||||
$success = false ;
|
|
||||||
// Boucler sur les pages
|
|
||||||
foreach($this->getHierarchy(null,null,null) as $parentId => $childIds) {
|
|
||||||
$content = $this->getPage($parentId, self::$i18n);
|
|
||||||
$content = $titre . ' ' . $content ;
|
|
||||||
$replace = str_replace( 'href="' . $old , 'href="'. $new , stripslashes($content),$c1) ;
|
|
||||||
$replace = str_replace( 'src="' . $old , 'src="'. $new , stripslashes($replace),$c2) ;
|
|
||||||
|
|
||||||
if ($c1 > 0 || $c2 > 0) {
|
|
||||||
$success = true;
|
|
||||||
$this->setPage($parentId, $replace, self::$i18n);
|
|
||||||
$c3 += $c1 + $c2;
|
|
||||||
}
|
|
||||||
foreach($childIds as $childId) {
|
|
||||||
$content = $this->getPage($childId, self::$i18n);
|
|
||||||
$content = $titre . ' ' . $content ;
|
|
||||||
$replace = str_replace( 'href="' . $old , 'href="'. $new , stripslashes($content),$c1) ;
|
|
||||||
$replace = str_replace( 'src="' . $old , 'src="'. $new , stripslashes($replace),$c2) ;
|
|
||||||
if ($c1 > 0 || $c2 > 0) {
|
|
||||||
$success = true;
|
|
||||||
$this->setPage($childId, $replace, self::$i18n);
|
|
||||||
$c3 += $c1 + $c2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Traiter les modules dont la redirection
|
|
||||||
$content = $this->getdata(['module']);
|
|
||||||
$replace = $this->recursive_array_replace('href="' . $old , 'href="'. $new, $content, $c1);
|
|
||||||
$replace = $this->recursive_array_replace('src="' . $old , 'src="'. $new, $replace, $c2);
|
|
||||||
if ($content !== $replace) {
|
|
||||||
$this->setdata(['module',$replace]);
|
|
||||||
$c3 += $c1 + $c2;
|
|
||||||
$success = true;
|
|
||||||
}
|
|
||||||
// Mettre à jour la base URl
|
|
||||||
$this->setData(['core','baseUrl',helper::baseUrl(true,false)]);
|
|
||||||
// Valeurs en sortie
|
|
||||||
$this->addOutput([
|
|
||||||
'title' => $text[0],
|
|
||||||
'view' => 'restore',
|
|
||||||
'notification' => $success ? $c3. $text[1] . ($c3 > 1 ? 's' : '') . $text[2] . ($c3 > 1 ? 's' : '') : $text[3],
|
|
||||||
'state' => $success ? true : false
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Vider le fichier de log
|
* Vider le fichier de log
|
||||||
|
|
|
@ -10,13 +10,6 @@ switch ($val) {
|
||||||
$text[3] = 'Sélectionnez une archive au format ZIP';
|
$text[3] = 'Sélectionnez une archive au format ZIP';
|
||||||
$text[4] = 'L\'archive a été déposée dans le gestionnaire de fichiers.';
|
$text[4] = 'L\'archive a été déposée dans le gestionnaire de fichiers.';
|
||||||
$text[5] = 'Préserver les comptes des utilisateurs déjà installés';
|
$text[5] = 'Préserver les comptes des utilisateurs déjà installés';
|
||||||
$text[6] = 'Conversion après la restauration';
|
|
||||||
$text[7] = 'Conversion des URL des ressources multimédia entre deux sites aux arborescences différentes.';
|
|
||||||
$text[8] = 'Pas de donnée dans la sauvegarde';
|
|
||||||
$text[9] = 'Dossier de l\'archive';
|
|
||||||
$text[10] = 'Le dossier de base du site est stockée dans la sauvegarde.';
|
|
||||||
$text[11] = 'Dossier du site actuel';
|
|
||||||
$text[12] = 'Convertir';
|
|
||||||
break;
|
break;
|
||||||
case 'en' :
|
case 'en' :
|
||||||
$text[0] = 'Return';
|
$text[0] = 'Return';
|
||||||
|
@ -25,13 +18,6 @@ switch ($val) {
|
||||||
$text[3] = 'Select an archive in ZIP format';
|
$text[3] = 'Select an archive in ZIP format';
|
||||||
$text[4] = 'The archive has been dropped into the file manager.';
|
$text[4] = 'The archive has been dropped into the file manager.';
|
||||||
$text[5] = 'Preserve user accounts already installed';
|
$text[5] = 'Preserve user accounts already installed';
|
||||||
$text[6] = 'Convert after restore';
|
|
||||||
$text[7] = 'Conversion of media URLs between two sites with different trees';
|
|
||||||
$text[8] = 'No data in backup';
|
|
||||||
$text[9] = 'Archive folder';
|
|
||||||
$text[10] = 'The site\'s base folder is stored in the backup';
|
|
||||||
$text[11] = 'Current site folder';
|
|
||||||
$text[12] = 'Convert';
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -75,46 +61,4 @@ switch ($val) {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
|
||||||
<div class="col12">
|
|
||||||
<div class="block">
|
|
||||||
<h4><?php echo $text[6]; echo template::help($text[7]);?></h4>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col4 offset1">
|
|
||||||
<?php
|
|
||||||
if (is_null($this->getData(['core', 'baseUrl'])) ) {
|
|
||||||
$baseUrlValue = $text[8];
|
|
||||||
$buttonClass = 'disabled';
|
|
||||||
} elseif ($this->getData(['core', 'baseUrl']) === '') {
|
|
||||||
$baseUrlValue = '/';
|
|
||||||
$buttonClass = helper::baseUrl(false,false) !== $this->getData(['core', 'baseUrl']) ? '' : 'disabled';
|
|
||||||
} else {
|
|
||||||
$baseUrlValue = str_replace('?','',$this->getData(['core', 'baseUrl']));
|
|
||||||
$buttonClass = helper::baseUrl(false,false) !== $baseUrlValue ? '' : 'disabled';
|
|
||||||
}
|
|
||||||
echo template::text('configRestoreBaseURLToConvert', [
|
|
||||||
'label' => $text[9] ,
|
|
||||||
'value' => $baseUrlValue,
|
|
||||||
'readonly' => true,
|
|
||||||
'help' => $text[10]
|
|
||||||
]); ?>
|
|
||||||
</div>
|
|
||||||
<div class="col4">
|
|
||||||
<?php echo template::text('configRestoreCurrentURL', [
|
|
||||||
'label' => $text[11],
|
|
||||||
'value' => helper::baseUrl(false,false),
|
|
||||||
'readonly' => true
|
|
||||||
]); ?>
|
|
||||||
</div>
|
|
||||||
<div class="col2 verticalAlignMiddle">
|
|
||||||
<?php echo template::button('configRestoreUpdateBaseURLButton', [
|
|
||||||
'href' => helper::baseUrl() . 'config/updateBaseUrl',
|
|
||||||
'class' => $buttonClass,
|
|
||||||
'value' => $text[12]
|
|
||||||
]); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php echo template::formClose(); ?>
|
<?php echo template::formClose(); ?>
|
||||||
|
|
|
@ -70,7 +70,7 @@ class init extends common {
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'core' => [
|
'core' => [
|
||||||
'dataVersion' => 4104,
|
'dataVersion' => 4105,
|
||||||
'lastBackup' => 0,
|
'lastBackup' => 0,
|
||||||
'lastClearTmp' => 0,
|
'lastClearTmp' => 0,
|
||||||
'lastAutoUpdate' => 0,
|
'lastAutoUpdate' => 0,
|
||||||
|
@ -805,7 +805,8 @@ class init extends common {
|
||||||
'config' => [
|
'config' => [
|
||||||
'feeds' => true,
|
'feeds' => true,
|
||||||
'feedsLabel' => 'Syndication RSS',
|
'feedsLabel' => 'Syndication RSS',
|
||||||
'itemsperPage' => 4
|
'itemsperPage' => 4,
|
||||||
|
'versionData' => '6.0'
|
||||||
],
|
],
|
||||||
'texts' => [
|
'texts' => [
|
||||||
'NoComment' => 'Pas encore de commentaire',
|
'NoComment' => 'Pas encore de commentaire',
|
||||||
|
|
|
@ -207,7 +207,7 @@ class page extends common {
|
||||||
'group' => self::GROUP_VISITOR,
|
'group' => self::GROUP_VISITOR,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => $pageTitle,
|
'title' => $pageTitle,
|
||||||
'shortTitle' => $pageTitle,
|
'shortTitle' => '',
|
||||||
'block' => '12',
|
'block' => '12',
|
||||||
'barLeft' => '',
|
'barLeft' => '',
|
||||||
'barRight' => '',
|
'barRight' => '',
|
||||||
|
|
|
@ -526,7 +526,12 @@ pageTypeMenuDOM.on("change", function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Duplication du champ Title dans Short title
|
||||||
|
*/
|
||||||
|
$("#pageEditTitle").on("input", function() {
|
||||||
|
$("#pageEditShortTitle").val($(this).val());
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -657,9 +657,9 @@ class user extends common {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Journalisation
|
// Journalisation
|
||||||
$dataLog = mb_detect_encoding(strftime('%d/%m/%y',time()), 'UTF-8', true)
|
$dataLog = mb_detect_encoding(date('d\/m\/y',time()), 'UTF-8', true)
|
||||||
? strftime('%d/%m/%y',time()) . ';' . strftime('%R',time()) . ';'
|
? date('d\/m\/y',time()) . ';' . date('H\:i',time()) . ';'
|
||||||
: utf8_encode(strftime('%d/%m/%y',time())) . ';' . utf8_encode(strftime('%R',time())) . ';' ;
|
: utf8_encode(date('d\/m\/y',time())) . ';' . utf8_encode(date('H\:i',time())) . ';' ;
|
||||||
$dataLog .= helper::getIp($this->getData(['config','connect','anonymousIp'])) . ';';
|
$dataLog .= helper::getIp($this->getData(['config','connect','anonymousIp'])) . ';';
|
||||||
$dataLog .= $this->getInput('userLoginId', helper::FILTER_ID) . ';' ;
|
$dataLog .= $this->getInput('userLoginId', helper::FILTER_ID) . ';' ;
|
||||||
$dataLog .= $this->getUrl() .';' ;
|
$dataLog .= $this->getUrl() .';' ;
|
||||||
|
|
|
@ -3,15 +3,27 @@ $version = "9.14.0";
|
||||||
if (session_id() == '') session_start();
|
if (session_id() == '') session_start();
|
||||||
|
|
||||||
mb_internal_encoding('UTF-8');
|
mb_internal_encoding('UTF-8');
|
||||||
mb_http_output('UTF-8');
|
mb_http_output();
|
||||||
mb_http_input('UTF-8');
|
mb_http_input();
|
||||||
mb_language('uni');
|
mb_language('uni');
|
||||||
if (function_exists('mb_regex_encoding')) {
|
if (function_exists('mb_regex_encoding')) {
|
||||||
mb_regex_encoding('UTF-8');
|
mb_regex_encoding('UTF-8');
|
||||||
}
|
}
|
||||||
ob_start('mb_output_handler');
|
ob_start('mb_output_handler');
|
||||||
|
|
||||||
|
// Langage et locales fonction de la langue d'administration
|
||||||
|
$json = file_get_contents('../../../site/data/config.json');
|
||||||
|
$tab = json_decode($json, true);
|
||||||
|
$langAdmin = $tab['config']['i18n']['langAdmin'];
|
||||||
|
if($langAdmin === 'fr'){
|
||||||
date_default_timezone_set('Europe/Paris');
|
date_default_timezone_set('Europe/Paris');
|
||||||
setlocale(LC_CTYPE, 'fr_FR'); //correct transliteration
|
setlocale(LC_CTYPE, 'fr_FR', 'fr'); //correct transliteration
|
||||||
|
$_SESSION['RF']['language']= 'fr_FR';
|
||||||
|
} else {
|
||||||
|
date_default_timezone_set('Europe/London');
|
||||||
|
setlocale(LC_CTYPE, 'en_GB', 'en'); //correct transliteration
|
||||||
|
$_SESSION['RF']['language']= 'en_EN';
|
||||||
|
}
|
||||||
|
|
||||||
/* Lecture du groupe de l'utilisateur connecté pour attribuer les droits et les dossiers */
|
/* Lecture du groupe de l'utilisateur connecté pour attribuer les droits et les dossiers */
|
||||||
$userId = $_COOKIE['DELTA_USER_ID'];
|
$userId = $_COOKIE['DELTA_USER_ID'];
|
||||||
|
|
|
@ -438,9 +438,9 @@ class blog extends common {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
self::$comments[] = [
|
self::$comments[] = [
|
||||||
mb_detect_encoding(strftime('%d %B %Y - %H:%M', $comment['createdOn']), 'UTF-8', true)
|
mb_detect_encoding(date('d\/m\/Y\ \-\ H\:i', $comment['createdOn']), 'UTF-8', true)
|
||||||
? strftime('%d %B %Y - %H:%M', $comment['createdOn'])
|
? date('d\/m\/Y\ \-\ H\:i', $comment['createdOn'])
|
||||||
: utf8_encode(strftime('%d %B %Y - %H:%M', $comment['createdOn'])),
|
: utf8_encode(date('d\/m\/Y\ \-\ H\:i', $comment['createdOn'])),
|
||||||
$comment['content'],
|
$comment['content'],
|
||||||
$comment['userId'] ? $this->getData(['user', $comment['userId'], 'firstname']) . ' ' . $this->getData(['user', $comment['userId'], 'lastname']) : $comment['author'],
|
$comment['userId'] ? $this->getData(['user', $comment['userId'], 'firstname']) . ' ' . $this->getData(['user', $comment['userId'], 'lastname']) : $comment['author'],
|
||||||
$buttonApproval,
|
$buttonApproval,
|
||||||
|
@ -675,12 +675,12 @@ class blog extends common {
|
||||||
$approved = count($this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i],'comment']));
|
$approved = count($this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i],'comment']));
|
||||||
}
|
}
|
||||||
// Met en forme le tableau
|
// Met en forme le tableau
|
||||||
$date = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])), 'UTF-8', true)
|
$date = mb_detect_encoding(date('d\/m\/Y', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])), 'UTF-8', true)
|
||||||
? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn']))
|
? date('d\/m\/Y', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn']))
|
||||||
: utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])));
|
: utf8_encode(date('d\/m\/Y', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])));
|
||||||
$heure = mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])), 'UTF-8', true)
|
$heure = mb_detect_encoding(date('H\:i', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])), 'UTF-8', true)
|
||||||
? strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn']))
|
? date('H\:i', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn']))
|
||||||
: utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])));
|
: utf8_encode(date('H\:i', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])));
|
||||||
self::$articles[] = [
|
self::$articles[] = [
|
||||||
'<a href="' . helper::baseurl() . $this->getUrl(0) . '/' . $articleIds[$i] . '" target="_blank" >' .
|
'<a href="' . helper::baseurl() . $this->getUrl(0) . '/' . $articleIds[$i] . '" target="_blank" >' .
|
||||||
$this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'title']) .
|
$this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'title']) .
|
||||||
|
|
|
@ -36,8 +36,19 @@ echo '<script src="'. helper::baseUrl(false).'core/vendor/tinymce/init.js"></scr
|
||||||
echo '<script src="'. helper::baseUrl(false).'core/vendor/tinymce/init.css"></script>';
|
echo '<script src="'. helper::baseUrl(false).'core/vendor/tinymce/init.css"></script>';
|
||||||
|
|
||||||
// Pour les dates suivant la langue d'administration
|
// Pour les dates suivant la langue d'administration
|
||||||
setlocale(LC_TIME, 'fr_FR');
|
$lang = 'fr_FR';
|
||||||
if( $this->getData(['config', 'i18n', 'langAdmin']) === 'en') setlocale(LC_TIME, 'en_GB');
|
$zone = 'Europe/Paris';
|
||||||
|
if ( $this->getData(['config', 'i18n', 'langAdmin']) === 'en'){
|
||||||
|
$lang = 'en_GB';
|
||||||
|
$zone = 'Europe/London';
|
||||||
|
}
|
||||||
|
$fmt = datefmt_create(
|
||||||
|
$lang,
|
||||||
|
IntlDateFormatter::LONG,
|
||||||
|
IntlDateFormatter::SHORT,
|
||||||
|
$zone,
|
||||||
|
IntlDateFormatter::GREGORIAN
|
||||||
|
);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -56,14 +67,7 @@ if( $this->getData(['config', 'i18n', 'langAdmin']) === 'en') setlocale(LC_TIME,
|
||||||
<!-- bloc signature et date -->
|
<!-- bloc signature et date -->
|
||||||
<?php echo $module::$articleSignature . ' - ';?>
|
<?php echo $module::$articleSignature . ' - ';?>
|
||||||
<i class="far fa-calendar-alt"></i>
|
<i class="far fa-calendar-alt"></i>
|
||||||
<?php $date = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true)
|
<?php echo datefmt_format($fmt, strtotime( date('Y/m/d H:i:s',$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])))); ?>
|
||||||
? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))
|
|
||||||
: utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])));
|
|
||||||
$heure = mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true)
|
|
||||||
? strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))
|
|
||||||
: utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])));
|
|
||||||
echo $date .' - ' . $heure;
|
|
||||||
?>
|
|
||||||
<!-- Bloc edition -->
|
<!-- Bloc edition -->
|
||||||
<?php if (
|
<?php if (
|
||||||
|
|
||||||
|
@ -190,9 +194,9 @@ if( $this->getData(['config', 'i18n', 'langAdmin']) === 'en') setlocale(LC_TIME,
|
||||||
<?php foreach($module::$comments as $commentId => $comment): ?>
|
<?php foreach($module::$comments as $commentId => $comment): ?>
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo $module::$commentsSignature[$commentId]; ?>
|
<h4><?php echo $module::$commentsSignature[$commentId]; ?>
|
||||||
<?php echo ' - '; echo mb_detect_encoding(strftime('%d %B %Y - %H:%M', $comment['createdOn']), 'UTF-8', true)
|
<?php echo ' - '; echo mb_detect_encoding(date('d\/m\/Y\ \-\ H\:i', $comment['createdOn']), 'UTF-8', true)
|
||||||
? strftime('%d %B %Y - %H:%M', $comment['createdOn'])
|
? date('d\/m\/Y\ \-\ H\:i', $comment['createdOn'])
|
||||||
: utf8_encode(strftime('%d %B %Y - %H:%M', $comment['createdOn']));
|
: utf8_encode(date('d\/m\/Y\ \-\ H\:i', $comment['createdOn']));
|
||||||
?>
|
?>
|
||||||
</h4>
|
</h4>
|
||||||
<?php echo $comment['content']; ?>
|
<?php echo $comment['content']; ?>
|
||||||
|
|
|
@ -10,10 +10,21 @@ switch ($val) {
|
||||||
$text[0] = 'Read more';
|
$text[0] = 'Read more';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
?>
|
// Pour les dates suivant la langue d'administration
|
||||||
<?php setlocale(LC_TIME, 'fr_FR');
|
$lang = 'fr_FR';
|
||||||
if( $this->getData(['config', 'i18n', 'langAdmin']) === 'en') setlocale(LC_TIME, 'en_GB'); ?>
|
$zone = 'Europe/Paris';
|
||||||
<?php if($module::$articles): ?>
|
if ( $this->getData(['config', 'i18n', 'langAdmin']) === 'en'){
|
||||||
|
$lang = 'en_GB';
|
||||||
|
$zone = 'Europe/London';
|
||||||
|
}
|
||||||
|
$fmt = datefmt_create(
|
||||||
|
$lang,
|
||||||
|
IntlDateFormatter::LONG,
|
||||||
|
IntlDateFormatter::SHORT,
|
||||||
|
$zone,
|
||||||
|
IntlDateFormatter::GREGORIAN
|
||||||
|
);
|
||||||
|
if($module::$articles): ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<?php foreach($module::$articles as $articleId => $article): ?>
|
<?php foreach($module::$articles as $articleId => $article): ?>
|
||||||
|
@ -51,9 +62,7 @@ if( $this->getData(['config', 'i18n', 'langAdmin']) === 'en') setlocale(LC_TIME,
|
||||||
</div>
|
</div>
|
||||||
<div class="blogDate">
|
<div class="blogDate">
|
||||||
<i class="far fa-calendar-alt"></i>
|
<i class="far fa-calendar-alt"></i>
|
||||||
<?php echo mb_detect_encoding(strftime('%d %B %Y - %H:%M', $article['publishedOn']), 'UTF-8', true)
|
<?php echo datefmt_format($fmt, strtotime( date('Y/m/d H:i:s',$article['publishedOn']))); ?>
|
||||||
? strftime('%d %B %Y', $article['publishedOn'])
|
|
||||||
: utf8_encode(strftime('%d %B %Y', $article['publishedOn'])); ?>
|
|
||||||
</div>
|
</div>
|
||||||
<p class="blogContent">
|
<p class="blogContent">
|
||||||
<?php echo helper::subword(strip_tags($article['content']), 0, 400); ?>...
|
<?php echo helper::subword(strip_tags($article['content']), 0, 400); ?>...
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
class form extends common {
|
class form extends common {
|
||||||
|
|
||||||
const VERSION = '3.0';
|
const VERSION = '4.0';
|
||||||
const REALNAME = 'Formulaire';
|
const REALNAME = 'Formulaire';
|
||||||
const DELETE = true;
|
const DELETE = true;
|
||||||
const UPDATE = '0.0';
|
const UPDATE = '0.0';
|
||||||
|
@ -26,6 +26,7 @@ class form extends common {
|
||||||
|
|
||||||
public static $actions = [
|
public static $actions = [
|
||||||
'config' => self::GROUP_MODERATOR,
|
'config' => self::GROUP_MODERATOR,
|
||||||
|
'update' => self::GROUP_MODERATOR,
|
||||||
'data' => self::GROUP_MODERATOR,
|
'data' => self::GROUP_MODERATOR,
|
||||||
'delete' => self::GROUP_MODERATOR,
|
'delete' => self::GROUP_MODERATOR,
|
||||||
'deleteall' => self::GROUP_MODERATOR,
|
'deleteall' => self::GROUP_MODERATOR,
|
||||||
|
@ -49,6 +50,7 @@ class form extends common {
|
||||||
const TYPE_DATETIME = 'date';
|
const TYPE_DATETIME = 'date';
|
||||||
const TYPE_CHECKBOX = 'checkbox';
|
const TYPE_CHECKBOX = 'checkbox';
|
||||||
const TYPE_LABEL = 'label';
|
const TYPE_LABEL = 'label';
|
||||||
|
const TYPE_FILE = 'file';
|
||||||
const ITEMSPAGE = 10;
|
const ITEMSPAGE = 10;
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,7 +61,8 @@ class form extends common {
|
||||||
self::TYPE_MAIL => 'Champ mail',
|
self::TYPE_MAIL => 'Champ mail',
|
||||||
self::TYPE_SELECT => 'Sélection',
|
self::TYPE_SELECT => 'Sélection',
|
||||||
self::TYPE_CHECKBOX => 'Case à cocher',
|
self::TYPE_CHECKBOX => 'Case à cocher',
|
||||||
self::TYPE_DATETIME => 'Date'
|
self::TYPE_DATETIME => 'Date',
|
||||||
|
self::TYPE_FILE => 'fichier'
|
||||||
];
|
];
|
||||||
public static $types_en = [
|
public static $types_en = [
|
||||||
self::TYPE_LABEL => 'Label',
|
self::TYPE_LABEL => 'Label',
|
||||||
|
@ -68,7 +71,8 @@ class form extends common {
|
||||||
self::TYPE_MAIL => 'Mail field',
|
self::TYPE_MAIL => 'Mail field',
|
||||||
self::TYPE_SELECT => 'Selection',
|
self::TYPE_SELECT => 'Selection',
|
||||||
self::TYPE_CHECKBOX => 'Check box',
|
self::TYPE_CHECKBOX => 'Check box',
|
||||||
self::TYPE_DATETIME => 'Date'
|
self::TYPE_DATETIME => 'Date',
|
||||||
|
self::TYPE_FILE => 'file'
|
||||||
];
|
];
|
||||||
|
|
||||||
public static $listUsers = [
|
public static $listUsers = [
|
||||||
|
@ -88,6 +92,22 @@ class form extends common {
|
||||||
'80' => '80%',
|
'80' => '80%',
|
||||||
'100' => '100%'
|
'100' => '100%'
|
||||||
];
|
];
|
||||||
|
public static $maxSizeUpload = [
|
||||||
|
'100000' => '100Ko',
|
||||||
|
'200000' => '200Ko',
|
||||||
|
'500000' => '500Ko',
|
||||||
|
'1000000' => '1Mo',
|
||||||
|
'2000000' => '2Mo',
|
||||||
|
'5000000' => '5Mo'
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mise à jour du module
|
||||||
|
*/
|
||||||
|
public function update() {
|
||||||
|
if( null === $this->getData(['module', $this->getUrl(0), 'config', 'maxSizeUpload'])) $this->setData(['module', $this->getUrl(0), 'config', 'maxSizeUpload', '500000']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration
|
* Configuration
|
||||||
|
@ -131,7 +151,8 @@ class form extends common {
|
||||||
'replyto' => $this->getInput('formConfigMailReplyTo', helper::FILTER_BOOLEAN),
|
'replyto' => $this->getInput('formConfigMailReplyTo', helper::FILTER_BOOLEAN),
|
||||||
'signature' => $this->getInput('formConfigSignature'),
|
'signature' => $this->getInput('formConfigSignature'),
|
||||||
'logoUrl' => $this->getInput('formConfigLogo'),
|
'logoUrl' => $this->getInput('formConfigLogo'),
|
||||||
'logoWidth' => $this->getInput('formConfigLogoWidth')
|
'logoWidth' => $this->getInput('formConfigLogoWidth'),
|
||||||
|
'maxSizeUpload' => $this->getInput('formConfigMaxSize')
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
// Génération des données vides
|
// Génération des données vides
|
||||||
|
@ -381,6 +402,8 @@ class form extends common {
|
||||||
* Accueil
|
* Accueil
|
||||||
*/
|
*/
|
||||||
public function index() {
|
public function index() {
|
||||||
|
// Mise à jour du module
|
||||||
|
$this->update();
|
||||||
// Lexique
|
// Lexique
|
||||||
$text = [];
|
$text = [];
|
||||||
$val = $this->getData(['config', 'i18n', 'langAdmin']);
|
$val = $this->getData(['config', 'i18n', 'langAdmin']);
|
||||||
|
@ -390,12 +413,24 @@ class form extends common {
|
||||||
$text[1] = 'Nouveau message en provenance de votre site';
|
$text[1] = 'Nouveau message en provenance de votre site';
|
||||||
$text[2] = 'Nouveau message en provenance de la page "';
|
$text[2] = 'Nouveau message en provenance de la page "';
|
||||||
$text[3] = 'Formulaire soumis';
|
$text[3] = 'Formulaire soumis';
|
||||||
|
$text[4] = 'La pièce jointe n\'est pas une image';
|
||||||
|
$text[5] = '?';
|
||||||
|
$text[6] = 'La taille du fichier excède ';
|
||||||
|
$text[7] = 'L\'extension du fichier doit être jpg, jpeg, png ou gif';
|
||||||
|
$text[8] = 'Erreur pendant le téléversement du fichier';
|
||||||
|
$text[9] = 'échec le message n\'est pas envoyé car ';
|
||||||
break;
|
break;
|
||||||
case 'en' :
|
case 'en' :
|
||||||
$text[0] = 'Incorrect';
|
$text[0] = 'Incorrect';
|
||||||
$text[1] = 'New message from your site';
|
$text[1] = 'New message from your site';
|
||||||
$text[2] = 'New message from the page "';
|
$text[2] = 'New message from the page "';
|
||||||
$text[3] = 'Form submitted';
|
$text[3] = 'Form submitted';
|
||||||
|
$text[4] = 'File is not an image';
|
||||||
|
$text[5] = '?';
|
||||||
|
$text[6] = 'File size exceeds ';
|
||||||
|
$text[7] = 'The file extension must be jpg, jpeg, png or gif';
|
||||||
|
$text[8] = 'Error while uploading file' ;
|
||||||
|
$text[9] = 'failure, the message is not sent because ';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Soumission du formulaire
|
// Soumission du formulaire
|
||||||
|
@ -413,20 +448,32 @@ class form extends common {
|
||||||
$data = [];
|
$data = [];
|
||||||
$replyTo = null;
|
$replyTo = null;
|
||||||
$content = '';
|
$content = '';
|
||||||
|
// $notice concerne la pièce jointe
|
||||||
|
$notice = '';
|
||||||
foreach($this->getData(['module', $this->getUrl(0), 'input']) as $index => $input) {
|
foreach($this->getData(['module', $this->getUrl(0), 'input']) as $index => $input) {
|
||||||
// Filtre la valeur
|
// Filtre la valeur
|
||||||
switch($input['type']) {
|
switch($input['type']) {
|
||||||
case self::TYPE_MAIL:
|
case self::TYPE_MAIL:
|
||||||
$filter = helper::FILTER_MAIL;
|
$filter = helper::FILTER_MAIL;
|
||||||
|
$this->setData(['module', $this->getUrl(0), 'draft', 'mail', $this->getInput('formInput[' . $index . ']')]);
|
||||||
break;
|
break;
|
||||||
case self::TYPE_TEXTAREA:
|
case self::TYPE_TEXTAREA:
|
||||||
$filter = helper::FILTER_STRING_LONG;
|
$filter = helper::FILTER_STRING_LONG;
|
||||||
|
$this->setData(['module', $this->getUrl(0), 'draft', 'textarea', $this->getInput('formInput[' . $index . ']')]);
|
||||||
break;
|
break;
|
||||||
case self::TYPE_DATETIME:
|
case self::TYPE_DATETIME:
|
||||||
$filter = helper::FILTER_STRING_SHORT; // Mettre TYPE_DATETIME pour récupérer un TIMESTAMP
|
$filter = helper::FILTER_STRING_SHORT; // Mettre TYPE_DATETIME pour récupérer un TIMESTAMP
|
||||||
|
$this->setData(['module', $this->getUrl(0), 'draft', 'datetime', $this->getInput('formInput[' . $index . ']')]);
|
||||||
break;
|
break;
|
||||||
case self::TYPE_CHECKBOX:
|
case self::TYPE_CHECKBOX:
|
||||||
$filter = helper::FILTER_BOOLEAN;
|
$filter = helper::FILTER_BOOLEAN;
|
||||||
|
$this->setData(['module', $this->getUrl(0), 'draft', 'checkbox', $this->getInput('formInput[' . $index . ']')]);
|
||||||
|
break;
|
||||||
|
case self::TYPE_SELECT:
|
||||||
|
$this->setData(['module', $this->getUrl(0), 'draft', 'select', $this->getInput('formInput[' . $index . ']')]);
|
||||||
|
break;
|
||||||
|
case self::TYPE_TEXT:
|
||||||
|
$this->setData(['module', $this->getUrl(0), 'draft', 'text', $this->getInput('formInput[' . $index . ']')]);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$filter = helper::FILTER_STRING_SHORT;
|
$filter = helper::FILTER_STRING_SHORT;
|
||||||
|
@ -437,16 +484,69 @@ class form extends common {
|
||||||
$input['type'] === 'mail') {
|
$input['type'] === 'mail') {
|
||||||
$replyTo = $value;
|
$replyTo = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Traitement de la pièce jointe, fichier avec extension valide de taille maximum $sizeMax
|
||||||
|
// Fichier chargé dans site/file/uploads/ et effacé après l'envoi du mail
|
||||||
|
if( $input['type'] === 'file'){
|
||||||
|
$target_dir = self::FILE_DIR.'uploads';
|
||||||
|
$sizeMax = $this->getData(['module', $this->getUrl(0), 'config', 'maxSizeUpload']);
|
||||||
|
$extensions_valides = array( 'jpg' , 'jpeg' , 'gif' , 'png');
|
||||||
|
$extensions_images = array( 'jpg' , 'jpeg' , 'gif' , 'png' );
|
||||||
|
$file_name = basename($_FILES["fileToUpload"]["name"]);
|
||||||
|
if( $_FILES["fileToUpload"]["error"] === 0){
|
||||||
|
if($file_name !== '' && $file_name !== null){
|
||||||
|
if( ! is_dir( $target_dir )) mkdir( $target_dir, 0744);
|
||||||
|
// Copie du fichier .htaccess depuis module/form/ressource
|
||||||
|
copy('./module/form/ressource/.htaccess', $target_dir.'/.htaccess');
|
||||||
|
$target_file = $target_dir .'/'. $file_name;
|
||||||
|
$imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
|
||||||
|
|
||||||
|
// Vérification que la pièce jointe est une image quand son extension est celle d'une image
|
||||||
|
if( $_FILES["fileToUpload"]["tmp_name"] !== '' && $_FILES["fileToUpload"]["tmp_name"] !== null
|
||||||
|
&& in_array($imageFileType,$extensions_images)){
|
||||||
|
$check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
|
||||||
|
if($check === false) $notice = $text[4];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Vérification de la taille du fichier
|
||||||
|
if ($_FILES["fileToUpload"]["size"] > $sizeMax) $notice = $text[6].intval($sizeMax/1000).' Ko';
|
||||||
|
|
||||||
|
// Vérification des types de fichiers autorisés
|
||||||
|
if( ! in_array($imageFileType,$extensions_valides) ) $notice = $text[7];
|
||||||
|
|
||||||
|
// Upload du fichier
|
||||||
|
if ($notice === '') {
|
||||||
|
if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
|
||||||
|
$value = $file_name;
|
||||||
|
} else {
|
||||||
|
$notice = $text[8];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
switch($_FILES["fileToUpload"]["error"]) {
|
||||||
|
case 2 :
|
||||||
|
$notice = $text[6].' MAX_FILE_SIZE : 5Mo';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$notice = $text[8];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Préparation des données pour la création dans la base
|
// Préparation des données pour la création dans la base
|
||||||
$data[$this->getData(['module', $this->getUrl(0), 'input', $index, 'name'])] = $value;
|
$data[$this->getData(['module', $this->getUrl(0), 'input', $index, 'name'])] = $value;
|
||||||
// Préparation des données pour le mail
|
// Préparation des données pour le mail
|
||||||
$content .= '<strong>' . $this->getData(['module', $this->getUrl(0), 'input', $index, 'name']) . ' :</strong> ' . $value . '<br>';
|
$content .= '<strong>' . $this->getData(['module', $this->getUrl(0), 'input', $index, 'name']) . ' :</strong> ' . $value . '<br>';
|
||||||
}
|
}
|
||||||
|
// Si absence d'erreur sur la pièce jointe
|
||||||
|
if( $notice === ''){
|
||||||
// Crée les données
|
// Crée les données
|
||||||
$this->setData(['module', $this->getUrl(0), 'data', helper::increment(1, $this->getData(['module', $this->getUrl(0), 'data'])), $data]);
|
$this->setData(['module', $this->getUrl(0), 'data', helper::increment(1, $this->getData(['module', $this->getUrl(0), 'data'])), $data]);
|
||||||
// Envoi du mail
|
|
||||||
// Rechercher l'adresse en fonction du mail
|
|
||||||
$sent = true;
|
$sent = true;
|
||||||
|
// Emission du mail
|
||||||
|
// Rechercher l'adresse en fonction du mail
|
||||||
$singleuser = $this->getData(['user',
|
$singleuser = $this->getData(['user',
|
||||||
$this->getData(['module', $this->getUrl(0), 'config', 'user']),
|
$this->getData(['module', $this->getUrl(0), 'config', 'user']),
|
||||||
'mail']);
|
'mail']);
|
||||||
|
@ -488,12 +588,25 @@ class form extends common {
|
||||||
$subject,
|
$subject,
|
||||||
$text[2] . $this->getData(['page', $this->getUrl(0), 'title']) . '" :<br><br>' .
|
$text[2] . $this->getData(['page', $this->getUrl(0), 'title']) . '" :<br><br>' .
|
||||||
$content,
|
$content,
|
||||||
$replyTo
|
$replyTo,
|
||||||
|
$file_name
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Nettoyage du dossier self::FILE_DIR.uploads
|
||||||
|
$FilesUpload = glob( self::FILE_DIR.'uploads/*');
|
||||||
|
foreach($FilesUpload as $file) {
|
||||||
|
if(is_file($file)) unlink($file);
|
||||||
|
}
|
||||||
// Redirection
|
// Redirection
|
||||||
$redirect = $this->getData(['module', $this->getUrl(0), 'config', 'pageId']);
|
$redirect = helper::baseUrl() . $this->getUrl(0);
|
||||||
|
if ( $this->getData(['module', $this->getUrl(0), 'config', 'pageId']) !== '') $redirect = helper::baseUrl() . $this->getData(['module', $this->getUrl(0), 'config', 'pageId']);
|
||||||
|
// Effacement des données provisoires
|
||||||
|
$this->setData(['module', $this->getUrl(0), 'draft', '']);
|
||||||
|
} else {
|
||||||
|
$sent = false;
|
||||||
|
$redirect = helper::baseUrl() . $this->getUrl(0);
|
||||||
|
}
|
||||||
// Passage de la langue d'administration à flatpickr
|
// Passage de la langue d'administration à flatpickr
|
||||||
$lang_flatpickr = 'fr';
|
$lang_flatpickr = 'fr';
|
||||||
if( $this->getData(['config', 'i18n', 'langAdmin']) ==='en'){
|
if( $this->getData(['config', 'i18n', 'langAdmin']) ==='en'){
|
||||||
|
@ -506,9 +619,9 @@ class form extends common {
|
||||||
<?php
|
<?php
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'notification' => ($sent === true ? $text[3] : $sent),
|
'notification' => ($sent === true ? $text[3] : $notice),
|
||||||
'redirect' => $redirect ? helper::baseUrl() . $redirect : '',
|
'redirect' => $redirect,
|
||||||
'state' => ($sent === true ? true : null),
|
'state' => ($sent === true ? true : false),
|
||||||
'vendor' => [
|
'vendor' => [
|
||||||
'flatpickr'
|
'flatpickr'
|
||||||
],
|
],
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
# Interdire l'exécution de fichiers
|
||||||
|
<FilesMatch "\.(php|phtml|php3|php4|php5|pl|py|jsp|asp|html|htm|shtml|sh|cgi|suspected)$">
|
||||||
|
deny from all
|
||||||
|
</FilesMatch>
|
|
@ -23,7 +23,7 @@ switch ($val) {
|
||||||
$text[16] = 'A une adresse email';
|
$text[16] = 'A une adresse email';
|
||||||
$text[17] = 'Un email ou une liste de diffusion';
|
$text[17] = 'Un email ou une liste de diffusion';
|
||||||
$text[18] = 'Répondre à l\'expéditeur depuis le mail de notification';
|
$text[18] = 'Répondre à l\'expéditeur depuis le mail de notification';
|
||||||
$text[19] = 'Cette option permet de réponse drectement à l\'expéditeur du message si celui-ci a indiqué un email valide.';
|
$text[19] = 'Cette option permet de répondre directement à l\'expéditeur du message si celui-ci a indiqué un email valide.';
|
||||||
$text[20] = 'Sélectionner le type de signature';
|
$text[20] = 'Sélectionner le type de signature';
|
||||||
$text[21] = 'Sélectionnez le logo du site';
|
$text[21] = 'Sélectionnez le logo du site';
|
||||||
$text[22] = 'Logo';
|
$text[22] = 'Logo';
|
||||||
|
@ -35,6 +35,7 @@ switch ($val) {
|
||||||
$text[28] = 'Le formulaire ne contient aucun champ.';
|
$text[28] = 'Le formulaire ne contient aucun champ.';
|
||||||
$text[29] = 'Version n°';
|
$text[29] = 'Version n°';
|
||||||
$text[30] = 'Enregistrer';
|
$text[30] = 'Enregistrer';
|
||||||
|
$text[31] = 'Taille maximale de la pièce jointe';
|
||||||
$types = $module::$types;
|
$types = $module::$types;
|
||||||
$signature = $module::$signature;
|
$signature = $module::$signature;
|
||||||
break;
|
break;
|
||||||
|
@ -70,6 +71,7 @@ switch ($val) {
|
||||||
$text[28] = 'The form contains no fields';
|
$text[28] = 'The form contains no fields';
|
||||||
$text[29] = 'Version no.';
|
$text[29] = 'Version no.';
|
||||||
$text[30] = 'Register';
|
$text[30] = 'Register';
|
||||||
|
$text[31] = 'Maximum size of the attachment';
|
||||||
$types = $module::$types_en;
|
$types = $module::$types_en;
|
||||||
$signature = $module::$signature_en;
|
$signature = $module::$signature_en;
|
||||||
break;
|
break;
|
||||||
|
@ -242,10 +244,21 @@ switch ($val) {
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col6">
|
||||||
<?php echo template::checkbox('formConfigCaptcha', true, $text[26], [
|
<?php echo template::checkbox('formConfigCaptcha', true, $text[26], [
|
||||||
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'captcha'])
|
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'captcha'])
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col6">
|
||||||
|
<?php echo template::select('formConfigMaxSize', $module::$maxSizeUpload, [
|
||||||
|
'label' => $text[31],
|
||||||
|
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'maxSizeUpload'])
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo $text[27]; ?></h4>
|
<h4><?php echo $text[27]; ?></h4>
|
||||||
<div id="formConfigNoInput">
|
<div id="formConfigNoInput">
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
/**
|
||||||
|
* This file is part of DeltaCMS.
|
||||||
|
* For full copyright and license information, please see the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
* @author Sylvain Lelièvre <lelievresylvain@free.fr>
|
||||||
|
* @copyright Copyright (C) 2021-2022, Sylvain Lelièvre
|
||||||
|
* @license GNU General Public License, version 3
|
||||||
|
* @link https://deltacms.fr/
|
||||||
|
*
|
||||||
|
* Delta was created from version 11.2.00.24 of ZwiiCMS
|
||||||
|
* @author Rémi Jean <remi.jean@outlook.com>
|
||||||
|
* @copyright Copyright (C) 2008-2018, Rémi Jean
|
||||||
|
* @author Frédéric Tempez <frederic.tempez@outlook.com>
|
||||||
|
* @copyright Copyright (C) 2018-2021, Frédéric Tempez
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#formFileReset {
|
||||||
|
background-color: red;
|
||||||
|
border-width:1px;
|
||||||
|
border-color: orange;
|
||||||
|
font-size: 1.15em;
|
||||||
|
font-style: bold;
|
||||||
|
color: yellow;
|
||||||
|
}
|
||||||
|
|
||||||
|
#formFileReset:hover {
|
||||||
|
background-color: orange;
|
||||||
|
border-color: orange;
|
||||||
|
font-style: normal;
|
||||||
|
color:black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formInputFile {
|
||||||
|
padding: 9px;
|
||||||
|
border-radius: 2px;
|
||||||
|
border: 1px solid #D8DFE3;
|
||||||
|
backgroung-color: rgba(255,255,255,1);
|
||||||
|
}
|
|
@ -15,3 +15,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
$( "#formFileReset" ).click(function() {
|
||||||
|
$( "#fileToUpload" ).val('');
|
||||||
|
});
|
||||||
|
|
|
@ -14,12 +14,13 @@ switch ($val) {
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<?php if($this->getData(['module', $this->getUrl(0), 'input'])): ?>
|
<?php if($this->getData(['module', $this->getUrl(0), 'input'])): ?>
|
||||||
<?php echo template::formOpen('formForm'); ?>
|
<?php echo template::formOpenFile('formForm'); ?>
|
||||||
<?php foreach($this->getData(['module', $this->getUrl(0), 'input']) as $index => $input): ?>
|
<?php foreach($this->getData(['module', $this->getUrl(0), 'input']) as $index => $input): ?>
|
||||||
<?php if($input['type'] === $module::TYPE_MAIL): ?>
|
<?php if($input['type'] === $module::TYPE_MAIL): ?>
|
||||||
<?php echo template::mail('formInput[' . $index . ']', [
|
<?php echo template::mail('formInput[' . $index . ']', [
|
||||||
'id' => 'formInput_' . $index,
|
'id' => 'formInput_' . $index,
|
||||||
'label' => $input['name']
|
'label' => $input['name'],
|
||||||
|
'value' => $this->getData([ 'module', $this->getUrl(0), 'draft', 'mail'])
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php elseif($input['type'] === $module::TYPE_SELECT): ?>
|
<?php elseif($input['type'] === $module::TYPE_SELECT): ?>
|
||||||
<?php
|
<?php
|
||||||
|
@ -30,32 +31,44 @@ switch ($val) {
|
||||||
?>
|
?>
|
||||||
<?php echo template::select('formInput[' . $index . ']', $values, [
|
<?php echo template::select('formInput[' . $index . ']', $values, [
|
||||||
'id' => 'formInput_' . $index,
|
'id' => 'formInput_' . $index,
|
||||||
'label' => $input['name']
|
'label' => $input['name'],
|
||||||
|
'value' => $this->getData([ 'module', $this->getUrl(0), 'draft', 'select'])
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php elseif($input['type'] === $module::TYPE_TEXT): ?>
|
<?php elseif($input['type'] === $module::TYPE_TEXT): ?>
|
||||||
<?php echo template::text('formInput[' . $index . ']', [
|
<?php echo template::text('formInput[' . $index . ']', [
|
||||||
'id' => 'formInput_' . $index,
|
'id' => 'formInput_' . $index,
|
||||||
'label' => $input['name']
|
'label' => $input['name'],
|
||||||
|
'value' => $this->getData([ 'module', $this->getUrl(0), 'draft', 'text'])
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php elseif($input['type'] === $module::TYPE_TEXTAREA): ?>
|
<?php elseif($input['type'] === $module::TYPE_TEXTAREA): ?>
|
||||||
<?php echo template::textarea('formInput[' . $index . ']', [
|
<?php echo template::textarea('formInput[' . $index . ']', [
|
||||||
'id' => 'formInput_' . $index,
|
'id' => 'formInput_' . $index,
|
||||||
'label' => $input['name']
|
'label' => $input['name'],
|
||||||
|
'value' => $this->getData([ 'module', $this->getUrl(0), 'draft', 'textarea'])
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php elseif($input['type'] === $module::TYPE_DATETIME): ?>
|
<?php elseif($input['type'] === $module::TYPE_DATETIME): ?>
|
||||||
<?php echo template::date('formInput[' . $index . ']', [
|
<?php echo template::date('formInput[' . $index . ']', [
|
||||||
'id' => 'formInput_' . $index,
|
'id' => 'formInput_' . $index,
|
||||||
'label' => $input['name'],
|
'label' => $input['name'],
|
||||||
'vendor' => 'flatpickr'
|
'vendor' => 'flatpickr',
|
||||||
|
'value' => $this->getData([ 'module', $this->getUrl(0), 'draft', 'datetime'])
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php elseif($input['type'] === $module::TYPE_CHECKBOX): ?>
|
<?php elseif($input['type'] === $module::TYPE_CHECKBOX): ?>
|
||||||
<?php echo template::checkbox('formInput[' . $index . ']', true, $input['name']
|
<?php echo template::checkbox('formInput[' . $index . ']', true, $input['name'], [
|
||||||
); ?>
|
'checked' => $this->getData([ 'module', $this->getUrl(0), 'draft', 'checkbox'])
|
||||||
|
]); ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<?php elseif($input['type'] === $module::TYPE_FILE): ?>
|
||||||
|
<label class='formLabel'> <?php echo $input['name']; ?> </label>
|
||||||
|
<div class="formInputFile">
|
||||||
|
<input type="hidden" name="MAX_FILE_SIZE" value="5000000">
|
||||||
|
<input type="file" name="fileToUpload" id="fileToUpload">
|
||||||
|
<input type="button" id="formFileReset" value="X">
|
||||||
|
</div><br>
|
||||||
<?php elseif($input['type'] === $module::TYPE_LABEL): ?>
|
<?php elseif($input['type'] === $module::TYPE_LABEL): ?>
|
||||||
<h3 class='formLabel'>
|
<p class='formLabel'> <?php echo $input['name']; ?> </p>
|
||||||
<?php echo $input['name']; ?>
|
|
||||||
<hr class="formLabel">
|
|
||||||
</h3>
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php if($this->getData(['module', $this->getUrl(0), 'config', 'captcha'])): ?>
|
<?php if($this->getData(['module', $this->getUrl(0), 'config', 'captcha'])): ?>
|
||||||
|
|
|
@ -675,7 +675,7 @@ class gallery extends common {
|
||||||
// Tri des images
|
// Tri des images
|
||||||
switch ($this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(2), 'config', 'sort'])) {
|
switch ($this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(2), 'config', 'sort'])) {
|
||||||
case self::SORT_HAND:
|
case self::SORT_HAND:
|
||||||
$positions = $this->getdata(['module',$this->getUrl(0), $this->getUrl(2),'positions']);
|
$positions = $this->getdata(['module',$this->getUrl(0),'content', $this->getUrl(2),'positions']);
|
||||||
if ($positions) {
|
if ($positions) {
|
||||||
foreach ($positions as $key => $value) {
|
foreach ($positions as $key => $value) {
|
||||||
if (array_key_exists($key,self::$pictures)) {
|
if (array_key_exists($key,self::$pictures)) {
|
||||||
|
|
|
@ -68,11 +68,7 @@ $( document ).ready(function() {
|
||||||
$("#galleryTable").tableDnD({
|
$("#galleryTable").tableDnD({
|
||||||
onDrop: function(table, row) {
|
onDrop: function(table, row) {
|
||||||
$("#galleryEditFormResponse").val($.tableDnD.serialize());
|
$("#galleryEditFormResponse").val($.tableDnD.serialize());
|
||||||
},
|
|
||||||
onDragStop : function(table, row) {
|
|
||||||
// Sauvegarde le tri
|
|
||||||
sortPictures();
|
sortPictures();
|
||||||
$("#galleryEditFormResponse").val("");
|
|
||||||
},
|
},
|
||||||
serializeRegexp: ""
|
serializeRegexp: ""
|
||||||
});
|
});
|
||||||
|
|
|
@ -146,7 +146,9 @@ if( file_exists($fichiers_json.'filtre_primaire.json')){
|
||||||
|
|
||||||
//Initialisation si c'est un nouvel indice
|
//Initialisation si c'est un nouvel indice
|
||||||
if(!isset($log[$indice])){
|
if(!isset($log[$indice])){
|
||||||
$log[$indice] = array('ip' => $ip, 'user_id'=> $delta_user_id, 'userAgent' => $_SERVER['HTTP_USER_AGENT'], 'langage' => $_SERVER['HTTP_ACCEPT_LANGUAGE'], 'referer' => $_SERVER['HTTP_REFERER'], 'vues' => array(), 'client' => array() );
|
$referer = '';
|
||||||
|
if( isset( $_SERVER['HTTP_REFERER'] )) $referer = $_SERVER['HTTP_REFERER'];
|
||||||
|
$log[$indice] = array('ip' => $ip, 'user_id'=> $delta_user_id, 'userAgent' => $_SERVER['HTTP_USER_AGENT'], 'langage' => $_SERVER['HTTP_ACCEPT_LANGUAGE'], 'referer' => $referer, 'vues' => array(), 'client' => array() );
|
||||||
}
|
}
|
||||||
// Ajout de la vue sous la forme date et page vue
|
// Ajout de la vue sous la forme date et page vue
|
||||||
$indice2 = count($log[$indice]['vues']);
|
$indice2 = count($log[$indice]['vues']);
|
||||||
|
|
|
@ -846,7 +846,9 @@ class statislite extends common {
|
||||||
$log[$numSession]['vues'] = $tableau[$numSession]['vues'];
|
$log[$numSession]['vues'] = $tableau[$numSession]['vues'];
|
||||||
$nbpageparsession = count($log[$numSession]['vues']);
|
$nbpageparsession = count($log[$numSession]['vues']);
|
||||||
}
|
}
|
||||||
|
if(isset($log[$numSession]['ip'])){
|
||||||
$ip = $log[$numSession]['ip'];
|
$ip = $log[$numSession]['ip'];
|
||||||
|
}
|
||||||
$datetimei = strtotime(substr($log[$numSession]['vues'][0], 0 , 19));
|
$datetimei = strtotime(substr($log[$numSession]['vues'][0], 0 , 19));
|
||||||
// Si $nbpageparsession <=1 on force la valeur de $datetimef
|
// Si $nbpageparsession <=1 on force la valeur de $datetimef
|
||||||
if($nbpageparsession <= 1){
|
if($nbpageparsession <= 1){
|
||||||
|
@ -884,10 +886,10 @@ class statislite extends common {
|
||||||
$log[$numSession]['client'][2] = $this->systeme($log[$numSession]['userAgent']);
|
$log[$numSession]['client'][2] = $this->systeme($log[$numSession]['userAgent']);
|
||||||
// Geolocalisation si elle n'a pas été faite et si l'IP n'est pas déjà détruite
|
// Geolocalisation si elle n'a pas été faite et si l'IP n'est pas déjà détruite
|
||||||
if(isset($log[$numSession]['ip'])){
|
if(isset($log[$numSession]['ip'])){
|
||||||
if($geolocalisation && ! isset($log[$numSession]['geolocalisation'])){
|
/*if($geolocalisation && ! isset($log[$numSession]['geolocalisation'])){
|
||||||
$geo = $this->geolocalise($log[$numSession]['ip']);
|
$geo = $this->geolocalise($log[$numSession]['ip']);
|
||||||
$log[$numSession]['geolocalisation'] = $geo['country_name'].' - '.$geo['city'];
|
$log[$numSession]['geolocalisation'] = $geo['country_name'].' - '.$geo['city'];
|
||||||
}
|
}*/
|
||||||
// CNIL : ne pas mémoriser d'adresse IP
|
// CNIL : ne pas mémoriser d'adresse IP
|
||||||
unset($log[$numSession]['ip']);
|
unset($log[$numSession]['ip']);
|
||||||
}
|
}
|
||||||
|
@ -998,11 +1000,13 @@ class statislite extends common {
|
||||||
$nom = substr($value, 22 , strlen($value));
|
$nom = substr($value, 22 , strlen($value));
|
||||||
//$date = strtotime(substr($value, 0 , 19)); ajouter dans le if && ( strtotime(substr($tab[$numSession]['vues'][$i], 0 , 19)) - $date) < 60)
|
//$date = strtotime(substr($value, 0 , 19)); ajouter dans le if && ( strtotime(substr($tab[$numSession]['vues'][$i], 0 , 19)) - $date) < 60)
|
||||||
for($i=$key + 1 ; $i < $nbpageparsession; $i++){
|
for($i=$key + 1 ; $i < $nbpageparsession; $i++){
|
||||||
|
if( isset ($tab[$numSession]['vues'][$i])){
|
||||||
if( substr($tab[$numSession]['vues'][$i], 22 , strlen($tab[$numSession]['vues'][$i])) == $nom){
|
if( substr($tab[$numSession]['vues'][$i], 22 , strlen($tab[$numSession]['vues'][$i])) == $nom){
|
||||||
unset($tab[$numSession]['vues'][$i]);
|
unset($tab[$numSession]['vues'][$i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$nbpagesvalides = count($tab[$numSession]['vues']);
|
$nbpagesvalides = count($tab[$numSession]['vues']);
|
||||||
}
|
}
|
||||||
// Mise à jour du tableau $cumul
|
// Mise à jour du tableau $cumul
|
||||||
|
@ -1063,7 +1067,7 @@ class statislite extends common {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Geolocalisation
|
// Geolocalisation
|
||||||
if($log[$numSession]['geolocalisation'] != 'Fichier - clef_ipapi_com.txt - absent , .'){
|
/*if($log[$numSession]['geolocalisation'] != 'Fichier - clef_ipapi_com.txt - absent , .'){
|
||||||
// Extraction du pays
|
// Extraction du pays
|
||||||
$postiret = strpos($log[$numSession]['geolocalisation'], '-');
|
$postiret = strpos($log[$numSession]['geolocalisation'], '-');
|
||||||
$pays = substr($log[$numSession]['geolocalisation'], 0, $postiret - 1);
|
$pays = substr($log[$numSession]['geolocalisation'], 0, $postiret - 1);
|
||||||
|
@ -1080,6 +1084,7 @@ class statislite extends common {
|
||||||
$cumul['clients']['localisation'][$pays] = 1;
|
$cumul['clients']['localisation'][$pays] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Mise à jour des variables liées au fichier sessionLog.json
|
// Mise à jour des variables liées au fichier sessionLog.json
|
||||||
self::$comptepages = self::$comptepages - $nbpageparsession;
|
self::$comptepages = self::$comptepages - $nbpageparsession;
|
||||||
|
@ -1311,9 +1316,11 @@ class statislite extends common {
|
||||||
}
|
}
|
||||||
$tampon = $tableau;
|
$tampon = $tableau;
|
||||||
$nbsessiontampon = count($tampon);
|
$nbsessiontampon = count($tampon);
|
||||||
|
if( $nbsessiontampon > 0 ){
|
||||||
for($i=0; $i < $nbEnregSession; $i++){
|
for($i=0; $i < $nbEnregSession; $i++){
|
||||||
self::$affidetaille[$i] = $tampon[$nbsessiontampon - 1 - $i];
|
self::$affidetaille[$i] = $tampon[$nbsessiontampon - 1 - $i];
|
||||||
if($nbsessiontampon - 1 - $i == 0){ break;}
|
if($nbsessiontampon - 1 - $i === 0) break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
|
@ -1402,7 +1409,7 @@ class statislite extends common {
|
||||||
|
|
||||||
/* Geolocalisation */
|
/* Geolocalisation */
|
||||||
/* Utilisation de cette fonction supprimée */
|
/* Utilisation de cette fonction supprimée */
|
||||||
private function geolocalise($ip){
|
/*private function geolocalise($ip){
|
||||||
// Géolocalisation avec le site www.ipapi.com qui offre 10000 requêtes / mois
|
// Géolocalisation avec le site www.ipapi.com qui offre 10000 requêtes / mois
|
||||||
if( is_file(self::$base.'clef_ipapi_com.txt')){
|
if( is_file(self::$base.'clef_ipapi_com.txt')){
|
||||||
$access_key = file_get_contents(self::$base.'clef_ipapi_com.txt');
|
$access_key = file_get_contents(self::$base.'clef_ipapi_com.txt');
|
||||||
|
@ -1420,6 +1427,7 @@ class statislite extends common {
|
||||||
}
|
}
|
||||||
return $api_result;
|
return $api_result;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/* Initialisation de cumul.json */
|
/* Initialisation de cumul.json */
|
||||||
private function initcumul(){
|
private function initcumul(){
|
||||||
|
|
Loading…
Reference in New Issue