lgro...@hephaestos.ovh.adullact.org
unread,Nov 20, 2020, 11:33:50 AM11/20/20Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to openmairie...@googlegroups.com
Author: lgroleau
Date: 2020-11-20 17:33:48 +0100 (Fri, 20 Nov 2020)
New Revision: 4666
Modified:
openmairie_exemple/branches/4.9-extras/HISTORY.txt
openmairie_exemple/branches/4.9-extras/core/om_application.class.php
openmairie_exemple/branches/4.9-extras/core/om_version.inc.php
Log:
version 1.0.9
Modified: openmairie_exemple/branches/4.9-extras/HISTORY.txt
===================================================================
--- openmairie_exemple/branches/4.9-extras/HISTORY.txt 2020-11-20 15:51:53 UTC (rev 4665)
+++ openmairie_exemple/branches/4.9-extras/HISTORY.txt 2020-11-20 16:33:48 UTC (rev 4666)
@@ -7,8 +7,14 @@
-ajouter à dbForm les méthodes pour afficher un tableau de valeurs avec une action par ligne simple et flexible (idem OEM)
-ajouter le widget snapshot d'openMarchéForain
-
+
+1.0.9 (20/11/2020)
+------------------
+* Adaptation : la sécurisation du cookie de session est paramétrable à part dans dyn/config.inc.php, pour le cas où la couche SSL est assurée par un frontal web
+
+* Correction : la redirection https ne pouvait pas être mofifiée par le fichier dyn/config.inc.php
+
1.0.8 (20/11/2020)
------------------
Modified: openmairie_exemple/branches/4.9-extras/core/om_application.class.php
===================================================================
--- openmairie_exemple/branches/4.9-extras/core/om_application.class.php 2020-11-20 15:51:53 UTC (rev 4665)
+++ openmairie_exemple/branches/4.9-extras/core/om_application.class.php 2020-11-20 16:33:48 UTC (rev 4666)
@@ -597,15 +597,6 @@
// Logger
$this->addToLog(__METHOD__."()", VERBOSE_MODE);
- // redirection HTTPS si https obligatoire
- if ( ( $this->get_https_mandatory() === true )
- && (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] === "off") ) {
- $location = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
- header('HTTP/1.1 301 Moved Permanently');
- header('Location: ' . $location);
- exit;
- }
-
// XXX Faire la gestion correcte du paramétrage du layout
$this->layout = new layout("jqueryui");
if (!is_null($this->layout->error)) {
@@ -621,6 +612,15 @@
$this->setTitle($title);
$this->setRight($right);
+ // redirection HTTPS si https obligatoire
+ if ( ( $this->get_https_mandatory() === true )
+ && (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] === "off") ) {
+ $location = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
+ header('HTTP/1.1 301 Moved Permanently');
+ header('Location: ' . $location);
+ exit;
+ }
+
// Pour les connexions anonymes
if ($this->flag == "anonym") {
//
@@ -1089,7 +1089,7 @@
"lifetime" => $this->get_session_lifetime(),
"path" => "/" ,
"domain" => "",
- "secure" => $this->get_https_mandatory(),
+ "secure" => $this->get_secure_cookie(),
"httponly" => true,
"samesite" => "Strict", // Strict | Lax
);
@@ -1106,7 +1106,7 @@
}
// rappel de la session en mode "sans échec"
- @session_start();
+ @session_start();
// Regénération de l'indentifiant de session pour sécurisation
//
@@ -3514,8 +3514,8 @@
// comme attribut de om_application (framework) ou de utils (application).
$session_name = $this->_session_name;
}
- // Si on est en mode https obligatoire
- if ( $this->get_https_mandatory() === true ) {
+ // Si on est en mode secure_cookie
+ if ( $this->get_secure_cookie() === true ) {
// si le préfixe du cookie n'est pas déjà __Host- ou __Secure-
if ( ( substr($session_name, 0, 7) != "__Host-" )
|| ( substr($session_name, 0, 9) != "__Secure-" ) ) {
@@ -3566,6 +3566,13 @@
* @var mixed Configuration niveau framework.
*/
protected $_https_mandatory = false;
+
+ /**
+ * Gestion du mode secure cookie
+ *
+ * @var mixed Configuration niveau framework.
+ */
+ protected $_secure_cookie = false;
/**
* Gestion du mode HTTPS obligatoire
@@ -3590,6 +3597,28 @@
}
/**
+ * Gestion du mode Cookie sécurisé
+ *
+ * L'objectif ici est d'avoir trois niveaux de configuration pour cet élément :
+ * framework, application et instance. Voici l'ordre de préférence si les trois
+ * niveaux sont configurés : instance > application > framework.
+ *
+ *
+ * @return mixed
+ */
+ function get_secure_cookie() {
+ // On récupère le paramètre depuis la configuration, si la valeur n'est
+ // pas nulle cela signifie qu'une configuration instance a été spécifiée
+ // par config.inc.php (et pas par om_parametre pas encore lue)
+ if ($this->getParameter("secure_cookie") !== null) {
+ return $this->getParameter("secure_cookie");
+ }
+ // On retourne ici la configuration framework ou application spécifiée
+ // comme attribut de om_application (framework) ou de utils (application).
+ return $this->_secure_cookie;
+ }
+
+ /**
* Gestion du mode de gestion des permissions.
*
* @var mixed Configuration niveau framework.
Property changes on: openmairie_exemple/branches/4.9-extras/core/om_application.class.php
___________________________________________________________________
Added: svn:mergeinfo
## -0,0 +1,68 ##
+/openmairie_exemple/branches/4.5.0-optimisation-des-tests/core/om_application.class.php:3474-3498
+/openmairie_exemple/branches/4.6.x/core/om_application.class.php:3733-3820
+/openmairie_exemple/branches/4.7.0/core/om_application.class.php:3870-4098
+/openmairie_exemple/branches/4.7.0-om_rest_client/core/om_application.class.php:3971-4011
+/openmairie_exemple/branches/4.8.0-develop/core/om_application.class.php:4114-4184
+/openmairie_exemple/branches/4.9.0-develop/core/om_application.class.php:4191-4347
+/openmairie_exemple/branches/4.9.0-develop-prop0050-remove-idz/core/om_application.class.php:4196-4223
+/openmairie_exemple/branches/4.9.0-develop-prop0051-condition-om_dbform-exists/core/om_application.class.php:4198-4230
+/openmairie_exemple/branches/4.9.0-develop-prop0052-include-sql-inc-not-mandatory/core/om_application.class.php:4214-4246
+/openmairie_exemple/branches/4.9.0-develop-prop0053-gen-om_tables-in-core/core/om_application.class.php:4216-4254
+/openmairie_exemple/branches/4.9.0-develop-prop0054-move-simple-search-in-advs/core/om_application.class.php:4217-4237
+/openmairie_exemple/branches/4.9.0-develop-prop0055-new-ldap-authentication-mode/core/om_application.class.php:4226-4260
+/openmairie_exemple/branches/470-bug-replace-databaseiserror-isdatabaseerror/core/om_application.class.php:3872-3878
+/openmairie_exemple/branches/bug-8929-autocomplete-onchange-non-declenche/core/om_application.class.php:3985-3988
+/openmairie_exemple/branches/bug-dbform-supprimer-database-iserror/core/om_application.class.php:3866-3867
+/openmairie_exemple/branches/bug_reqmo_champs_en_double_formulaire/core/om_application.class.php:3962-3964
+/openmairie_exemple/branches/compatibilite_php7/core/om_application.class.php:3627-3713
+/openmairie_exemple/branches/dbform-initialisation-val-en-mode-ajout/core/om_application.class.php:3547-3552
+/openmairie_exemple/branches/export_csv/core/om_application.class.php:3508-3523
+/openmairie_exemple/branches/gen_doc_rf/core/om_application.class.php:3556-3557
+/openmairie_exemple/branches/inversion_controle_permissions/core/om_application.class.php:3699-3727
+/openmairie_exemple/branches/om-tests_local_mailhost/core/om_application.class.php:3694-3714
+/openmairie_exemple/branches/poc-remove-genaff/core/om_application.class.php:3939-3982
+/openmairie_exemple/branches/prop-0029-rendre-optionnelles-les-surcharges-des-classes-du-framework-dans-obj/core/om_application.class.php:3949-3954
+/openmairie_exemple/branches/prop0001-remove-pdf-folder/core/om_application.class.php:3701-3749
+/openmairie_exemple/branches/prop0002-remove-unused-ico-and-help/core/om_application.class.php:3702-3774
+/openmairie_exemple/branches/prop0003-remove-tab-actions-href/core/om_application.class.php:3703-3772
+/openmairie_exemple/branches/prop0004-tests_local_mailhost/core/om_application.class.php:3715-3796
+/openmairie_exemple/branches/prop0005-compatibilite-php7/core/om_application.class.php:3714-3744
+/openmairie_exemple/branches/prop0006-ameliorer-l-ergonomie/core/om_application.class.php:3980-4028
+/openmairie_exemple/branches/prop0007-widget-list/core/om_application.class.php:3709-3747
+/openmairie_exemple/branches/prop0009-remove-deprecated-scripts-in-scr-folder/core/om_application.class.php:3723-3770
+/openmairie_exemple/branches/prop0014-phpmailer-upgrade/core/om_application.class.php:3735-3801
+/openmairie_exemple/branches/prop0016_pdf_default_zoom_real/core/om_application.class.php:3760-4022
+/openmairie_exemple/branches/prop0018-remove-adressepostale/core/om_application.class.php:3834-3914
+/openmairie_exemple/branches/prop0019-remove-combobba/core/om_application.class.php:3835-3912
+/openmairie_exemple/branches/prop0020-remove-maincss/core/om_application.class.php:3836-3908
+/openmairie_exemple/branches/prop0021-remove-layoutjquerymobileaftercss/core/om_application.class.php:3840-3910
+/openmairie_exemple/branches/prop0025_correction_tinymce/core/om_application.class.php:3863-3864
+/openmairie_exemple/branches/prop0026-fiabiliser-perenniser-le-module-sig/core/om_application.class.php:3957-4031
+/openmairie_exemple/branches/prop0028_champs_fusion_spec_edition/core/om_application.class.php:4071-4073
+/openmairie_exemple/branches/prop0029-rendre-optionnelles-les-surcharges-des-classes-du-framework-dans-obj/core/om_application.class.php:3955-4044
+/openmairie_exemple/branches/prop0030-factoriser-du-code-en-creant-la-classe-om_base/core/om_application.class.php:3956-4040
+/openmairie_exemple/branches/prop0031-supprimer-la-fonction-genaff/core/om_application.class.php:3983-4037
+/openmairie_exemple/branches/prop0036_invalid_credential_verbose_mode/core/om_application.class.php:4061-4093
+/openmairie_exemple/branches/prop0037_invalid_credential_verbose_mode/core/om_application.class.php:4094-4148
+/openmairie_exemple/branches/prop0040-improve_custom_and_remove_mandatory_cascade_obj_core_gen/core/om_application.class.php:4116-4131
+/openmairie_exemple/branches/prop0041-remove_forminc_files/core/om_application.class.php:4117-4128
+/openmairie_exemple/branches/prop0042-rewrite_widget_autocomplete/core/om_application.class.php:4118-4141
+/openmairie_exemple/branches/prop0043-rewrite_post_get_vars/core/om_application.class.php:4119-4168
+/openmairie_exemple/branches/prop0044-add_button_before_form/core/om_application.class.php:4120-4163
+/openmairie_exemple/branches/prop0045-simplify_form_button_label/core/om_application.class.php:4121-4134
+/openmairie_exemple/branches/prop0073-gestion_session/core/om_application.class.php:4665
+/openmairie_exemple/branches/prop0074-configuration_header_http/core/om_application.class.php:4652,4657,4661
+/openmairie_exemple/branches/tab_actions/core/om_application.class.php:3641-3648
+/openmairie_exemple/branches/tests-frameworkopenmairie-coverage--bug--testsuite-login-open-too-much-browsers/core/om_application.class.php:3786-3792
+/openmairie_exemple/branches/tests-frameworkopenmairie-utility--bug--run-test-script-without-return/core/om_application.class.php:3785-3790
+/openmairie_exemple/branches/ticket_8830_appels_preparemulticell/core/om_application.class.php:3832-3847
+/openmairie_exemple/branches/trunk-bug-8891-registres-css-js/core/om_application.class.php:3902
+/openmairie_exemple/branches/trunk_bug_direct_link/core/om_application.class.php:3881-3906
+/openmairie_exemple/branches/trunk_bug_fermeture_tinymce/core/om_application.class.php:3865-3918
+/openmairie_exemple/branches/trunk_bug_reqmo_filtre/core/om_application.class.php:3960-3968
+/openmairie_exemple/branches/undofiletransaction/core/om_application.class.php:3677-3679
+/openmairie_exemple/branches/upgrade_db_pear_php7/core/om_application.class.php:3625-3626
+/openmairie_exemple/tags/4.5.1/core/om_application.class.php:3731-3759
+/openmairie_exemple/tags/4.6.3/core/om_application.class.php:3997-4060
+/openmairie_exemple/trunk/core/om_application.class.php:4593-4628
+/openmairie_exemple/trunk-bug-8891-registres-css-js/core/om_application.class.php:3900-3901
\ No newline at end of property
Modified: openmairie_exemple/branches/4.9-extras/core/om_version.inc.php
===================================================================
--- openmairie_exemple/branches/4.9-extras/core/om_version.inc.php 2020-11-20 15:51:53 UTC (rev 4665)
+++ openmairie_exemple/branches/4.9-extras/core/om_version.inc.php 2020-11-20 16:33:48 UTC (rev 4666)
@@ -9,4 +9,4 @@
/**
*
*/
-$version = "4.9.8-extra-1.0.8";
+$version = "4.9.8-extra-1.0.9";