mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-24 02:49:07 +01:00
Compare commits
3 commits
fa5b5ceb6d
...
05519c5432
Author | SHA1 | Date | |
---|---|---|---|
|
05519c5432 | ||
|
fde66b2335 | ||
|
5376435d8b |
6 changed files with 136 additions and 24 deletions
|
@ -18,7 +18,11 @@
|
|||
<citetitle>Structure</citetitle>...
|
||||
<![CDATA['ldap_options' => array (
|
||||
'timestamp' => [Booléen], // Si la date est stockée au format timestamp
|
||||
'format' => '[Format de stockage]', // Default : "YmdHisO"
|
||||
'formats' => array(
|
||||
'[Format de stockage principal]', // Par défaut : "YmdHisO"
|
||||
'[Formats de stockage alternatifs]', // Par défaut : "YmdHis.vO" & "YmdHis.uO"
|
||||
[...]
|
||||
),
|
||||
'timezone' => '[Fuseau horaire]', // Default : "UTC"
|
||||
),]]>
|
||||
...
|
||||
|
@ -39,26 +43,30 @@
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>format</term>
|
||||
<term>formats</term>
|
||||
<listitem>
|
||||
<para>Format de stockage de la date dans l'annuaire. Ce format est composé à
|
||||
<para>Formats de stockage de la date dans l'annuaire. Ces formats sont composés à
|
||||
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>.
|
||||
<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='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='https://tools.ietf.org/html/rfc4517'>RFC4517</ulink>. Exemples :
|
||||
<literal>20091206230506Z</literal>
|
||||
<emphasis>(=2009/12/06 23:05:66 UTC)</emphasis> ou
|
||||
<emphasis>(=2009/12/06 23:05:66 UTC)</emphasis>,
|
||||
<literal>20190613143537+0200</literal>
|
||||
<emphasis>(=2019/06/13 14:35:37 UTC+0200)</emphasis>.</simpara></note>
|
||||
<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>
|
||||
<warning><simpara>Si vous exploitez un attribut stockant une date incluant les
|
||||
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>
|
||||
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>
|
||||
</para>
|
||||
|
||||
</listitem>
|
||||
|
|
|
@ -148,6 +148,12 @@ $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 (
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<?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,9 +40,12 @@ class LSattr_ldap_date extends LSattr_ldap {
|
|||
}
|
||||
$retval=array();
|
||||
foreach($data as $val) {
|
||||
$datetime = date_create_from_format($this -> getFormat(), $val);
|
||||
foreach($this -> getFormats() as $format) {
|
||||
$datetime = date_create_from_format($format, $val);
|
||||
if ($datetime instanceof DateTime) {
|
||||
$retval[] = $datetime -> format('U');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $retval;
|
||||
|
@ -65,7 +68,7 @@ class LSattr_ldap_date extends LSattr_ldap {
|
|||
foreach($data as $val) {
|
||||
$datetime = date_create("@$val");
|
||||
$datetime -> setTimezone($timezone);
|
||||
$datetime_string = $datetime -> format($this -> getFormat());
|
||||
$datetime_string = $datetime -> format($this -> getFormats(true));
|
||||
|
||||
// Replace +0000 or -0000 end by Z
|
||||
$datetime_string = preg_replace('/[\+\-]0000$/', 'Z', $datetime_string);
|
||||
|
@ -76,12 +79,20 @@ class LSattr_ldap_date extends LSattr_ldap {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return the storage date format
|
||||
* Return the storage date formats
|
||||
* Note: The first one will be used to store the value
|
||||
*
|
||||
* @return string The storage date format
|
||||
* @return array<string> The storage date formats
|
||||
**/
|
||||
public function getFormat() {
|
||||
return $this -> getConfig('ldap_options.format', 'YmdHisO');
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -41,13 +41,29 @@ 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 (
|
||||
|
||||
|
||||
$phpcas_client_init_args = array(
|
||||
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;
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
<?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