Skip to content

Commit

Permalink
16.8 (#551)
Browse files Browse the repository at this point in the history
* first commit ...

réduction des erreurs

* mauvaise valeur (vide) pour un type decimal dans la table

génère erreur : remplacé par 0

* erreur nom de champ

* clean code

* stabilisation comment system + code  + bad variable type in mktime

* missing globalisation for $NPDS_Prefix

#546

* better condition !

* champ devenu trop court (suite full utf8)

generait une erreur fatale  : data too long

* comment sondage et sondage

erreur url de retour et bug + indent et condition ternaire

* modification de l'ordre des arguments dans la fonction

- suite à la remise en ordre des argument requis/facultatif imposé désormais par php

* typo

* regex dans requête pour mysql8

Co-Authored-By: Nicolas2 <138593106+nicolas2@users.noreply.github.com>

* regex dans requête pour mysql8 + longueur de champ url dans champs form et controle

Co-Authored-By: Nicolas2 <138593106+nicolas2@users.noreply.github.com>

* missing var

* missing var

* system comment + regexp dans mysql8 + code

epic battle with missing variable regexp and settype  ....

Co-Authored-By: Nicolas2 <129994189+nicolas2dev@users.noreply.github.com>

* clean old $site_font var (global et paramètre de la fonction import_css)

reste à modifier settings .. et le formulaire d'entrée

* clean $site_font

modification du formulaire et remplacer par var $not_used3 dans le conf

* update version 2 => version 3

* no need images

#521 fait pour ces 3 ressources ...
pour le reste les icons forum sont encore utilisés par des metamots ou le core

* typo => Réponse <= Réponse

* php required

* original config file for 16.8

* tarteaucitron : no gtag @start  + year

* tarteaucitron no gtag @ start + ternary condition

* implementation de dataimagetofileurl()

#545

* création du répertoire utilisateur (si n'existe pas) à partir de l'édition du journal utilisateur ...

- la fonction dataimagetofileurl() transforme et classe les images en base64.
dans ce cas précis l'utilisation de cette fonction dans le cadre du journal utilisateur posait un problème (non existence du répertoire) quand l'utilisateur n'avait pas de dossier (créé seulement par l'octroi d'un mns par l'admin) ...

* code : ternary

* bad controle with settype() + remove comment +year

pour eviter : Undefined variable $Mmember

* no need !

- si le template est recopié pour l'écriture d'un nouveau module alors ce module n'apparaitra pas dans la liste des modules ....
- la présence de ce fichier n'est utile que pour les modules du core !!!

* ternary condition + year

* missing check of $cookie

pas de cookie quand c'est un anonyme qui poste un lien == Trying to access array offset on value of type null

* missing $npds_prefix et instruction mysql en majuscule

Co-Authored-By: Nicolas2 <129994189+Nicolas2dev@users.noreply.github.com>

* nettoyage de globales inutiles  ex : $NPDS_Prefix ou manquantes +code

+ year
+ condition ternaire
+ identation

Co-Authored-By: Nicolas2 <129994189+Nicolas2dev@users.noreply.github.com>

* typo on ternary condition

Co-Authored-By: Nicolas2 <129994189+Nicolas2dev@users.noreply.github.com>

* int type in mktime() function +  search term required in search bloc

- mauvais typage des variables dans mktime()
+ terme de recherche requis dans le bloc de recherche (évite qu'un return n'envoi une valeur vide faisant dérailler les requêtes ...)

* year

* prefixe suite + year

les tribulations de $NPDS_Prefix ... and more details

Co-Authored-By: Nicolas2 <129994189+Nicolas2dev@users.noreply.github.com>

* erreur quand variable $dossier non defini + ternary condition

* implémentation bloc des groupes

pour la création d'un bloc avec la liste des groupes (ouvert == avec membre) et un lien de demande de participation aux groupes par les utilisateurs ...

Co-Authored-By: Nicolas2 <129994189+Nicolas2dev@users.noreply.github.com>

* code

- year
- ternary condition
- instruction sql en majuscule

Co-Authored-By: Nicolas2 <129994189+Nicolas2dev@users.noreply.github.com>

* missing $imgtmpPI + code

- year
- ternary condition

* code

 -ternary condition
- clean ...

* forgotten each !!

- int() for mktime()
- code

Co-Authored-By: Nicolas2 <129994189+Nicolas2dev@users.noreply.github.com>

* update

* support PHPMailer

- introduction librairie
- modifications interface settings.php
- modifications code settings_save.php
- ajout d'un fichier de conf indépendant
- de la fonction send_mail()
- traductions

Co-Authored-By: Nicolas2 <129994189+Nicolas2dev@users.noreply.github.com>

* remove strftime +year + remove old class

* fixe une erreur oubliée

set $gr_from to 0 pour éviter une erreur dans un certain contexte (mais je me rappelle plus lequel ...)

* fixe undefined variable

* ternary and undefined variable

* forgotten each ... the last

Co-Authored-By: Nicolas2 <129994189+Nicolas2dev@users.noreply.github.com>

* bad encoding

* some sql_free_result() correction + minor code

Co-Authored-By: Nicolas2 <129994189+Nicolas2dev@users.noreply.github.com>

* no need generate an error ...

* missing .

* no need ! html entities dans le sujet du mail

& remove html entities dans autodoc
& year

* mysql8 bad value in the request ...

== erreur PHP et pas d'entrée dans la base

* code (ternary)

* remove iso support + bug sur selecteur langue et doc type

Co-Authored-By: Nicolas2 <129994189+Nicolas2dev@users.noreply.github.com>

* interface + bug + code

- stabilisation de la cohérence de l'interface (champ obligatoire) lors de la première utilisation (ie quand il n'y a pas de catégories définie)
- ternary condition
- correction affichage des icones des droits dans le tableau  (défaillants à cause de comparaison non adaptée au type de la variable)
- rajout d'une option d'entête dans le select des catégories pour que cela entraine obligatoirement un onchange nécessaire au remplissage de l'input ce qui n'était pas le cas quand on avait une seule catégorie
- rajout droits à tous par défaut
- extension du nombre de car max pour durl (controle du formulaire)

Co-Authored-By: Nicolas2 <129994189+Nicolas2dev@users.noreply.github.com>

* mise à jour

* update small typo

* php8 - clean code -

- correction : fatal erreur lors du vidage des fichiers logs
- year
- ternary
- code remove unused var
- add $adminmail for the sender

Co-Authored-By: Nicolas2 <129994189+Nicolas2dev@users.noreply.github.com>

* bug canonical + code

Co-Authored-By: Nicolas2 <129994189+Nicolas2dev@users.noreply.github.com>

* PHPmailer implémentation

- suppression des options de fonction d'envoi d'email mail() et email()?
- utilisation de la librairie PHPmailer
- avec choix du protocole SMTP(S) ou non
- avec authentification ou non
- avec chiffrage ou non (tls ou ssl)
- rajout d'une variable pour la gestion des pieces jointes
- génération automatique DKIM ou utilisation DKIM serveur
- option debug (non interfacée)
- doc et trad ...

Co-Authored-By: Nicolas2 <129994189+Nicolas2dev@users.noreply.github.com>

* forgotten new $dkim_auto

Co-Authored-By: Nicolas2 <129994189+Nicolas2dev@users.noreply.github.com>

* doc admin log

* fatal typo ...

* path for help file ...

* chemin pour admin help file et requete inutile

- requête de création inutile la table DOIT exister
- global $dbname probablement inutile ici

* old error on sitemap generation

- quand le sitemap.php se déclenchait sur une page de l'admin on avait une erreur (non dysfonctionelle) $PAGES n'était pas là ...

* global pour $PAGES

-  pas sûr à 100% qu'elle soit nécessaire correction en relation avec  commit a5427bc

* metamot obsolète

suppression (en attente d'une éventuelle réécriture)

* year

* spanish manuels update

- html correction (structure, entity)
- nouveau contenu

* html type for email

* french admin manuel work :  contenu et html

* no html stuf for text type  ...

Co-Authored-By: Nicolas2 <129994189+Nicolas2dev@users.noreply.github.com>

* spanish manuels : html + contenu

* manuels german work :  html + contenu

* manuels french work : html + contenu

* manuels english on work : html trad contenu

* manuels german on works : add reseaux sociaux

* add help file + year

* manuel english work : html + trad

* manuels french works : html + contenu

* manuels enqlish works : html

* manuel german work : html + contenu

* manuels chines work : html + trad + contenu

* manuel chinese work : html + contenu

* geoloc doc trad + inclusion dans la navigation manuel ...

* manuels works : html + contenu

* chinese trad in admin

* bloc multilang doit dépendre de l'option multilang

pas de bloc langue quand multilang est désactivé !

Co-Authored-By: Nicolas2 <129994189+Nicolas2dev@users.noreply.github.com>

* manuels all works : html + contenu

mistake : lazzy is not lazy ! ...
contenu : doc + trad de archives stories

* archives stories : support manuel et lang + doc spanish + code undefined var

* doc : manuels metatags

* defaut conf PHPmailer

* metatags and multilang

- rappatriement des fonctions metatags dans metatags.php
- chat need mainfile and $nuke_url
- modification function language_iso()
- fichier meta.php originel

* bug js sur masquage/validation preferences système de messagerie PHPmailer

* modififcation fonction userpopover

- rajout d'un argument qui permet soit d'avoir l'avatar seul soit l'avatar et le popover ... et donc implémentation des avatar dans la fenetre du chat ...

* metamot !login! bug et html

https://labo.infocapagde.com/viewtopic.php?topic=1668&forum=18

* suppression support mysql4 < 5.5

* bug à l'install  bloc note + year + autodoc

la table peu avoir été créée par l'administration des groupes avant l'intall-auto !
donc ...
add IF NOT EXISTS  et  ON DUPLICATE KEY UPDATE
- controle si la table existe
- controle sur l'insert dans la table metalang si la clef def exist alors (-stratagème- ...) on update juste le champ type_meta ...

* marquetapage install.conf : doc + year

* need mainfile pour fonction language_iso() ! (Call to undefined function)

- suite à modif langage / metatag

* need mainfile ...

* doc admin modules

* modules et module_install : code + interface

code :
- prise en compte $npds_prefix dans expression régulière
- suppression support mysql4
- ajout fonction et droit dans la liste des tables modifées

* pas d'affichage lat/long dans user ...

correction empirique incertaine ...(je ne sais toujours pas pourquoi $C7 et $C8 n'arrive pas par sform ...)

* bugs + year

- correction du switch ($op) sur 'ConfigFiles_load' entrainait l'affichage de deux fonctions ...(mais qui était masqué par d'autres erreurs ...)

- still to do :
- éviter le changement des fins de lignes des fichiers visualisés ! qui passent de LF à CRLF (par fopen?)... pénible ...
- optimisation d'écriture du code de la fonction ConfigFiles_save
- pourquoi ne pas passer dans les urls le nom complet du fichier ?....

* geoloc : doc - suppression stamen provider + few trad + be lazy

still to do : mise à jour doc et trad es, de zh .....

* geoloc :  suppression stamen provider + error mysql8 + changement de lib color + html

* more safe ublock !

Co-Authored-By: Nicolas2 <129994189+Nicolas2dev@users.noreply.github.com>

* missing argument dans send_mail + translation of subject as text ...

* ternary + year

* maj + clean + code

- suppression des fonctions inutilisées : getmicrotime() , check_html(), unhtmlentities()
- geolocalisation des ip :
  - modification des conditions
  - rajout d'une possibilité en http
  - rajout d'une clef désormais obligatoire pour extreme-ip-lookup.com
  - to do passer le bloc de code dans un fichier de geoloc ...
- fonction Site_Active() : changement de nom de variable $who_online ??? pour $aff - suppression du -1 pour exclure anonyme dans le total des membres >> passé dans req_stat()
- $NPDS_Prefix still missing dans bloc admin !!!
- ternary condition and code ....

* suppression de getmicrotime() + utilisation de $_SERVER["REQUEST_TIME_FLOAT"] + doc + interface

- dans les metamots debugON et debugOFF
- dans les fichiers devenu inutiles ..
- utilisation de $_SERVER["REQUEST_TIME_FLOAT"] permet de supprimer la demande de temps dans header_before.inc
- add icon sut l'interface
- to do : faudra bien trouver une solution pour activer desactiver ce pseudo-module à partir de l'admin des modules

* rajout  clef extreme-ip-lookup + code et geoloc.conf origine

* code

* geoloc transfert fonction de georeferencement des IP du mainfile vers geoloc_refip + fonction online

fonction online : dysfonctionnement en anonyme of course ... $cookie[1] ...

* code ternary

* isset

* isset

* code no need

* ternary + html + appel news_aff

* code

* clockpicker update

* interface formulaire pour membre/choix groupe

- affichage du choix de groupe que si membre est coché (sinon on a un comportement normal mais déstabilisant) quand on choisi un groupe alors que membre n'est pas coché
- add userpopover
-validation du fromulaire : add required sur topic
- improve : affichage du logo ou du nom dans la prévisualisation

* traduction

* traduction

* clockpicker implementation

* corrections diverses ...

- correction et interface bloc ancien article
- copy_to_email() add argument à send_mail()
- ctrl_aff() : code ...
- news_aff() : still not clear ...
- themepreview() : html

* envoi mail lors d'un commentaire + code

* update

* code + html

* update various

* update install auto

* update upload lang and conf

* year

* maj version licence 2 > 3

* 2024 ...

* Maj BS5.3 ressources et suppressions appel au css.map et js.map

* update bootstrap-icons 1.11

* select content no need

https://labo.infocapagde.com/viewtopic.php?topic=1752&forum=18

* requête en doublon

https: //labo.infocapagde.com/viewtopic.php?topic=1765&forum=18
Co-Authored-By: Nicolas2 <158532428+nicolas2-dev@users.noreply.github.com>

* unused argument

https: //labo.infocapagde.com/viewtopic.php?topic=1761&forum=18
Co-Authored-By: Nicolas2 <158532428+nicolas2-dev@users.noreply.github.com>

* réécriture de la condition ...

https: //labo.infocapagde.com/viewtopic.php?topic=1743&forum=18
Co-Authored-By: Nicolas2 <158532428+nicolas2-dev@users.noreply.github.com>

* pas la bonne variable !!

https: //labo.infocapagde.com/viewtopic.php?topic=1741&forum=18
Co-Authored-By: Nicolas2 <158532428+nicolas2-dev@users.noreply.github.com>

* bad variables pour écriture des logs

https://labo.infocapagde.com/viewtopic.php?topic=1737&forum=18
(...lignes de code probablement héritées de friend.php ...)

Co-Authored-By: Nicolas2 <158532428+nicolas2-dev@users.noreply.github.com>

* no need

https: //labo.infocapagde.com/viewtopic.php?topic=1735&forum=18
Co-Authored-By: Nicolas2 <158532428+nicolas2-dev@users.noreply.github.com>

* Update install-fr.php

* conflict

* no need

---------

Co-authored-by: Nicolas2 <138593106+nicolas2@users.noreply.github.com>
Co-authored-by: Nicolas2 <129994189+nicolas2dev@users.noreply.github.com>
Co-authored-by: Nicolas2 <158532428+nicolas2-dev@users.noreply.github.com>
  • Loading branch information
4 people authored May 3, 2024
1 parent eb6370b commit d6506f2
Show file tree
Hide file tree
Showing 773 changed files with 66,824 additions and 25,716 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Ses points forts : sa richesse fonctionnelle, sa sécurité, sa rapidité, sa fa

## Required
un serveur (local ou distant : Lamp, Wamp ...) avec
- php >= 5.6
- php >= 7
- mysql >= 5.5.3
- une base de donnée existante

Expand Down
8 changes: 4 additions & 4 deletions revolution_16/abla.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
/* */
/* Based on PhpNuke 4.x source code */
/* */
/* NPDS Copyright (c) 2002-2020 by Philippe Brunier */
/* NPDS Copyright (c) 2002-2024 by Philippe Brunier */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/* the Free Software Foundation; either version 3 of the License. */
/************************************************************************/
if (!stristr($_SERVER['PHP_SELF'],'admin.php'))
include("admin/die.php");
Expand All @@ -24,7 +24,7 @@
admindroits($aid,$f_meta_nom);
//<== controle droit
global $language;
$hlpfile = '';
$hlpfile = '/manuels/'.$language.'/abla.html';

global $admin;
if ($admin) {
Expand Down Expand Up @@ -244,4 +244,4 @@
adminfoot('','','','');
} else
redirect_url("index.php");
?>
?>
31 changes: 20 additions & 11 deletions revolution_16/admin.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
/* =========================== */
/* */
/* */
/* NPDS Copyright (c) 2002-2022 by Philippe Brunier */
/* NPDS Copyright (c) 2002-2024 by Philippe Brunier */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/* the Free Software Foundation; either version 3 of the License. */
/************************************************************************/

if (!function_exists("Mysql_Connexion"))
Expand Down Expand Up @@ -194,11 +194,22 @@ function GraphicAdmin($hlpfile) {
sql_num_rows(sql_query("SELECT * FROM ".$NPDS_Prefix."seccont_tempo")):
sql_num_rows(sql_query("SELECT * FROM ".$NPDS_Prefix."seccont_tempo WHERE author='$aid'"));
if($newpubli) sql_query("UPDATE ".$NPDS_Prefix."fonctions SET fetat='1',fretour='".$newpubli."', fretour_h='".adm_translate("Publication(s) en attente de validation")."' WHERE fid='50'"); else sql_query("UPDATE ".$NPDS_Prefix."fonctions SET fetat='0',fretour='0' WHERE fid='50'");
//utilisateur(s) en attente de groupe
$directory = "users_private/groupe";
$iterator = new DirectoryIterator($directory);
$j=0;
foreach ($iterator as $fileinfo) {
if ($fileinfo->isFile() and strpos($fileinfo->getFilename(),'ask4group') !== false)
$j++;
}
if($j>0)
sql_query("UPDATE ".$NPDS_Prefix."fonctions SET fetat='1',fretour='".$j."',fretour_h='".adm_translate("Utilisateur en attente de groupe !")."' WHERE fid='46'");
else
sql_query("UPDATE ".$NPDS_Prefix."fonctions SET fetat='0',fretour='0' WHERE fid='46'");
//<== etc...etc recupérations des états des fonctions d'ALERTE et maj

//==> Pour les modules installés produisant des notifications

$alert_modules=sql_query("SELECT * FROM fonctions f LEFT JOIN modules m ON m.mnom = f.fnom WHERE m.minstall=1 AND fcategorie=9");
$alert_modules=sql_query("SELECT * FROM ".$NPDS_Prefix."fonctions f LEFT JOIN ".$NPDS_Prefix."modules m ON m.mnom = f.fnom WHERE m.minstall=1 AND fcategorie=9");
if($alert_modules) {
while($am=sql_fetch_array($alert_modules)) {
include("modules/".$am['fnom']."/admin/adm_alertes.php");
Expand All @@ -216,16 +227,13 @@ function GraphicAdmin($hlpfile) {
}
}
}

//<== Pour les modules installés produisant des notifications

//==> construction des blocs menu : selection de fonctions actives ayant une interface graphique de premier niveau et dont l'administrateur connecté en posséde les droits d'accès
// on prend tout ce qui a une interface
if ($Q['radminsuper']==1)
$R = sql_query("SELECT * FROM ".$NPDS_Prefix."fonctions f WHERE f.finterface =1 AND f.fetat != '0' ORDER BY f.fcategorie, f.fordre");
else
$R = sql_query("SELECT * FROM ".$NPDS_Prefix."fonctions f LEFT JOIN droits d ON f.fdroits1 = d.d_fon_fid LEFT JOIN authors a ON d.d_aut_aid =a.aid WHERE f.finterface =1 AND fetat!=0 AND d.d_aut_aid='$aid' AND d.d_droits REGEXP'^1' ORDER BY f.fcategorie, f.fordre");

$R = $Q['radminsuper']==1 ?
sql_query("SELECT * FROM ".$NPDS_Prefix."fonctions f WHERE f.finterface =1 AND f.fetat != '0' ORDER BY f.fcategorie, f.fordre") :
sql_query("SELECT * FROM ".$NPDS_Prefix."fonctions f LEFT JOIN ".$NPDS_Prefix."droits d ON f.fdroits1 = d.d_fon_fid LEFT JOIN ".$NPDS_Prefix."authors a ON d.d_aut_aid =a.aid WHERE f.finterface =1 AND fetat!=0 AND d.d_aut_aid='$aid' AND d.d_droits REGEXP'^1' ORDER BY f.fcategorie, f.fordre") ;
$j=0;

while($SAQ=sql_fetch_assoc($R)) {
Expand Down Expand Up @@ -282,7 +290,7 @@ function GraphicAdmin($hlpfile) {
$li_c .='</a></li>';
$ul_f='';
if ($j!==0)
$ul_f ='
$ul_f ='
</ul>
<script type="text/javascript">
//<![CDATA[
Expand Down Expand Up @@ -1224,6 +1232,7 @@ function adminMain($deja_affiches) {
case 'groupe_mns_delete':
case 'groupe_chat_create':
case 'groupe_chat_delete':
case 'groupe_member_ask':
include('admin/groupes.php');
break;
// NPDS-Instal-Modules
Expand Down
2 changes: 1 addition & 1 deletion revolution_16/admin/adminblock.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/* the Free Software Foundation; either version 3 of the License. */
/************************************************************************/

if (!function_exists('admindroits'))
Expand Down
131 changes: 63 additions & 68 deletions revolution_16/admin/adminedito.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
/* */
/* Manage the EDITO (static/edito.txt) of your web site */
/* */
/* NPDS Copyright (c) 2002-2022 by Philippe Brunier */
/* NPDS Copyright (c) 2002-2023 by Philippe Brunier */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/* the Free Software Foundation; either version 3 of the License. */
/************************************************************************/
if (!function_exists('admindroits'))
include('die.php');
Expand All @@ -18,7 +18,7 @@
//==> controle droit
admindroits($aid,$f_meta_nom);
//<== controle droit
global $language, $NPDS_Prefix;
global $language;
$hlpfile = "manuels/$language/edito.html";

function edito($edito_type, $contents, $Xaff_jours, $Xaff_jour, $Xaff_nuit) {
Expand All @@ -44,11 +44,10 @@ function edito($edito_type, $contents, $Xaff_jours, $Xaff_jour, $Xaff_nuit) {
adminfoot('','','','');

} else {
if ($edito_type=='G') {
if ($edito_type=='G')
$edito_typeL=' '.adm_translate("Anonyme");
} elseif ($edito_type=='M') {
elseif ($edito_type=='M')
$edito_typeL=' '.adm_translate("Membre");;
}
if (strpos($contents,'[/jour]')>0) {
$contentJ=substr($contents,strpos($contents,'[jour]')+6,strpos($contents,'[/jour]')-6);
$contentN=substr($contents,strpos($contents,'[nuit]')+6,strpos($contents,'[/nuit]')-19-strlen($contentJ));
Expand Down Expand Up @@ -125,77 +124,73 @@ function edito($edito_type, $contents, $Xaff_jours, $Xaff_jour, $Xaff_nuit) {
}
}
},
';
adminfoot('fv',$fv_parametres,$arg1,'');
}
}

function edito_mod_save($edito_type, $XeditoJ, $XeditoN, $aff_jours, $aff_jour, $aff_nuit) {
if ($aff_jours<=0) {$aff_jours='999';}
if ($edito_type=='G') {
$fp=fopen("static/edito.txt","w");
fputs($fp,"[jour]".str_replace('&quot;','"',stripslashes($XeditoJ)).'[/jour][nuit]'.str_replace('&quot;','"',stripslashes($XeditoN)).'[/nuit]');
fputs($fp,'aff_jours='.$aff_jours);
fputs($fp,'&aff_jour='.$aff_jour);
fputs($fp,'&aff_nuit='.$aff_nuit);
fputs($fp,'&aff_date='.time());
fclose($fp);
} elseif ($edito_type=='M') {
$fp=fopen('static/edito_membres.txt','w');
fputs($fp,'[jour]'.str_replace('&quot;','"',stripslashes($XeditoJ)).'[/jour][nuit]'.str_replace('&quot;','"',stripslashes($XeditoN)).'[/nuit]');
fputs($fp,'aff_jours='.$aff_jours);
fputs($fp,'&aff_jour='.$aff_jour);
fputs($fp,'&aff_nuit='.$aff_nuit);
fputs($fp,'&aff_date='.time());
fclose($fp);
}
global $aid; Ecr_Log('security', "editoSave () by AID : $aid", '');
if ($aff_jours<=0) {$aff_jours='999';}
if ($edito_type=='G') {
$fp=fopen("static/edito.txt","w");
fputs($fp,"[jour]".str_replace('&quot;','"',stripslashes($XeditoJ)).'[/jour][nuit]'.str_replace('&quot;','"',stripslashes($XeditoN)).'[/nuit]');
fputs($fp,'aff_jours='.$aff_jours);
fputs($fp,'&aff_jour='.$aff_jour);
fputs($fp,'&aff_nuit='.$aff_nuit);
fputs($fp,'&aff_date='.time());
fclose($fp);
} elseif ($edito_type=='M') {
$fp=fopen('static/edito_membres.txt','w');
fputs($fp,'[jour]'.str_replace('&quot;','"',stripslashes($XeditoJ)).'[/jour][nuit]'.str_replace('&quot;','"',stripslashes($XeditoN)).'[/nuit]');
fputs($fp,'aff_jours='.$aff_jours);
fputs($fp,'&aff_jour='.$aff_jour);
fputs($fp,'&aff_nuit='.$aff_nuit);
fputs($fp,'&aff_date='.time());
fclose($fp);
}
global $aid; Ecr_Log('security', "editoSave () by AID : $aid", '');

redirect_url('admin.php?op=Edito');
redirect_url('admin.php?op=Edito');
}

switch ($op) {
case 'Edito_save':
edito_mod_save($edito_type, $XeditoJ, $XeditoN, $aff_jours, $aff_jour, $aff_nuit);
break;

case 'Edito_load':
if ($edito_type=='G') {
if (file_exists('static/edito.txt')) {
$fp=fopen('static/edito.txt','r');
if (filesize('static/edito.txt')>0)
$Xcontents=fread($fp,filesize('static/edito.txt'));
fclose($fp);
}
} elseif ($edito_type=='M') {
if (file_exists('static/edito_membres.txt')) {
$fp=fopen('static/edito_membres.txt','r');
if (filesize('static/edito_membres.txt')>0)
$Xcontents=fread($fp,filesize('static/edito_membres.txt'));
fclose($fp);
}
}
$Xcontents=preg_replace('#<!--|/-->#', '', $Xcontents);
if ($Xcontents=='') {
$Xcontents='Edito ...';
} else {
$ibid=strstr($Xcontents,'aff_jours');
parse_str($ibid,$Xibidout);
}
if ($Xibidout['aff_jours']) {
$Xcontents=substr($Xcontents,0,strpos($Xcontents,'aff_jours'));
} else {
$Xibidout['aff_jours']=20;
$Xibidout['aff_jour']='checked="checked"';
$Xibidout['aff_nuit']='checked="checked"';
}
edito($edito_type, $Xcontents, $Xibidout['aff_jours'], $Xibidout['aff_jour'], $Xibidout['aff_nuit']);
break;
default:
edito('','','','','');
break;
case 'Edito_save':
edito_mod_save($edito_type, $XeditoJ, $XeditoN, $aff_jours, $aff_jour, $aff_nuit);
break;
case 'Edito_load':
if ($edito_type=='G') {
if (file_exists('static/edito.txt')) {
$fp=fopen('static/edito.txt','r');
if (filesize('static/edito.txt')>0)
$Xcontents=fread($fp,filesize('static/edito.txt'));
fclose($fp);
}
} elseif ($edito_type=='M') {
if (file_exists('static/edito_membres.txt')) {
$fp=fopen('static/edito_membres.txt','r');
if (filesize('static/edito_membres.txt')>0)
$Xcontents=fread($fp,filesize('static/edito_membres.txt'));
fclose($fp);
}
}
$Xcontents=preg_replace('#<!--|/-->#', '', $Xcontents);
if ($Xcontents=='')
$Xcontents='Edito ...';
else {
$ibid=strstr($Xcontents,'aff_jours');
parse_str($ibid,$Xibidout);
}
if ($Xibidout['aff_jours'])
$Xcontents=substr($Xcontents,0,strpos($Xcontents,'aff_jours'));
else {
$Xibidout['aff_jours']=20;
$Xibidout['aff_jour']='checked="checked"';
$Xibidout['aff_nuit']='checked="checked"';
}
edito($edito_type, $Xcontents, $Xibidout['aff_jours'], $Xibidout['aff_jour'], $Xibidout['aff_nuit']);
break;
default:
edito('','','','','');
break;
}
?>
8 changes: 4 additions & 4 deletions revolution_16/admin/adminfaq.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
/* */
/* Based on PhpNuke 4.x source code */
/* */
/* NPDS Copyright (c) 2002-2022 by Philippe Brunier */
/* NPDS Copyright (c) 2002-2023 by Philippe Brunier */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/* the Free Software Foundation; either version 3 of the License. */
/************************************************************************/

if (!function_exists('admindroits'))
Expand All @@ -19,7 +19,7 @@
//==> controle droit
admindroits($aid,$f_meta_nom);
//<== controle droit
global $language, $adminimg, $admf_ext;
global $language;
$hlpfile = "manuels/$language/faqs.html";

function FaqAdmin() {
Expand Down Expand Up @@ -205,7 +205,7 @@ function FaqCatGoEdit($id) {
<h4>'.adm_translate("Prévisualiser").'</h4>';
echo'
<label class="col-form-label" for="">'
.aff_local_langue(adm_translate("Langue de Prévisualisation"),'','local_user_language').'
.aff_local_langue('','local_user_language',adm_translate("Langue de Prévisualisation")).'
</label>
<div class="card card-body mb-3">
<p>'.preview_local_langue($local_user_language, $question).'</p>';
Expand Down
9 changes: 6 additions & 3 deletions revolution_16/admin/authors.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/* the Free Software Foundation; either version 3 of the License. */
/************************************************************************/

if (!function_exists('admindroits'))
Expand Down Expand Up @@ -491,10 +491,13 @@ function error_handler($ibid) {
modifyadmin($chng_aid);
break;
case 'UpdateAuthor':
settype( $chng_radminsuper,'string');
settype( $chng_radminsuper,'int');
settype( $ad_d_27,'int');
updateadmin($chng_aid, $chng_name, $chng_email, $chng_url, $chng_radminsuper, $chng_pwd, $chng_pwd2, $ad_d_27, $old_pwd);
break;
case 'AddAuthor':
settype( $add_radminsuper,'int');

if (!($add_aid && $add_name && $add_email && $add_pwd)) {
global $hlpfile;
include("header.php");
Expand Down Expand Up @@ -522,7 +525,7 @@ function error_handler($ibid) {
$result = sql_query("INSERT INTO ".$NPDS_Prefix."authors VALUES ('$add_aid', '$add_name', '$add_url', '$add_email', '$add_pwdX', '1', '0', '$add_radminsuper')");
updatedroits($add_aid);
// Copie du fichier pour filemanager
if ($add_radminsuper or $ad_d_27 !='')
if ($add_radminsuper or isset($ad_d_27)) // $ad_d_27 pas là ?
@copy("modules/f-manager/users/modele.admin.conf.php","modules/f-manager/users/".strtolower($add_aid).".conf.php");
global $aid; Ecr_Log('security', "AddAuthor($add_aid) by AID : $aid", '');
Header("Location: admin.php?op=mod_authors");
Expand Down
Loading

0 comments on commit d6506f2

Please sign in to comment.