mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-24 02:49:07 +01:00
Compare commits
No commits in common. "05519c543276f8f06d24628d29598b75f40c732f" and "fa5b5ceb6d12999c22c34ec0137ea9f333f5898b" have entirely different histories.
05519c5432
...
fa5b5ceb6d
6 changed files with 24 additions and 136 deletions
|
@ -18,11 +18,7 @@
|
|||
<citetitle>Structure</citetitle>...
|
||||
<![CDATA['ldap_options' => array (
|
||||
'timestamp' => [Booléen], // Si la date est stockée au format timestamp
|
||||
'formats' => array(
|
||||
'[Format de stockage principal]', // Par défaut : "YmdHisO"
|
||||
'[Formats de stockage alternatifs]', // Par défaut : "YmdHis.vO" & "YmdHis.uO"
|
||||
[...]
|
||||
),
|
||||
'format' => '[Format de stockage]', // Default : "YmdHisO"
|
||||
'timezone' => '[Fuseau horaire]', // Default : "UTC"
|
||||
),]]>
|
||||
...
|
||||
|
@ -43,30 +39,26 @@
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>formats</term>
|
||||
<term>format</term>
|
||||
<listitem>
|
||||
<para>Formats de stockage de la date dans l'annuaire. Ces formats sont composés à
|
||||
<para>Format de stockage de la date dans l'annuaire. Ce format est composé à
|
||||
partir des motifs clés gérés par la fonction <function>date()</function>
|
||||
de &php;. Pour plus d'information, consulter
|
||||
<ulink url='http://www.php.net/date'>la documentation officielle</ulink>. Plusieurs
|
||||
formats peuvent être définis, mais en cas de stockage d'une nouvelle valeur, se sera
|
||||
le premier format défini qui sera utilisé.
|
||||
<note><simpara>La valeur par défaut est <emphasis>["YmdHisO", "YmdHis.vO", "YmdHis.uO"]</emphasis>,
|
||||
correspondant à la syntaxe <literal>Generalized Time</literal> (sans et avec les milli-secondes
|
||||
ou micro-secondes) telle que définie dans la
|
||||
<ulink url='http://www.php.net/date'>la documentation officielle</ulink>.
|
||||
<note><simpara>La valeur par défaut est <emphasis>YmdHisO</emphasis>,
|
||||
correspondant à la syntaxe <literal>Generalized Time</literal> (sans les
|
||||
micro-secondes) telle que définie dans la
|
||||
<ulink url='https://tools.ietf.org/html/rfc4517'>RFC4517</ulink>. Exemples :
|
||||
<literal>20091206230506Z</literal>
|
||||
<emphasis>(=2009/12/06 23:05:66 UTC)</emphasis>,
|
||||
<emphasis>(=2009/12/06 23:05:66 UTC)</emphasis> ou
|
||||
<literal>20190613143537+0200</literal>
|
||||
<emphasis>(=2019/06/13 14:35:37 UTC+0200)</emphasis> ou
|
||||
<literal>20230818121005.307+0200</literal>
|
||||
<emphasis>(=2023/08/18 12:10:05.307 UTC+0200)</emphasis>.</simpara></note>
|
||||
<emphasis>(=2019/06/13 14:35:37 UTC+0200)</emphasis>.</simpara></note>
|
||||
<warning><simpara>Si vous exploitez un attribut stockant une date incluant les
|
||||
milli-secondes ou les micro-secondes, ce type d'attribut LDAP sera capable de gérer
|
||||
l'interpratation des valeurs stockées, en outre le type d'attribut &LSattr_html_date;,
|
||||
s'appuyant sur les méthodes standards <literal>strftime()</literal> et
|
||||
<literal>strptime()</literal>, ne permettra pas aujourd'hui leur saisie et affichage.
|
||||
</simpara></warning>
|
||||
micro-secondes, ce type d'attribut LDAP sera capable de gérer l'interpratation des
|
||||
valeurs stockées en configurant le format <literal>YmdHis.uO</literal>. En outre,
|
||||
le type d'attribut &LSattr_html_date;, s'appuyant sur les méthodes standards
|
||||
<literal>strftime()</literal> et <literal>strptime()</literal>, ne permettra pas
|
||||
aujourd'hui la saisie et l'affichage des millisecondes.</simpara></warning>
|
||||
</para>
|
||||
|
||||
</listitem>
|
||||
|
|
|
@ -148,12 +148,6 @@ $GLOBALS['supannNomenclatures'] = array (
|
|||
'SupannVerrouAdministratif' => ___('Account locked for administrative reasons (account suspension, charter abuse, etc.)'),
|
||||
'SupannVerrouTechnique' => ___("Account locked for a technical reason (detection of a namesake, suspicion of a hacked account, etc.)"),
|
||||
),
|
||||
'cmsIdTechnologie' => array(
|
||||
'MIFARE:XLSB' => "Mifare (XLSB)",
|
||||
'MIFARE:XMSB' => "Mifare (XMSB)",
|
||||
'MIFARE:DLSB' => "Mifare (DLSB)",
|
||||
'MIFARE:DMSB' => "Mifare (DMSB)",
|
||||
),
|
||||
),
|
||||
'eduPerson' => array(
|
||||
'affiliation' => array (
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
<?php
|
||||
/*******************************************************************************
|
||||
* Copyright (C) 2021 Easter-eggs
|
||||
* https://ldapsaisie.org
|
||||
*
|
||||
* Author: See AUTHORS file in top-level directory.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License version 2
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
/**
|
||||
* Type d'attribut HTML supannCMSIdEtiquette
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*/
|
||||
class LSattr_html_supannCMSIdEtiquette extends LSattr_html {
|
||||
|
||||
var $LSformElement_type = 'supannCMSIdEtiquette';
|
||||
|
||||
}
|
|
@ -40,12 +40,9 @@ class LSattr_ldap_date extends LSattr_ldap {
|
|||
}
|
||||
$retval=array();
|
||||
foreach($data as $val) {
|
||||
foreach($this -> getFormats() as $format) {
|
||||
$datetime = date_create_from_format($format, $val);
|
||||
if ($datetime instanceof DateTime) {
|
||||
$retval[] = $datetime -> format('U');
|
||||
break;
|
||||
}
|
||||
$datetime = date_create_from_format($this -> getFormat(), $val);
|
||||
if ($datetime instanceof DateTime) {
|
||||
$retval[] = $datetime -> format('U');
|
||||
}
|
||||
}
|
||||
return $retval;
|
||||
|
@ -68,7 +65,7 @@ class LSattr_ldap_date extends LSattr_ldap {
|
|||
foreach($data as $val) {
|
||||
$datetime = date_create("@$val");
|
||||
$datetime -> setTimezone($timezone);
|
||||
$datetime_string = $datetime -> format($this -> getFormats(true));
|
||||
$datetime_string = $datetime -> format($this -> getFormat());
|
||||
|
||||
// Replace +0000 or -0000 end by Z
|
||||
$datetime_string = preg_replace('/[\+\-]0000$/', 'Z', $datetime_string);
|
||||
|
@ -79,20 +76,12 @@ class LSattr_ldap_date extends LSattr_ldap {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return the storage date formats
|
||||
* Note: The first one will be used to store the value
|
||||
* Return the storage date format
|
||||
*
|
||||
* @return array<string> The storage date formats
|
||||
* @return string The storage date format
|
||||
**/
|
||||
public function getFormats($first=false) {
|
||||
$formats = $this -> getConfig('ldap_options.formats', [], 'array');
|
||||
if (!$formats) {
|
||||
$format = $this -> getConfig('ldap_options.format');
|
||||
$formats = $format ? [$format] : ['YmdHisO', 'YmdHis.vO', 'YmdHis.uO'];
|
||||
}
|
||||
if ($first)
|
||||
return $formats?$formats[0]:null;
|
||||
return $formats;
|
||||
public function getFormat() {
|
||||
return $this -> getConfig('ldap_options.format', 'YmdHisO');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -41,29 +41,13 @@ class LSauthMethod_CAS extends LSauthMethod {
|
|||
phpCAS::setDebug(PHP_CAS_DEBUG_FILE);
|
||||
}
|
||||
self :: log_debug('LSauthMethod_CAS : initialise phpCAS :: client with CAS server URL https://'.LSAUTH_CAS_SERVER_HOSTNAME.':'.LSAUTH_CAS_SERVER_PORT.(defined('LSAUTH_CAS_SERVER_URI')?LSAUTH_CAS_SERVER_URI: ''));
|
||||
|
||||
|
||||
$phpcas_client_init_args = array(
|
||||
phpCAS::client (
|
||||
constant(LSAUTH_CAS_VERSION),
|
||||
LSAUTH_CAS_SERVER_HOSTNAME,
|
||||
LSAUTH_CAS_SERVER_PORT,
|
||||
(defined('LSAUTH_CAS_SERVER_URI')?LSAUTH_CAS_SERVER_URI: ''),
|
||||
false
|
||||
);
|
||||
// Determine phpCAS version to correctly handle the $service_base_url parameter added in 1.6.0.
|
||||
// Note: this parameter is also required for Debian Buster 1.3.6-1+deb10u1 package, because
|
||||
// to fix CVE-2022-39369, this version was patched and this parameter have been added. Check
|
||||
// if CAS_Client::getServiceBaseUrl() exists to detect this case.
|
||||
if (
|
||||
intval(str_replace('.', '000', phpCAS::getVersion()).'000') >= 100060000000
|
||||
|| method_exists('CAS_Client', 'getServiceBaseUrl')
|
||||
)
|
||||
$phpcas_client_init_args[] = LSurl :: get_public_absolute_url('/');
|
||||
|
||||
// Parameter $changeSessionID or $start_session: always need to be false
|
||||
$phpcas_client_init_args[] = false;
|
||||
|
||||
// Call phpCAS::client() to initialize phpCAS client
|
||||
call_user_func_array(array('phpCAS', 'client'), $phpcas_client_init_args);
|
||||
|
||||
// Configure CAS server SSL validation
|
||||
$cas_server_ssl_validation_configured = false;
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
<?php
|
||||
/*******************************************************************************
|
||||
* Copyright (C) 2021 Easter-eggs
|
||||
* https://ldapsaisie.org
|
||||
*
|
||||
* Author: See AUTHORS file in top-level directory.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License version 2
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
LSsession :: loadLSclass('LSformElement_supannLabeledValue');
|
||||
LSsession :: loadLSaddon('supann');
|
||||
|
||||
/**
|
||||
* Element supannCMSIdEtiquette d'un formulaire pour LdapSaisie
|
||||
*
|
||||
* Cette classe définis les éléments supannCMSIdEtiquette des formulaires.
|
||||
* Elle etant la classe basic LSformElement_supannLabeledValue.
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*/
|
||||
|
||||
class LSformElement_supannCMSIdEtiquette extends LSformElement_supannLabeledValue {
|
||||
|
||||
var $supannLabelNomenclatureTable = 'cmsIdTechnologie';
|
||||
|
||||
}
|
Loading…
Reference in a new issue