revert to core origin

This commit is contained in:
Fred Tempez 2020-10-11 04:29:57 +02:00
parent f2fc03ce91
commit 4104fdf736
1 changed files with 22 additions and 28 deletions

View File

@ -39,7 +39,7 @@ class common {
const ACCESS_TIMER = 1800; const ACCESS_TIMER = 1800;
// Numéro de version // Numéro de version
const ZWII_VERSION = '10.3.03'; const ZWII_VERSION = '10.3.02';
const ZWII_UPDATE_CHANNEL = "v10"; const ZWII_UPDATE_CHANNEL = "v10";
public static $actions = []; public static $actions = [];
@ -1740,10 +1740,9 @@ class core extends common {
} }
// Check l'accès à la page // Check l'accès à la page
$access = null; $access = null;
if($this->getData(['page', $this->getUrl(0)]) !== null $accessInfo['userName'] = '';
OR $this->getData(['page', $this->getUrl(1)]) !== null $accessInfo['pageId'] = '';
OR $this->getData(['page', $this->getUrl(2)]) !== null if($this->getData(['page', $this->getUrl(0)]) !== null) {
) {
if( if(
$this->getData(['page', $this->getUrl(0), 'group']) === self::GROUP_VISITOR $this->getData(['page', $this->getUrl(0), 'group']) === self::GROUP_VISITOR
OR ( OR (
@ -1754,10 +1753,7 @@ class core extends common {
$access = true; $access = true;
} }
else { else {
if($this->getUrl(0) === $this->getData(['config', 'homePageId'])) {
if($this->getUrl(0) === 'user'
AND $this->getUrl(1) === 'login'
) {
$access = 'login'; $access = 'login';
} }
else { else {
@ -1765,8 +1761,7 @@ class core extends common {
} }
} }
} }
var_dump($access);
echo $this->getUrl(1);
/** /**
* Contrôle si la page demandée est en édition ou accès à la gestion du site * Contrôle si la page demandée est en édition ou accès à la gestion du site
* conditions de blocage : * conditions de blocage :
@ -1775,16 +1770,14 @@ class core extends common {
* - Une partie de l'URL fait partie de la liste de filtrage (édition d'un module etc..) * - Une partie de l'URL fait partie de la liste de filtrage (édition d'un module etc..)
* - 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
*/ */
$accessInfo['userName'] = '';
$accessInfo['pageId'] = '';
foreach($this->getData(['user']) as $userId => $userIds){ foreach($this->getData(['user']) as $userId => $userIds){
$t = explode('/',$this->getData(['user', $userId, 'accessUrl'])); $t = explode('/',$this->getData(['user', $userId, 'accessUrl']));
if ( $this->getuser('id') if ( $this->getuser('id') &&
AND $userId !== $this->getuser('id') $userId !== $this->getuser('id') &&
AND $this->getData(['user', $userId,'accessUrl']) === $this->getUrl() $this->getData(['user', $userId,'accessUrl']) === $this->getUrl() &&
AND array_intersect($t,self::$accessList) array_intersect($t,self::$accessList) &&
AND array_intersect($t,self::$accessExclude) !== false array_intersect($t,self::$accessExclude) !== false &&
AND time() < $this->getData(['user', $userId,'accessTimer']) + self::ACCESS_TIMER time() < $this->getData(['user', $userId,'accessTimer']) + self::ACCESS_TIMER
) { ) {
$access = false; $access = false;
$accessInfo['userName'] = $this->getData(['user', $userId, 'lastname']) . ' ' . $this->getData(['user', $userId, 'firstname']); $accessInfo['userName'] = $this->getData(['user', $userId, 'lastname']) . ' ' . $this->getData(['user', $userId, 'firstname']);
@ -1798,13 +1791,16 @@ class core extends common {
} }
// Breadcrumb // Breadcrumb
$title = $this->getData(['page', $this->getUrl(0), 'title']); $title = $this->getData(['page', $this->getUrl(0), 'title']);
if (!empty($this->getData(['page', $this->getUrl(0), 'parentPageId'])) if (!empty($this->getData(['page', $this->getUrl(0), 'parentPageId'])) &&
AND $this->getData(['page', $this->getUrl(0), 'breadCrumb'])) { $this->getData(['page', $this->getUrl(0), 'breadCrumb'])) {
$title = '<a href="' . helper::baseUrl() . $this->getData(['page', $this->getUrl(0), 'parentPageId']) . $title = '<a href="' . helper::baseUrl() .
'">' . ucfirst($this->getData(['page',$this->getData(['page', $this->getUrl(0), 'parentPageId']), 'title'])) . $this->getData(['page', $this->getUrl(0), 'parentPageId']) .
'</a> &#8250; '. $this->getData(['page', $this->getUrl(0), 'title']); '">' .
ucfirst($this->getData(['page',$this->getData(['page', $this->getUrl(0), 'parentPageId']), 'title'])) .
'</a> &#8250; '.
$this->getData(['page', $this->getUrl(0), 'title']);
} }
var_dump($access);
// Importe la page // Importe la page
if( if(
$this->getData(['page', $this->getUrl(0)]) !== null $this->getData(['page', $this->getUrl(0)]) !== null
@ -1825,7 +1821,7 @@ class core extends common {
} }
// Importe le module // Importe le module
else { else {
// Id du module, et valeurs en sortie de la page s'il s'agit d'un module de page // Id du module, et valeurs en sortie de la page si il s'agit d'un module de page
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']);
@ -1878,7 +1874,6 @@ class core extends common {
) )
) )
AND $output['access'] === true AND $output['access'] === true
AND $access !== false
) { ) {
// Enregistrement du contenu de la méthode POST lorsqu'une notice est présente // Enregistrement du contenu de la méthode POST lorsqu'une notice est présente
if(common::$inputNotices) { if(common::$inputNotices) {
@ -2002,7 +1997,6 @@ class core extends common {
} }
} }
} }
var_dump($access);
// Erreurs // Erreurs
if($access === 'login') { if($access === 'login') {
http_response_code(302); http_response_code(302);