mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-18 00:09:06 +01:00
Clean/normalize comments format about parameters & returned value of functions/methods
This commit is contained in:
parent
e71823b644
commit
8a02680114
103 changed files with 2103 additions and 2126 deletions
|
@ -82,7 +82,7 @@ les possibilités de contribution.</para>
|
||||||
*
|
*
|
||||||
* @author My Name <my.email@example.com>
|
* @author My Name <my.email@example.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true if my addon is totaly supported, false in other cases
|
* @return boolean true if my addon is totaly supported, false in other cases
|
||||||
**/
|
**/
|
||||||
function LSaddon_myaddon_support() {
|
function LSaddon_myaddon_support() {
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ les possibilités de contribution.</para>
|
||||||
*
|
*
|
||||||
* @author My Name <my.email@example.com>
|
* @author My Name <my.email@example.com>
|
||||||
*
|
*
|
||||||
* @retval [type(s) of returned values (pipe separator)] Description of the return of this function
|
* @return [type(s) of returned values (pipe separator)] Description of the return of this function
|
||||||
**/
|
**/
|
||||||
function myaddon_first_function($arg1, $arg2) {
|
function myaddon_first_function($arg1, $arg2) {
|
||||||
// Do some stuff
|
// Do some stuff
|
||||||
|
@ -257,7 +257,7 @@ les possibilités de contribution.</para>
|
||||||
*
|
*
|
||||||
* @author My Name <my.email@example.com>
|
* @author My Name <my.email@example.com>
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
function myaddon_view() {
|
function myaddon_view() {
|
||||||
// Do some stuff and set some template variables
|
// Do some stuff and set some template variables
|
||||||
|
@ -431,7 +431,7 @@ les possibilités de contribution.</para>
|
||||||
*
|
*
|
||||||
* Description of this CLI command.
|
* Description of this CLI command.
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array Command arguments
|
* @param array $command_args Command arguments
|
||||||
* - Positional arguments :
|
* - Positional arguments :
|
||||||
* - LSobject
|
* - LSobject
|
||||||
* - dn
|
* - dn
|
||||||
|
@ -440,7 +440,7 @@ les possibilités de contribution.</para>
|
||||||
*
|
*
|
||||||
* @author My Name <my.email@example.com>
|
* @author My Name <my.email@example.com>
|
||||||
*
|
*
|
||||||
* @retval boolean True on success, false otherwise
|
* @return boolean True on success, false otherwise
|
||||||
**/
|
**/
|
||||||
function cli_my_custom_cli_cmd($command_args) {
|
function cli_my_custom_cli_cmd($command_args) {
|
||||||
$objType = null;
|
$objType = null;
|
||||||
|
@ -480,12 +480,12 @@ les possibilités de contribution.</para>
|
||||||
/**
|
/**
|
||||||
* Args autocompleter for CLI my_custom_cli_cmd command
|
* Args autocompleter for CLI my_custom_cli_cmd command
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array List of already typed words of the command
|
* @param array $command_args List of already typed words of the command
|
||||||
* @param[in] $comp_word_num int The command word number to autocomplete
|
* @param int $comp_word_num The command word number to autocomplete
|
||||||
* @param[in] $comp_word string The command word to autocomplete
|
* @param string $comp_word The command word to autocomplete
|
||||||
* @param[in] $opts array List of global available options
|
* @param array $opts List of global available options
|
||||||
*
|
*
|
||||||
* @retval array List of available options for the word to autocomplete
|
* @return array List of available options for the word to autocomplete
|
||||||
**/
|
**/
|
||||||
public static function cli_my_custom_cli_cmd_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
public static function cli_my_custom_cli_cmd_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
||||||
$opts = array_merge($opts, array ('-f', '--force'));
|
$opts = array_merge($opts, array ('-f', '--force'));
|
||||||
|
|
|
@ -31,7 +31,7 @@ LSerror :: defineError('LSACCESSRIGHTSMATRIXVIEW_SUPPORT_01',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true if LSaccessRightsMatrixView addon is totally supported, false in other case
|
* @return boolean true if LSaccessRightsMatrixView addon is totally supported, false in other case
|
||||||
*/
|
*/
|
||||||
function LSaddon_LSaccessRightsMatrixView_support() {
|
function LSaddon_LSaccessRightsMatrixView_support() {
|
||||||
$retval = True;
|
$retval = True;
|
||||||
|
|
|
@ -41,7 +41,7 @@ LSerror :: defineError('ASTERISK_03',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true if Asterisk is totally supported, false in other case
|
* @return boolean true if Asterisk is totally supported, false in other case
|
||||||
*/
|
*/
|
||||||
function LSaddon_asterisk_support() {
|
function LSaddon_asterisk_support() {
|
||||||
$retval=true;
|
$retval=true;
|
||||||
|
@ -72,10 +72,10 @@ LSerror :: defineError('ASTERISK_03',
|
||||||
*
|
*
|
||||||
* This function can be used as encode_function of LSattr_ldap :: password.
|
* This function can be used as encode_function of LSattr_ldap :: password.
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject LSldapObject The LSldapObject use to build the hashed password
|
* @param LSldapObject $ldapObject The LSldapObject use to build the hashed password
|
||||||
* @param[in] $clearPassword string The password in clear text
|
* @param string $clearPassword The password in clear text
|
||||||
*
|
*
|
||||||
* @retval string The hashed password
|
* @return string The hashed password
|
||||||
*/
|
*/
|
||||||
function hashAsteriskPassword($ldapObject,$clearPassword) {
|
function hashAsteriskPassword($ldapObject,$clearPassword) {
|
||||||
if (!is_a($ldapObject,'LSldapObject')) {
|
if (!is_a($ldapObject,'LSldapObject')) {
|
||||||
|
@ -94,9 +94,9 @@ LSerror :: defineError('ASTERISK_03',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject The LSldapObject
|
* @param LSldapObject $ldapObject The LSldapObject
|
||||||
*
|
*
|
||||||
* @retval string asterisk MD5 hashed password or False
|
* @return string asterisk MD5 hashed password or False
|
||||||
*/
|
*/
|
||||||
function generate_asteriskMD5HashedPassword($ldapObject) {
|
function generate_asteriskMD5HashedPassword($ldapObject) {
|
||||||
if ( get_class($ldapObject -> attrs[ LS_ASTERISK_USERPASSWORD_ATTR ]) != 'LSattribute' ) {
|
if ( get_class($ldapObject -> attrs[ LS_ASTERISK_USERPASSWORD_ATTR ]) != 'LSattribute' ) {
|
||||||
|
|
|
@ -44,7 +44,7 @@ LSerror :: defineError('DYNGROUP_02',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true if dyngroup are fully supported, false otherwise
|
* @return boolean true if dyngroup are fully supported, false otherwise
|
||||||
*/
|
*/
|
||||||
function LSaddon_dyngroup_support() {
|
function LSaddon_dyngroup_support() {
|
||||||
$retval = true;
|
$retval = true;
|
||||||
|
@ -82,9 +82,9 @@ function LSaddon_dyngroup_support() {
|
||||||
/*
|
/*
|
||||||
* Parse LDAP search URI
|
* Parse LDAP search URI
|
||||||
*
|
*
|
||||||
* @param[in] $uri string The LDAP search URI to parse
|
* @param string $uri The LDAP search URI to parse
|
||||||
*
|
*
|
||||||
* @retval array|false Array of parsed LDAP search URI info, or false
|
* @return array|false Array of parsed LDAP search URI info, or false
|
||||||
*/
|
*/
|
||||||
function parseLdapSearchURI($uri) {
|
function parseLdapSearchURI($uri) {
|
||||||
$uri_parts = explode('?', $uri);
|
$uri_parts = explode('?', $uri);
|
||||||
|
@ -103,9 +103,9 @@ function parseLdapSearchURI($uri) {
|
||||||
/*
|
/*
|
||||||
* Extract attributes cited in an LDAP filter string
|
* Extract attributes cited in an LDAP filter string
|
||||||
*
|
*
|
||||||
* @param[in] $filter string The LDAP filter string
|
* @param string $uri The LDAP filter string
|
||||||
*
|
*
|
||||||
* @retval array|false Array of the attributes cited in the LDAP filter string, or false
|
* @return array|false Array of the attributes cited in the LDAP filter string, or false
|
||||||
*/
|
*/
|
||||||
function extractAttributesFromLdapFilterString($filter) {
|
function extractAttributesFromLdapFilterString($filter) {
|
||||||
if ($filter[0] != '(')
|
if ($filter[0] != '(')
|
||||||
|
@ -122,9 +122,9 @@ function extractAttributesFromLdapFilterString($filter) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject The LSldapObject
|
* @param LSldapObject $ldapObject The LSldapObject
|
||||||
*
|
*
|
||||||
* @retval array|null array of memberUid URI attribute values or null in case of error
|
* @return array|null array of memberUid URI attribute values or null in case of error
|
||||||
*/
|
*/
|
||||||
function generateDyngroupMemberUidURI($ldapObject) {
|
function generateDyngroupMemberUidURI($ldapObject) {
|
||||||
if (!isset($ldapObject -> attrs[ DYNGROUP_MEMBER_DN_URI_ATTRIBUTE ])) {
|
if (!isset($ldapObject -> attrs[ DYNGROUP_MEMBER_DN_URI_ATTRIBUTE ])) {
|
||||||
|
@ -155,9 +155,9 @@ function generateDyngroupMemberUidURI($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $dyngroup The LSldapObject
|
* @param LSldapObject $dyngroup The LSldapObject
|
||||||
*
|
*
|
||||||
* @retval boolean True on success, False otherwise
|
* @return boolean True on success, False otherwise
|
||||||
*/
|
*/
|
||||||
function updateDynGroupMembersCache($dyngroup, $reload=true) {
|
function updateDynGroupMembersCache($dyngroup, $reload=true) {
|
||||||
if ($reload && !$dyngroup -> reloadData()) {
|
if ($reload && !$dyngroup -> reloadData()) {
|
||||||
|
|
|
@ -50,7 +50,7 @@ LSerror :: defineError('LS_EXPORTSEARCHRESULTASCSV_03',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true if exportSearchResultAsCSV is fully supported, false in other case
|
* @return boolean true if exportSearchResultAsCSV is fully supported, false in other case
|
||||||
*/
|
*/
|
||||||
function LSaddon_exportSearchResultAsCSV_support() {
|
function LSaddon_exportSearchResultAsCSV_support() {
|
||||||
$retval=true;
|
$retval=true;
|
||||||
|
@ -79,11 +79,11 @@ LSerror :: defineError('LS_EXPORTSEARCHRESULTASCSV_03',
|
||||||
/**
|
/**
|
||||||
* Write LSsearch result as CSV and force download of it.
|
* Write LSsearch result as CSV and force download of it.
|
||||||
*
|
*
|
||||||
* @param[in] $LSsearch The LSsearch object
|
* @param LSsearch $LSsearch The LSsearch object
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean Void if CSV file is successfully generated and upload, false in other case
|
* @return boolean Void if CSV file is successfully generated and upload, false in other case
|
||||||
*/
|
*/
|
||||||
function exportSearchResultAsCSV($LSsearch) {
|
function exportSearchResultAsCSV($LSsearch) {
|
||||||
$csv = fopen('php://temp/maxmemory:'. (5*1024*1024), 'r+');
|
$csv = fopen('php://temp/maxmemory:'. (5*1024*1024), 'r+');
|
||||||
|
@ -139,12 +139,12 @@ LSerror :: defineError('LS_EXPORTSEARCHRESULTASCSV_03',
|
||||||
/**
|
/**
|
||||||
* Write CSV row in file
|
* Write CSV row in file
|
||||||
*
|
*
|
||||||
* @param[in] $csv The CSV file description reference
|
* @param resource &$csv The CSV file description reference
|
||||||
* @param[in] $row An array of a CSV row fields to write
|
* @param array[string] $row An array of a CSV row fields to write
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean True if CSV row is successfully writed, false in other case
|
* @return boolean True if CSV row is successfully writed, false in other case
|
||||||
*/
|
*/
|
||||||
function writeRowInCSV(&$csv, &$row) {
|
function writeRowInCSV(&$csv, &$row) {
|
||||||
if (!defined('PHP_VERSION_ID') or PHP_VERSION_ID < 50504) {
|
if (!defined('PHP_VERSION_ID') or PHP_VERSION_ID < 50504) {
|
||||||
|
|
|
@ -58,7 +58,7 @@ LSerror :: defineError('FTP_05',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true si FTP est pleinement supporté, false sinon
|
* @return boolean true si FTP est pleinement supporté, false sinon
|
||||||
*/
|
*/
|
||||||
function LSaddon_ftp_support() {
|
function LSaddon_ftp_support() {
|
||||||
$retval=true;
|
$retval=true;
|
||||||
|
@ -84,12 +84,12 @@ LSerror :: defineError('FTP_05',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $host string Le nom ou l'IP du serveur FTP
|
* @param string $host Le nom ou l'IP du serveur FTP
|
||||||
* @param[in] $port string Le port de connexion au serveur ftp
|
* @param string $port Le port de connexion au serveur ftp
|
||||||
* @param[in] $user string Le nom d'utilidateur de connexion
|
* @param string $user Le nom d'utilidateur de connexion
|
||||||
* @param[in] $pwd string Le mot de passe de connexion
|
* @param string $pwd Le mot de passe de connexion
|
||||||
*
|
*
|
||||||
* @retval mixed Net_FTP object en cas de succès, false sinon
|
* @return mixed Net_FTP object en cas de succès, false sinon
|
||||||
*/
|
*/
|
||||||
function connectToFTP($host,$port,$user,$pwd) {
|
function connectToFTP($host,$port,$user,$pwd) {
|
||||||
$cnx = new Net_FTP();
|
$cnx = new Net_FTP();
|
||||||
|
@ -117,13 +117,13 @@ LSerror :: defineError('FTP_05',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $host string Le nom ou l'IP du serveur FTP
|
* @param string $host Le nom ou l'IP du serveur FTP
|
||||||
* @param[in] $port string Le port de connexion au serveur ftp
|
* @param string $port Le port de connexion au serveur ftp
|
||||||
* @param[in] $user string Le nom d'utilidateur de connexion
|
* @param string $user Le nom d'utilidateur de connexion
|
||||||
* @param[in] $pwd string Le mot de passe de connexion
|
* @param string $pwd Le mot de passe de connexion
|
||||||
* @param[in] $dirs array ou string Le(s) dossier(s) à ajouter
|
* @param array $dirs ou string Le(s) dossier(s) à ajouter
|
||||||
*
|
*
|
||||||
* @retval string True ou false si il y a un problème durant la création du/des dossier(s)
|
* @return string True ou false si il y a un problème durant la création du/des dossier(s)
|
||||||
*/
|
*/
|
||||||
function createDirsByFTP($host,$port,$user,$pwd,$dirs,$chmod=NULL) {
|
function createDirsByFTP($host,$port,$user,$pwd,$dirs,$chmod=NULL) {
|
||||||
$cnx = connectToFTP($host,$port,$user,$pwd);
|
$cnx = connectToFTP($host,$port,$user,$pwd);
|
||||||
|
@ -164,13 +164,13 @@ LSerror :: defineError('FTP_05',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $host string Le nom ou l'IP du serveur FTP
|
* @param string $host Le nom ou l'IP du serveur FTP
|
||||||
* @param[in] $port string Le port de connexion au serveur ftp
|
* @param string $port Le port de connexion au serveur ftp
|
||||||
* @param[in] $user string Le nom d'utilidateur de connexion
|
* @param string $user Le nom d'utilidateur de connexion
|
||||||
* @param[in] $pwd string Le mot de passe de connexion
|
* @param string $pwd Le mot de passe de connexion
|
||||||
* @param[in] $dirs array ou string Le(s) dossier(s) à supprimer
|
* @param array $dirs ou string Le(s) dossier(s) à supprimer
|
||||||
*
|
*
|
||||||
* @retval string True ou false si il y a un problème durant la suppression du/des dossier(s)
|
* @return string True ou false si il y a un problème durant la suppression du/des dossier(s)
|
||||||
*/
|
*/
|
||||||
function removeDirsByFTP($host,$port,$user,$pwd,$dirs) {
|
function removeDirsByFTP($host,$port,$user,$pwd,$dirs) {
|
||||||
$cnx = connectToFTP($host,$port,$user,$pwd);
|
$cnx = connectToFTP($host,$port,$user,$pwd);
|
||||||
|
@ -199,14 +199,14 @@ LSerror :: defineError('FTP_05',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $host string Le nom ou l'IP du serveur FTP
|
* @param string $host Le nom ou l'IP du serveur FTP
|
||||||
* @param[in] $port string Le port de connexion au serveur ftp
|
* @param string $port Le port de connexion au serveur ftp
|
||||||
* @param[in] $user string Le nom d'utilidateur de connexion
|
* @param string $user Le nom d'utilidateur de connexion
|
||||||
* @param[in] $pwd string Le mot de passe de connexion
|
* @param string $pwd Le mot de passe de connexion
|
||||||
* @param[in] $old string Le dossier à renomer
|
* @param string $old Le dossier à renomer
|
||||||
* @param[in] $new string Le nouveau nom du dossier à renomer
|
* @param string $new Le nouveau nom du dossier à renomer
|
||||||
*
|
*
|
||||||
* @retval string True ou false si il y a un problème durant le renomage du/des dossier(s)
|
* @return string True ou false si il y a un problème durant le renomage du/des dossier(s)
|
||||||
*/
|
*/
|
||||||
function renameDirByFTP($host,$port,$user,$pwd,$old,$new) {
|
function renameDirByFTP($host,$port,$user,$pwd,$old,$new) {
|
||||||
$cnx = connectToFTP($host,$port,$user,$pwd);
|
$cnx = connectToFTP($host,$port,$user,$pwd);
|
||||||
|
|
|
@ -44,7 +44,7 @@ LSerror :: defineError('MAIL_01',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true si MAIL est pleinement supporté, false sinon
|
* @return boolean true si MAIL est pleinement supporté, false sinon
|
||||||
*/
|
*/
|
||||||
function LSaddon_mail_support() {
|
function LSaddon_mail_support() {
|
||||||
$retval=true;
|
$retval=true;
|
||||||
|
@ -87,7 +87,7 @@ LSerror :: defineError('MAIL_01',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true si MAIL est pleinement supporté, false sinon
|
* @return boolean true si MAIL est pleinement supporté, false sinon
|
||||||
*/
|
*/
|
||||||
function sendMail($to, $subject, $msg, $headers=array(), $attachments=array(), $eol="\n", $encoding="utf8", $html=false) {
|
function sendMail($to, $subject, $msg, $headers=array(), $attachments=array(), $eol="\n", $encoding="utf8", $html=false) {
|
||||||
global $MAIL_SEND_PARAMS, $MAIL_HEARDERS;
|
global $MAIL_SEND_PARAMS, $MAIL_HEARDERS;
|
||||||
|
|
|
@ -49,7 +49,7 @@ LSerror :: defineError('MAILDIR_04',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true si Maildir est pleinement supporté, false sinon
|
* @return boolean true si Maildir est pleinement supporté, false sinon
|
||||||
*/
|
*/
|
||||||
function LSaddon_maildir_support() {
|
function LSaddon_maildir_support() {
|
||||||
$retval=true;
|
$retval=true;
|
||||||
|
@ -83,11 +83,11 @@ $retval=true;
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
* @param[in] $dir Le chemin de la maildir. Si défini, la valeur ne sera pas
|
* @param string $dir Le chemin de la maildir. Si défini, la valeur ne sera pas
|
||||||
* récupérée dans le ldapObject
|
* récupérée dans le ldapObject
|
||||||
*
|
*
|
||||||
* @retval string True ou false si il y a un problème durant la création de la Maildir
|
* @return string True ou false si il y a un problème durant la création de la Maildir
|
||||||
*/
|
*/
|
||||||
function createMaildirByFTP($ldapObject,$dir=null) {
|
function createMaildirByFTP($ldapObject,$dir=null) {
|
||||||
if (!$dir) {
|
if (!$dir) {
|
||||||
|
@ -113,11 +113,11 @@ $retval=true;
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
* @param[in] $dir Le chemin de la maildir. Si défini, la valeur ne sera pas
|
* @param string $dir Le chemin de la maildir. Si défini, la valeur ne sera pas
|
||||||
* récupérée dans le ldapObject
|
* récupérée dans le ldapObject
|
||||||
*
|
*
|
||||||
* @retval string True ou false si il y a un problème durant la suppression de la Maildir
|
* @return string True ou false si il y a un problème durant la suppression de la Maildir
|
||||||
*/
|
*/
|
||||||
function removeMaildirByFTP($ldapObject,$dir=null) {
|
function removeMaildirByFTP($ldapObject,$dir=null) {
|
||||||
if (!$dir) {
|
if (!$dir) {
|
||||||
|
@ -138,9 +138,9 @@ $retval=true;
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
*
|
*
|
||||||
* @retval string Le chemin distant de la maildir ou false si il y a un problème
|
* @return string Le chemin distant de la maildir ou false si il y a un problème
|
||||||
*/
|
*/
|
||||||
function getMaildirPath($ldapObject) {
|
function getMaildirPath($ldapObject) {
|
||||||
$dir = getFData(LS_MAILDIR_FTP_MAILDIR_PATH,$ldapObject,'getValue');
|
$dir = getFData(LS_MAILDIR_FTP_MAILDIR_PATH,$ldapObject,'getValue');
|
||||||
|
@ -167,10 +167,10 @@ $retval=true;
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $old L'ancien chemin de la maildir
|
* @param string $old L'ancien chemin de la maildir
|
||||||
* @param[in] $new Le nouveau chemin de la maildir
|
* @param string $new Le nouveau chemin de la maildir
|
||||||
*
|
*
|
||||||
* @retval string True ou false si il y a un problème durant le renomage de la Maildir
|
* @return string True ou false si il y a un problème durant le renomage de la Maildir
|
||||||
*/
|
*/
|
||||||
function renameMaildirByFTP($old,$new) {
|
function renameMaildirByFTP($old,$new) {
|
||||||
if (!renameDirByFTP(LS_MAILDIR_FTP_HOST,LS_MAILDIR_FTP_PORT,LS_MAILDIR_FTP_USER,LS_MAILDIR_FTP_PWD,$old,$new)) {
|
if (!renameDirByFTP(LS_MAILDIR_FTP_HOST,LS_MAILDIR_FTP_PORT,LS_MAILDIR_FTP_USER,LS_MAILDIR_FTP_PWD,$old,$new)) {
|
||||||
|
|
|
@ -49,7 +49,7 @@ LSerror :: defineError('MAILQUOTA_04',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean True if this addons is fully supported, false otherwise
|
* @return boolean True if this addons is fully supported, false otherwise
|
||||||
*/
|
*/
|
||||||
function LSaddon_mailquota_support() {
|
function LSaddon_mailquota_support() {
|
||||||
$retval=True;
|
$retval=True;
|
||||||
|
@ -81,9 +81,9 @@ function LSaddon_mailquota_support() {
|
||||||
/**
|
/**
|
||||||
* Get IMAP mailbox usage
|
* Get IMAP mailbox usage
|
||||||
*
|
*
|
||||||
* @param[in] $ldapobject LSldapObject The LDAP object
|
* @param LSldapObject $ldapobject The LDAP object
|
||||||
*
|
*
|
||||||
* @retval array|false Array with mailbox usage and quota, or false
|
* @return array|false Array with mailbox usage and quota, or false
|
||||||
**/
|
**/
|
||||||
function mailquota_get_usage(&$LSldapObject) {
|
function mailquota_get_usage(&$LSldapObject) {
|
||||||
$logger = LSlog :: get_logger("LSaddon_mailquota");
|
$logger = LSlog :: get_logger("LSaddon_mailquota");
|
||||||
|
@ -144,9 +144,9 @@ function mailquota_get_usage(&$LSldapObject) {
|
||||||
* [...]
|
* [...]
|
||||||
* );
|
* );
|
||||||
*
|
*
|
||||||
* @param[in] $ldapobject LSldapObject The LDAP object
|
* @param LSldapObject $ldapobject The LDAP object
|
||||||
*
|
*
|
||||||
* @retval true in any case
|
* @return true in any case
|
||||||
**/
|
**/
|
||||||
function mailquota_show_usage(&$LSldapObject) {
|
function mailquota_show_usage(&$LSldapObject) {
|
||||||
$quota = mailquota_get_usage($LSldapObject);
|
$quota = mailquota_get_usage($LSldapObject);
|
||||||
|
|
|
@ -35,7 +35,7 @@ LSerror :: defineError('LSORGCHART_SUPPORT_02',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true if orgchart addon is totally supported, false in other case
|
* @return boolean true if orgchart addon is totally supported, false in other case
|
||||||
*/
|
*/
|
||||||
function LSaddon_orgchart_support() {
|
function LSaddon_orgchart_support() {
|
||||||
$retval = True;
|
$retval = True;
|
||||||
|
|
|
@ -33,7 +33,7 @@ LSerror :: defineError('PHPLDAPADMIN_SUPPORT_01',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true if is supported, false also
|
* @return boolean true if is supported, false also
|
||||||
*/
|
*/
|
||||||
function LSaddon_phpldapadmin_support() {
|
function LSaddon_phpldapadmin_support() {
|
||||||
$retval=true;
|
$retval=true;
|
||||||
|
@ -57,7 +57,7 @@ function LSaddon_phpldapadmin_support() {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true in all cases
|
* @return boolean true in all cases
|
||||||
*/
|
*/
|
||||||
function redirectToPhpLdapAdmin(&$ldapObject) {
|
function redirectToPhpLdapAdmin(&$ldapObject) {
|
||||||
$url = $ldapObject->getFData(LS_PHPLDAPADMIN_VIEW_OBJECT_URL_FORMAT);
|
$url = $ldapObject->getFData(LS_PHPLDAPADMIN_VIEW_OBJECT_URL_FORMAT);
|
||||||
|
|
|
@ -41,7 +41,7 @@ LSerror :: defineError('POSIX_01',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true si POSIX est pleinement supporté, false sinon
|
* @return boolean true si POSIX est pleinement supporté, false sinon
|
||||||
*/
|
*/
|
||||||
function LSaddon_posix_support() {
|
function LSaddon_posix_support() {
|
||||||
|
|
||||||
|
@ -85,9 +85,9 @@ LSerror :: defineError('POSIX_01',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
*
|
*
|
||||||
* @retval integer uidNumber ou false si il y a un problème durant la génération
|
* @return integer uidNumber ou false si il y a un problème durant la génération
|
||||||
*/
|
*/
|
||||||
function generate_uidNumber($ldapObject) {
|
function generate_uidNumber($ldapObject) {
|
||||||
|
|
||||||
|
@ -120,9 +120,9 @@ LSerror :: defineError('POSIX_01',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
*
|
*
|
||||||
* @retval integer gidNumber ou false si il y a un problème durant la génération
|
* @return integer gidNumber ou false si il y a un problème durant la génération
|
||||||
*/
|
*/
|
||||||
function generate_gidNumber($ldapObject) {
|
function generate_gidNumber($ldapObject) {
|
||||||
|
|
||||||
|
@ -155,9 +155,9 @@ LSerror :: defineError('POSIX_01',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
*
|
*
|
||||||
* @retval string homeDirectory ou false si il y a un problème durant la génération
|
* @return string homeDirectory ou false si il y a un problème durant la génération
|
||||||
*/
|
*/
|
||||||
function generate_homeDirectory($ldapObject) {
|
function generate_homeDirectory($ldapObject) {
|
||||||
if ( get_class($ldapObject -> attrs[ LS_POSIX_UID_ATTR ]) != 'LSattribute' ) {
|
if ( get_class($ldapObject -> attrs[ LS_POSIX_UID_ATTR ]) != 'LSattribute' ) {
|
||||||
|
@ -176,9 +176,9 @@ LSerror :: defineError('POSIX_01',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
*
|
*
|
||||||
* @retval string homeDirectory ou false si il y a un problème durant la génération
|
* @return string homeDirectory ou false si il y a un problème durant la génération
|
||||||
*/
|
*/
|
||||||
function createHomeDirectoryByFTP($ldapObject) {
|
function createHomeDirectoryByFTP($ldapObject) {
|
||||||
$dir = getFData(LS_POSIX_HOMEDIRECTORY_FTP_PATH,$ldapObject,'getValue');
|
$dir = getFData(LS_POSIX_HOMEDIRECTORY_FTP_PATH,$ldapObject,'getValue');
|
||||||
|
@ -197,9 +197,9 @@ LSerror :: defineError('POSIX_01',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject The LSldapObject
|
* @param LSldapObject $ldapObject The LSldapObject
|
||||||
*
|
*
|
||||||
* @retval array|null array of member attribute values or null in case of error
|
* @return array|null array of member attribute values or null in case of error
|
||||||
*/
|
*/
|
||||||
function generateMemberFromMemberUid($ldapObject) {
|
function generateMemberFromMemberUid($ldapObject) {
|
||||||
if ( get_class($ldapObject -> attrs[ 'memberUid' ]) != 'LSattribute' ) {
|
if ( get_class($ldapObject -> attrs[ 'memberUid' ]) != 'LSattribute' ) {
|
||||||
|
@ -235,9 +235,9 @@ LSerror :: defineError('POSIX_01',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject The LSldapObject
|
* @param LSldapObject $ldapObject The LSldapObject
|
||||||
*
|
*
|
||||||
* @retval array|null array of memberUid values or null in case of error
|
* @return array|null array of memberUid values or null in case of error
|
||||||
*/
|
*/
|
||||||
function generate_memberUidFromUniqueMember($ldapObject) {
|
function generate_memberUidFromUniqueMember($ldapObject) {
|
||||||
if ( get_class($ldapObject -> attrs[ 'memberUid' ]) != 'LSattribute' ) {
|
if ( get_class($ldapObject -> attrs[ 'memberUid' ]) != 'LSattribute' ) {
|
||||||
|
@ -275,9 +275,9 @@ LSerror :: defineError('POSIX_01',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $anything anything
|
* @param mixed $anything anything
|
||||||
*
|
*
|
||||||
* @retval integer The shadowLastChange attribute value (=current date)
|
* @return integer The shadowLastChange attribute value (=current date)
|
||||||
*/
|
*/
|
||||||
function generate_shadowLastChange($anything) {
|
function generate_shadowLastChange($anything) {
|
||||||
return time();
|
return time();
|
||||||
|
|
|
@ -96,7 +96,7 @@ function LSaddon_ppolicy_support() {
|
||||||
/**
|
/**
|
||||||
* Retrieve ppolicy object (from cache if already loaded)
|
* Retrieve ppolicy object (from cache if already loaded)
|
||||||
*
|
*
|
||||||
* @param[in] $dn string The DN of the ppolicy object
|
* @param string $dn The DN of the ppolicy object
|
||||||
*
|
*
|
||||||
* @return array|false Array of ppolicy object's attributes on success, false otherwise
|
* @return array|false Array of ppolicy object's attributes on success, false otherwise
|
||||||
*
|
*
|
||||||
|
@ -112,7 +112,7 @@ function get_ppolicy_object($dn) {
|
||||||
/**
|
/**
|
||||||
* Retrieve ppolicy password max age
|
* Retrieve ppolicy password max age
|
||||||
*
|
*
|
||||||
* @param[in] $ppolicy_dn string Optional DN of the ppolicy object to use
|
* @param string $dn Optional DN of the ppolicy object to use
|
||||||
*
|
*
|
||||||
* @return int|null|false The ppolicy password max age (in second) if defined, null if no password max age is defined or false in case of error
|
* @return int|null|false The ppolicy password max age (in second) if defined, null if no password max age is defined or false in case of error
|
||||||
*
|
*
|
||||||
|
@ -134,9 +134,9 @@ function get_ppolicy_password_max_age($ppolicy_dn=null) {
|
||||||
/**
|
/**
|
||||||
* Format and return HTML code of a badge
|
* Format and return HTML code of a badge
|
||||||
*
|
*
|
||||||
* @param[in] $text string The text of the badge
|
* @param string $dn The text of the badge
|
||||||
* @param[in] $bg_color string The background color of the badge (optional, default: green)
|
* @param string $dn The background color of the badge (optional, default: green)
|
||||||
* @param[in] $color string The text color of the badge (optional, default: white)
|
* @param string $dn The text color of the badge (optional, default: white)
|
||||||
*
|
*
|
||||||
* @return string The HTML code of the badge
|
* @return string The HTML code of the badge
|
||||||
*
|
*
|
||||||
|
@ -157,7 +157,7 @@ function _ppolicy_badge($text, $bg_color='green', $color='white') {
|
||||||
/**
|
/**
|
||||||
* Retrieve Ppolicy extraDisplayedColumn password expiration
|
* Retrieve Ppolicy extraDisplayedColumn password expiration
|
||||||
*
|
*
|
||||||
* @param[in] $entry An LSsearchEntry object
|
* @param LSsearchEntry $entry An LSsearchEntry object
|
||||||
*
|
*
|
||||||
* @return string Ppolicy extraDisplayedColumn password expiration
|
* @return string Ppolicy extraDisplayedColumn password expiration
|
||||||
*
|
*
|
||||||
|
@ -194,7 +194,7 @@ function ppolicy_extraDisplayColumn_password_expiration($entry) {
|
||||||
/**
|
/**
|
||||||
* Write LSsearch result as CSV and force download of it.
|
* Write LSsearch result as CSV and force download of it.
|
||||||
*
|
*
|
||||||
* @param[in] $LSsearch The LSsearch object
|
* @param LSsearch $LSsearch The LSsearch object
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
|
@ -301,12 +301,12 @@ function ppolicy_export_search_info($LSsearch, $as_csv=true, $return=false) {
|
||||||
/**
|
/**
|
||||||
* Write CSV row in file
|
* Write CSV row in file
|
||||||
*
|
*
|
||||||
* @param[in] $csv The CSV file description reference
|
* @param resource $csv The CSV file description reference
|
||||||
* @param[in] $row An array of a CSV row fields to write
|
* @param array[string] $row An array of a CSV row fields to write
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean True if CSV row is successfully writed, false in other case
|
* @return boolean True if CSV row is successfully writed, false in other case
|
||||||
*/
|
*/
|
||||||
function _ppolicy_write_row_in_csv(&$csv, &$row) {
|
function _ppolicy_write_row_in_csv(&$csv, &$row) {
|
||||||
if (!defined('PHP_VERSION_ID') or PHP_VERSION_ID < 50504) {
|
if (!defined('PHP_VERSION_ID') or PHP_VERSION_ID < 50504) {
|
||||||
|
@ -324,7 +324,7 @@ function _ppolicy_write_row_in_csv(&$csv, &$row) {
|
||||||
/**
|
/**
|
||||||
* Handle exportPpolicyInfo API request
|
* Handle exportPpolicyInfo API request
|
||||||
*
|
*
|
||||||
* @param[in] $request LSurlRequest The request
|
* @param LSurlRequest $request The request
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
**/
|
**/
|
||||||
|
@ -432,12 +432,12 @@ function cli_export_ppolicy_info($command_args) {
|
||||||
/**
|
/**
|
||||||
* Args autocompleter for CLI export_ppolicy_info command
|
* Args autocompleter for CLI export_ppolicy_info command
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array List of already typed words of the command
|
* @param string $dn List of already typed words of the command
|
||||||
* @param[in] $comp_word_num int The command word number to autocomplete
|
* @param string $dn The command word number to autocomplete
|
||||||
* @param[in] $comp_word string The command word to autocomplete
|
* @param string $dn The command word to autocomplete
|
||||||
* @param[in] $opts array List of global available options
|
* @param string $dn List of global available options
|
||||||
*
|
*
|
||||||
* @retval array List of available options for the word to autocomplete
|
* @return array List of available options for the word to autocomplete
|
||||||
**/
|
**/
|
||||||
function cli_export_ppolicy_info_args_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
function cli_export_ppolicy_info_args_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
||||||
$opts = array_merge($opts, array ('-o', '--output', '-j', '--json', '-p', '--pretty'));
|
$opts = array_merge($opts, array ('-o', '--output', '-j', '--json', '-p', '--pretty'));
|
||||||
|
|
|
@ -58,7 +58,7 @@ define('LS_SAMBA_INFINITY_TIME',2147483647);
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean True if Samba is fully supported, false otherwise
|
* @return boolean True if Samba is fully supported, false otherwise
|
||||||
*/
|
*/
|
||||||
function LSaddon_samba_support() {
|
function LSaddon_samba_support() {
|
||||||
|
|
||||||
|
@ -110,11 +110,11 @@ function LSaddon_samba_support() {
|
||||||
* sambaSID = LS_SAMBA_DOMAIN_SID-Number
|
* sambaSID = LS_SAMBA_DOMAIN_SID-Number
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
* @param[in] $ldapObject LSldapObjet The LSldapObjet object
|
* @param LSldapObjet $ldapObject The LSldapObjet object
|
||||||
* @param[in] $unix_attr string The UNIX attribute name
|
* @param string $unix_attr The UNIX attribute name
|
||||||
* @param[in] $base_number integer The base number value
|
* @param integer $base_number The base number value
|
||||||
*
|
*
|
||||||
* @retval string SambaSID ou false si il y a un problème durant la génération
|
* @return string SambaSID ou false si il y a un problème durant la génération
|
||||||
*/
|
*/
|
||||||
function generate_sambaSID($ldapObject, $unix_attr, $base_number) {
|
function generate_sambaSID($ldapObject, $unix_attr, $base_number) {
|
||||||
if ( get_class($ldapObject -> attrs[ $unix_attr ]) != 'LSattribute' ) {
|
if ( get_class($ldapObject -> attrs[ $unix_attr ]) != 'LSattribute' ) {
|
||||||
|
@ -139,10 +139,10 @@ function generate_sambaSID($ldapObject, $unix_attr, $base_number) {
|
||||||
* Number = LS_SAMBA_UIDNUMBER_ATTR * 2 + LS_SAMBA_SID_BASE_USER
|
* Number = LS_SAMBA_UIDNUMBER_ATTR * 2 + LS_SAMBA_SID_BASE_USER
|
||||||
* sambaSID = LS_SAMBA_DOMAIN_SID-Number
|
* sambaSID = LS_SAMBA_DOMAIN_SID-Number
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject LSldapObjet The user LSldapObjet object
|
* @param LSldapObjet $ldapObject The user LSldapObjet object
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval string User SambaSID value on success, false otherwise
|
* @return string User SambaSID value on success, false otherwise
|
||||||
*/
|
*/
|
||||||
function generate_user_sambaSID($ldapObject) {
|
function generate_user_sambaSID($ldapObject) {
|
||||||
return generate_sambaSID($ldapObject, LS_SAMBA_UIDNUMBER_ATTR, LS_SAMBA_SID_BASE_USER);
|
return generate_sambaSID($ldapObject, LS_SAMBA_UIDNUMBER_ATTR, LS_SAMBA_SID_BASE_USER);
|
||||||
|
@ -156,10 +156,10 @@ function generate_user_sambaSID($ldapObject) {
|
||||||
* Number = LS_SAMBA_UIDNUMBER_ATTR * 2 + LS_SAMBA_SID_BASE_USER
|
* Number = LS_SAMBA_UIDNUMBER_ATTR * 2 + LS_SAMBA_SID_BASE_USER
|
||||||
* sambaSID = LS_SAMBA_DOMAIN_SID-Number
|
* sambaSID = LS_SAMBA_DOMAIN_SID-Number
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject LSldapObjet The user LSldapObjet object
|
* @param LSldapObjet $ldapObject The user LSldapObjet object
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval string User SambaSID value on success, false otherwise
|
* @return string User SambaSID value on success, false otherwise
|
||||||
*/
|
*/
|
||||||
function generate_sambaUserSID($ldapObject) {
|
function generate_sambaUserSID($ldapObject) {
|
||||||
LSerror :: addErrorCode(
|
LSerror :: addErrorCode(
|
||||||
|
@ -179,10 +179,10 @@ function generate_sambaUserSID($ldapObject) {
|
||||||
* Number = LS_SAMBA_GIDNUMBER_ATTR * 2 + LS_SAMBA_SID_BASE_GROUP
|
* Number = LS_SAMBA_GIDNUMBER_ATTR * 2 + LS_SAMBA_SID_BASE_GROUP
|
||||||
* sambaSID = LS_SAMBA_DOMAIN_SID-Number
|
* sambaSID = LS_SAMBA_DOMAIN_SID-Number
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject LSldapObjet The group LSldapObjet object
|
* @param LSldapObjet $ldapObject The group LSldapObjet object
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval string Group SambaSID value on success, false otherwise
|
* @return string Group SambaSID value on success, false otherwise
|
||||||
*/
|
*/
|
||||||
function generate_group_sambaSID($ldapObject) {
|
function generate_group_sambaSID($ldapObject) {
|
||||||
return generate_sambaSID($ldapObject, LS_SAMBA_GIDNUMBER_ATTR, LS_SAMBA_SID_BASE_GROUP);
|
return generate_sambaSID($ldapObject, LS_SAMBA_GIDNUMBER_ATTR, LS_SAMBA_SID_BASE_GROUP);
|
||||||
|
@ -194,10 +194,10 @@ function generate_group_sambaSID($ldapObject) {
|
||||||
* Note: old-name of the function keep for retro-compatibility. An error
|
* Note: old-name of the function keep for retro-compatibility. An error
|
||||||
* message is raised when this function is used.
|
* message is raised when this function is used.
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject LSldapObjet The group LSldapObjet object
|
* @param LSldapObjet $ldapObject The group LSldapObjet object
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval string Group SambaSID value on success, false otherwise
|
* @return string Group SambaSID value on success, false otherwise
|
||||||
*/
|
*/
|
||||||
function generate_sambaGroupSID($ldapObject) {
|
function generate_sambaGroupSID($ldapObject) {
|
||||||
LSerror :: addErrorCode(
|
LSerror :: addErrorCode(
|
||||||
|
@ -217,10 +217,10 @@ function generate_sambaGroupSID($ldapObject) {
|
||||||
* Number = LS_SAMBA_GIDNUMBER_ATTR * 2 + LS_SAMBA_SID_BASE_GROUP
|
* Number = LS_SAMBA_GIDNUMBER_ATTR * 2 + LS_SAMBA_SID_BASE_GROUP
|
||||||
* sambaSID = LS_SAMBA_DOMAIN_SID-Number
|
* sambaSID = LS_SAMBA_DOMAIN_SID-Number
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject LSldapObjet The LSldapObjet object
|
* @param LSldapObjet $ldapObject The LSldapObjet object
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval string The sambaPrimaryGroupSID value on success, false otherwise
|
* @return string The sambaPrimaryGroupSID value on success, false otherwise
|
||||||
*/
|
*/
|
||||||
function generate_sambaPrimaryGroupSID($ldapObject) {
|
function generate_sambaPrimaryGroupSID($ldapObject) {
|
||||||
return generate_sambaSID($ldapObject, LS_SAMBA_GIDNUMBER_ATTR, LS_SAMBA_SID_BASE_GROUP);
|
return generate_sambaSID($ldapObject, LS_SAMBA_GIDNUMBER_ATTR, LS_SAMBA_SID_BASE_GROUP);
|
||||||
|
@ -232,9 +232,9 @@ function generate_sambaPrimaryGroupSID($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject LSldapObjet The user LSldapObjet object
|
* @param LSldapObjet $ldapObject The user LSldapObjet object
|
||||||
*
|
*
|
||||||
* @retval string|false sambaNTPassword value on success, false otherwise
|
* @return string|false sambaNTPassword value on success, false otherwise
|
||||||
*/
|
*/
|
||||||
function generate_sambaNTPassword($ldapObject) {
|
function generate_sambaNTPassword($ldapObject) {
|
||||||
if ( get_class($ldapObject -> attrs[ LS_SAMBA_USERPASSWORD_ATTR ]) != 'LSattribute' ) {
|
if ( get_class($ldapObject -> attrs[ LS_SAMBA_USERPASSWORD_ATTR ]) != 'LSattribute' ) {
|
||||||
|
@ -257,9 +257,9 @@ function generate_sambaPrimaryGroupSID($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject LSldapObjet The user LSldapObjet object
|
* @param LSldapObjet $ldapObject The user LSldapObjet object
|
||||||
*
|
*
|
||||||
* @retval string|false sambaLMPassword value on success, false otherwise
|
* @return string|false sambaLMPassword value on success, false otherwise
|
||||||
*/
|
*/
|
||||||
function generate_sambaLMPassword($ldapObject) {
|
function generate_sambaLMPassword($ldapObject) {
|
||||||
if ( get_class($ldapObject -> attrs[ LS_SAMBA_USERPASSWORD_ATTR ]) != 'LSattribute' ) {
|
if ( get_class($ldapObject -> attrs[ LS_SAMBA_USERPASSWORD_ATTR ]) != 'LSattribute' ) {
|
||||||
|
@ -282,9 +282,9 @@ function generate_sambaPrimaryGroupSID($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $attr string The sambaUnixIdPool attribute name that contain next ID value
|
* @param string $unix_attr The sambaUnixIdPool attribute name that contain next ID value
|
||||||
*
|
*
|
||||||
* @retval integer UNIX ID value on success, false otherwise
|
* @return integer UNIX ID value on success, false otherwise
|
||||||
*/
|
*/
|
||||||
function get_samba_unix_pool_next_id($attr) {
|
function get_samba_unix_pool_next_id($attr) {
|
||||||
$unix_id_pool_dn = (defined('LS_SAMBA_UNIX_ID_POOL_DN')?constant('LS_SAMBA_UNIX_ID_POOL_DN'):LS_SAMBA_DOMAIN_OBJECT_DN);
|
$unix_id_pool_dn = (defined('LS_SAMBA_UNIX_ID_POOL_DN')?constant('LS_SAMBA_UNIX_ID_POOL_DN'):LS_SAMBA_DOMAIN_OBJECT_DN);
|
||||||
|
@ -316,9 +316,9 @@ function get_samba_unix_pool_next_id($attr) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject LSldapObjet The user LSldapObjet object
|
* @param LSldapObjet $ldapObject The user LSldapObjet object
|
||||||
*
|
*
|
||||||
* @retval integer|false uidNumber value on success, false otherwise
|
* @return integer|false uidNumber value on success, false otherwise
|
||||||
*/
|
*/
|
||||||
function generate_samba_uidNumber($ldapObject) {
|
function generate_samba_uidNumber($ldapObject) {
|
||||||
return get_samba_unix_pool_next_id('uidNumber');
|
return get_samba_unix_pool_next_id('uidNumber');
|
||||||
|
@ -332,9 +332,9 @@ function generate_samba_uidNumber($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject LSldapObjet The user LSldapObjet object
|
* @param LSldapObjet $ldapObject The user LSldapObjet object
|
||||||
*
|
*
|
||||||
* @retval integer|false uidNumber value on success, false otherwise
|
* @return integer|false uidNumber value on success, false otherwise
|
||||||
*/
|
*/
|
||||||
function generate_uidNumber_withSambaDomainObject($ldapObject) {
|
function generate_uidNumber_withSambaDomainObject($ldapObject) {
|
||||||
LSerror :: addErrorCode(
|
LSerror :: addErrorCode(
|
||||||
|
@ -353,9 +353,9 @@ function generate_uidNumber_withSambaDomainObject($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject LSldapObjet The user LSldapObjet object
|
* @param LSldapObjet $ldapObject The user LSldapObjet object
|
||||||
*
|
*
|
||||||
* @retval integer|false gidNumber value on success, false otherwise
|
* @return integer|false gidNumber value on success, false otherwise
|
||||||
*/
|
*/
|
||||||
function generate_samba_gidNumber($ldapObject) {
|
function generate_samba_gidNumber($ldapObject) {
|
||||||
return get_samba_unix_pool_next_id('gidNumber');
|
return get_samba_unix_pool_next_id('gidNumber');
|
||||||
|
@ -369,9 +369,9 @@ function generate_samba_gidNumber($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject LSldapObjet The user LSldapObjet object
|
* @param LSldapObjet $ldapObject The user LSldapObjet object
|
||||||
*
|
*
|
||||||
* @retval integer|false gidNumber value on success, false otherwise
|
* @return integer|false gidNumber value on success, false otherwise
|
||||||
*/
|
*/
|
||||||
function generate_gidNumber_withSambaDomainObject($ldapObject) {
|
function generate_gidNumber_withSambaDomainObject($ldapObject) {
|
||||||
LSerror :: addErrorCode(
|
LSerror :: addErrorCode(
|
||||||
|
@ -390,9 +390,9 @@ function generate_gidNumber_withSambaDomainObject($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $anything anything
|
* @param mixed $anything anything
|
||||||
*
|
*
|
||||||
* @retval integer NT infinity time
|
* @return integer NT infinity time
|
||||||
*/
|
*/
|
||||||
function get_samba_infinity_time($anything=null) {
|
function get_samba_infinity_time($anything=null) {
|
||||||
return LS_SAMBA_INFINITY_TIME;
|
return LS_SAMBA_INFINITY_TIME;
|
||||||
|
@ -406,9 +406,9 @@ function get_samba_infinity_time($anything=null) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $anything anything
|
* @param mixed $anything anything
|
||||||
*
|
*
|
||||||
* @retval integer NT infinity time
|
* @return integer NT infinity time
|
||||||
*/
|
*/
|
||||||
function return_sambaInfinityTime($anything=null) {
|
function return_sambaInfinityTime($anything=null) {
|
||||||
LSerror :: addErrorCode(
|
LSerror :: addErrorCode(
|
||||||
|
@ -429,9 +429,9 @@ function return_sambaInfinityTime($anything=null) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $anything anything
|
* @param mixed $anything anything
|
||||||
*
|
*
|
||||||
* @retval integer The sambaPwdLastSet attribute value (=current timestamp)
|
* @return integer The sambaPwdLastSet attribute value (=current timestamp)
|
||||||
*/
|
*/
|
||||||
function generate_sambaPwdLastSet($anything) {
|
function generate_sambaPwdLastSet($anything) {
|
||||||
return time();
|
return time();
|
||||||
|
@ -444,9 +444,9 @@ function generate_sambaPwdLastSet($anything) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $anything anything
|
* @param mixed $anything anything
|
||||||
*
|
*
|
||||||
* @retval string The sambaDomainName attribute value
|
* @return string The sambaDomainName attribute value
|
||||||
*/
|
*/
|
||||||
function generate_sambaDomainName($anything) {
|
function generate_sambaDomainName($anything) {
|
||||||
return LS_SAMBA_DOMAIN_NAME;
|
return LS_SAMBA_DOMAIN_NAME;
|
||||||
|
@ -457,9 +457,9 @@ function generate_sambaDomainName($anything) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject LSldapObjet The user LSldapObjet object
|
* @param LSldapObjet $ldapObject The user LSldapObjet object
|
||||||
*
|
*
|
||||||
* @retval string The sambaHomePath attribute value
|
* @return string The sambaHomePath attribute value
|
||||||
*/
|
*/
|
||||||
function generate_sambaHomePath($ldapObject) {
|
function generate_sambaHomePath($ldapObject) {
|
||||||
return $ldapObject -> getFData(LS_SAMBA_HOME_PATH_FORMAT);
|
return $ldapObject -> getFData(LS_SAMBA_HOME_PATH_FORMAT);
|
||||||
|
@ -470,9 +470,9 @@ function generate_sambaHomePath($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject LSldapObjet The user LSldapObjet object
|
* @param LSldapObjet $ldapObject The user LSldapObjet object
|
||||||
*
|
*
|
||||||
* @retval string The sambaProfilePath attribute value
|
* @return string The sambaProfilePath attribute value
|
||||||
*/
|
*/
|
||||||
function generate_sambaProfilePath($ldapObject) {
|
function generate_sambaProfilePath($ldapObject) {
|
||||||
return $ldapObject -> getFData(LS_SAMBA_PROFILE_PATH_FORMAT);
|
return $ldapObject -> getFData(LS_SAMBA_PROFILE_PATH_FORMAT);
|
||||||
|
@ -484,9 +484,9 @@ function generate_sambaProfilePath($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject LSldapObjet The user LSldapObjet object
|
* @param LSldapObjet $ldapObject The user LSldapObjet object
|
||||||
*
|
*
|
||||||
* @retval string The shadowExpire attribute value
|
* @return string The shadowExpire attribute value
|
||||||
*/
|
*/
|
||||||
function generate_shadowExpire_from_sambaPwdMustChange($ldapObject) {
|
function generate_shadowExpire_from_sambaPwdMustChange($ldapObject) {
|
||||||
$time = $ldapObject -> getValue('sambaPwdMustChange', true, null);
|
$time = $ldapObject -> getValue('sambaPwdMustChange', true, null);
|
||||||
|
@ -500,9 +500,9 @@ function generate_shadowExpire_from_sambaPwdMustChange($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject LSldapObjet The user LSldapObjet object
|
* @param LSldapObjet $ldapObject The user LSldapObjet object
|
||||||
*
|
*
|
||||||
* @retval string Timestamp corresponding to shadowExpire
|
* @return string Timestamp corresponding to shadowExpire
|
||||||
*/
|
*/
|
||||||
function generate_timestamp_from_shadowExpire($ldapObject) {
|
function generate_timestamp_from_shadowExpire($ldapObject) {
|
||||||
$days = $ldapObject -> getValue('shadowExpire', true, null);
|
$days = $ldapObject -> getValue('shadowExpire', true, null);
|
||||||
|
@ -517,9 +517,9 @@ function generate_timestamp_from_shadowExpire($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject LSldapObjet The user LSldapObjet object
|
* @param LSldapObjet $ldapObject The user LSldapObjet object
|
||||||
*
|
*
|
||||||
* @retval string The sambaPwdMustChange attribute value
|
* @return string The sambaPwdMustChange attribute value
|
||||||
*/
|
*/
|
||||||
function generate_sambaPwdMustChange_from_shadowExpire($ldapObject) {
|
function generate_sambaPwdMustChange_from_shadowExpire($ldapObject) {
|
||||||
return generate_timestamp_from_shadowExpire($ldapObject);
|
return generate_timestamp_from_shadowExpire($ldapObject);
|
||||||
|
@ -531,9 +531,9 @@ function generate_sambaPwdMustChange_from_shadowExpire($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject LSldapObjet The user LSldapObjet object
|
* @param LSldapObjet $ldapObject The user LSldapObjet object
|
||||||
*
|
*
|
||||||
* @retval string The sambaKickoffTime attribute value
|
* @return string The sambaKickoffTime attribute value
|
||||||
*/
|
*/
|
||||||
function generate_sambaKickoffTime_from_shadowExpire($ldapObject) {
|
function generate_sambaKickoffTime_from_shadowExpire($ldapObject) {
|
||||||
return generate_timestamp_from_shadowExpire($ldapObject);
|
return generate_timestamp_from_shadowExpire($ldapObject);
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true if LSaccessRightsMatrixView addon is totally supported, false in other case
|
* @return boolean true if LSaccessRightsMatrixView addon is totally supported, false in other case
|
||||||
*/
|
*/
|
||||||
function LSaddon_showTechInfo_support() {
|
function LSaddon_showTechInfo_support() {
|
||||||
return True;
|
return True;
|
||||||
|
|
|
@ -64,7 +64,7 @@ LSerror :: defineError('SSH_07',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true if SSH is fully supported, false otherwise
|
* @return boolean true if SSH is fully supported, false otherwise
|
||||||
*/
|
*/
|
||||||
function LSaddon_ssh_support() {
|
function LSaddon_ssh_support() {
|
||||||
$retval=true;
|
$retval=true;
|
||||||
|
@ -88,7 +88,7 @@ LSerror :: defineError('SSH_07',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $params array The SSH connexion parameters :
|
* @param array $params The SSH connexion parameters :
|
||||||
* array (
|
* array (
|
||||||
* 'host' => '[SSH server hostname/IP]', // required
|
* 'host' => '[SSH server hostname/IP]', // required
|
||||||
* 'port' => [SSH port], // optional, default : 22
|
* 'port' => [SSH port], // optional, default : 22
|
||||||
|
@ -109,9 +109,9 @@ LSerror :: defineError('SSH_07',
|
||||||
* 'password' => '[SSH private key file password]' // Only if need
|
* 'password' => '[SSH private key file password]' // Only if need
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
* @param[in] $sftp boolean Enable SFTP mode (default : false)
|
* @param boolean $sftp Enable SFTP mode (default : false)
|
||||||
*
|
*
|
||||||
* @retval mixed SSH2/SFTP object or false
|
* @return mixed SSH2/SFTP object or false
|
||||||
*/
|
*/
|
||||||
function connectToSSH($params, $sftp=false) {
|
function connectToSSH($params, $sftp=false) {
|
||||||
$logger = LSlog :: get_logger('LSaddon_ssh');
|
$logger = LSlog :: get_logger('LSaddon_ssh');
|
||||||
|
@ -182,14 +182,14 @@ LSerror :: defineError('SSH_07',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $connection_params array Connection parameters
|
* @param array $params Connection parameters
|
||||||
* @param[in] $dirs array|string The directory/ies to add
|
* @param array|string $dirs The directory/ies to add
|
||||||
* @param[in] $mode integer The directory/ies mode as an octal number (do not forget leading zero,
|
* @param boolean $sftp The directory/ies mode as an octal number (do not forget leading zero,
|
||||||
* example: 0755 or 02755, default : default umask on the SSH server)
|
* example: 0755 or 02755, default : default umask on the SSH server)
|
||||||
* @param[in] $recursive boolean Enable recursive mode (default : false)
|
* @param boolean $sftp Enable recursive mode (default : false)
|
||||||
* @param[in] $continue boolean Enable continue mode : do not on error (default : false)
|
* @param boolean $sftp Enable continue mode : do not on error (default : false)
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function createDirsBySFTP($connection_params, $dirs, $chmod=-1, $recursive=false, $continue=false) {
|
function createDirsBySFTP($connection_params, $dirs, $chmod=-1, $recursive=false, $continue=false) {
|
||||||
$cnx = connectToSSH($connection_params, true);
|
$cnx = connectToSSH($connection_params, true);
|
||||||
|
@ -216,12 +216,12 @@ LSerror :: defineError('SSH_07',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $connection_params array Connection parameters
|
* @param array $params Connection parameters
|
||||||
* @param[in] $dirs array|string The directory/ies to remove
|
* @param array|string $dirs The directory/ies to remove
|
||||||
* @param[in] $recursive boolean Enable recursive mode (default : false)
|
* @param boolean $sftp Enable recursive mode (default : false)
|
||||||
* @param[in] $continue boolean Enable continue mode : do not on error (default : false)
|
* @param boolean $sftp Enable continue mode : do not on error (default : false)
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function removeDirsBySFTP($connection_params, $dirs, $recursive=false, $continue=false) {
|
function removeDirsBySFTP($connection_params, $dirs, $recursive=false, $continue=false) {
|
||||||
$cnx = connectToSSH($connection_params, true);
|
$cnx = connectToSSH($connection_params, true);
|
||||||
|
@ -248,11 +248,11 @@ LSerror :: defineError('SSH_07',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $connection_params array Connection parameters
|
* @param array $params Connection parameters
|
||||||
* @param[in] $old string The actual directory path to rename
|
* @param array $params The actual directory path to rename
|
||||||
* @param[in] $new string The new directory path
|
* @param array $params The new directory path
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function renameDirBySFTP($connection_params, $old, $new) {
|
function renameDirBySFTP($connection_params, $old, $new) {
|
||||||
$cnx = connectToSSH($connection_params, true);
|
$cnx = connectToSSH($connection_params, true);
|
||||||
|
@ -272,10 +272,10 @@ LSerror :: defineError('SSH_07',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $connection_params array Connection parameters
|
* @param array $params Connection parameters
|
||||||
* @param[in] $cmd string The command to run on remote server
|
* @param array $params The command to run on remote server
|
||||||
*
|
*
|
||||||
* @retval mixed False if connection fail and an array otherwise, with
|
* @return mixed False if connection fail and an array otherwise, with
|
||||||
* exit code as first value and the command outup as second
|
* exit code as first value and the command outup as second
|
||||||
* one (stdout + stderr).
|
* one (stdout + stderr).
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -52,7 +52,7 @@ LSerror :: defineError('SUPANN_04',
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true si SUPANN est pleinement supporté, false sinon
|
* @return boolean true si SUPANN est pleinement supporté, false sinon
|
||||||
*/
|
*/
|
||||||
function LSaddon_supann_support() {
|
function LSaddon_supann_support() {
|
||||||
$retval = true;
|
$retval = true;
|
||||||
|
@ -110,9 +110,9 @@ function LSaddon_supann_support() {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
*
|
*
|
||||||
* @retval string Le displayName ou false si il y a un problème durant la génération
|
* @return string Le displayName ou false si il y a un problème durant la génération
|
||||||
*/
|
*/
|
||||||
function generate_displayName($ldapObject) {
|
function generate_displayName($ldapObject) {
|
||||||
if ( get_class($ldapObject -> attrs[ $GLOBALS['LS_SUPANN_LASTNAME_ATTR'] ]) != 'LSattribute' ) {
|
if ( get_class($ldapObject -> attrs[ $GLOBALS['LS_SUPANN_LASTNAME_ATTR'] ]) != 'LSattribute' ) {
|
||||||
|
@ -141,9 +141,9 @@ function generate_displayName($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
*
|
*
|
||||||
* @retval string Le CN ou false si il y a un problème durant la génération
|
* @return string Le CN ou false si il y a un problème durant la génération
|
||||||
*/
|
*/
|
||||||
function generate_cn($ldapObject) {
|
function generate_cn($ldapObject) {
|
||||||
if ( get_class($ldapObject -> attrs[ $GLOBALS['LS_SUPANN_LASTNAME_ATTR'] ]) != 'LSattribute' ) {
|
if ( get_class($ldapObject -> attrs[ $GLOBALS['LS_SUPANN_LASTNAME_ATTR'] ]) != 'LSattribute' ) {
|
||||||
|
@ -173,9 +173,9 @@ function generate_cn($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
*
|
*
|
||||||
* @retval array Les valeurs de l'attribut eduPersonOrgUnitDN ou false
|
* @return array Les valeurs de l'attribut eduPersonOrgUnitDN ou false
|
||||||
* si il y a un problème durant la génération
|
* si il y a un problème durant la génération
|
||||||
*/
|
*/
|
||||||
function generate_eduPersonOrgUnitDN($ldapObject) {
|
function generate_eduPersonOrgUnitDN($ldapObject) {
|
||||||
|
@ -209,9 +209,9 @@ function generate_eduPersonOrgUnitDN($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
*
|
*
|
||||||
* @retval array La valeur de l'attribut eduPersonPrimaryOrgUnitDN
|
* @return array La valeur de l'attribut eduPersonPrimaryOrgUnitDN
|
||||||
* ou false si il y a un problème durant la génération
|
* ou false si il y a un problème durant la génération
|
||||||
*/
|
*/
|
||||||
function generate_eduPersonPrimaryOrgUnitDN($ldapObject) {
|
function generate_eduPersonPrimaryOrgUnitDN($ldapObject) {
|
||||||
|
@ -245,9 +245,9 @@ function generate_eduPersonPrimaryOrgUnitDN($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
*
|
*
|
||||||
* @retval array La valeur de l'attribut eduPersonOrgDN ou false
|
* @return array La valeur de l'attribut eduPersonOrgDN ou false
|
||||||
* si il y a un problème durant la génération
|
* si il y a un problème durant la génération
|
||||||
*/
|
*/
|
||||||
function generate_eduPersonOrgDN($ldapObject) {
|
function generate_eduPersonOrgDN($ldapObject) {
|
||||||
|
@ -277,9 +277,9 @@ function generate_eduPersonOrgDN($ldapObject) {
|
||||||
*
|
*
|
||||||
* {SUPANN}S410
|
* {SUPANN}S410
|
||||||
*
|
*
|
||||||
* @param[in] $val La valeur
|
* @param string $val La valeur
|
||||||
*
|
*
|
||||||
* @retval array Un tableau cle->valeur contenant label et value ou False
|
* @return array Un tableau cle->valeur contenant label et value ou False
|
||||||
**/
|
**/
|
||||||
function supannParseLabeledValue($value) {
|
function supannParseLabeledValue($value) {
|
||||||
if (preg_match('/^\{([^\}]*)\}(.*)$/', $value, $m)) {
|
if (preg_match('/^\{([^\}]*)\}(.*)$/', $value, $m)) {
|
||||||
|
@ -300,9 +300,9 @@ function supannParseLabeledValue($value) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $val La valeur composite
|
* @param string $val La valeur composite
|
||||||
*
|
*
|
||||||
* @retval array Un tableau contenant key->value ou false en cas d'erreur
|
* @return array Un tableau contenant key->value ou false en cas d'erreur
|
||||||
**/
|
**/
|
||||||
function supannParseCompositeValue($val) {
|
function supannParseCompositeValue($val) {
|
||||||
// Check value is valid
|
// Check value is valid
|
||||||
|
@ -342,9 +342,9 @@ function supannParseCompositeValue($val) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $val Tableau associatif des valeurs
|
* @param array $val Tableau associatif des valeurs
|
||||||
*
|
*
|
||||||
* @retval array Un tableau contenant key->value ou false en cas d'erreur
|
* @return array Un tableau contenant key->value ou false en cas d'erreur
|
||||||
**/
|
**/
|
||||||
function supannFormatCompositeValue($val) {
|
function supannFormatCompositeValue($val) {
|
||||||
$retval = "";
|
$retval = "";
|
||||||
|
@ -361,9 +361,9 @@ function supannFormatCompositeValue($val) {
|
||||||
/**
|
/**
|
||||||
* Retourne le nom court d'une entite en fonction de son identifiant
|
* Retourne le nom court d'une entite en fonction de son identifiant
|
||||||
*
|
*
|
||||||
* @param[in] $id L'identifiant de l'entite (supannCodeEntite)
|
* @param string $id L'identifiant de l'entite (supannCodeEntite)
|
||||||
*
|
*
|
||||||
* @retval string Le nom de l'entite
|
* @return string Le nom de l'entite
|
||||||
**/
|
**/
|
||||||
function supanGetEntiteNameById($id) {
|
function supanGetEntiteNameById($id) {
|
||||||
if (LSsession::loadLSobject($GLOBALS['LS_SUPANN_LSOBJECT_ENTITE_TYPE'])) {
|
if (LSsession::loadLSobject($GLOBALS['LS_SUPANN_LSOBJECT_ENTITE_TYPE'])) {
|
||||||
|
@ -379,9 +379,9 @@ function supanGetEntiteNameById($id) {
|
||||||
/**
|
/**
|
||||||
* Valide l'ID d'une entite
|
* Valide l'ID d'une entite
|
||||||
*
|
*
|
||||||
* @param[in] $id L'identifiant de l'entite (supannCodeEntite)
|
* @param string $id L'identifiant de l'entite (supannCodeEntite)
|
||||||
*
|
*
|
||||||
* @retval boolean True si une entité avec cet ID existe, False sinon
|
* @return boolean True si une entité avec cet ID existe, False sinon
|
||||||
**/
|
**/
|
||||||
function supannValidateEntityId($id) {
|
function supannValidateEntityId($id) {
|
||||||
if (LSsession::loadLSobject($GLOBALS['LS_SUPANN_LSOBJECT_ENTITE_TYPE'])) {
|
if (LSsession::loadLSobject($GLOBALS['LS_SUPANN_LSOBJECT_ENTITE_TYPE'])) {
|
||||||
|
@ -399,10 +399,10 @@ function supannValidateEntityId($id) {
|
||||||
* et retourne un tableau mettant en relation leur identifiant et leur nom
|
* et retourne un tableau mettant en relation leur identifiant et leur nom
|
||||||
* d'affichage.
|
* d'affichage.
|
||||||
*
|
*
|
||||||
* @param[in] $pattern string Le pattern de recherche
|
* @param string $pattern Le pattern de recherche
|
||||||
* @param[in] $max_matches int Nombre maximum de résultat retournés (optionnel, par défaut : 10)
|
* @param string $pattern Nombre maximum de résultat retournés (optionnel, par défaut : 10)
|
||||||
*
|
*
|
||||||
* @retval array Tableau du résultat de la recherche mettant en relation
|
* @return array Tableau du résultat de la recherche mettant en relation
|
||||||
* l'identifiant des entités trouvés avec leur nom d'affichage.
|
* l'identifiant des entités trouvés avec leur nom d'affichage.
|
||||||
**/
|
**/
|
||||||
function supannSearchEntityByPattern($pattern, $max_matches=10) {
|
function supannSearchEntityByPattern($pattern, $max_matches=10) {
|
||||||
|
@ -437,9 +437,9 @@ function supannSearchEntityByPattern($pattern, $max_matches=10) {
|
||||||
/**
|
/**
|
||||||
* Retourne les infos d'un parrain en fonction de son DN
|
* Retourne les infos d'un parrain en fonction de son DN
|
||||||
*
|
*
|
||||||
* @param[in] $dn Le DN du parrain
|
* @param string $dn Le DN du parrain
|
||||||
*
|
*
|
||||||
* @retval array Le nom, le type et le DN du parrain (Format: array('dn' => [DN], 'type' => [type], 'name' => [name]))
|
* @return array Le nom, le type et le DN du parrain (Format: array('dn' => [DN], 'type' => [type], 'name' => [name]))
|
||||||
**/
|
**/
|
||||||
function supanGetParrainInfoByDN($dn) {
|
function supanGetParrainInfoByDN($dn) {
|
||||||
$matched = array(
|
$matched = array(
|
||||||
|
@ -466,9 +466,9 @@ function supanGetParrainInfoByDN($dn) {
|
||||||
/**
|
/**
|
||||||
* Valide le DN d'un parrain
|
* Valide le DN d'un parrain
|
||||||
*
|
*
|
||||||
* @param[in] $dn Le DN d'un parrain
|
* @param string $dn Le DN d'un parrain
|
||||||
*
|
*
|
||||||
* @retval boolean True si un parrain avec ce DN existe, False sinon
|
* @return boolean True si un parrain avec ce DN existe, False sinon
|
||||||
**/
|
**/
|
||||||
function supannValidateParrainDN($dn) {
|
function supannValidateParrainDN($dn) {
|
||||||
$info = supanGetParrainInfoByDN($dn);
|
$info = supanGetParrainInfoByDN($dn);
|
||||||
|
@ -479,10 +479,10 @@ function supannValidateParrainDN($dn) {
|
||||||
* Cherche des parrains répondant au pattern de recherche passé en paramètres
|
* Cherche des parrains répondant au pattern de recherche passé en paramètres
|
||||||
* et retourne un tableau mettant en relation leur DN et leur nom d'affichage.
|
* et retourne un tableau mettant en relation leur DN et leur nom d'affichage.
|
||||||
*
|
*
|
||||||
* @param[in] $pattern string Le pattern de recherche
|
* @param string $pattern Le pattern de recherche
|
||||||
* @param[in] $max_matches int Nombre maximum de résultat retournés (optionnel, par défaut : 10)
|
* @param string $pattern Nombre maximum de résultat retournés (optionnel, par défaut : 10)
|
||||||
*
|
*
|
||||||
* @retval array Tableau du résultat de la recherche mettant en relation
|
* @return array Tableau du résultat de la recherche mettant en relation
|
||||||
* le DN des parrains trouvés avec leur nom d'affichage.
|
* le DN des parrains trouvés avec leur nom d'affichage.
|
||||||
**/
|
**/
|
||||||
function supannSearchParrainByPattern($pattern, $max_matches=10) {
|
function supannSearchParrainByPattern($pattern, $max_matches=10) {
|
||||||
|
@ -518,11 +518,11 @@ function supannSearchParrainByPattern($pattern, $max_matches=10) {
|
||||||
/**
|
/**
|
||||||
* Vérifie si une valeur et son étiquette sont valide pour une table donnée
|
* Vérifie si une valeur et son étiquette sont valide pour une table donnée
|
||||||
*
|
*
|
||||||
* @param[in] $table La table de nomenclature
|
* @param string $table La table de nomenclature
|
||||||
* @param[in] $label L'étiquette de la valeur (optionnel)
|
* @param string $label L'étiquette de la valeur (optionnel)
|
||||||
* @param[in] $value La valeur
|
* @param string $value La valeur
|
||||||
*
|
*
|
||||||
* @retval booleab True si valide, False sinon
|
* @return booleab True si valide, False sinon
|
||||||
**/
|
**/
|
||||||
function supannValidateNomenclatureValue($table, $label, $value) {
|
function supannValidateNomenclatureValue($table, $label, $value) {
|
||||||
if (!supannLoadNomenclature($table))
|
if (!supannLoadNomenclature($table))
|
||||||
|
@ -561,11 +561,11 @@ function supannValidateNomenclatureValue($table, $label, $value) {
|
||||||
* Retourne le label d'une valeur en fonction de la table de nomenclature
|
* Retourne le label d'une valeur en fonction de la table de nomenclature
|
||||||
* et de l'étiquette de la valeur.
|
* et de l'étiquette de la valeur.
|
||||||
*
|
*
|
||||||
* @param[in] $table La table de nomenclature
|
* @param string $table La table de nomenclature
|
||||||
* @param[in] $label L'étiquette de la valeur (optionnel)
|
* @param string $label L'étiquette de la valeur (optionnel)
|
||||||
* @param[in] $value La valeur
|
* @param string $value La valeur
|
||||||
*
|
*
|
||||||
* @retval array Le label de la valeur. En cas de valeur nor-reconnue, retourne
|
* @return array Le label de la valeur. En cas de valeur nor-reconnue, retourne
|
||||||
* la valeur en spécifiant qu'elle n'est pas reconnue.
|
* la valeur en spécifiant qu'elle n'est pas reconnue.
|
||||||
**/
|
**/
|
||||||
function supannGetNomenclatureLabel($table, $label, $value) {
|
function supannGetNomenclatureLabel($table, $label, $value) {
|
||||||
|
@ -578,9 +578,9 @@ function supannGetNomenclatureLabel($table, $label, $value) {
|
||||||
/**
|
/**
|
||||||
* Retourne les valeurs possibles d'une table de nomenclature pour chaque fournisseur
|
* Retourne les valeurs possibles d'une table de nomenclature pour chaque fournisseur
|
||||||
*
|
*
|
||||||
* @param[in] $table La table de nomenclature
|
* @param string $table La table de nomenclature
|
||||||
*
|
*
|
||||||
* @retval array Tableau contenant pour chaque fournisseur, les valeurs possibles de
|
* @return array Tableau contenant pour chaque fournisseur, les valeurs possibles de
|
||||||
* la table de nomenclature
|
* la table de nomenclature
|
||||||
**/
|
**/
|
||||||
function supannGetNomenclatureTable($table) {
|
function supannGetNomenclatureTable($table) {
|
||||||
|
@ -598,12 +598,12 @@ function supannGetNomenclatureTable($table) {
|
||||||
/**
|
/**
|
||||||
* Retourne les valeurs possibles d'une table de nomenclature
|
* Retourne les valeurs possibles d'une table de nomenclature
|
||||||
*
|
*
|
||||||
* @param[in] $table La table de nomenclature
|
* @param string $table La table de nomenclature
|
||||||
* @param[in] $add_provider_label Booléen définissant si le fournisseur de la valeur
|
* @param bool $add_provider_label Booléen définissant si le fournisseur de la valeur
|
||||||
* doit être ajouté en tant qu'étiquette de la valeur
|
* doit être ajouté en tant qu'étiquette de la valeur
|
||||||
* (optinel, par défaut: vrai)
|
* (optinel, par défaut: vrai)
|
||||||
*
|
*
|
||||||
* @retval array Tableau contenant les valeurs possibles de la table
|
* @return array Tableau contenant les valeurs possibles de la table
|
||||||
* de nomenclature
|
* de nomenclature
|
||||||
**/
|
**/
|
||||||
function supannGetNomenclaturePossibleValues($table, $add_provider_label=True) {
|
function supannGetNomenclaturePossibleValues($table, $add_provider_label=True) {
|
||||||
|
@ -626,10 +626,10 @@ function supannGetNomenclaturePossibleValues($table, $add_provider_label=True) {
|
||||||
* Cherche des valeurs d'une nomenclature répondant au pattern de recherche passé en paramètres
|
* Cherche des valeurs d'une nomenclature répondant au pattern de recherche passé en paramètres
|
||||||
* et retourne un tableau de celles-ci.
|
* et retourne un tableau de celles-ci.
|
||||||
*
|
*
|
||||||
* @param[in] $pattern string Le pattern de recherche
|
* @param string $pattern Le pattern de recherche
|
||||||
* @param[in] $max_matches int Nombre maximum de résultat retournés (optionnel, par défaut : 10)
|
* @param string $pattern Nombre maximum de résultat retournés (optionnel, par défaut : 10)
|
||||||
*
|
*
|
||||||
* @retval array Tableau du résultat de la recherche
|
* @return array Tableau du résultat de la recherche
|
||||||
**/
|
**/
|
||||||
function supannSearchNomenclatureValueByPattern($table, $pattern, $max_matches=10) {
|
function supannSearchNomenclatureValueByPattern($table, $pattern, $max_matches=10) {
|
||||||
$retval = array();
|
$retval = array();
|
||||||
|
@ -659,11 +659,11 @@ function supannSearchNomenclatureValueByPattern($table, $pattern, $max_matches=1
|
||||||
* get_possible_values de la configuration HTML de l'attribut
|
* get_possible_values de la configuration HTML de l'attribut
|
||||||
* supannCivilite avec un type d'attribut HTML select_list (ou select_box).
|
* supannCivilite avec un type d'attribut HTML select_list (ou select_box).
|
||||||
*
|
*
|
||||||
* @param[in] $options La configuration HTML de l'attribut
|
* @param array $options La configuration HTML de l'attribut
|
||||||
* @param[in] $name Le nom de l'attribut
|
* @param string $name Le nom de l'attribut
|
||||||
* @param[in] &$ldapObject Une référence à l'object LSldapObject
|
* @param LSldapObject &$ldapObject Une référence à l'object LSldapObject
|
||||||
*
|
*
|
||||||
* @retval array Tableau contenant les valeurs possibles de l'attribut
|
* @return array Tableau contenant les valeurs possibles de l'attribut
|
||||||
* (avec les labels traduits).
|
* (avec les labels traduits).
|
||||||
**/
|
**/
|
||||||
function supannGetCivilitePossibleValues($options, $name, $ldapObject) {
|
function supannGetCivilitePossibleValues($options, $name, $ldapObject) {
|
||||||
|
@ -677,11 +677,11 @@ function supannGetCivilitePossibleValues($options, $name, $ldapObject) {
|
||||||
* get_possible_values de la configuration HTML de l'attribut
|
* get_possible_values de la configuration HTML de l'attribut
|
||||||
* eduPersonAffiliation (par exemple) avec un type d'attribut HTML select_list.
|
* eduPersonAffiliation (par exemple) avec un type d'attribut HTML select_list.
|
||||||
*
|
*
|
||||||
* @param[in] $options La configuration HTML de l'attribut
|
* @param array $options La configuration HTML de l'attribut
|
||||||
* @param[in] $name Le nom de l'attribut
|
* @param string $name Le nom de l'attribut
|
||||||
* @param[in] &$ldapObject Une référence à l'object LSldapObject
|
* @param LSldapObject &$ldapObject Une référence à l'object LSldapObject
|
||||||
*
|
*
|
||||||
* @retval array Tableau contenant les valeurs possibles de l'attribut
|
* @return array Tableau contenant les valeurs possibles de l'attribut
|
||||||
* (avec les labels traduits).
|
* (avec les labels traduits).
|
||||||
**/
|
**/
|
||||||
function supannGetAffiliationPossibleValues($options=null, $name=null, $ldapObject=null) {
|
function supannGetAffiliationPossibleValues($options=null, $name=null, $ldapObject=null) {
|
||||||
|
@ -695,11 +695,11 @@ function supannGetAffiliationPossibleValues($options=null, $name=null, $ldapObje
|
||||||
* get_possible_values de la configuration du composant ressource de l'attribut
|
* get_possible_values de la configuration du composant ressource de l'attribut
|
||||||
* supannRessourceEtat (entre autre) avec un type de composant select.
|
* supannRessourceEtat (entre autre) avec un type de composant select.
|
||||||
*
|
*
|
||||||
* @param[in] $options La configuration HTML de l'attribut
|
* @param array $options La configuration HTML de l'attribut
|
||||||
* @param[in] $name Le nom de l'attribut
|
* @param string $name Le nom de l'attribut
|
||||||
* @param[in] &$ldapObject Une référence à l'object LSldapObject
|
* @param LSldapObject &$ldapObject Une référence à l'object LSldapObject
|
||||||
*
|
*
|
||||||
* @retval array Tableau contenant les valeurs possibles de l'attribut
|
* @return array Tableau contenant les valeurs possibles de l'attribut
|
||||||
* (avec les labels traduits).
|
* (avec les labels traduits).
|
||||||
**/
|
**/
|
||||||
function supannGetRessourcePossibleValues($options=null, $name=null, $ldapObject=null) {
|
function supannGetRessourcePossibleValues($options=null, $name=null, $ldapObject=null) {
|
||||||
|
@ -713,11 +713,11 @@ function supannGetRessourcePossibleValues($options=null, $name=null, $ldapObject
|
||||||
* get_possible_values de la configuration du composant etat de l'attribut
|
* get_possible_values de la configuration du composant etat de l'attribut
|
||||||
* supannRessourceEtat (entre autre) avec un type de composant select.
|
* supannRessourceEtat (entre autre) avec un type de composant select.
|
||||||
*
|
*
|
||||||
* @param[in] $options La configuration HTML de l'attribut
|
* @param array $options La configuration HTML de l'attribut
|
||||||
* @param[in] $name Le nom de l'attribut
|
* @param string $name Le nom de l'attribut
|
||||||
* @param[in] &$ldapObject Une référence à l'object LSldapObject
|
* @param LSldapObject &$ldapObject Une référence à l'object LSldapObject
|
||||||
*
|
*
|
||||||
* @retval array Tableau contenant les valeurs possibles de l'attribut
|
* @return array Tableau contenant les valeurs possibles de l'attribut
|
||||||
* (avec les labels traduits).
|
* (avec les labels traduits).
|
||||||
**/
|
**/
|
||||||
function supannGetRessourceEtatPossibleValues($options=null, $name=null, $ldapObject=null) {
|
function supannGetRessourceEtatPossibleValues($options=null, $name=null, $ldapObject=null) {
|
||||||
|
@ -731,11 +731,11 @@ function supannGetRessourceEtatPossibleValues($options=null, $name=null, $ldapOb
|
||||||
* get_possible_values de la configuration du composant sous_etat de l'attribut
|
* get_possible_values de la configuration du composant sous_etat de l'attribut
|
||||||
* supannRessourceEtat (entre autre) avec un type de composant select.
|
* supannRessourceEtat (entre autre) avec un type de composant select.
|
||||||
*
|
*
|
||||||
* @param[in] $options La configuration HTML de l'attribut
|
* @param array $options La configuration HTML de l'attribut
|
||||||
* @param[in] $name Le nom de l'attribut
|
* @param string $name Le nom de l'attribut
|
||||||
* @param[in] &$ldapObject Une référence à l'object LSldapObject
|
* @param LSldapObject &$ldapObject Une référence à l'object LSldapObject
|
||||||
*
|
*
|
||||||
* @retval array Tableau contenant les valeurs possibles de l'attribut
|
* @return array Tableau contenant les valeurs possibles de l'attribut
|
||||||
* (avec les labels traduits).
|
* (avec les labels traduits).
|
||||||
**/
|
**/
|
||||||
function supannGetRessourceSousEtatPossibleValues($options=null, $name=null, $ldapObject=null) {
|
function supannGetRessourceSousEtatPossibleValues($options=null, $name=null, $ldapObject=null) {
|
||||||
|
@ -754,10 +754,10 @@ function supannGetRessourceSousEtatPossibleValues($options=null, $name=null, $ld
|
||||||
*
|
*
|
||||||
* @author Benjamin Dauvergne <bdauvergne@entrouvert.com>
|
* @author Benjamin Dauvergne <bdauvergne@entrouvert.com>
|
||||||
*
|
*
|
||||||
* @param[in] &$ldapObject Une référence à l'object LSldapObject
|
* @param LSldapObject &$ldapObject Une référence à l'object LSldapObject
|
||||||
* @author Benjamin Dauvergne <bdauvergne@entrouvert.com>
|
* @author Benjamin Dauvergne <bdauvergne@entrouvert.com>
|
||||||
*
|
*
|
||||||
* @retval boolean True si les valeurs sont valides, False sinon
|
* @return boolean True si les valeurs sont valides, False sinon
|
||||||
**/
|
**/
|
||||||
global $_supannCheckEduPersonAffiliation_checked;
|
global $_supannCheckEduPersonAffiliation_checked;
|
||||||
$_supannCheckEduPersonAffiliation_checked = false;
|
$_supannCheckEduPersonAffiliation_checked = false;
|
||||||
|
@ -784,9 +784,9 @@ function supannCheckEduPersonAffiliation(&$ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Dauvergne <bdauvergne@entrouvert.com>
|
* @author Benjamin Dauvergne <bdauvergne@entrouvert.com>
|
||||||
*
|
*
|
||||||
* @param[in] &$ldapObject Une référence à l'object LSldapObject
|
* @param LSldapObject &$ldapObject Une référence à l'object LSldapObject
|
||||||
*
|
*
|
||||||
* @retval boolean True si la valeur est valide, False sinon
|
* @return boolean True si la valeur est valide, False sinon
|
||||||
**/
|
**/
|
||||||
function supannCheckEduPersonPrimaryAffiliation(&$ldapObject) {
|
function supannCheckEduPersonPrimaryAffiliation(&$ldapObject) {
|
||||||
$primary = $ldapObject->getValue('eduPersonPrimaryAffiliation');
|
$primary = $ldapObject->getValue('eduPersonPrimaryAffiliation');
|
||||||
|
@ -803,11 +803,11 @@ function supannCheckEduPersonPrimaryAffiliation(&$ldapObject) {
|
||||||
* get_possible_values de la configuration HTML de l'attribut
|
* get_possible_values de la configuration HTML de l'attribut
|
||||||
* supannOIDCGenre avec un type d'attribut HTML select_list ou select_box.
|
* supannOIDCGenre avec un type d'attribut HTML select_list ou select_box.
|
||||||
*
|
*
|
||||||
* @param[in] $options La configuration HTML de l'attribut
|
* @param array $options La configuration HTML de l'attribut
|
||||||
* @param[in] $name Le nom de l'attribut
|
* @param string $name Le nom de l'attribut
|
||||||
* @param[in] &$ldapObject Une référence à l'object LSldapObject
|
* @param LSldapObject &$ldapObject Une référence à l'object LSldapObject
|
||||||
*
|
*
|
||||||
* @retval array Tableau contenant les valeurs possibles de l'attribut
|
* @return array Tableau contenant les valeurs possibles de l'attribut
|
||||||
* (avec les labels traduits).
|
* (avec les labels traduits).
|
||||||
**/
|
**/
|
||||||
function supannGetOIDCGenrePossibleValues($options, $name, $ldapObject) {
|
function supannGetOIDCGenrePossibleValues($options, $name, $ldapObject) {
|
||||||
|
@ -837,9 +837,9 @@ function supannDetectCodesPopulations($populations, $prefix="") {
|
||||||
/*
|
/*
|
||||||
* Charge une nomenclature SUPANN
|
* Charge une nomenclature SUPANN
|
||||||
*
|
*
|
||||||
* @param[in] $table string La nomenclature à charger
|
* @param string $pattern La nomenclature à charger
|
||||||
*
|
*
|
||||||
* @retval boolean True si la nomenclature est chargée, False en cas de problème
|
* @return boolean True si la nomenclature est chargée, False en cas de problème
|
||||||
*/
|
*/
|
||||||
$GLOBALS['_supann_loaded_nomenclatures'] = array();
|
$GLOBALS['_supann_loaded_nomenclatures'] = array();
|
||||||
function supannLoadNomenclature($table) {
|
function supannLoadNomenclature($table) {
|
||||||
|
@ -1007,9 +1007,9 @@ function supannLoadNomenclature($table) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
*
|
*
|
||||||
* @retval array La valeur de l'attribut eduPersonOrgDN ou false
|
* @return array La valeur de l'attribut eduPersonOrgDN ou false
|
||||||
* si il y a un problème durant la génération
|
* si il y a un problème durant la génération
|
||||||
*/
|
*/
|
||||||
function generate_eduPersonPrincipalName($ldapObject) {
|
function generate_eduPersonPrincipalName($ldapObject) {
|
||||||
|
@ -1022,9 +1022,9 @@ function generate_eduPersonPrincipalName($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
*
|
*
|
||||||
* @retval array La valeur de l'attribut eduPersonOrgDN ou false
|
* @return array La valeur de l'attribut eduPersonOrgDN ou false
|
||||||
* si il y a un problème durant la génération
|
* si il y a un problème durant la génération
|
||||||
*/
|
*/
|
||||||
function generate_eduPersonUniqueId($ldapObject) {
|
function generate_eduPersonUniqueId($ldapObject) {
|
||||||
|
@ -1044,9 +1044,9 @@ function generate_eduPersonUniqueId($ldapObject) {
|
||||||
* Note: Cette fonction peut également être utilisé pour le type d'objet
|
* Note: Cette fonction peut également être utilisé pour le type d'objet
|
||||||
* correspond aux établissements.
|
* correspond aux établissements.
|
||||||
*
|
*
|
||||||
* @param[in] &$ldapObject Une référence à l'object LSldapObject
|
* @param LSldapObject &$ldapObject Une référence à l'object LSldapObject
|
||||||
*
|
*
|
||||||
* @retval boolean True si la valeur est valide, False sinon
|
* @return boolean True si la valeur est valide, False sinon
|
||||||
**/
|
**/
|
||||||
function supannCheckEntityCouldBeDeleted($ldapObject) {
|
function supannCheckEntityCouldBeDeleted($ldapObject) {
|
||||||
$children = $ldapObject -> listObjectsInRelation(
|
$children = $ldapObject -> listObjectsInRelation(
|
||||||
|
@ -1067,11 +1067,11 @@ function supannCheckEntityCouldBeDeleted($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
* @param[in] $component Le composant associés à l'attribut à généré
|
* @param string $component Le composant associés à l'attribut à généré
|
||||||
* @param[in] $ignore_value Valeur possible du composant qui doit être ignoré (optionnel)
|
* @param string $ignore_value Valeur possible du composant qui doit être ignoré (optionnel)
|
||||||
*
|
*
|
||||||
* @retval array Les valeurs (uniques) du composant passé en paramètres trouvées dans les
|
* @return array Les valeurs (uniques) du composant passé en paramètres trouvées dans les
|
||||||
* valeurs de l'attribut supannEtuInscription
|
* valeurs de l'attribut supannEtuInscription
|
||||||
*/
|
*/
|
||||||
function generate_from_supannEtuInscription($ldapObject, $component, $ignore_value=null) {
|
function generate_from_supannEtuInscription($ldapObject, $component, $ignore_value=null) {
|
||||||
|
@ -1108,9 +1108,9 @@ function generate_from_supannEtuInscription($ldapObject, $component, $ignore_val
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
*
|
*
|
||||||
* @retval array Les valeurs de l'attribut supannEtuDiplome
|
* @return array Les valeurs de l'attribut supannEtuDiplome
|
||||||
*/
|
*/
|
||||||
function generate_supannEtuDiplome($ldapObject) {
|
function generate_supannEtuDiplome($ldapObject) {
|
||||||
return generate_from_supannEtuInscription($ldapObject, 'diplome');
|
return generate_from_supannEtuInscription($ldapObject, 'diplome');
|
||||||
|
@ -1122,9 +1122,9 @@ function generate_supannEtuDiplome($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
*
|
*
|
||||||
* @retval array Les valeurs de l'attribut supannEtuTypeDiplome
|
* @return array Les valeurs de l'attribut supannEtuTypeDiplome
|
||||||
*/
|
*/
|
||||||
function generate_supannEtuTypeDiplome($ldapObject) {
|
function generate_supannEtuTypeDiplome($ldapObject) {
|
||||||
return generate_from_supannEtuInscription($ldapObject, 'typedip');
|
return generate_from_supannEtuInscription($ldapObject, 'typedip');
|
||||||
|
@ -1136,9 +1136,9 @@ function generate_supannEtuTypeDiplome($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
*
|
*
|
||||||
* @retval array Les valeurs de l'attribut supannEtuRegimeInscription
|
* @return array Les valeurs de l'attribut supannEtuRegimeInscription
|
||||||
*/
|
*/
|
||||||
function generate_supannEtuRegimeInscription($ldapObject) {
|
function generate_supannEtuRegimeInscription($ldapObject) {
|
||||||
return generate_from_supannEtuInscription($ldapObject, 'regimeinsc', '$');
|
return generate_from_supannEtuInscription($ldapObject, 'regimeinsc', '$');
|
||||||
|
@ -1150,9 +1150,9 @@ function generate_supannEtuRegimeInscription($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
*
|
*
|
||||||
* @retval array Les valeurs de l'attribut supannEtuSecteurDisciplinaire
|
* @return array Les valeurs de l'attribut supannEtuSecteurDisciplinaire
|
||||||
*/
|
*/
|
||||||
function generate_supannEtuSecteurDisciplinaire($ldapObject) {
|
function generate_supannEtuSecteurDisciplinaire($ldapObject) {
|
||||||
return generate_from_supannEtuInscription($ldapObject, 'sectdisc', '-');
|
return generate_from_supannEtuInscription($ldapObject, 'sectdisc', '-');
|
||||||
|
@ -1164,9 +1164,9 @@ function generate_supannEtuSecteurDisciplinaire($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
*
|
*
|
||||||
* @retval array Les valeurs de l'attribut supannEtuAnneeInscription
|
* @return array Les valeurs de l'attribut supannEtuAnneeInscription
|
||||||
*/
|
*/
|
||||||
function generate_supannEtuAnneeInscription($ldapObject) {
|
function generate_supannEtuAnneeInscription($ldapObject) {
|
||||||
return generate_from_supannEtuInscription($ldapObject, 'anneeinsc');
|
return generate_from_supannEtuInscription($ldapObject, 'anneeinsc');
|
||||||
|
@ -1178,9 +1178,9 @@ function generate_supannEtuAnneeInscription($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
*
|
*
|
||||||
* @retval array Les valeurs de l'attribut supannEtuCursusAnnee
|
* @return array Les valeurs de l'attribut supannEtuCursusAnnee
|
||||||
*/
|
*/
|
||||||
function generate_supannEtuCursusAnnee($ldapObject) {
|
function generate_supannEtuCursusAnnee($ldapObject) {
|
||||||
return generate_from_supannEtuInscription($ldapObject, 'cursusann');
|
return generate_from_supannEtuInscription($ldapObject, 'cursusann');
|
||||||
|
@ -1192,9 +1192,9 @@ function generate_supannEtuCursusAnnee($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
*
|
*
|
||||||
* @retval array Les valeurs de l'attribut supannEtuElementPedagogique
|
* @return array Les valeurs de l'attribut supannEtuElementPedagogique
|
||||||
*/
|
*/
|
||||||
function generate_supannEtuElementPedagogique($ldapObject) {
|
function generate_supannEtuElementPedagogique($ldapObject) {
|
||||||
return generate_from_supannEtuInscription($ldapObject, 'eltpedago');
|
return generate_from_supannEtuInscription($ldapObject, 'eltpedago');
|
||||||
|
@ -1206,9 +1206,9 @@ function generate_supannEtuElementPedagogique($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
*
|
*
|
||||||
* @retval array Les valeurs de l'attribut supannEtuEtape
|
* @return array Les valeurs de l'attribut supannEtuEtape
|
||||||
*/
|
*/
|
||||||
function generate_supannEtuEtape($ldapObject) {
|
function generate_supannEtuEtape($ldapObject) {
|
||||||
return generate_from_supannEtuInscription($ldapObject, 'etape');
|
return generate_from_supannEtuInscription($ldapObject, 'etape');
|
||||||
|
@ -1220,9 +1220,9 @@ function generate_supannEtuEtape($ldapObject) {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $ldapObject L'objet ldap
|
* @param LSldapObject $ldapObject L'objet ldap
|
||||||
*
|
*
|
||||||
* @retval array Les valeurs de l'attribut supannEtuDateFin
|
* @return array Les valeurs de l'attribut supannEtuDateFin
|
||||||
*/
|
*/
|
||||||
function generate_supannEtuDateFin($ldapObject) {
|
function generate_supannEtuDateFin($ldapObject) {
|
||||||
$values = generate_from_supannEtuInscription($ldapObject, 'datefin');
|
$values = generate_from_supannEtuInscription($ldapObject, 'datefin');
|
||||||
|
|
|
@ -54,11 +54,11 @@ class LSattr_html extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $name string Nom de l'attribut ldap
|
* @param string $name Nom de l'attribut ldap
|
||||||
* @param[in] $config array Configuration de l'objet
|
* @param array $config Configuration de l'objet
|
||||||
* @param[in] &$attribute LSattribute L'objet LSattribut parent
|
* @param LSattribute &$attribute L'objet LSattribut parent
|
||||||
*
|
*
|
||||||
* @retval boolean Retourne true.
|
* @return boolean Retourne true.
|
||||||
*/
|
*/
|
||||||
public function __construct($name, $config, &$attribute) {
|
public function __construct($name, $config, &$attribute) {
|
||||||
$this -> name = $name;
|
$this -> name = $name;
|
||||||
|
@ -70,7 +70,7 @@ class LSattr_html extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Allow conversion of LSattr_html to string
|
* Allow conversion of LSattr_html to string
|
||||||
*
|
*
|
||||||
* @retval string The string representation of the LSattr_html
|
* @return string The string representation of the LSattr_html
|
||||||
*/
|
*/
|
||||||
public function __toString() {
|
public function __toString() {
|
||||||
return "<".get_class($this)." ".$this -> name.">";
|
return "<".get_class($this)." ".$this -> name.">";
|
||||||
|
@ -82,7 +82,7 @@ class LSattr_html extends LSlog_staticLoggerClass {
|
||||||
* Retourne le label de l'attribut ou son nom si aucun label n'est défini
|
* Retourne le label de l'attribut ou son nom si aucun label n'est défini
|
||||||
* dans la configuration.
|
* dans la configuration.
|
||||||
*
|
*
|
||||||
* @retval string Le label de l'attribut.
|
* @return string Le label de l'attribut.
|
||||||
*/
|
*/
|
||||||
public function getLabel() {
|
public function getLabel() {
|
||||||
return __($this -> getConfig('label', $this -> name));
|
return __($this -> getConfig('label', $this -> name));
|
||||||
|
@ -91,11 +91,11 @@ class LSattr_html extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Ajoute l'attribut au formualaire passer en paramètre
|
* Ajoute l'attribut au formualaire passer en paramètre
|
||||||
*
|
*
|
||||||
* @param[in] &$form LSform Le formulaire
|
* @param LSform &$form Le formulaire
|
||||||
* @param[in] $idForm L'identifiant du formulaire
|
* @param string $idForm L'identifiant du formulaire
|
||||||
* @param[in] $data Valeur du champs du formulaire
|
* @param array|string|null $data Valeur du champs du formulaire
|
||||||
*
|
*
|
||||||
* @retval LSformElement L'element du formulaire ajouté
|
* @return LSformElement L'element du formulaire ajouté
|
||||||
*/
|
*/
|
||||||
public function addToForm (&$form,$idForm,$data=NULL) {
|
public function addToForm (&$form,$idForm,$data=NULL) {
|
||||||
if (!$this -> LSformElement_type) {
|
if (!$this -> LSformElement_type) {
|
||||||
|
@ -123,9 +123,9 @@ class LSattr_html extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Effectue les tâches nécéssaires au moment du rafraichissement du formulaire
|
* Effectue les tâches nécéssaires au moment du rafraichissement du formulaire
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed La valeur de l'attribut
|
* @param mixed $data La valeur de l'attribut
|
||||||
*
|
*
|
||||||
* @retval mixed La valeur formatée de l'attribut
|
* @return mixed La valeur formatée de l'attribut
|
||||||
**/
|
**/
|
||||||
public function refreshForm($data) {
|
public function refreshForm($data) {
|
||||||
return $data;
|
return $data;
|
||||||
|
@ -134,9 +134,9 @@ class LSattr_html extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return the values to be displayed in the LSform
|
* Return the values to be displayed in the LSform
|
||||||
*
|
*
|
||||||
* @param[in] $data The values of attribute
|
* @param array $data The values of attribute
|
||||||
*
|
*
|
||||||
* @retval array The values to be displayed in the LSform
|
* @return array The values to be displayed in the LSform
|
||||||
**/
|
**/
|
||||||
public function getFormVal($data) {
|
public function getFormVal($data) {
|
||||||
return $this -> attribute -> getDisplayValue($data);
|
return $this -> attribute -> getDisplayValue($data);
|
||||||
|
@ -149,7 +149,7 @@ class LSattr_html extends LSlog_staticLoggerClass {
|
||||||
* @param[] $default The default value (default : null)
|
* @param[] $default The default value (default : null)
|
||||||
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
||||||
*
|
*
|
||||||
* @retval mixed The configuration parameter value or default value if not set
|
* @return mixed The configuration parameter value or default value if not set
|
||||||
**/
|
**/
|
||||||
public function getConfig($param, $default=null, $cast=null) {
|
public function getConfig($param, $default=null, $cast=null) {
|
||||||
return LSconfig :: get($param, $default, $cast, $this -> config);
|
return LSconfig :: get($param, $default, $cast, $this -> config);
|
||||||
|
|
|
@ -32,11 +32,11 @@ class LSattr_html_date extends LSattr_html {
|
||||||
/**
|
/**
|
||||||
* Ajoute l'attribut au formualaire passer en paramètre
|
* Ajoute l'attribut au formualaire passer en paramètre
|
||||||
*
|
*
|
||||||
* @param[in] &$form LSform Le formulaire
|
* @param LSform &$form Le formulaire
|
||||||
* @param[in] $idForm L'identifiant du formulaire
|
* @param string $idForm L'identifiant du formulaire
|
||||||
* @param[in] $data Valeur du champs du formulaire
|
* @param array|string|null $data Valeur du champs du formulaire
|
||||||
*
|
*
|
||||||
* @retval LSformElement L'element du formulaire ajouté
|
* @return LSformElement L'element du formulaire ajouté
|
||||||
*/
|
*/
|
||||||
function addToForm (&$form,$idForm,$data=NULL) {
|
function addToForm (&$form,$idForm,$data=NULL) {
|
||||||
$element = parent::addToForm($form,$idForm,$data);
|
$element = parent::addToForm($form,$idForm,$data);
|
||||||
|
|
|
@ -32,13 +32,13 @@ class LSattr_html_sambaAcctFlags extends LSattr_html_select_box {
|
||||||
/**
|
/**
|
||||||
* Retourne un tableau des valeurs possibles de la liste
|
* Retourne un tableau des valeurs possibles de la liste
|
||||||
*
|
*
|
||||||
* @param[in] $options Attribute options (optional)
|
* @param array $options Attribute options (optional)
|
||||||
* @param[in] $name Attribute name (optional)
|
* @param string $name Attribute name (optional)
|
||||||
* @param[in] &$ldapObject Related LSldapObject (optional)
|
* @param LSldapObject &$ldapObject Related LSldapObject (optional)
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval array Tableau associatif des valeurs possible de la liste avec en clé
|
* @return array Tableau associatif des valeurs possible de la liste avec en clé
|
||||||
* la valeur des balises option et en valeur ce qui sera affiché.
|
* la valeur des balises option et en valeur ce qui sera affiché.
|
||||||
*/
|
*/
|
||||||
public static function _getPossibleValues($options=false, $name=false, &$ldapObject=false) {
|
public static function _getPossibleValues($options=false, $name=false, &$ldapObject=false) {
|
||||||
|
|
|
@ -47,11 +47,11 @@ class LSattr_html_select_list extends LSattr_html{
|
||||||
/**
|
/**
|
||||||
* Ajoute l'attribut au formualaire passer en paramètre
|
* Ajoute l'attribut au formualaire passer en paramètre
|
||||||
*
|
*
|
||||||
* @param[in] &$form LSform Le formulaire
|
* @param LSform &$form Le formulaire
|
||||||
* @param[in] $idForm L'identifiant du formulaire
|
* @param string $idForm L'identifiant du formulaire
|
||||||
* @param[in] $data Valeur du champs du formulaire
|
* @param array|string|null $data Valeur du champs du formulaire
|
||||||
*
|
*
|
||||||
* @retval LSformElement L'element du formulaire ajouté
|
* @return LSformElement L'element du formulaire ajouté
|
||||||
*/
|
*/
|
||||||
public function addToForm (&$form,$idForm,$data=NULL) {
|
public function addToForm (&$form,$idForm,$data=NULL) {
|
||||||
$possible_values=$this -> getPossibleValues();
|
$possible_values=$this -> getPossibleValues();
|
||||||
|
@ -70,7 +70,7 @@ class LSattr_html_select_list extends LSattr_html{
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval array Associative array with possible values as key and corresponding
|
* @return array Associative array with possible values as key and corresponding
|
||||||
* translated label as value.
|
* translated label as value.
|
||||||
*/
|
*/
|
||||||
protected function getPossibleValues() {
|
protected function getPossibleValues() {
|
||||||
|
@ -84,13 +84,13 @@ class LSattr_html_select_list extends LSattr_html{
|
||||||
/**
|
/**
|
||||||
* Return array of possible values with translated labels (if enabled)
|
* Return array of possible values with translated labels (if enabled)
|
||||||
*
|
*
|
||||||
* @param[in] $options Attribute HTML options (optional)
|
* @param array $options Attribute HTML options (optional)
|
||||||
* @param[in] $name Attribute name (optional)
|
* @param string $name Attribute name (optional)
|
||||||
* @param[in] &$ldapObject Related LSldapObject (optional)
|
* @param LSldapObject &$ldapObject Related LSldapObject (optional)
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval array Associative array with possible values as key and corresponding
|
* @return array Associative array with possible values as key and corresponding
|
||||||
* translated label as value.
|
* translated label as value.
|
||||||
*/
|
*/
|
||||||
public static function _getPossibleValues($options=false, $name=false, &$ldapObject=false) {
|
public static function _getPossibleValues($options=false, $name=false, &$ldapObject=false) {
|
||||||
|
@ -152,7 +152,7 @@ class LSattr_html_select_list extends LSattr_html{
|
||||||
* As array_merge PHP function, this function merge arrays but
|
* As array_merge PHP function, this function merge arrays but
|
||||||
* this method permit to preverve key even if it's numeric key.
|
* this method permit to preverve key even if it's numeric key.
|
||||||
*
|
*
|
||||||
* @retval array Merged array
|
* @return array Merged array
|
||||||
**/
|
**/
|
||||||
protected static function _array_merge() {
|
protected static function _array_merge() {
|
||||||
$ret=array();
|
$ret=array();
|
||||||
|
@ -167,10 +167,10 @@ class LSattr_html_select_list extends LSattr_html{
|
||||||
/**
|
/**
|
||||||
* Apply sort feature on possible values if this feature is enabled
|
* Apply sort feature on possible values if this feature is enabled
|
||||||
*
|
*
|
||||||
* @param[in] &$retInfos array Possible values array reference to sort
|
* @param array &$retInfos Possible values array reference to sort
|
||||||
* @param[in] $options array|false Attribute HTML options
|
* @param array|false $options Attribute HTML options
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function _sort(&$retInfos, $options) {
|
public static function _sort(&$retInfos, $options) {
|
||||||
if (!isset($options['sort']) || $options['sort']) {
|
if (!isset($options['sort']) || $options['sort']) {
|
||||||
|
@ -186,10 +186,10 @@ class LSattr_html_select_list extends LSattr_html{
|
||||||
/**
|
/**
|
||||||
* Function use with uasort to sort two values in ASC order
|
* Function use with uasort to sort two values in ASC order
|
||||||
*
|
*
|
||||||
* @param[in] $va string One value
|
* @param string $va One value
|
||||||
* @param[in] $vb string One value
|
* @param string $va One value
|
||||||
*
|
*
|
||||||
* @retval int Value for uasort
|
* @return int Value for uasort
|
||||||
**/
|
**/
|
||||||
protected static function _sortTwoValuesAsc(&$va,&$vb) {
|
protected static function _sortTwoValuesAsc(&$va,&$vb) {
|
||||||
if (is_array($va)) {
|
if (is_array($va)) {
|
||||||
|
@ -216,10 +216,10 @@ class LSattr_html_select_list extends LSattr_html{
|
||||||
/**
|
/**
|
||||||
* Function use with uasort to sort two values in DESC order
|
* Function use with uasort to sort two values in DESC order
|
||||||
*
|
*
|
||||||
* @param[in] $va string One value
|
* @param string $va One value
|
||||||
* @param[in] $vb string One value
|
* @param string $va One value
|
||||||
*
|
*
|
||||||
* @retval int Value for uasort
|
* @return int Value for uasort
|
||||||
**/
|
**/
|
||||||
protected static function _sortTwoValuesDesc(&$va,&$vb) {
|
protected static function _sortTwoValuesDesc(&$va,&$vb) {
|
||||||
return (-1 * static :: _sortTwoValuesAsc($va,$vb));
|
return (-1 * static :: _sortTwoValuesAsc($va,$vb));
|
||||||
|
@ -229,13 +229,13 @@ class LSattr_html_select_list extends LSattr_html{
|
||||||
/**
|
/**
|
||||||
* Retourne un tableau des valeurs possibles d'un type d'objet
|
* Retourne un tableau des valeurs possibles d'un type d'objet
|
||||||
*
|
*
|
||||||
* @param[in] $conf OTHER_OBJECT configuration array
|
* @param array $conf OTHER_OBJECT configuration array
|
||||||
* @param[in] $options array|false Attribute HTML options
|
* @param array|false $options Attribute HTML options
|
||||||
* @param[in] $name Attribute name
|
* @param string $name Attribute name
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval array Tableau associatif des valeurs possible de la liste avec en clé
|
* @return array Tableau associatif des valeurs possible de la liste avec en clé
|
||||||
* la valeur des balises option et en valeur ce qui sera affiché.
|
* la valeur des balises option et en valeur ce qui sera affiché.
|
||||||
*/
|
*/
|
||||||
protected static function getLSobjectPossibleValues($conf, $options, $name) {
|
protected static function getLSobjectPossibleValues($conf, $options, $name) {
|
||||||
|
@ -299,14 +299,14 @@ class LSattr_html_select_list extends LSattr_html{
|
||||||
/**
|
/**
|
||||||
* Retourne un tableau des valeurs possibles d'un autre attribut
|
* Retourne un tableau des valeurs possibles d'un autre attribut
|
||||||
*
|
*
|
||||||
* @param[in] $attr OTHER_ATTRIBUTE configuration value
|
* @param string|array $attr OTHER_ATTRIBUTE configuration value
|
||||||
* @param[in] $options array|false Attribute HTML options
|
* @param array|false $options Attribute HTML options
|
||||||
* @param[in] $name Attribute name
|
* @param string $name Attribute name
|
||||||
* @param[in] $LSldapObject LSldapObject reference
|
* @param LSform &$form reference
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval array Tableau associatif des valeurs possible de la liste avec en clé
|
* @return array Tableau associatif des valeurs possible de la liste avec en clé
|
||||||
* la valeur des balises option et en valeur ce qui sera affiché.
|
* la valeur des balises option et en valeur ce qui sera affiché.
|
||||||
*/
|
*/
|
||||||
protected static function getLSattributePossibleValues($attr, $options ,$name ,&$ldapObject) {
|
protected static function getLSattributePossibleValues($attr, $options ,$name ,&$ldapObject) {
|
||||||
|
@ -381,13 +381,13 @@ class LSattr_html_select_list extends LSattr_html{
|
||||||
* Return array of possible values with translated labels (if enabled)
|
* Return array of possible values with translated labels (if enabled)
|
||||||
* by using specify callable
|
* by using specify callable
|
||||||
*
|
*
|
||||||
* @param[in] $options Attribute HTML options
|
* @param array $options Attribute HTML options
|
||||||
* @param[in] $name Attribute name
|
* @param string $name Attribute name
|
||||||
* @param[in] &$ldapObject Related LSldapObject
|
* @param LSldapObject &$ldapObject Related LSldapObject
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval array|false Associative array with possible values as key and corresponding
|
* @return array|false Associative array with possible values as key and corresponding
|
||||||
* translated label as value, or false in case of error.
|
* translated label as value, or false in case of error.
|
||||||
*/
|
*/
|
||||||
public static function getCallablePossibleValues($options, $name, &$ldapObject) {
|
public static function getCallablePossibleValues($options, $name, &$ldapObject) {
|
||||||
|
|
|
@ -33,11 +33,11 @@ class LSattr_html_select_object extends LSattr_html{
|
||||||
/**
|
/**
|
||||||
* Ajoute l'attribut au formualaire passer en paramètre
|
* Ajoute l'attribut au formualaire passer en paramètre
|
||||||
*
|
*
|
||||||
* @param[in] &$form LSform Le formulaire
|
* @param LSform &$form Le formulaire
|
||||||
* @param[in] $idForm L'identifiant du formulaire
|
* @param string $idForm L'identifiant du formulaire
|
||||||
* @param[in] $data Valeur du champs du formulaire
|
* @param array|string|null $data Valeur du champs du formulaire
|
||||||
*
|
*
|
||||||
* @retval LSformElement L'element du formulaire ajouté
|
* @return LSformElement L'element du formulaire ajouté
|
||||||
*/
|
*/
|
||||||
public function addToForm (&$form,$idForm,$data=NULL) {
|
public function addToForm (&$form,$idForm,$data=NULL) {
|
||||||
$this -> config['attrObject'] = $this;
|
$this -> config['attrObject'] = $this;
|
||||||
|
@ -61,9 +61,9 @@ class LSattr_html_select_object extends LSattr_html{
|
||||||
* Récupère un array du type array('DNs' => 'displayName') à partir d'une
|
* Récupère un array du type array('DNs' => 'displayName') à partir d'une
|
||||||
* liste de DNs.
|
* liste de DNs.
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed La valeur de l'attribut (liste de DNs)
|
* @param mixed $data La valeur de l'attribut (liste de DNs)
|
||||||
*
|
*
|
||||||
* @retval mixed La valeur formatée de l'attribut (array('DNs' => 'displayName'))
|
* @return mixed La valeur formatée de l'attribut (array('DNs' => 'displayName'))
|
||||||
**/
|
**/
|
||||||
public function refreshForm($data,$fromDNs=false) {
|
public function refreshForm($data,$fromDNs=false) {
|
||||||
return $this -> getFormValues($data,$fromDNs);
|
return $this -> getFormValues($data,$fromDNs);
|
||||||
|
@ -73,13 +73,13 @@ class LSattr_html_select_object extends LSattr_html{
|
||||||
* Check and return selectable objects configuration and eventually instanciate
|
* Check and return selectable objects configuration and eventually instanciate
|
||||||
* it if &instanciate
|
* it if &instanciate
|
||||||
*
|
*
|
||||||
* @param[in] boolean &$instanciated_objects reference If this reference point to an array, each valid
|
* @param boolean &$instanciated_objects reference If this reference point to an array, each valid
|
||||||
* selectable object type will be instanciated in this
|
* selectable object type will be instanciated in this
|
||||||
* array with object type name as key.
|
* array with object type name as key.
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval array|false Selectable objects configuration or False on error.
|
* @return array|false Selectable objects configuration or False on error.
|
||||||
*/
|
*/
|
||||||
public function getSelectableObjectsConfig(&$instanciated_objects) {
|
public function getSelectableObjectsConfig(&$instanciated_objects) {
|
||||||
$confs = $this -> getConfig('html_options.selectable_object');
|
$confs = $this -> getConfig('html_options.selectable_object');
|
||||||
|
@ -166,14 +166,14 @@ class LSattr_html_select_object extends LSattr_html{
|
||||||
* Return an array of selected objects with DN as key and as value, an array with object name (key name)
|
* Return an array of selected objects with DN as key and as value, an array with object name (key name)
|
||||||
* and type (key object_type).
|
* and type (key object_type).
|
||||||
*
|
*
|
||||||
* @param[in] mixed $values array|null Array of the input values ()
|
* @param mixed $values array|null Array of the input values ()
|
||||||
* @param[in] boolean $fromDNs boolean If true, considered provided values as DNs (default: false)
|
* @param boolean $fromDNs boolean If true, considered provided values as DNs (default: false)
|
||||||
* @param[in] boolean $retrieveAttrValues boolean If true, attribute values will be returned instead
|
* @param boolean $retrieveAttrValues boolean If true, attribute values will be returned instead
|
||||||
* of selected objects info (default: false)
|
* of selected objects info (default: false)
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval array|false Array of selected objects with DN as key and object info as value or array
|
* @return array|false Array of selected objects with DN as key and object info as value or array
|
||||||
* of attribute values if $retrieveAttrValues==true or False on error.
|
* of attribute values if $retrieveAttrValues==true or False on error.
|
||||||
*/
|
*/
|
||||||
public function getFormValues($values=NULL, $fromDNs=false, $retrieveAttrValues=false) {
|
public function getFormValues($values=NULL, $fromDNs=false, $retrieveAttrValues=false) {
|
||||||
|
@ -343,11 +343,11 @@ class LSattr_html_select_object extends LSattr_html{
|
||||||
/**
|
/**
|
||||||
* Return array of atttribute values form array of form values
|
* Return array of atttribute values form array of form values
|
||||||
*
|
*
|
||||||
* @param[in] mixed Array of form values
|
* @param mixed $values Array of form values
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval array|false Array of attribute values or False on error.
|
* @return array|false Array of attribute values or False on error.
|
||||||
*/
|
*/
|
||||||
public function getValuesFromFormValues($values=NULL) {
|
public function getValuesFromFormValues($values=NULL) {
|
||||||
if (is_array($values)) {
|
if (is_array($values)) {
|
||||||
|
@ -362,7 +362,7 @@ class LSattr_html_select_object extends LSattr_html{
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval array Tableau associatif des objects selectionnés avec en clé
|
* @return array Tableau associatif des objects selectionnés avec en clé
|
||||||
* le DN et en valeur ce qui sera affiché.
|
* le DN et en valeur ce qui sera affiché.
|
||||||
*/
|
*/
|
||||||
public function getValuesFromLSselect() {
|
public function getValuesFromLSselect() {
|
||||||
|
@ -383,9 +383,9 @@ class LSattr_html_select_object extends LSattr_html{
|
||||||
/**
|
/**
|
||||||
* Return the values to be displayed in the LSform
|
* Return the values to be displayed in the LSform
|
||||||
*
|
*
|
||||||
* @param[in] $data The values of attribute
|
* @param array $data The values of attribute
|
||||||
*
|
*
|
||||||
* @retval array The values to be displayed in the LSform
|
* @return array The values to be displayed in the LSform
|
||||||
**/
|
**/
|
||||||
public function getFormVal($data) {
|
public function getFormVal($data) {
|
||||||
return $data;
|
return $data;
|
||||||
|
|
|
@ -40,11 +40,11 @@ class LSattr_ldap extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $name string Nom de l'attribut ldap
|
* @param string $name Nom de l'attribut ldap
|
||||||
* @param[in] $config array Configuration de l'objet
|
* @param array $config Configuration de l'objet
|
||||||
* @param[in] &$attribute LSattribute L'objet LSattribut parent
|
* @param LSattribute &$attribute L'objet LSattribut parent
|
||||||
*
|
*
|
||||||
* @retval boolean Retourne true.
|
* @return boolean Retourne true.
|
||||||
*/
|
*/
|
||||||
public function __construct($name, $config, &$attribute) {
|
public function __construct($name, $config, &$attribute) {
|
||||||
$this -> name = $name;
|
$this -> name = $name;
|
||||||
|
@ -56,7 +56,7 @@ class LSattr_ldap extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Allow conversion of LSattr_ldap to string
|
* Allow conversion of LSattr_ldap to string
|
||||||
*
|
*
|
||||||
* @retval string The string representation of the LSattr_ldap
|
* @return string The string representation of the LSattr_ldap
|
||||||
*/
|
*/
|
||||||
public function __toString() {
|
public function __toString() {
|
||||||
return "<".get_class($this)." ".$this -> name.">";
|
return "<".get_class($this)." ".$this -> name.">";
|
||||||
|
@ -65,9 +65,9 @@ class LSattr_ldap extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Retourne la valeur de l'attribut après traitement lié à son type ldap
|
* Retourne la valeur de l'attribut après traitement lié à son type ldap
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed La valeur de l'attribut
|
* @param mixed $data La valeur de l'attribut
|
||||||
*
|
*
|
||||||
* @retval mixed La valeur traitée de l'attribut
|
* @return mixed La valeur traitée de l'attribut
|
||||||
*/
|
*/
|
||||||
public function getUpdateData($data) {
|
public function getUpdateData($data) {
|
||||||
return ensureIsArray($data);
|
return ensureIsArray($data);
|
||||||
|
@ -76,9 +76,9 @@ class LSattr_ldap extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Retourne la valeur d'affichage de l'attribut après traitement lié à son type ldap
|
* Retourne la valeur d'affichage de l'attribut après traitement lié à son type ldap
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed La valeur de l'attribut
|
* @param mixed $data La valeur de l'attribut
|
||||||
*
|
*
|
||||||
* @retval mixed La valeur d'affichage de l'attribut
|
* @return mixed La valeur d'affichage de l'attribut
|
||||||
*/
|
*/
|
||||||
public function getDisplayValue($data) {
|
public function getDisplayValue($data) {
|
||||||
return ensureIsArray($data);
|
return ensureIsArray($data);
|
||||||
|
@ -88,9 +88,9 @@ class LSattr_ldap extends LSlog_staticLoggerClass {
|
||||||
* Retourne vrai si la valeur passé en paramètre n'était pas la même que la
|
* Retourne vrai si la valeur passé en paramètre n'était pas la même que la
|
||||||
* valeur passer au formulaire
|
* valeur passer au formulaire
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed La valeur a tester
|
* @param mixed $data La valeur a tester
|
||||||
*
|
*
|
||||||
* @retval boolean True uniquement si la valeur passer en paramètre différe de l'actuelle
|
* @return boolean True uniquement si la valeur passer en paramètre différe de l'actuelle
|
||||||
*/
|
*/
|
||||||
public function isUpdated($data) {
|
public function isUpdated($data) {
|
||||||
$data = $this -> getUpdateData($data);
|
$data = $this -> getUpdateData($data);
|
||||||
|
@ -107,7 +107,7 @@ class LSattr_ldap extends LSlog_staticLoggerClass {
|
||||||
* @param[] $default The default value (default : null)
|
* @param[] $default The default value (default : null)
|
||||||
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
||||||
*
|
*
|
||||||
* @retval mixed The configuration parameter value or default value if not set
|
* @return mixed The configuration parameter value or default value if not set
|
||||||
**/
|
**/
|
||||||
public function getConfig($param, $default=null, $cast=null) {
|
public function getConfig($param, $default=null, $cast=null) {
|
||||||
return LSconfig :: get($param, $default, $cast, $this -> config);
|
return LSconfig :: get($param, $default, $cast, $this -> config);
|
||||||
|
|
|
@ -28,9 +28,9 @@ class LSattr_ldap_boolean extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Return display value of attribute after treatment related to LDAP type
|
* Return display value of attribute after treatment related to LDAP type
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed Attribute data
|
* @param mixed $data Attribute data
|
||||||
*
|
*
|
||||||
* @retval mixed Attribute display value
|
* @return mixed Attribute display value
|
||||||
**/
|
**/
|
||||||
public function getDisplayValue($data) {
|
public function getDisplayValue($data) {
|
||||||
if ($this -> isTrue($data))
|
if ($this -> isTrue($data))
|
||||||
|
@ -43,9 +43,9 @@ class LSattr_ldap_boolean extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Return attribute value after treatment related to LDAP type
|
* Return attribute value after treatment related to LDAP type
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed Attribute data
|
* @param mixed $data Attribute data
|
||||||
*
|
*
|
||||||
* @retval mixed Attribute data
|
* @return mixed Attribute data
|
||||||
**/
|
**/
|
||||||
public function getUpdateData($data) {
|
public function getUpdateData($data) {
|
||||||
$data = ensureIsArray($data);
|
$data = ensureIsArray($data);
|
||||||
|
@ -63,9 +63,9 @@ class LSattr_ldap_boolean extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Check if a value corresponding to True
|
* Check if a value corresponding to True
|
||||||
*
|
*
|
||||||
* @param[in] $data Attribute data
|
* @param array|string|null $data Attribute data
|
||||||
*
|
*
|
||||||
* @retval boolean True or False
|
* @return boolean True or False
|
||||||
**/
|
**/
|
||||||
public function isTrue($data) {
|
public function isTrue($data) {
|
||||||
$data = ensureIsArray($data);
|
$data = ensureIsArray($data);
|
||||||
|
@ -78,9 +78,9 @@ class LSattr_ldap_boolean extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Check if a value corresponding to False
|
* Check if a value corresponding to False
|
||||||
*
|
*
|
||||||
* @param[in] $data Attribute data
|
* @param array|string|null $data Attribute data
|
||||||
*
|
*
|
||||||
* @retval boolean True or False
|
* @return boolean True or False
|
||||||
**/
|
**/
|
||||||
public function isFalse($data) {
|
public function isFalse($data) {
|
||||||
$data = ensureIsArray($data);
|
$data = ensureIsArray($data);
|
||||||
|
@ -93,7 +93,7 @@ class LSattr_ldap_boolean extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Return True value
|
* Return True value
|
||||||
*
|
*
|
||||||
* @retval string The True value
|
* @return string The True value
|
||||||
**/
|
**/
|
||||||
public function getTrue() {
|
public function getTrue() {
|
||||||
return $this -> getConfig('ldap_options.true_value', 'TRUE', 'string');
|
return $this -> getConfig('ldap_options.true_value', 'TRUE', 'string');
|
||||||
|
@ -102,7 +102,7 @@ class LSattr_ldap_boolean extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Return False value
|
* Return False value
|
||||||
*
|
*
|
||||||
* @retval string The False value
|
* @return string The False value
|
||||||
**/
|
**/
|
||||||
public function getFalse() {
|
public function getFalse() {
|
||||||
return $this -> getConfig('ldap_options.false_value', 'FALSE', 'string');
|
return $this -> getConfig('ldap_options.false_value', 'FALSE', 'string');
|
||||||
|
|
|
@ -32,9 +32,9 @@ class LSattr_ldap_compositeValueToJSON extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Retourne la valeur d'affichage de l'attribut après traitement lié à son type ldap
|
* Retourne la valeur d'affichage de l'attribut après traitement lié à son type ldap
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed La valeur de l'attribut
|
* @param mixed $data La valeur de l'attribut
|
||||||
*
|
*
|
||||||
* @retval mixed La valeur d'affichage de l'attribut
|
* @return mixed La valeur d'affichage de l'attribut
|
||||||
*/
|
*/
|
||||||
public function getDisplayValue($data) {
|
public function getDisplayValue($data) {
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
@ -46,9 +46,9 @@ class LSattr_ldap_compositeValueToJSON extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Retourne la valeur de l'attribut après traitement lié à son type ldap
|
* Retourne la valeur de l'attribut après traitement lié à son type ldap
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed La valeur de l'attribut
|
* @param mixed $data La valeur de l'attribut
|
||||||
*
|
*
|
||||||
* @retval mixed La valeur traitée de l'attribut
|
* @return mixed La valeur traitée de l'attribut
|
||||||
*/
|
*/
|
||||||
public function getUpdateData($data) {
|
public function getUpdateData($data) {
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
|
|
@ -29,9 +29,9 @@ class LSattr_ldap_date extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Retourne la valeur d'affichage de l'attribut après traitement lié à son type ldap
|
* Retourne la valeur d'affichage de l'attribut après traitement lié à son type ldap
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed La valeur de l'attribut
|
* @param mixed $data La valeur de l'attribut
|
||||||
*
|
*
|
||||||
* @retval mixed La valeur d'affichage de l'attribut
|
* @return mixed La valeur d'affichage de l'attribut
|
||||||
*/
|
*/
|
||||||
public function getDisplayValue($data) {
|
public function getDisplayValue($data) {
|
||||||
$data = ensureIsArray($data);
|
$data = ensureIsArray($data);
|
||||||
|
@ -51,9 +51,9 @@ class LSattr_ldap_date extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Retourne la valeur de l'attribut après traitement lié à son type ldap
|
* Retourne la valeur de l'attribut après traitement lié à son type ldap
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed La valeur de l'attribut
|
* @param mixed $data La valeur de l'attribut
|
||||||
*
|
*
|
||||||
* @retval mixed La valeur traitée de l'attribut
|
* @return mixed La valeur traitée de l'attribut
|
||||||
*/
|
*/
|
||||||
public function getUpdateData($data) {
|
public function getUpdateData($data) {
|
||||||
$data = ensureIsArray($data);
|
$data = ensureIsArray($data);
|
||||||
|
@ -78,7 +78,7 @@ class LSattr_ldap_date extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Retourne le format de stockage de la date
|
* Retourne le format de stockage de la date
|
||||||
*
|
*
|
||||||
* @retval string Le format de la date
|
* @return string Le format de la date
|
||||||
**/
|
**/
|
||||||
public function getFormat() {
|
public function getFormat() {
|
||||||
return $this -> getConfig('ldap_options.format', 'YmdHisO');
|
return $this -> getConfig('ldap_options.format', 'YmdHisO');
|
||||||
|
|
|
@ -31,9 +31,9 @@ class LSattr_ldap_naiveDate extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Return the display value of the attribute after handling is LDAP type
|
* Return the display value of the attribute after handling is LDAP type
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed The LDAP attribute value
|
* @param mixed $data The LDAP attribute value
|
||||||
*
|
*
|
||||||
* @retval mixed The display value ot the attribute
|
* @return mixed The display value ot the attribute
|
||||||
*/
|
*/
|
||||||
public function getDisplayValue($data) {
|
public function getDisplayValue($data) {
|
||||||
$retval = array();
|
$retval = array();
|
||||||
|
@ -56,9 +56,9 @@ class LSattr_ldap_naiveDate extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Return the value of the LDAP attribute after handling is LDAP type
|
* Return the value of the LDAP attribute after handling is LDAP type
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed The value of the attribute
|
* @param mixed $data The value of the attribute
|
||||||
*
|
*
|
||||||
* @retval mixed The LDAP value of the attribute
|
* @return mixed The LDAP value of the attribute
|
||||||
*/
|
*/
|
||||||
public function getUpdateData($data) {
|
public function getUpdateData($data) {
|
||||||
$retval = array();
|
$retval = array();
|
||||||
|
@ -72,7 +72,7 @@ class LSattr_ldap_naiveDate extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Return the storage format of the date (as accept by strptime()/strftime())
|
* Return the storage format of the date (as accept by strptime()/strftime())
|
||||||
*
|
*
|
||||||
* @retval string the storage format of the date
|
* @return string the storage format of the date
|
||||||
**/
|
**/
|
||||||
public function getFormat() {
|
public function getFormat() {
|
||||||
return $this -> getConfig('ldap_options.format', "%Y%m%d%H%M%SZ");
|
return $this -> getConfig('ldap_options.format', "%Y%m%d%H%M%SZ");
|
||||||
|
|
|
@ -31,9 +31,9 @@ class LSattr_ldap_password extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Return the display value of this attribute
|
* Return the display value of this attribute
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed The value of this attribute
|
* @param mixed $data The value of this attribute
|
||||||
*
|
*
|
||||||
* @retval mixed The display value of this attribute
|
* @return mixed The display value of this attribute
|
||||||
*/
|
*/
|
||||||
public function getDisplayValue($data) {
|
public function getDisplayValue($data) {
|
||||||
if ($this -> getConfig('ldap_options.displayClearValue', false, 'bool')) {
|
if ($this -> getConfig('ldap_options.displayClearValue', false, 'bool')) {
|
||||||
|
@ -56,9 +56,9 @@ class LSattr_ldap_password extends LSattr_ldap {
|
||||||
* Note : Password encoding was strongly inspired of the project phpLdapAdmin.
|
* Note : Password encoding was strongly inspired of the project phpLdapAdmin.
|
||||||
* URL : http://phpldapadmin.sourceforge.net/
|
* URL : http://phpldapadmin.sourceforge.net/
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed The attribute value
|
* @param mixed $data The attribute value
|
||||||
*
|
*
|
||||||
* @retval mixed The value of this attribute to be stocked
|
* @return mixed The value of this attribute to be stocked
|
||||||
*/
|
*/
|
||||||
public function getUpdateData($data) {
|
public function getUpdateData($data) {
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
@ -84,9 +84,9 @@ class LSattr_ldap_password extends LSattr_ldap {
|
||||||
* Note : Password encoding was strongly inspired of the project phpLdapAdmin.
|
* Note : Password encoding was strongly inspired of the project phpLdapAdmin.
|
||||||
* URL : http://phpldapadmin.sourceforge.net/
|
* URL : http://phpldapadmin.sourceforge.net/
|
||||||
*
|
*
|
||||||
* @param[in] $clearPassword string The clear password
|
* @param mixed $data The clear password
|
||||||
*
|
*
|
||||||
* @retval strinf The encode password
|
* @return strinf The encode password
|
||||||
*/
|
*/
|
||||||
public function encodePassword($clearPassword, $encode=null, $encode_function=null, $salt=null) {
|
public function encodePassword($clearPassword, $encode=null, $encode_function=null, $salt=null) {
|
||||||
if (is_null($encode))
|
if (is_null($encode))
|
||||||
|
@ -343,9 +343,9 @@ class LSattr_ldap_password extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Return salt (random string)
|
* Return salt (random string)
|
||||||
*
|
*
|
||||||
* @param[in] integer Number of caracters in this salt
|
* @param integer $length Number of caracters in this salt
|
||||||
*
|
*
|
||||||
* @retval string A salt
|
* @return string A salt
|
||||||
*/
|
*/
|
||||||
public static function getSalt($length=8) {
|
public static function getSalt($length=8) {
|
||||||
$pattern = "1234567890abcdefghijklmnopqrstuvwxyz";
|
$pattern = "1234567890abcdefghijklmnopqrstuvwxyz";
|
||||||
|
@ -360,7 +360,7 @@ class LSattr_ldap_password extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Return the password in clear text
|
* Return the password in clear text
|
||||||
*
|
*
|
||||||
* @retval string The password in clear text
|
* @return string The password in clear text
|
||||||
*/
|
*/
|
||||||
public function getClearPassword() {
|
public function getClearPassword() {
|
||||||
return $this -> clearPassword;
|
return $this -> clearPassword;
|
||||||
|
|
|
@ -29,9 +29,9 @@ class LSattr_ldap_postaladdress extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Retourne la valeur d'affichage de l'attribut après traitement lié à son type ldap
|
* Retourne la valeur d'affichage de l'attribut après traitement lié à son type ldap
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed La valeur de l'attribut
|
* @param mixed $data La valeur de l'attribut
|
||||||
*
|
*
|
||||||
* @retval mixed La valeur d'affichage de l'attribut
|
* @return mixed La valeur d'affichage de l'attribut
|
||||||
*/
|
*/
|
||||||
public function getDisplayValue($data) {
|
public function getDisplayValue($data) {
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
@ -43,9 +43,9 @@ class LSattr_ldap_postaladdress extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Retourne la valeur de l'attribut après traitement lié à son type ldap
|
* Retourne la valeur de l'attribut après traitement lié à son type ldap
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed La valeur de l'attribut
|
* @param mixed $data La valeur de l'attribut
|
||||||
*
|
*
|
||||||
* @retval mixed La valeur traitée de l'attribut
|
* @return mixed La valeur traitée de l'attribut
|
||||||
*/
|
*/
|
||||||
public function getUpdateData($data) {
|
public function getUpdateData($data) {
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
|
|
@ -36,9 +36,9 @@ class LSattr_ldap_pwdHistory extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Return the values as JSON encoded string
|
* Return the values as JSON encoded string
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed LDAP attribute value
|
* @param mixed $data LDAP attribute value
|
||||||
*
|
*
|
||||||
* @retval mixed Array of JSON encoded string
|
* @return mixed Array of JSON encoded string
|
||||||
*/
|
*/
|
||||||
public function getDisplayValue($data) {
|
public function getDisplayValue($data) {
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
@ -50,9 +50,9 @@ class LSattr_ldap_pwdHistory extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Return the values for saving
|
* Return the values for saving
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed Array of timestamp
|
* @param mixed $data Array of timestamp
|
||||||
*
|
*
|
||||||
* @retval mixed LDAP attribute values
|
* @return mixed LDAP attribute values
|
||||||
*/
|
*/
|
||||||
public function getUpdateData($data) {
|
public function getUpdateData($data) {
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
@ -111,7 +111,7 @@ class LSattr_ldap_pwdHistory extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Return date format
|
* Return date format
|
||||||
*
|
*
|
||||||
* @retval string The date format (as accept by Datetime :: format() and date_create_from_format())
|
* @return string The date format (as accept by Datetime :: format() and date_create_from_format())
|
||||||
**/
|
**/
|
||||||
public function getFormat() {
|
public function getFormat() {
|
||||||
return $this -> getConfig('ldap_options.date_format', 'Y/m/d H:i:s');
|
return $this -> getConfig('ldap_options.date_format', 'Y/m/d H:i:s');
|
||||||
|
|
|
@ -28,9 +28,9 @@ class LSattr_ldap_sambaAcctFlags extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Return display value of attribute after treatment related to LDAP type
|
* Return display value of attribute after treatment related to LDAP type
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed Attribute data
|
* @param mixed $data Attribute data
|
||||||
*
|
*
|
||||||
* @retval mixed Attribute display value
|
* @return mixed Attribute display value
|
||||||
**/
|
**/
|
||||||
public function getDisplayValue($data) {
|
public function getDisplayValue($data) {
|
||||||
$values = self :: parse_flags($data);
|
$values = self :: parse_flags($data);
|
||||||
|
@ -42,9 +42,9 @@ class LSattr_ldap_sambaAcctFlags extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Return attribute value after treatment related to LDAP type
|
* Return attribute value after treatment related to LDAP type
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed Attribute data
|
* @param mixed $data Attribute data
|
||||||
*
|
*
|
||||||
* @retval mixed Attribute data
|
* @return mixed Attribute data
|
||||||
**/
|
**/
|
||||||
public function getUpdateData($data) {
|
public function getUpdateData($data) {
|
||||||
$values = self :: format_flags($data);
|
$values = self :: format_flags($data);
|
||||||
|
@ -56,9 +56,9 @@ class LSattr_ldap_sambaAcctFlags extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Parse flags
|
* Parse flags
|
||||||
*
|
*
|
||||||
* @param[in] $data Attribute data
|
* @param array|string|null $data Attribute data
|
||||||
*
|
*
|
||||||
* @retval array Array of enabled flags
|
* @return array Array of enabled flags
|
||||||
**/
|
**/
|
||||||
public static function parse_flags($data) {
|
public static function parse_flags($data) {
|
||||||
if (!$data)
|
if (!$data)
|
||||||
|
@ -94,9 +94,9 @@ class LSattr_ldap_sambaAcctFlags extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Format flags as one LDAP attribute value
|
* Format flags as one LDAP attribute value
|
||||||
*
|
*
|
||||||
* @param[in] $flags array of string Flags
|
* @param array $flags of string Flags
|
||||||
*
|
*
|
||||||
* @retval array Array of LDAP attribute value
|
* @return array Array of LDAP attribute value
|
||||||
**/
|
**/
|
||||||
public static function format_flags($flags) {
|
public static function format_flags($flags) {
|
||||||
$flags = ensureIsArray($flags);
|
$flags = ensureIsArray($flags);
|
||||||
|
@ -117,9 +117,9 @@ class LSattr_ldap_sambaAcctFlags extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Check if a flag is valid
|
* Check if a flag is valid
|
||||||
*
|
*
|
||||||
* @param[in] $flag string The flag
|
* @param string $flag The flag
|
||||||
*
|
*
|
||||||
* @retval boolean True if flag is valid, False otherwise
|
* @return boolean True if flag is valid, False otherwise
|
||||||
**/
|
**/
|
||||||
public static function check_flag($flag) {
|
public static function check_flag($flag) {
|
||||||
foreach(self :: get_available_flags() as $group_label => $flags)
|
foreach(self :: get_available_flags() as $group_label => $flags)
|
||||||
|
|
|
@ -31,9 +31,9 @@ class LSattr_ldap_shadowExpire extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Return the values as timestamps
|
* Return the values as timestamps
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed LDAP attribute value
|
* @param mixed $data LDAP attribute value
|
||||||
*
|
*
|
||||||
* @retval mixed Array of timestamp
|
* @return mixed Array of timestamp
|
||||||
*/
|
*/
|
||||||
public function getDisplayValue($data) {
|
public function getDisplayValue($data) {
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
@ -45,9 +45,9 @@ class LSattr_ldap_shadowExpire extends LSattr_ldap {
|
||||||
/**
|
/**
|
||||||
* Return the values for saving
|
* Return the values for saving
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed Array of timestamp
|
* @param mixed $data Array of timestamp
|
||||||
*
|
*
|
||||||
* @retval mixed LDAP attribute values
|
* @return mixed LDAP attribute values
|
||||||
*/
|
*/
|
||||||
public function getUpdateData($data) {
|
public function getUpdateData($data) {
|
||||||
$ret=array();
|
$ret=array();
|
||||||
|
|
|
@ -55,11 +55,11 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $name string Nom de l'attribut ldap
|
* @param string $name Nom de l'attribut ldap
|
||||||
* @param[in] $config array Configuration de l'objet
|
* @param string $name Configuration de l'objet
|
||||||
* @param[in] &$ldapObject LSldapObject L'objet ldap parent
|
* @param LSldapObject &$ldapObject L'objet ldap parent
|
||||||
*
|
*
|
||||||
* @retval boolean Retourne true si la création a réussi, false sinon.
|
* @return boolean Retourne true si la création a réussi, false sinon.
|
||||||
*/
|
*/
|
||||||
public function __construct($name, $config, &$ldapObject) {
|
public function __construct($name, $config, &$ldapObject) {
|
||||||
$this -> name = $name;
|
$this -> name = $name;
|
||||||
|
@ -88,7 +88,7 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Allow conversion of LSattribute to string
|
* Allow conversion of LSattribute to string
|
||||||
*
|
*
|
||||||
* @retval string The string representation of the LSattribute
|
* @return string The string representation of the LSattribute
|
||||||
*/
|
*/
|
||||||
public function __toString() {
|
public function __toString() {
|
||||||
return strval($this -> ldapObject)." -> <LSattribute ".$this -> name.">";
|
return strval($this -> ldapObject)." -> <LSattribute ".$this -> name.">";
|
||||||
|
@ -99,7 +99,7 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval string Le label de l'attribut
|
* @return string Le label de l'attribut
|
||||||
*
|
*
|
||||||
* @see LSattr_html::getLabel()
|
* @see LSattr_html::getLabel()
|
||||||
*/
|
*/
|
||||||
|
@ -117,7 +117,7 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true
|
* @return boolean true
|
||||||
*/
|
*/
|
||||||
public function loadData($attr_data) {
|
public function loadData($attr_data) {
|
||||||
$this -> data = ensureIsArray($attr_data);
|
$this -> data = ensureIsArray($attr_data);
|
||||||
|
@ -129,7 +129,7 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true
|
* @return boolean true
|
||||||
*/
|
*/
|
||||||
public function reloadData($attr_data) {
|
public function reloadData($attr_data) {
|
||||||
$this -> data = ensureIsArray($attr_data);
|
$this -> data = ensureIsArray($attr_data);
|
||||||
|
@ -145,7 +145,7 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval mixed La valeur de l'attribut
|
* @return mixed La valeur de l'attribut
|
||||||
*/
|
*/
|
||||||
public function getValue() {
|
public function getValue() {
|
||||||
if ($this -> isUpdate()) {
|
if ($this -> isUpdate()) {
|
||||||
|
@ -161,7 +161,7 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval mixed La valeur originale de l'attribut
|
* @return mixed La valeur originale de l'attribut
|
||||||
*/
|
*/
|
||||||
public function getOldValue() {
|
public function getOldValue() {
|
||||||
return $this -> data;
|
return $this -> data;
|
||||||
|
@ -170,11 +170,11 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return attribute's display value
|
* Return attribute's display value
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed Custom attribute data (optional, default: current attribute data)
|
* @param string $name Custom attribute data (optional, default: current attribute data)
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval mixed The display value of the attribute
|
* @return mixed The display value of the attribute
|
||||||
*/
|
*/
|
||||||
public function getDisplayValue($data=false) {
|
public function getDisplayValue($data=false) {
|
||||||
if (!$this -> ldap) {
|
if (!$this -> ldap) {
|
||||||
|
@ -217,12 +217,12 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] object $form Le formulaire dans lequel doit être ajouté l'attribut
|
* @param object $form Le formulaire dans lequel doit être ajouté l'attribut
|
||||||
* @param[in] string $idForm L'identifiant du formulaire
|
* @param string $idForm L'identifiant du formulaire
|
||||||
* @param[in] objet &$obj Objet utilisable pour la génération de la valeur de l'attribut
|
* @param object &$obj Objet utilisable pour la génération de la valeur de l'attribut
|
||||||
* @param[in] array $value valeur de l'élement
|
* @param string $idForm valeur de l'élement
|
||||||
*
|
*
|
||||||
* @retval boolean true si l'ajout a fonctionner ou qu'il n'est pas nécessaire, false sinon
|
* @return boolean true si l'ajout a fonctionner ou qu'il n'est pas nécessaire, false sinon
|
||||||
*/
|
*/
|
||||||
public function addToForm(&$form,$idForm,&$obj=NULL,$value=NULL) {
|
public function addToForm(&$form,$idForm,&$obj=NULL,$value=NULL) {
|
||||||
$form_mode = $this -> getConfig("form.$idForm", false);
|
$form_mode = $this -> getConfig("form.$idForm", false);
|
||||||
|
@ -277,7 +277,7 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Récupération des droits de l'utilisateur sur l'attribut
|
* Récupération des droits de l'utilisateur sur l'attribut
|
||||||
*
|
*
|
||||||
* @retval string 'r'/'w'/'n' pour 'read'/'write'/'none'
|
* @return string 'r'/'w'/'n' pour 'read'/'write'/'none'
|
||||||
**/
|
**/
|
||||||
private function myRights() {
|
private function myRights() {
|
||||||
// cache
|
// cache
|
||||||
|
@ -313,11 +313,11 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $form LSform The LSform object
|
* @param LSldapObject &$ldapObject The LSform object
|
||||||
* @param[in] $api_mode boolean True if it's a view in API mode (=all accessible attributes present,
|
* @param boolean $api_mode True if it's a view in API mode (=all accessible attributes present,
|
||||||
* optional, default: false)
|
* optional, default: false)
|
||||||
*
|
*
|
||||||
* @retval boolean True on success, False otherwise
|
* @return boolean True on success, False otherwise
|
||||||
*/
|
*/
|
||||||
public function addToView(&$form, $api_mode=false) {
|
public function addToView(&$form, $api_mode=false) {
|
||||||
if ((!$api_mode && !$this -> getConfig('view', false, 'bool')) || ($this -> myRights() == 'n') )
|
if ((!$api_mode && !$this -> getConfig('view', false, 'bool')) || ($this -> myRights() == 'n') )
|
||||||
|
@ -335,9 +335,9 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $form LSform The LSform object
|
* @param LSldapObject &$ldapObject The LSform object
|
||||||
*
|
*
|
||||||
* @retval boolean True on success, False otherwise
|
* @return boolean True on success, False otherwise
|
||||||
*/
|
*/
|
||||||
public function addToExport(&$form) {
|
public function addToExport(&$form) {
|
||||||
if ($this -> myRights() == 'n')
|
if ($this -> myRights() == 'n')
|
||||||
|
@ -355,9 +355,9 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] object $form The LSform object
|
* @param object $form The LSform object
|
||||||
*
|
*
|
||||||
* @retval LSformElement|False LSformElement object on success, False otherwise
|
* @return LSformElement|False LSformElement object on success, False otherwise
|
||||||
*/
|
*/
|
||||||
private function _addToForm(&$form, $idForm, &$obj=NULL, $data=NULL) {
|
private function _addToForm(&$form, $idForm, &$obj=NULL, $data=NULL) {
|
||||||
if (!$this -> html) {
|
if (!$this -> html) {
|
||||||
|
@ -387,10 +387,10 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] object &$form LSform Le formulaire dans lequel doit être ajouté l'attribut
|
* @param object $form LSform Le formulaire dans lequel doit être ajouté l'attribut
|
||||||
* @param[in] string $idForm L'identifiant du formulaire
|
* @param string $idForm L'identifiant du formulaire
|
||||||
*
|
*
|
||||||
* @retval boolean true si la valeur a été rafraichie ou que ce n'est pas nécessaire, false sinon
|
* @return boolean true si la valeur a été rafraichie ou que ce n'est pas nécessaire, false sinon
|
||||||
*/
|
*/
|
||||||
public function refreshForm(&$form,$idForm) {
|
public function refreshForm(&$form,$idForm) {
|
||||||
if ($this -> getConfig("form.$idForm") && ($this -> myRights() != 'n')) {
|
if ($this -> getConfig("form.$idForm") && ($this -> myRights() != 'n')) {
|
||||||
|
@ -413,11 +413,11 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return the form display value
|
* Return the form display value
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed Custom attribute data (optional, default: current attribute data)
|
* @param string $name Custom attribute data (optional, default: current attribute data)
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval string The form display value
|
* @return string The form display value
|
||||||
*/
|
*/
|
||||||
public function getFormVal($data=null) {
|
public function getFormVal($data=null) {
|
||||||
if (is_null($data)) {
|
if (is_null($data)) {
|
||||||
|
@ -431,9 +431,9 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] string $data Les données de mise à jour.
|
* @param string $idForm Les données de mise à jour.
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setUpdateData($data) {
|
public function setUpdateData($data) {
|
||||||
if($this -> ldap -> isUpdated($data)) {
|
if($this -> ldap -> isUpdated($data)) {
|
||||||
|
@ -446,7 +446,7 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true si l'attribut a été validé, false sinon
|
* @return boolean true si l'attribut a été validé, false sinon
|
||||||
*/
|
*/
|
||||||
public function isValidate() {
|
public function isValidate() {
|
||||||
return $this -> is_validate;
|
return $this -> is_validate;
|
||||||
|
@ -457,7 +457,7 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function validate() {
|
public function validate() {
|
||||||
$this -> is_validate=true;
|
$this -> is_validate=true;
|
||||||
|
@ -468,7 +468,7 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true si l'attribut a été mis à jour, false sinon
|
* @return boolean true si l'attribut a été mis à jour, false sinon
|
||||||
*/
|
*/
|
||||||
public function isUpdate() {
|
public function isUpdate() {
|
||||||
return ($this -> updateData===false)?false:true;
|
return ($this -> updateData===false)?false:true;
|
||||||
|
@ -479,7 +479,7 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true si l'attribut est obligatoire, false sinon
|
* @return boolean true si l'attribut est obligatoire, false sinon
|
||||||
*/
|
*/
|
||||||
public function isRequired() {
|
public function isRequired() {
|
||||||
return $this -> getConfig('required', false, 'bool');
|
return $this -> getConfig('required', false, 'bool');
|
||||||
|
@ -490,7 +490,7 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true si la valeur de l'attribut peut être générée, false sinon
|
* @return boolean true si la valeur de l'attribut peut être générée, false sinon
|
||||||
*/
|
*/
|
||||||
public function canBeGenerated() {
|
public function canBeGenerated() {
|
||||||
$format = $this -> getConfig('generate_value_format', $this -> getConfig('default_value'));
|
$format = $this -> getConfig('generate_value_format', $this -> getConfig('default_value'));
|
||||||
|
@ -507,7 +507,7 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true si la valeur à put être générée, false sinon
|
* @return boolean true si la valeur à put être générée, false sinon
|
||||||
*/
|
*/
|
||||||
public function generateValue() {
|
public function generateValue() {
|
||||||
$value = $this -> getConfig('default_value', false);
|
$value = $this -> getConfig('default_value', false);
|
||||||
|
@ -533,7 +533,7 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval mixed La valeur de l'attribut pour son enregistrement dans l'annuaire
|
* @return mixed La valeur de l'attribut pour son enregistrement dans l'annuaire
|
||||||
*/
|
*/
|
||||||
public function getUpdateData() {
|
public function getUpdateData() {
|
||||||
if (!$this -> isUpdate()) {
|
if (!$this -> isUpdate()) {
|
||||||
|
@ -584,7 +584,7 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval mixed La configuration de validation de l'attribut
|
* @return mixed La configuration de validation de l'attribut
|
||||||
*/
|
*/
|
||||||
public function getValidateConfig() {
|
public function getValidateConfig() {
|
||||||
if (isset($this -> config['validation'])) {
|
if (isset($this -> config['validation'])) {
|
||||||
|
@ -598,7 +598,7 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval array les noms des attributs dépendants
|
* @return array les noms des attributs dépendants
|
||||||
*/
|
*/
|
||||||
public function getDependsAttrs() {
|
public function getDependsAttrs() {
|
||||||
return (isset($this -> config['dependAttrs'])?$this -> config['dependAttrs']:null);
|
return (isset($this -> config['dependAttrs'])?$this -> config['dependAttrs']:null);
|
||||||
|
@ -607,12 +607,12 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Ajouter une action lors d'un événement
|
* Ajouter une action lors d'un événement
|
||||||
*
|
*
|
||||||
* @param[in] $event string Le nom de l'événement
|
* @param string $name Le nom de l'événement
|
||||||
* @param[in] $fct string Le nom de la fonction à exectuer
|
* @param string $name Le nom de la fonction à exectuer
|
||||||
* @param[in] $params mixed Paramètres pour le lancement de la fonction
|
* @param string $name Paramètres pour le lancement de la fonction
|
||||||
* @param[in] $class Nom de la classe possèdant la méthode $fct à executer
|
* @param string $class Nom de la classe possèdant la méthode $fct à executer
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function addEvent($event,$fct,$params,$class=NULL) {
|
public function addEvent($event,$fct,$params,$class=NULL) {
|
||||||
$this -> _events[$event][] = array(
|
$this -> _events[$event][] = array(
|
||||||
|
@ -625,12 +625,12 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Ajouter une action sur un objet lors d'un événement
|
* Ajouter une action sur un objet lors d'un événement
|
||||||
*
|
*
|
||||||
* @param[in] $event string Le nom de l'événement
|
* @param string $name Le nom de l'événement
|
||||||
* @param[in] $obj object L'objet dont la méthode doit être executé
|
* @param object $obj L'objet dont la méthode doit être executé
|
||||||
* @param[in] $meth string Le nom de la méthode
|
* @param string $name Le nom de la méthode
|
||||||
* @param[in] $params mixed Paramètres d'execution de la méthode
|
* @param string $name Paramètres d'execution de la méthode
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function addObjectEvent($event,&$obj,$meth,$params=NULL) {
|
public function addObjectEvent($event,&$obj,$meth,$params=NULL) {
|
||||||
$this -> _objectEvents[$event][] = array(
|
$this -> _objectEvents[$event][] = array(
|
||||||
|
@ -643,9 +643,9 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Lance les actions à executer lors d'un événement
|
* Lance les actions à executer lors d'un événement
|
||||||
*
|
*
|
||||||
* @param[in] $event string Le nom de l'événement
|
* @param string $name Le nom de l'événement
|
||||||
*
|
*
|
||||||
* @retval boolean True si tout c'est bien passé, false sinon
|
* @return boolean True si tout c'est bien passé, false sinon
|
||||||
*/
|
*/
|
||||||
public function fireEvent($event) {
|
public function fireEvent($event) {
|
||||||
self :: log_debug(strval($this)." -> fireEvent($event)");
|
self :: log_debug(strval($this)." -> fireEvent($event)");
|
||||||
|
@ -740,7 +740,7 @@ class LSattribute extends LSlog_staticLoggerClass {
|
||||||
* @param[] $default The default value (default : null)
|
* @param[] $default The default value (default : null)
|
||||||
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
||||||
*
|
*
|
||||||
* @retval mixed The configuration parameter value or default value if not set
|
* @return mixed The configuration parameter value or default value if not set
|
||||||
**/
|
**/
|
||||||
public function getConfig($param, $default=null, $cast=null) {
|
public function getConfig($param, $default=null, $cast=null) {
|
||||||
return LSconfig :: get($param, $default, $cast, $this -> config);
|
return LSconfig :: get($param, $default, $cast, $this -> config);
|
||||||
|
|
|
@ -102,7 +102,7 @@ class LSauth extends LSlog_staticLoggerClass {
|
||||||
* @param[] $default The default value (default : null)
|
* @param[] $default The default value (default : null)
|
||||||
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
||||||
*
|
*
|
||||||
* @retval mixed The configuration parameter value or default value if not set
|
* @return mixed The configuration parameter value or default value if not set
|
||||||
**/
|
**/
|
||||||
private static function getConfig($param, $default=null, $cast=null) {
|
private static function getConfig($param, $default=null, $cast=null) {
|
||||||
return LSconfig :: get($param, $default, $cast, self :: $config);
|
return LSconfig :: get($param, $default, $cast, self :: $config);
|
||||||
|
@ -142,7 +142,7 @@ class LSauth extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check if the specified auth object type have acces to LdapSaisie (on the current mode)
|
* Check if the specified auth object type have acces to LdapSaisie (on the current mode)
|
||||||
*
|
*
|
||||||
* @param[in] $objType string The LSobject type
|
* @param string $objType The LSobject type
|
||||||
*
|
*
|
||||||
* @return boolean True if specified auth object type have acces to LdapSaisie, False otherwise
|
* @return boolean True if specified auth object type have acces to LdapSaisie, False otherwise
|
||||||
*/
|
*/
|
||||||
|
@ -157,7 +157,7 @@ class LSauth extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Retrieved LSobjects corresponding to a username
|
* Retrieved LSobjects corresponding to a username
|
||||||
*
|
*
|
||||||
* @retval array|false Array of corresponding LSldapObject with object DN as key, or false in case of error
|
* @return array|false Array of corresponding LSldapObject with object DN as key, or false in case of error
|
||||||
*/
|
*/
|
||||||
public static function username2LSobjects($username) {
|
public static function username2LSobjects($username) {
|
||||||
$user_objects = array();
|
$user_objects = array();
|
||||||
|
@ -198,9 +198,9 @@ class LSauth extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Get user password attribute name
|
* Get user password attribute name
|
||||||
*
|
*
|
||||||
* @param[in] &object LSldapObject The user object
|
* @param LSldapObject &object The user object
|
||||||
*
|
*
|
||||||
* @retval string|false The user password attribute name or false if not configured
|
* @return string|false The user password attribute name or false if not configured
|
||||||
*/
|
*/
|
||||||
public static function getUserPasswordAttribute(&$object) {
|
public static function getUserPasswordAttribute(&$object) {
|
||||||
$authObjectTypes = self :: getAuthObjectTypes();
|
$authObjectTypes = self :: getAuthObjectTypes();
|
||||||
|
@ -217,7 +217,7 @@ class LSauth extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @params[in] $user The LSldapObject of the user authificated
|
* @params[in] $user The LSldapObject of the user authificated
|
||||||
*
|
*
|
||||||
* @retval Array|false Array of LDAP credentials array('dn','pwd') or False
|
* @return array|false Array of LDAP credentials array('dn','pwd') or False
|
||||||
**/
|
**/
|
||||||
public static function getLDAPcredentials($user) {
|
public static function getLDAPcredentials($user) {
|
||||||
return self :: $provider -> getLDAPcredentials($user);
|
return self :: $provider -> getLDAPcredentials($user);
|
||||||
|
@ -226,7 +226,7 @@ class LSauth extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Logout
|
* Logout
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function logout() {
|
public static function logout() {
|
||||||
if (!is_null(self :: $provider)) {
|
if (!is_null(self :: $provider)) {
|
||||||
|
@ -242,7 +242,7 @@ class LSauth extends LSlog_staticLoggerClass {
|
||||||
* This method is run by LSsession after the local session was
|
* This method is run by LSsession after the local session was
|
||||||
* was successfully destroyed.
|
* was successfully destroyed.
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function afterLogout() {
|
public static function afterLogout() {
|
||||||
if (!is_null(self :: $provider)) {
|
if (!is_null(self :: $provider)) {
|
||||||
|
@ -255,7 +255,7 @@ class LSauth extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Disable logout button in LSauth parameters
|
* Disable logout button in LSauth parameters
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function disableLogoutBtn() {
|
public static function disableLogoutBtn() {
|
||||||
self :: $params['displayLogoutBtn'] = false;
|
self :: $params['displayLogoutBtn'] = false;
|
||||||
|
@ -264,7 +264,7 @@ class LSauth extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Can display or not logout button in LSauth parameters
|
* Can display or not logout button in LSauth parameters
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @return boolean
|
||||||
**/
|
**/
|
||||||
public static function displayLogoutBtn() {
|
public static function displayLogoutBtn() {
|
||||||
return self :: $params['displayLogoutBtn'];
|
return self :: $params['displayLogoutBtn'];
|
||||||
|
@ -273,7 +273,7 @@ class LSauth extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Disable self access
|
* Disable self access
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function disableSelfAccess() {
|
public static function disableSelfAccess() {
|
||||||
self :: $params['displaySelfAccess'] = false;
|
self :: $params['displaySelfAccess'] = false;
|
||||||
|
@ -282,7 +282,7 @@ class LSauth extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Can display or not self access
|
* Can display or not self access
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @return boolean
|
||||||
**/
|
**/
|
||||||
public static function displaySelfAccess() {
|
public static function displaySelfAccess() {
|
||||||
return self :: $params['displaySelfAccess'];
|
return self :: $params['displaySelfAccess'];
|
||||||
|
|
|
@ -48,7 +48,7 @@ class LSauthMethod extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* Return authentication data or false
|
* Return authentication data or false
|
||||||
*
|
*
|
||||||
* @retval Array|false Array of authentication data or False
|
* @return array|false Array of authentication data or False
|
||||||
**/
|
**/
|
||||||
public function getAuthData() {
|
public function getAuthData() {
|
||||||
// Do nothing in the standard LSauthMethod class
|
// Do nothing in the standard LSauthMethod class
|
||||||
|
@ -59,7 +59,7 @@ class LSauthMethod extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check authentication
|
* Check authentication
|
||||||
*
|
*
|
||||||
* @retval LSldapObject|false The LSldapObject of the user authificated or false
|
* @return LSldapObject|false The LSldapObject of the user authificated or false
|
||||||
*/
|
*/
|
||||||
public function authenticate() {
|
public function authenticate() {
|
||||||
$authobjects = LSauth :: username2LSobjects($this -> authData['username']);
|
$authobjects = LSauth :: username2LSobjects($this -> authData['username']);
|
||||||
|
@ -82,7 +82,7 @@ class LSauthMethod extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Logout
|
* Logout
|
||||||
*
|
*
|
||||||
* @retval boolean True on success or False
|
* @return boolean True on success or False
|
||||||
**/
|
**/
|
||||||
public function logout() {
|
public function logout() {
|
||||||
// Do nothing in the standard LSauthMethod class
|
// Do nothing in the standard LSauthMethod class
|
||||||
|
@ -95,7 +95,7 @@ class LSauthMethod extends LSlog_staticLoggerClass {
|
||||||
* This method is run by LSsession after the local session was
|
* This method is run by LSsession after the local session was
|
||||||
* was successfully destroyed.
|
* was successfully destroyed.
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function afterLogout() {
|
public static function afterLogout() {
|
||||||
return true;
|
return true;
|
||||||
|
@ -108,7 +108,7 @@ class LSauthMethod extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @params[in] $user The LSldapObject of the user authificated
|
* @params[in] $user The LSldapObject of the user authificated
|
||||||
*
|
*
|
||||||
* @retval Array|false Array of LDAP credentials array('dn','pwd') or False
|
* @return array|false Array of LDAP credentials array('dn','pwd') or False
|
||||||
**/
|
**/
|
||||||
public function getLDAPcredentials($user) {
|
public function getLDAPcredentials($user) {
|
||||||
if (isset($this -> authData['password'])) {
|
if (isset($this -> authData['password'])) {
|
||||||
|
@ -123,7 +123,7 @@ class LSauthMethod extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check API mode support of this method
|
* Check API mode support of this method
|
||||||
*
|
*
|
||||||
* @retval boolean True if API mode is support, false otherwise
|
* @return boolean True if API mode is support, false otherwise
|
||||||
*/
|
*/
|
||||||
static public function apiModeSupported() {
|
static public function apiModeSupported() {
|
||||||
return static :: $api_mode_supported;
|
return static :: $api_mode_supported;
|
||||||
|
|
|
@ -92,7 +92,7 @@ class LSauthMethod_CAS extends LSauthMethod {
|
||||||
*
|
*
|
||||||
* Return authentication data or false
|
* Return authentication data or false
|
||||||
*
|
*
|
||||||
* @retval Array|false Array of authentication data or False
|
* @return array|false Array of authentication data or False
|
||||||
**/
|
**/
|
||||||
public function getAuthData() {
|
public function getAuthData() {
|
||||||
if ($this -> configured) {
|
if ($this -> configured) {
|
||||||
|
@ -112,7 +112,7 @@ class LSauthMethod_CAS extends LSauthMethod {
|
||||||
/**
|
/**
|
||||||
* Logout
|
* Logout
|
||||||
*
|
*
|
||||||
* @retval boolean True on success or False
|
* @return boolean True on success or False
|
||||||
**/
|
**/
|
||||||
public function logout() {
|
public function logout() {
|
||||||
if($this -> configured) {
|
if($this -> configured) {
|
||||||
|
|
|
@ -44,7 +44,7 @@ class LSauthMethod_HTTP extends LSauthMethod_basic {
|
||||||
*
|
*
|
||||||
* Return authentication data or false
|
* Return authentication data or false
|
||||||
*
|
*
|
||||||
* @retval Array|false Array of authentication data or False
|
* @return array|false Array of authentication data or False
|
||||||
**/
|
**/
|
||||||
public function getAuthData() {
|
public function getAuthData() {
|
||||||
if (!defined('LSAUTHMETHOD_HTTP_METHOD')) {
|
if (!defined('LSAUTHMETHOD_HTTP_METHOD')) {
|
||||||
|
@ -110,7 +110,7 @@ class LSauthMethod_HTTP extends LSauthMethod_basic {
|
||||||
/**
|
/**
|
||||||
* Check authentication
|
* Check authentication
|
||||||
*
|
*
|
||||||
* @retval LSldapObject|false The LSldapObject of the user authificated or false
|
* @return LSldapObject|false The LSldapObject of the user authificated or false
|
||||||
*/
|
*/
|
||||||
public function authenticate() {
|
public function authenticate() {
|
||||||
if ( (defined('LSAUTHMETHOD_HTTP_TRUST_WITHOUT_PASSWORD_CHALLENGE')) && (constant('LSAUTHMETHOD_HTTP_TRUST_WITHOUT_PASSWORD_CHALLENGE') === True)) {
|
if ( (defined('LSAUTHMETHOD_HTTP_TRUST_WITHOUT_PASSWORD_CHALLENGE')) && (constant('LSAUTHMETHOD_HTTP_TRUST_WITHOUT_PASSWORD_CHALLENGE') === True)) {
|
||||||
|
@ -129,7 +129,7 @@ class LSauthMethod_HTTP extends LSauthMethod_basic {
|
||||||
* This method is run by LSsession after the local session was
|
* This method is run by LSsession after the local session was
|
||||||
* was successfully destroyed.
|
* was successfully destroyed.
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function afterLogout() {
|
public static function afterLogout() {
|
||||||
if (defined('LSAUTHMETHOD_HTTP_LOGOUT_REMOTE_URL')) {
|
if (defined('LSAUTHMETHOD_HTTP_LOGOUT_REMOTE_URL')) {
|
||||||
|
|
|
@ -52,7 +52,7 @@ class LSauthMethod_anonymous extends LSauthMethod {
|
||||||
*
|
*
|
||||||
* Return authentication data or false
|
* Return authentication data or false
|
||||||
*
|
*
|
||||||
* @retval Array|false Array of authentication data or False
|
* @return array|false Array of authentication data or False
|
||||||
**/
|
**/
|
||||||
public function getAuthData() {
|
public function getAuthData() {
|
||||||
$this -> authData = array(
|
$this -> authData = array(
|
||||||
|
|
|
@ -32,7 +32,7 @@ class LSauthMethod_basic extends LSauthMethod {
|
||||||
*
|
*
|
||||||
* Return authentication data or false
|
* Return authentication data or false
|
||||||
*
|
*
|
||||||
* @retval Array|false Array of authentication data or False
|
* @return array|false Array of authentication data or False
|
||||||
**/
|
**/
|
||||||
public function getAuthData() {
|
public function getAuthData() {
|
||||||
if (isset($_POST['LSauth_user']) && !empty($_POST['LSauth_user'])) {
|
if (isset($_POST['LSauth_user']) && !empty($_POST['LSauth_user'])) {
|
||||||
|
@ -48,7 +48,7 @@ class LSauthMethod_basic extends LSauthMethod {
|
||||||
/**
|
/**
|
||||||
* Check authentication
|
* Check authentication
|
||||||
*
|
*
|
||||||
* @retval LSldapObject|false The LSldapObject of the user authificated or false
|
* @return LSldapObject|false The LSldapObject of the user authificated or false
|
||||||
*/
|
*/
|
||||||
public function authenticate() {
|
public function authenticate() {
|
||||||
$authobjects = LSauth :: username2LSobjects($this -> authData['username']);
|
$authobjects = LSauth :: username2LSobjects($this -> authData['username']);
|
||||||
|
|
|
@ -38,20 +38,20 @@ class LScli extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Add a CLI command
|
* Add a CLI command
|
||||||
*
|
*
|
||||||
* @param[in] $command string The CLI command name (required)
|
* @param string $command The CLI command name (required)
|
||||||
* @param[in] $handler callable The CLI command handler (must be callable, required)
|
* @param callable $handler The CLI command handler (must be callable, required)
|
||||||
* @param[in] $short_desc string|false A short description of what this command does (required)
|
* @param string|false $short_desc A short description of what this command does (required)
|
||||||
* @param[in] $usage_args string|false A short list of commands available arguments show in usage message
|
* @param string|false $usage_args A short list of commands available arguments show in usage message
|
||||||
* (optional, default: false)
|
* (optional, default: false)
|
||||||
* @param[in] $long_desc string|false A long description of what this command does (optional, default: false)
|
* @param string|false $long_desc A long description of what this command does (optional, default: false)
|
||||||
* @param[in] $need_ldap_con boolean Permit to define if this command need connection to LDAP server (optional,
|
* @param boolean $need_ldap_con Permit to define if this command need connection to LDAP server (optional,
|
||||||
* default: true)
|
* default: true)
|
||||||
* @param[in] $args_autocompleter callable|null Callable of the CLI command arguments autocompleter (optional, default:
|
* @param callable|null $args_autocompleter Callable of the CLI command arguments autocompleter (optional, default:
|
||||||
* null)
|
* null)
|
||||||
* @param[in] $override boolean Allow override if a command already exists with the same name (optional,
|
* @param boolean $override Allow override if a command already exists with the same name (optional,
|
||||||
* default: false)
|
* default: false)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function add_command($command, $handler, $short_desc, $usage_args=false, $long_desc=false,
|
public static function add_command($command, $handler, $short_desc, $usage_args=false, $long_desc=false,
|
||||||
$need_ldap_con=true, $args_autocompleter=null, $override=false) {
|
$need_ldap_con=true, $args_autocompleter=null, $override=false) {
|
||||||
|
@ -79,8 +79,8 @@ class LScli extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Show usage message
|
* Show usage message
|
||||||
*
|
*
|
||||||
* @param[in] $error string|false Error message to display before usage message (optional, default: false)
|
* @param string|false $error Error message to display before usage message (optional, default: false)
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function usage($error=false) {
|
public static function usage($error=false) {
|
||||||
global $argv;
|
global $argv;
|
||||||
|
@ -125,7 +125,7 @@ class LScli extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Handle CLI arguments and run command (if provided)
|
* Handle CLI arguments and run command (if provided)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function handle_args() {
|
public static function handle_args() {
|
||||||
if (php_sapi_name() != "cli") {
|
if (php_sapi_name() != "cli") {
|
||||||
|
@ -260,11 +260,11 @@ class LScli extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Run command
|
* Run command
|
||||||
*
|
*
|
||||||
* @param[in] $command string The command name
|
* @param string $command The command name
|
||||||
* @param[in] $command string The command arguments (optional, default: array())
|
* @param string $command The command arguments (optional, default: array())
|
||||||
* @param[in] $exit boolean If true, function will exit after command execution (optional, default: true)
|
* @param boolean $exit If true, function will exit after command execution (optional, default: true)
|
||||||
*
|
*
|
||||||
* @retval void|boolean If $exit is False, return boolean casted command return
|
* @return void|boolean If $exit is False, return boolean casted command return
|
||||||
**/
|
**/
|
||||||
public static function run_command($command, $command_args=array(), $exit=true) {
|
public static function run_command($command, $command_args=array(), $exit=true) {
|
||||||
if (php_sapi_name() != "cli") {
|
if (php_sapi_name() != "cli") {
|
||||||
|
@ -301,7 +301,7 @@ class LScli extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Start LDAP connection (if not already connected)
|
* Start LDAP connection (if not already connected)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function need_ldap_con() {
|
public static function need_ldap_con() {
|
||||||
// Connect to LDAP server (if not already the case)
|
// Connect to LDAP server (if not already the case)
|
||||||
|
@ -314,14 +314,14 @@ class LScli extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Run external command
|
* Run external command
|
||||||
*
|
*
|
||||||
* @param[in] $command string|array The command. It's could be an array of the command with its arguments.
|
* @param string|array $command The command. It's could be an array of the command with its arguments.
|
||||||
* @param[in] $data_stdin string|null The command arguments (optional, default: null)
|
* @param string|null $data_stdin The command arguments (optional, default: null)
|
||||||
* @param[in] $escape_command_args boolean If true, the command will be escaped (optional, default: true)
|
* @param boolean $escape_command_args If true, the command will be escaped (optional, default: true)
|
||||||
* @param[in] $cwd string|null The initial working dir for the command
|
* @param string|null $cwd The initial working dir for the command
|
||||||
* (optional, default: null = use current PHP
|
* (optional, default: null = use current PHP
|
||||||
* process working directory)
|
* process working directory)
|
||||||
*
|
*
|
||||||
* @retval false|array An array of return code, stdout and stderr result or False in case of fatal error
|
* @return false|array An array of return code, stdout and stderr result or False in case of fatal error
|
||||||
**/
|
**/
|
||||||
public static function run_external_command($command, $data_stdin=null, $escape_command_args=true, $cwd=null) {
|
public static function run_external_command($command, $data_stdin=null, $escape_command_args=true, $cwd=null) {
|
||||||
if (array($command))
|
if (array($command))
|
||||||
|
@ -365,9 +365,9 @@ class LScli extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* CLI helper to ask for user confirmation
|
* CLI helper to ask for user confirmation
|
||||||
*
|
*
|
||||||
* @param[in] $question string The confirmation question (optional, default: "Are you sure?")
|
* @param string $question The confirmation question (optional, default: "Are you sure?")
|
||||||
*
|
*
|
||||||
* @retval boolean True if user confirmed, false otherwise
|
* @return boolean True if user confirmed, false otherwise
|
||||||
**/
|
**/
|
||||||
public static function confirm($question=null) {
|
public static function confirm($question=null) {
|
||||||
if (is_null($question))
|
if (is_null($question))
|
||||||
|
@ -386,9 +386,9 @@ class LScli extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* CLI command to handle BASH command autocompleter
|
* CLI command to handle BASH command autocompleter
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array Command arguments
|
* @param array $command_args Command arguments
|
||||||
*
|
*
|
||||||
* @retval boolean True on success, false otherwise
|
* @return boolean True on success, false otherwise
|
||||||
**/
|
**/
|
||||||
public static function bash_autocomplete($command_args) {
|
public static function bash_autocomplete($command_args) {
|
||||||
if (count($command_args) < 3)
|
if (count($command_args) < 3)
|
||||||
|
@ -548,9 +548,9 @@ class LScli extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Print list of available autocomplete options as required by BASH
|
* Print list of available autocomplete options as required by BASH
|
||||||
*
|
*
|
||||||
* @param[in] $list mixed List of available autocomplete options if it's an array
|
* @param mixed $list List of available autocomplete options if it's an array
|
||||||
*
|
*
|
||||||
* @retval boolean True if $list is an array, false otherwise
|
* @return boolean True if $list is an array, false otherwise
|
||||||
**/
|
**/
|
||||||
public static function return_bash_autocomplete_list($list) {
|
public static function return_bash_autocomplete_list($list) {
|
||||||
if (is_array($list)) {
|
if (is_array($list)) {
|
||||||
|
@ -563,9 +563,9 @@ class LScli extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Autocomplete class name
|
* Autocomplete class name
|
||||||
*
|
*
|
||||||
* @param[in] $prefix string Class name prefix (optional, default=empty string)
|
* @param string $prefix Class name prefix (optional, default=empty string)
|
||||||
*
|
*
|
||||||
* @retval array List of matched class names
|
* @return array List of matched class names
|
||||||
**/
|
**/
|
||||||
public static function autocomplete_class_name($prefix='', $quote_char=null) {
|
public static function autocomplete_class_name($prefix='', $quote_char=null) {
|
||||||
$classes = array();
|
$classes = array();
|
||||||
|
@ -585,9 +585,9 @@ class LScli extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Autocomplete addon name
|
* Autocomplete addon name
|
||||||
*
|
*
|
||||||
* @param[in] $prefix string Addon name prefix (optional, default=empty string)
|
* @param string $prefix Addon name prefix (optional, default=empty string)
|
||||||
*
|
*
|
||||||
* @retval array List of matched addon names
|
* @return array List of matched addon names
|
||||||
**/
|
**/
|
||||||
public static function autocomplete_addon_name($prefix='') {
|
public static function autocomplete_addon_name($prefix='') {
|
||||||
$addons = array();
|
$addons = array();
|
||||||
|
@ -606,13 +606,13 @@ class LScli extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Autocomplete options
|
* Autocomplete options
|
||||||
*
|
*
|
||||||
* @param[in] $opts array Available options
|
* @param array $opts Available options
|
||||||
* @param[in] $prefix string Option name prefix (optional, default=empty string)
|
* @param string $prefix Option name prefix (optional, default=empty string)
|
||||||
* @param[in] $case_sensitive boolean Set to false if options are case insensitive (optional, default=true)
|
* @param boolean $case_sensitive Set to false if options are case insensitive (optional, default=true)
|
||||||
* @param[in] $quote_char boolean Quote character (optional, if not set, $prefix will be unquoted and its
|
* @param boolean $quote_char Quote character (optional, if not set, $prefix will be unquoted and its
|
||||||
* quote char (if detected) will be used to quote options)
|
* quote char (if detected) will be used to quote options)
|
||||||
*
|
*
|
||||||
* @retval array List of matched options
|
* @return array List of matched options
|
||||||
**/
|
**/
|
||||||
public static function autocomplete_opts($opts, $prefix='', $case_sensitive=true, $quote_char='') {
|
public static function autocomplete_opts($opts, $prefix='', $case_sensitive=true, $quote_char='') {
|
||||||
if (!is_string($prefix) || strlen($prefix)==0)
|
if (!is_string($prefix) || strlen($prefix)==0)
|
||||||
|
@ -637,9 +637,9 @@ class LScli extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Autocomplete integer option
|
* Autocomplete integer option
|
||||||
*
|
*
|
||||||
* @param[in] $prefix string Option prefix (optional, default=empty string)
|
* @param string $prefix Option prefix (optional, default=empty string)
|
||||||
*
|
*
|
||||||
* @retval array List of available options
|
* @return array List of available options
|
||||||
**/
|
**/
|
||||||
public static function autocomplete_int($prefix='', $quote_char='') {
|
public static function autocomplete_int($prefix='', $quote_char='') {
|
||||||
$opts = array();
|
$opts = array();
|
||||||
|
@ -652,9 +652,9 @@ class LScli extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Autocomplete boolean option
|
* Autocomplete boolean option
|
||||||
*
|
*
|
||||||
* @param[in] $prefix string Option prefix (optional, default=empty string)
|
* @param string $prefix Option prefix (optional, default=empty string)
|
||||||
*
|
*
|
||||||
* @retval array List of available options
|
* @return array List of available options
|
||||||
**/
|
**/
|
||||||
public static function autocomplete_bool($prefix='', $quote_char='') {
|
public static function autocomplete_bool($prefix='', $quote_char='') {
|
||||||
return self :: autocomplete_opts(array('0', '1'), $prefix, false, $quote_char);
|
return self :: autocomplete_opts(array('0', '1'), $prefix, false, $quote_char);
|
||||||
|
@ -663,12 +663,12 @@ class LScli extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Autocomplete LSobject type option
|
* Autocomplete LSobject type option
|
||||||
*
|
*
|
||||||
* @param[in] $prefix string Option prefix (optional, default=empty string)
|
* @param string $prefix Option prefix (optional, default=empty string)
|
||||||
* @param[in] $case_sensitive boolean Set to false if options are case insensitive (optional, default=true)
|
* @param boolean $case_sensitive Set to false if options are case insensitive (optional, default=true)
|
||||||
* @param[in] $quote_char boolean Quote character (optional, if not set, $prefix will be unquoted and its
|
* @param boolean $quote_char Quote character (optional, if not set, $prefix will be unquoted and its
|
||||||
* quote char (if detected) will be used to quote options)
|
* quote char (if detected) will be used to quote options)
|
||||||
*
|
*
|
||||||
* @retval array List of available options
|
* @return array List of available options
|
||||||
**/
|
**/
|
||||||
public static function autocomplete_LSobject_types($prefix='', $case_sensitive=true, $quote_char='') {
|
public static function autocomplete_LSobject_types($prefix='', $case_sensitive=true, $quote_char='') {
|
||||||
$subdn_config = LSconfig :: get('subDn', null, null, LSsession :: $ldapServer);
|
$subdn_config = LSconfig :: get('subDn', null, null, LSsession :: $ldapServer);
|
||||||
|
@ -717,13 +717,13 @@ class LScli extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Autocomplete LSobject DN option
|
* Autocomplete LSobject DN option
|
||||||
*
|
*
|
||||||
* @param[in] $objType string LSobject type
|
* @param string $objType LSobject type
|
||||||
* @param[in] $prefix string Option prefix (optional, default=empty string)
|
* @param string $prefix Option prefix (optional, default=empty string)
|
||||||
* @param[in] $case_sensitive boolean Set to false if options are case insensitive (optional, default=true)
|
* @param boolean $case_sensitive Set to false if options are case insensitive (optional, default=true)
|
||||||
* @param[in] $quote_char boolean Quote character (optional, if not set, $prefix will be unquoted and its
|
* @param boolean $quote_char Quote character (optional, if not set, $prefix will be unquoted and its
|
||||||
* quote char (if detected) will be used to quote options)
|
* quote char (if detected) will be used to quote options)
|
||||||
*
|
*
|
||||||
* @retval array List of available options
|
* @return array List of available options
|
||||||
**/
|
**/
|
||||||
public static function autocomplete_LSobject_dn($objType, $prefix='', $case_sensitive=true, $quote_char='') {
|
public static function autocomplete_LSobject_dn($objType, $prefix='', $case_sensitive=true, $quote_char='') {
|
||||||
if (!LSsession ::loadLSobject($objType, false))
|
if (!LSsession ::loadLSobject($objType, false))
|
||||||
|
@ -756,13 +756,13 @@ class LScli extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Autocomplete LSobject ioFormat option
|
* Autocomplete LSobject ioFormat option
|
||||||
*
|
*
|
||||||
* @param[in] $objType string LSobject type
|
* @param string $objType LSobject type
|
||||||
* @param[in] $prefix string Option prefix (optional, default=empty string)
|
* @param string $prefix Option prefix (optional, default=empty string)
|
||||||
* @param[in] $case_sensitive boolean Set to false if options are case insensitive (optional, default=true)
|
* @param boolean $case_sensitive Set to false if options are case insensitive (optional, default=true)
|
||||||
* @param[in] $quote_char boolean Quote character (optional, if not set, $prefix will be unquoted and its
|
* @param boolean $quote_char Quote character (optional, if not set, $prefix will be unquoted and its
|
||||||
* quote char (if detected) will be used to quote options)
|
* quote char (if detected) will be used to quote options)
|
||||||
*
|
*
|
||||||
* @retval array List of available options
|
* @return array List of available options
|
||||||
**/
|
**/
|
||||||
public static function autocomplete_LSobject_ioFormat($objType, $prefix='', $case_sensitive=true, $quote_char='') {
|
public static function autocomplete_LSobject_ioFormat($objType, $prefix='', $case_sensitive=true, $quote_char='') {
|
||||||
if (!LSsession ::loadLSobject($objType, false))
|
if (!LSsession ::loadLSobject($objType, false))
|
||||||
|
@ -781,9 +781,9 @@ class LScli extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Autocomplete LSformRule name
|
* Autocomplete LSformRule name
|
||||||
*
|
*
|
||||||
* @param[in] $prefix string LSformRule name prefix (optional, default=empty string)
|
* @param string $prefix LSformRule name prefix (optional, default=empty string)
|
||||||
*
|
*
|
||||||
* @retval array List of matched LSformRule names
|
* @return array List of matched LSformRule names
|
||||||
**/
|
**/
|
||||||
public static function autocomplete_LSformRule_name($prefix='', $quote_char=null) {
|
public static function autocomplete_LSformRule_name($prefix='', $quote_char=null) {
|
||||||
$rules = array();
|
$rules = array();
|
||||||
|
@ -797,9 +797,9 @@ class LScli extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Unquote a word
|
* Unquote a word
|
||||||
*
|
*
|
||||||
* @param[in] &$word string Reference of the word to unquote
|
* @param string &$word Reference of the word to unquote
|
||||||
*
|
*
|
||||||
* @retval string The quote character or an empty string if word if not quoted
|
* @return string The quote character or an empty string if word if not quoted
|
||||||
*/
|
*/
|
||||||
public static function unquote_word(&$word) {
|
public static function unquote_word(&$word) {
|
||||||
if (in_array($word[0], array('"', "'"))) {
|
if (in_array($word[0], array('"', "'"))) {
|
||||||
|
@ -815,11 +815,11 @@ class LScli extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Quote a word
|
* Quote a word
|
||||||
*
|
*
|
||||||
* @param[in] $word string The word to quote
|
* @param string $word The word to quote
|
||||||
* @param[in] $quote_char string The quote character. If not defined or empty, the input word
|
* @param string $quote_char The quote character. If not defined or empty, the input word
|
||||||
* will be returned unmodified.
|
* will be returned unmodified.
|
||||||
*
|
*
|
||||||
* @retval string The quoted word
|
* @return string The quoted word
|
||||||
*/
|
*/
|
||||||
public static function quote_word($word, $quote_char) {
|
public static function quote_word($word, $quote_char) {
|
||||||
if (!$quote_char) return $word;
|
if (!$quote_char) return $word;
|
||||||
|
|
|
@ -36,7 +36,7 @@ class LSconfig {
|
||||||
* Chargement initiale des données de configuration à partir des fichiers en
|
* Chargement initiale des données de configuration à partir des fichiers en
|
||||||
* config.*.php du dossier LS_CONF_DIR
|
* config.*.php du dossier LS_CONF_DIR
|
||||||
*
|
*
|
||||||
* @retval boolean True si tout s'est bien passé, False sinon
|
* @return boolean True si tout s'est bien passé, False sinon
|
||||||
**/
|
**/
|
||||||
public static function start() {
|
public static function start() {
|
||||||
$files=array('config.inc.php','config.LSaddons.php');
|
$files=array('config.inc.php','config.LSaddons.php');
|
||||||
|
@ -56,15 +56,15 @@ class LSconfig {
|
||||||
/**
|
/**
|
||||||
* Get a specific configuration variable value
|
* Get a specific configuration variable value
|
||||||
*
|
*
|
||||||
* @param[in] $var string The configuration variable name
|
* @param string $var The configuration variable name
|
||||||
* @param[in] $default mixed The default value to return if configuration variable
|
* @param mixed $default The default value to return if configuration variable
|
||||||
* is not set (Default : null)
|
* is not set (Default : null)
|
||||||
* @param[in] $cast string The type of expected value. The configuration variable
|
* @param string $cast The type of expected value. The configuration variable
|
||||||
* value will be cast as this type. Could be : bool, int,
|
* value will be cast as this type. Could be : bool, int,
|
||||||
* float or string. (Optional, default : raw value)
|
* float or string. (Optional, default : raw value)
|
||||||
* @param[in] $data array The configuration data (optional)
|
* @param array $data The configuration data (optional)
|
||||||
*
|
*
|
||||||
* @retval mixed The configuration variable value
|
* @return mixed The configuration variable value
|
||||||
**/
|
**/
|
||||||
public static function get($var, $default=null, $cast=null, $data=null) {
|
public static function get($var, $default=null, $cast=null, $data=null) {
|
||||||
$vars = explode('.', $var);
|
$vars = explode('.', $var);
|
||||||
|
@ -98,10 +98,10 @@ class LSconfig {
|
||||||
/**
|
/**
|
||||||
* Get list of keys of a specific configuration variable
|
* Get list of keys of a specific configuration variable
|
||||||
*
|
*
|
||||||
* @param[in] $var string The configuration variable name
|
* @param string $var The configuration variable name
|
||||||
* @param[in] $data array The configuration data (optional)
|
* @param array $data The configuration data (optional)
|
||||||
*
|
*
|
||||||
* @retval array An array of the keys of a specific configuration variable
|
* @return array An array of the keys of a specific configuration variable
|
||||||
**/
|
**/
|
||||||
public static function keys($var, $data=null) {
|
public static function keys($var, $data=null) {
|
||||||
$value = self :: get($var, null, null, $data);
|
$value = self :: get($var, null, null, $data);
|
||||||
|
@ -115,13 +115,13 @@ class LSconfig {
|
||||||
* variable name. In this case, the keys of the parent value will be iterated to compose
|
* variable name. In this case, the keys of the parent value will be iterated to compose
|
||||||
* the result.
|
* the result.
|
||||||
*
|
*
|
||||||
* @param[in] $pattern string The configuration variable pattern
|
* @param string $pattern The configuration variable pattern
|
||||||
* @param[in] $default mixed The default value to return if configuration variable
|
* @param mixed $default The default value to return if configuration variable
|
||||||
* is not set (optional, see self :: get())
|
* is not set (optional, see self :: get())
|
||||||
* @param[in] $cast string The type of expected value (optional, see self :: get())
|
* @param string $cast The type of expected value (optional, see self :: get())
|
||||||
* @param[in] $data array The configuration data (optional, see self :: get())
|
* @param array $data The configuration data (optional, see self :: get())
|
||||||
*
|
*
|
||||||
* @retval array The list of matching configuration variables with their value
|
* @return array The list of matching configuration variables with their value
|
||||||
**/
|
**/
|
||||||
public static function getMatchingKeys($pattern, $default=null, $cast=null, $data=null, $prefix=null) {
|
public static function getMatchingKeys($pattern, $default=null, $cast=null, $data=null, $prefix=null) {
|
||||||
$return = array();
|
$return = array();
|
||||||
|
@ -151,10 +151,10 @@ class LSconfig {
|
||||||
/**
|
/**
|
||||||
* Définition d'une valeur
|
* Définition d'une valeur
|
||||||
*
|
*
|
||||||
* @param[in] $var string Le nom de valeur à définir
|
* @param string $var Le nom de valeur à définir
|
||||||
* @param[in] $val mixed La valeur de la variable
|
* @param mixed $val La valeur de la variable
|
||||||
*
|
*
|
||||||
* @retval boolean True si tout s'est bien passé, False sinon
|
* @return boolean True si tout s'est bien passé, False sinon
|
||||||
**/
|
**/
|
||||||
public static function set($var,$val) {
|
public static function set($var,$val) {
|
||||||
$vars=explode('.',$var);
|
$vars=explode('.',$var);
|
||||||
|
|
|
@ -25,7 +25,7 @@ class LSconfirmBox {
|
||||||
/*
|
/*
|
||||||
* Méthode chargeant les dépendances d'affichage
|
* Méthode chargeant les dépendances d'affichage
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function loadDependenciesDisplay() {
|
public static function loadDependenciesDisplay() {
|
||||||
LStemplate :: addJSscript('LSconfirmBox.js');
|
LStemplate :: addJSscript('LSconfirmBox.js');
|
||||||
|
|
|
@ -38,12 +38,12 @@ class LSerror {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $code string The error code
|
* @param string $code The error code
|
||||||
* @param[in] $msg LSformat The LSformat of the error message
|
* @param LSformat $msg The LSformat of the error message
|
||||||
* @param[in] $escape boolean Set to false if you don't want the message
|
* @param boolean $escape Set to false if you don't want the message
|
||||||
* to be escaped on display (Default: true)
|
* to be escaped on display (Default: true)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function defineError($code=-1, $msg='', $escape=True) {
|
public static function defineError($code=-1, $msg='', $escape=True) {
|
||||||
self :: $_errorCodes[$code] = array(
|
self :: $_errorCodes[$code] = array(
|
||||||
|
@ -57,16 +57,16 @@ class LSerror {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $code string The error code
|
* @param string $code The error code
|
||||||
* @param[in] $msg mixed If error code is not specified (or not defined), it could content the
|
* @param mixed $msg If error code is not specified (or not defined), it could content the
|
||||||
* the error message. If error code is provided (and defined), this parameter
|
* the error message. If error code is provided (and defined), this parameter
|
||||||
* will be used to format registred error message (as LSformat). In this case,
|
* will be used to format registred error message (as LSformat). In this case,
|
||||||
* it could be any of data support by getFData function as $data parameter.
|
* it could be any of data support by getFData function as $data parameter.
|
||||||
*
|
*
|
||||||
* @param[in] $escape boolean Set to false if you don't want the message
|
* @param boolean $escape Set to false if you don't want the message
|
||||||
* to be escaped on display (Default: true)
|
* to be escaped on display (Default: true)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function addErrorCode($code=null, $msg=null, $escape=true) {
|
public static function addErrorCode($code=null, $msg=null, $escape=true) {
|
||||||
$_SESSION['LSerror'][] = self :: formatError($code, $msg, $escape);
|
$_SESSION['LSerror'][] = self :: formatError($code, $msg, $escape);
|
||||||
|
@ -79,11 +79,11 @@ class LSerror {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $return boolean True if you want to retrieved errors message. If false,
|
* @param boolean $return True if you want to retrieved errors message. If false,
|
||||||
* (default), LSerrors template variable will be assigned
|
* (default), LSerrors template variable will be assigned
|
||||||
* with errors message.
|
* with errors message.
|
||||||
*
|
*
|
||||||
* @retval string|null
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
public static function display($return=False) {
|
public static function display($return=False) {
|
||||||
$errors = self :: getErrors();
|
$errors = self :: getErrors();
|
||||||
|
@ -98,11 +98,11 @@ class LSerror {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $code Error code (see addErrorCode())
|
* @param string $code Error code (see addErrorCode())
|
||||||
* @param[in] $msg Error msg (see addErrorCode())
|
* @param string $msg Error msg (see addErrorCode())
|
||||||
* @param[in] $escape boolean (see addErrorCode())
|
* @param boolean $escape (see addErrorCode())
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function stop($code=-1, $msg='', $escape=true) {
|
public static function stop($code=-1, $msg='', $escape=true) {
|
||||||
if(!empty($_SESSION['LSerror'])) {
|
if(!empty($_SESSION['LSerror'])) {
|
||||||
|
@ -190,9 +190,9 @@ class LSerror {
|
||||||
/**
|
/**
|
||||||
* Check if is Net_LDAP2 error and display possible error message
|
* Check if is Net_LDAP2 error and display possible error message
|
||||||
*
|
*
|
||||||
* @param[in] $data mixed Data
|
* @param mixed $data Data
|
||||||
*
|
*
|
||||||
* @retval boolean True if it's an error or False
|
* @return boolean True if it's an error or False
|
||||||
**/
|
**/
|
||||||
public static function isLdapError($data) {
|
public static function isLdapError($data) {
|
||||||
if (Net_LDAP2::isError($data)) {
|
if (Net_LDAP2::isError($data)) {
|
||||||
|
|
|
@ -64,10 +64,10 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $idForm [<b>required</b>] string L'identifiant du formulaire
|
* @param string $idForm L'identifiant du formulaire
|
||||||
* @param[in] $submit string La valeur du bouton submit
|
* @param string $submit La valeur du bouton submit
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct(&$ldapObject, $idForm, $submit=NULL, $api_mode=false){
|
public function __construct(&$ldapObject, $idForm, $submit=NULL, $api_mode=false){
|
||||||
$this -> idForm = $idForm;
|
$this -> idForm = $idForm;
|
||||||
|
@ -90,7 +90,7 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
* @param[] $default The default value (default : null)
|
* @param[] $default The default value (default : null)
|
||||||
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
||||||
*
|
*
|
||||||
* @retval mixed The configuration parameter value or default value if not set
|
* @return mixed The configuration parameter value or default value if not set
|
||||||
**/
|
**/
|
||||||
public function getConfig($param, $default=null, $cast=null) {
|
public function getConfig($param, $default=null, $cast=null) {
|
||||||
return LSconfig :: get($param, $default, $cast, $this -> config);
|
return LSconfig :: get($param, $default, $cast, $this -> config);
|
||||||
|
@ -99,7 +99,7 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Allow conversion of LSform to string
|
* Allow conversion of LSform to string
|
||||||
*
|
*
|
||||||
* @retval string The string representation of the LSform
|
* @return string The string representation of the LSform
|
||||||
*/
|
*/
|
||||||
public function __toString() {
|
public function __toString() {
|
||||||
return "<LSform ".$this -> idForm." on ".$this -> ldapObject -> toString(false).">";
|
return "<LSform ".$this -> idForm." on ".$this -> ldapObject -> toString(false).">";
|
||||||
|
@ -108,10 +108,10 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Display the form
|
* Display the form
|
||||||
*
|
*
|
||||||
* @param[in] $LSform_action string|null The form action attribute value (optional, default: $_SERVER['PHP_SELF'])
|
* @param string|null $LSform_action The form action attribute value (optional, default: $_SERVER['PHP_SELF'])
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function display($LSform_action=null){
|
public function display($LSform_action=null){
|
||||||
// Load view dependencies
|
// Load view dependencies
|
||||||
|
@ -212,7 +212,7 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
/*
|
/*
|
||||||
* Méthode chargeant les dépendances d'affichage d'une LSview
|
* Méthode chargeant les dépendances d'affichage d'une LSview
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function loadDependenciesDisplayView($ldapObject=false, $search_view=false) {
|
public static function loadDependenciesDisplayView($ldapObject=false, $search_view=false) {
|
||||||
LStemplate :: addCssFile('LSform.css');
|
LStemplate :: addCssFile('LSform.css');
|
||||||
|
@ -260,7 +260,7 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function displayView(){
|
public function displayView(){
|
||||||
self :: loadDependenciesDisplayView($this -> ldapObject);
|
self :: loadDependenciesDisplayView($this -> ldapObject);
|
||||||
|
@ -288,12 +288,12 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $attr [<b>required</b>] string Le nom du champ
|
* @param string $attrLe nom du champ
|
||||||
* @param[in] $msg Le format du message d'erreur à afficher (pouvant comporter
|
* @param string $msg Le format du message d'erreur à afficher (pouvant comporter
|
||||||
* des valeurs %{[n'importe quoi]} qui seront remplacé par le label
|
* des valeurs %{[n'importe quoi]} qui seront remplacé par le label
|
||||||
* du champs concerné.
|
* du champs concerné.
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setElementError($attr,$msg=NULL) {
|
public function setElementError($attr,$msg=NULL) {
|
||||||
if($msg!='') {
|
if($msg!='') {
|
||||||
|
@ -311,9 +311,9 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $element [<b>required</b>] string Le nom de l'élement
|
* @param string $attrLe nom de l'élement
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function definedError($element=NULL) {
|
public function definedError($element=NULL) {
|
||||||
if ($element) {
|
if ($element) {
|
||||||
|
@ -327,7 +327,7 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Retourne le tableau des erreurs
|
* Retourne le tableau des erreurs
|
||||||
*
|
*
|
||||||
* @retval Array array(element => array(errors))
|
* @return array array(element => array(errors))
|
||||||
*/
|
*/
|
||||||
public function getErrors() {
|
public function getErrors() {
|
||||||
return $this -> _elementsErrors;
|
return $this -> _elementsErrors;
|
||||||
|
@ -336,11 +336,11 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check form is submited and its data are validat
|
* Check form is submited and its data are validat
|
||||||
*
|
*
|
||||||
* @param[in] $onlyIfPresent boolean If true and data of this element is not present in POST data,
|
* @param boolean $onlyIfPresent If true and data of this element is not present in POST data,
|
||||||
* just ignore it.
|
* just ignore it.
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true if form is submited and its data are valid, false otherwise
|
* @return boolean true if form is submited and its data are valid, false otherwise
|
||||||
*/
|
*/
|
||||||
public function validate($onlyIfPresent=false){
|
public function validate($onlyIfPresent=false){
|
||||||
if(!$this -> can_validate)
|
if(!$this -> can_validate)
|
||||||
|
@ -370,7 +370,7 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true si toutes la saisie est OK, false sinon
|
* @return boolean true si toutes la saisie est OK, false sinon
|
||||||
*/
|
*/
|
||||||
public function checkData() {
|
public function checkData() {
|
||||||
$retval=true;
|
$retval=true;
|
||||||
|
@ -415,9 +415,9 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $data array tableau de valeurs
|
* @param string $submit tableau de valeurs
|
||||||
*
|
*
|
||||||
* @retval boolean true si au moins une valeur est présente, false sinon
|
* @return boolean true si au moins une valeur est présente, false sinon
|
||||||
*/
|
*/
|
||||||
public function checkRequired($data) {
|
public function checkRequired($data) {
|
||||||
foreach($data as $val) {
|
foreach($data as $val) {
|
||||||
|
@ -432,7 +432,7 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true si la saisie du formulaire est présente en POST, false sinon
|
* @return boolean true si la saisie du formulaire est présente en POST, false sinon
|
||||||
*/
|
*/
|
||||||
public function isSubmit() {
|
public function isSubmit() {
|
||||||
if ($this -> submited)
|
if ($this -> submited)
|
||||||
|
@ -445,7 +445,7 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Set form as submited
|
* Set form as submited
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setSubmited() {
|
public function setSubmited() {
|
||||||
$this -> submited = true;
|
$this -> submited = true;
|
||||||
|
@ -456,10 +456,10 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $data array('attr' => array(values)) Tableau des données du formulaire
|
* @param array $data Tableau des données du formulaire : array('attr' => array(values))
|
||||||
* @param[in] $consideredAsSubmit Définie si on force le formualaire comme envoyer
|
* @param bool $consideredAsSubmit Définie si on force le formualaire comme envoyer
|
||||||
*
|
*
|
||||||
* @retval boolean true si les données ont été définies, false sinon
|
* @return boolean true si les données ont été définies, false sinon
|
||||||
*/
|
*/
|
||||||
public function setPostData($data,$consideredAsSubmit=false) {
|
public function setPostData($data,$consideredAsSubmit=false) {
|
||||||
if (is_array($data)) {
|
if (is_array($data)) {
|
||||||
|
@ -483,11 +483,11 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Retrieve POST data of the form
|
* Retrieve POST data of the form
|
||||||
*
|
*
|
||||||
* @param[in] $onlyIfPresent boolean If true and data of this element is not present in POST data,
|
* @param boolean $onlyIfPresent If true and data of this element is not present in POST data,
|
||||||
* just ignore it.
|
* just ignore it.
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true if POST data are retrieved, false otherwise
|
* @return boolean true if POST data are retrieved, false otherwise
|
||||||
*/
|
*/
|
||||||
public function getPostData($onlyIfPresent=false) {
|
public function getPostData($onlyIfPresent=false) {
|
||||||
if (is_null($this -> dataEntryForm)) {
|
if (is_null($this -> dataEntryForm)) {
|
||||||
|
@ -542,12 +542,12 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* Ajoute un élément au formulaire et définis les informations le concernant.
|
* Ajoute un élément au formulaire et définis les informations le concernant.
|
||||||
*
|
*
|
||||||
* @param[in] $type string Le type de l'élément
|
* @param string $submit Le type de l'élément
|
||||||
* @param[in] $name string Le nom de l'élément
|
* @param string $submit Le nom de l'élément
|
||||||
* @param[in] $label string Le label de l'élément
|
* @param string $submit Le label de l'élément
|
||||||
* @param[in] $param mixed Paramètres supplémentaires
|
* @param string $submit Paramètres supplémentaires
|
||||||
*
|
*
|
||||||
* @retval LSformElement
|
* @return LSformElement
|
||||||
*/
|
*/
|
||||||
public function addElement($type,$name,$label,$params,&$attr_html) {
|
public function addElement($type,$name,$label,$params,&$attr_html) {
|
||||||
$elementType='LSformElement_'.$type;
|
$elementType='LSformElement_'.$type;
|
||||||
|
@ -570,9 +570,9 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check if form has a specified element (by attr name)
|
* Check if form has a specified element (by attr name)
|
||||||
*
|
*
|
||||||
* @param[in] $attr string The element/attribute name
|
* @param string $submit The element/attribute name
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @return boolean
|
||||||
**/
|
**/
|
||||||
public function hasElement($name) {
|
public function hasElement($name) {
|
||||||
return isset($this -> elements[$name]);
|
return isset($this -> elements[$name]);
|
||||||
|
@ -581,9 +581,9 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check if a specified element (by attr name) is freezed
|
* Check if a specified element (by attr name) is freezed
|
||||||
*
|
*
|
||||||
* @param[in] $attr string The element/attribute name
|
* @param string $submit The element/attribute name
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @return boolean
|
||||||
**/
|
**/
|
||||||
public function isFreeze($name) {
|
public function isFreeze($name) {
|
||||||
return isset($this -> elements[$name]) && $this -> elements[$name] -> isFreeze($name);
|
return isset($this -> elements[$name]) && $this -> elements[$name] -> isFreeze($name);
|
||||||
|
@ -594,11 +594,11 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $element string Le nom de l'élément conserné
|
* @param string $submit Le nom de l'élément conserné
|
||||||
* @param[in] $rule string Le nom de la règle à ajouter
|
* @param string $submit Le nom de la règle à ajouter
|
||||||
* @param[in] $options array Options (facultative)
|
* @param string $submit Options (facultative)
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function addRule($element, $rule, $options=null) {
|
public function addRule($element, $rule, $options=null) {
|
||||||
if ( isset($this ->elements[$element]) ) {
|
if ( isset($this ->elements[$element]) ) {
|
||||||
|
@ -628,9 +628,9 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $element string Le nom de l'élément conserné
|
* @param string $submit Le nom de l'élément conserné
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function setRequired($element) {
|
public function setRequired($element) {
|
||||||
if (isset( $this -> elements[$element] ) )
|
if (isset( $this -> elements[$element] ) )
|
||||||
|
@ -646,7 +646,7 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $element string Le nom de l'élément conserné
|
* @param string $submit Le nom de l'élément conserné
|
||||||
*/
|
*/
|
||||||
public function isRuleRegistered($rule) {
|
public function isRuleRegistered($rule) {
|
||||||
LSsession :: loadLSclass('LSformRule');
|
LSsession :: loadLSclass('LSformRule');
|
||||||
|
@ -657,7 +657,7 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Retourne les valeurs validés du formulaire
|
* Retourne les valeurs validés du formulaire
|
||||||
*
|
*
|
||||||
* @retval mixed Les valeurs validés du formulaire, ou false si elles ne le sont pas
|
* @return mixed Les valeurs validés du formulaire, ou false si elles ne le sont pas
|
||||||
*/
|
*/
|
||||||
public function exportValues() {
|
public function exportValues() {
|
||||||
if ($this -> _isValidate) {
|
if ($this -> _isValidate) {
|
||||||
|
@ -675,9 +675,9 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Retourn un élement du formulaire
|
* Retourn un élement du formulaire
|
||||||
*
|
*
|
||||||
* @param[in] string $element Nom de l'élement voulu
|
* @param string $element Nom de l'élement voulu
|
||||||
*
|
*
|
||||||
* @retval LSformElement L'élement du formulaire voulu
|
* @return LSformElement L'élement du formulaire voulu
|
||||||
*/
|
*/
|
||||||
public function getElement($element) {
|
public function getElement($element) {
|
||||||
return $this -> elements[$element];
|
return $this -> elements[$element];
|
||||||
|
@ -689,9 +689,9 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
* If form is posted, retrieve values from postData, otherwise
|
* If form is posted, retrieve values from postData, otherwise
|
||||||
* retrieve value from the element.
|
* retrieve value from the element.
|
||||||
*
|
*
|
||||||
* @param[in] string $element The element name
|
* @param string $element The element name
|
||||||
*
|
*
|
||||||
* @retval mixed The element values
|
* @return mixed The element values
|
||||||
**/
|
**/
|
||||||
public function getValue($element) {
|
public function getValue($element) {
|
||||||
if ($this -> isSubmit() && $this -> _postData) {
|
if ($this -> isSubmit() && $this -> _postData) {
|
||||||
|
@ -703,7 +703,7 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Défini les valeurs des élements à partir des valeurs postées
|
* Défini les valeurs des élements à partir des valeurs postées
|
||||||
*
|
*
|
||||||
* @retval boolean True si les valeurs ont été définies, false sinon.
|
* @return boolean True si les valeurs ont été définies, false sinon.
|
||||||
*/
|
*/
|
||||||
public function setValuesFromPostData() {
|
public function setValuesFromPostData() {
|
||||||
if (empty($this -> _postData)) {
|
if (empty($this -> _postData)) {
|
||||||
|
@ -718,10 +718,10 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return the HTML code of an empty form field
|
* Return the HTML code of an empty form field
|
||||||
*
|
*
|
||||||
* @param[in] $element string The form element name
|
* @param string $submit The form element name
|
||||||
* @param[in] $value_idx integer|null The value index (optional, default: null == 0)
|
* @param string|null $LSform_action The value index (optional, default: null == 0)
|
||||||
*
|
*
|
||||||
* @retval string|null The HTML code of the specified field if exist, null otherwise
|
* @return string|null The HTML code of the specified field if exist, null otherwise
|
||||||
*/
|
*/
|
||||||
public function getEmptyField($element, $value_idx=null) {
|
public function getEmptyField($element, $value_idx=null) {
|
||||||
$element = $this -> getElement($element);
|
$element = $this -> getElement($element);
|
||||||
|
@ -736,9 +736,9 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Défini la taille maximal pour les fichiers envoyés par le formualaire
|
* Défini la taille maximal pour les fichiers envoyés par le formualaire
|
||||||
*
|
*
|
||||||
* @param[in] $size La taille maximal en octets
|
* @param int $size La taille maximal en octets
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function setMaxFileSize($size) {
|
public function setMaxFileSize($size) {
|
||||||
$this -> maxFileSize = $size;
|
$this -> maxFileSize = $size;
|
||||||
|
@ -747,9 +747,9 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Applique un masque de saisie au formulaire
|
* Applique un masque de saisie au formulaire
|
||||||
*
|
*
|
||||||
* @param[in] $dataEntryForm string Le nom du masque de saisie
|
* @param string $submit Le nom du masque de saisie
|
||||||
*
|
*
|
||||||
* @retval boolean True si le masque de saisie a été appliqué, False sinon
|
* @return boolean True si le masque de saisie a été appliqué, False sinon
|
||||||
**/
|
**/
|
||||||
public function applyDataEntryForm($dataEntryForm) {
|
public function applyDataEntryForm($dataEntryForm) {
|
||||||
$dataEntryForm=(string)$dataEntryForm;
|
$dataEntryForm=(string)$dataEntryForm;
|
||||||
|
@ -781,9 +781,9 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Liste les dataEntryForm disponible pour un type d'LSldapObject
|
* Liste les dataEntryForm disponible pour un type d'LSldapObject
|
||||||
*
|
*
|
||||||
* @param[in] $type string Le type d'LSldapObject
|
* @param string $submit Le type d'LSldapObject
|
||||||
*
|
*
|
||||||
* @retval array Tableau contenant la liste de dataEntryForm disponible pour ce type d'LSldapObject (nom => label)
|
* @return array Tableau contenant la liste de dataEntryForm disponible pour ce type d'LSldapObject (nom => label)
|
||||||
**/
|
**/
|
||||||
public static function listAvailableDataEntryForm($type) {
|
public static function listAvailableDataEntryForm($type) {
|
||||||
$retval=array();
|
$retval=array();
|
||||||
|
@ -807,9 +807,9 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Ajoute un avertissement au sujet du formulaire
|
* Ajoute un avertissement au sujet du formulaire
|
||||||
*
|
*
|
||||||
* @param[in] $txt string Le texte de l'avertissement
|
* @param string $submit Le texte de l'avertissement
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function addWarning($txt) {
|
public function addWarning($txt) {
|
||||||
$this -> warnings[]=$txt;
|
$this -> warnings[]=$txt;
|
||||||
|
@ -818,9 +818,9 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Méthode Ajax permetant de retourner le code HTML d'un élément du formulaire vide
|
* Méthode Ajax permetant de retourner le code HTML d'un élément du formulaire vide
|
||||||
*
|
*
|
||||||
* @param[in] &$data Variable de retour
|
* @param array &$data Variable de retour
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function ajax_onAddFieldBtnClick(&$data) {
|
public static function ajax_onAddFieldBtnClick(&$data) {
|
||||||
if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['objectdn'])) && (isset($_REQUEST['idform'])) && (isset($_REQUEST['fieldId'])) ) {
|
if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['objectdn'])) && (isset($_REQUEST['idform'])) && (isset($_REQUEST['fieldId'])) ) {
|
||||||
|
@ -845,11 +845,11 @@ class LSform extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* CLI autocompleter for form attributes values
|
* CLI autocompleter for form attributes values
|
||||||
*
|
*
|
||||||
* @param[in] &$opts array Reference of array of avalaible autocomplete options
|
* @param array &$opts Array of avalaible autocomplete options
|
||||||
* @param[in] $comp_word string The command word to autocomplete
|
* @param string $submit The command word to autocomplete
|
||||||
* @param[in] $multiple_value_delimiter string The multiple value delimiter (optional, default: "|")
|
* @param string $submit The multiple value delimiter (optional, default: "|")
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function autocomplete_attrs_values(&$opts, $comp_word, $multiple_value_delimiter='|') {
|
public function autocomplete_attrs_values(&$opts, $comp_word, $multiple_value_delimiter='|') {
|
||||||
if ($comp_word && strpos($comp_word, '=') !== false) {
|
if ($comp_word && strpos($comp_word, '=') !== false) {
|
||||||
|
|
|
@ -49,13 +49,13 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] &$form LSform The LSform parent object
|
* @param LSform &$form The LSform parent object
|
||||||
* @param[in] $name string The name of the element
|
* @param string $name The name of the element
|
||||||
* @param[in] $label string The label of the element
|
* @param string $name The label of the element
|
||||||
* @param[in] $params array The parameters of the element
|
* @param string $name The parameters of the element
|
||||||
* @param[in] &$attr_html LSattr_html The LSattr_html object of the corresponding attribute
|
* @param LSform &$form The LSattr_html object of the corresponding attribute
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct(&$form, $name, $label, $params, &$attr_html){
|
public function __construct(&$form, $name, $label, $params, &$attr_html){
|
||||||
$this -> name = $name;
|
$this -> name = $name;
|
||||||
|
@ -68,7 +68,7 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Allow conversion of LSformElement to string
|
* Allow conversion of LSformElement to string
|
||||||
*
|
*
|
||||||
* @retval string The string representation of the LSformElement
|
* @return string The string representation of the LSformElement
|
||||||
*/
|
*/
|
||||||
public function __toString() {
|
public function __toString() {
|
||||||
return strval($this -> form)." -> <".get_class($this)." ".$this -> name.">";
|
return strval($this -> form)." -> <".get_class($this)." ".$this -> name.">";
|
||||||
|
@ -81,9 +81,9 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] [<b>required</b>] string or array La futur valeur de l'élément
|
* @param string|array $data La futur valeur de l'élément
|
||||||
*
|
*
|
||||||
* @retval boolean Retourne True
|
* @return boolean Retourne True
|
||||||
*/
|
*/
|
||||||
public function setValue($data) {
|
public function setValue($data) {
|
||||||
$this -> values = ensureIsArray($data);
|
$this -> values = ensureIsArray($data);
|
||||||
|
@ -99,9 +99,9 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] [<b>required</b>] string or array La futur valeur de l'élément
|
* @param string|array $data La futur valeur de l'élément
|
||||||
*
|
*
|
||||||
* @retval boolean Retourne True
|
* @return boolean Retourne True
|
||||||
*/
|
*/
|
||||||
public function setValueFromPostData($data) {
|
public function setValueFromPostData($data) {
|
||||||
$this -> values = ensureIsArray($data);
|
$this -> values = ensureIsArray($data);
|
||||||
|
@ -112,7 +112,7 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Exporte les valeurs de l'élément
|
* Exporte les valeurs de l'élément
|
||||||
*
|
*
|
||||||
* @retval Array Les valeurs de l'élement
|
* @return array Les valeurs de l'élement
|
||||||
*/
|
*/
|
||||||
public function exportValues(){
|
public function exportValues(){
|
||||||
return $this -> values;
|
return $this -> values;
|
||||||
|
@ -125,9 +125,9 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] [<b>required</b>] string or array La futur valeur de l'élément
|
* @param string|array $data La futur valeur de l'élément
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function addValue($data) {
|
public function addValue($data) {
|
||||||
$this -> values = array_merge($this -> values, ensureIsArray($data));
|
$this -> values = array_merge($this -> values, ensureIsArray($data));
|
||||||
|
@ -138,7 +138,7 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* Cette méthode test si l'élément est éditable
|
* Cette méthode test si l'élément est éditable
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function isFreeze(){
|
public function isFreeze(){
|
||||||
return $this -> _freeze;
|
return $this -> _freeze;
|
||||||
|
@ -149,7 +149,7 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* Rend l'élément non-editable
|
* Rend l'élément non-editable
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function freeze() {
|
public function freeze() {
|
||||||
$this -> _freeze = true;
|
$this -> _freeze = true;
|
||||||
|
@ -158,9 +158,9 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Défini la propriété required de l'élément.
|
* Défini la propriété required de l'élément.
|
||||||
*
|
*
|
||||||
* param[in] $isRequired boolean true si l'élément est requis, false sinon
|
* param boolean $isRequired true si l'élément est requis, false sinon
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setRequired($isRequired=true) {
|
public function setRequired($isRequired=true) {
|
||||||
$this -> _required = $isRequired;
|
$this -> _required = $isRequired;
|
||||||
|
@ -171,7 +171,7 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* Cette méthode test si l'élément est requis
|
* Cette méthode test si l'élément est requis
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function isRequired(){
|
public function isRequired(){
|
||||||
return $this -> _required;
|
return $this -> _required;
|
||||||
|
@ -180,7 +180,7 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Retourne le label de l'élement
|
* Retourne le label de l'élement
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function getLabelInfos() {
|
public function getLabelInfos() {
|
||||||
if ($this -> isRequired()) {
|
if ($this -> isRequired()) {
|
||||||
|
@ -207,11 +207,11 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
||||||
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
||||||
*
|
*
|
||||||
* @param[in] &$return array Reference of the array for retrieved values
|
* @param array &$return Reference of the array for retrieved values
|
||||||
* @param[in] $onlyIfPresent boolean If true and data of this element is not present in POST data,
|
* @param boolean $onlyIfPresent If true and data of this element is not present in POST data,
|
||||||
* just ignore it.
|
* just ignore it.
|
||||||
*
|
*
|
||||||
* @retval boolean true si la valeur est présente en POST, false sinon
|
* @return boolean true si la valeur est présente en POST, false sinon
|
||||||
*/
|
*/
|
||||||
public function getPostData(&$return, $onlyIfPresent=false) {
|
public function getPostData(&$return, $onlyIfPresent=false) {
|
||||||
if($this -> isFreeze()) {
|
if($this -> isFreeze()) {
|
||||||
|
@ -234,10 +234,10 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
* Retrieve the value of the element specified by its name ($name)
|
* Retrieve the value of the element specified by its name ($name)
|
||||||
* from POST data (provided as $post).
|
* from POST data (provided as $post).
|
||||||
*
|
*
|
||||||
* @param[in] &$post array Reference of the array for input POST data
|
* @param array &$return Reference of the array for input POST data
|
||||||
* @param[in] $name string POST data element name
|
* @param string $name POST data element name
|
||||||
*
|
*
|
||||||
* @retval mixed Array of POST data value if present, false otherwise
|
* @return mixed Array of POST data value if present, false otherwise
|
||||||
*/
|
*/
|
||||||
protected static function getData(&$post, $name) {
|
protected static function getData(&$post, $name) {
|
||||||
if (isset($post[$name])) {
|
if (isset($post[$name])) {
|
||||||
|
@ -258,7 +258,7 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* Retourne $this -> label, ou $this -> params['label'], ou $this -> name
|
* Retourne $this -> label, ou $this -> params['label'], ou $this -> name
|
||||||
*
|
*
|
||||||
* @retval string Le label de l'élément
|
* @return string Le label de l'élément
|
||||||
*/
|
*/
|
||||||
public function getLabel() {
|
public function getLabel() {
|
||||||
if ($this -> label != "") {
|
if ($this -> label != "") {
|
||||||
|
@ -270,7 +270,7 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Le champ est-il a valeur multiple
|
* Le champ est-il a valeur multiple
|
||||||
*
|
*
|
||||||
* @retval boolean True si le champ est à valeur multiple, False sinon
|
* @return boolean True si le champ est à valeur multiple, False sinon
|
||||||
*/
|
*/
|
||||||
public function isMultiple() {
|
public function isMultiple() {
|
||||||
return $this -> getParam('multiple', false, 'bool');
|
return $this -> getParam('multiple', false, 'bool');
|
||||||
|
@ -279,10 +279,10 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return HTML code of the LSformElement based on its (smarty) template file
|
* Return HTML code of the LSformElement based on its (smarty) template file
|
||||||
*
|
*
|
||||||
* @param[in] $template string The template filename (optional, default: $this -> template)
|
* @param string $name The template filename (optional, default: $this -> template)
|
||||||
* @param[in] $variables array Array of template variables to assign before template compilation (optional)
|
* @param string $name Array of template variables to assign before template compilation (optional)
|
||||||
*
|
*
|
||||||
* @retval string HTML code of the LSformElement
|
* @return string HTML code of the LSformElement
|
||||||
*/
|
*/
|
||||||
public function fetchTemplate($template=NULL,$variables=array()) {
|
public function fetchTemplate($template=NULL,$variables=array()) {
|
||||||
if (!$template) {
|
if (!$template) {
|
||||||
|
@ -310,9 +310,9 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return HTML code of an empty form field
|
* Return HTML code of an empty form field
|
||||||
*
|
*
|
||||||
* @param[in] $value_idx integer|null The value index (optional, default: null == 0)
|
* @param integer|null $value_idx The value index (optional, default: null == 0)
|
||||||
*
|
*
|
||||||
* @retval string The HTML code of an empty field
|
* @return string The HTML code of an empty field
|
||||||
*/
|
*/
|
||||||
public function getEmptyField($value_idx=null) {
|
public function getEmptyField($value_idx=null) {
|
||||||
return $this -> fetchTemplate(
|
return $this -> fetchTemplate(
|
||||||
|
@ -330,7 +330,7 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
* @param[] $default The default value (default : null)
|
* @param[] $default The default value (default : null)
|
||||||
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
||||||
*
|
*
|
||||||
* @retval mixed The parameter value or default value if not set
|
* @return mixed The parameter value or default value if not set
|
||||||
**/
|
**/
|
||||||
public function getParam($param, $default=null, $cast=null) {
|
public function getParam($param, $default=null, $cast=null) {
|
||||||
return LSconfig :: get($param, $default, $cast, $this -> params);
|
return LSconfig :: get($param, $default, $cast, $this -> params);
|
||||||
|
@ -339,14 +339,14 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* CLI autocompleter for form element attribute values
|
* CLI autocompleter for form element attribute values
|
||||||
*
|
*
|
||||||
* @param[in] &$opts array Reference of array of avalaible autocomplete options
|
* @param array &$return Array of avalaible autocomplete options
|
||||||
* @param[in] $comp_word string The (unquoted) command word to autocomplete
|
* @param string $name The (unquoted) command word to autocomplete
|
||||||
* @param[in] $attr_value string The current attribute value in command word to autocomplete
|
* @param string $name The current attribute value in command word to autocomplete
|
||||||
* (optional, default: empty string)
|
* (optional, default: empty string)
|
||||||
* @param[in] $multiple_value_delimiter string The multiple value delimiter (optional, default: "|")
|
* @param string $name The multiple value delimiter (optional, default: "|")
|
||||||
* @param[in] $quote_char string The quote character detected (optional, default: empty string)
|
* @param string $name The quote character detected (optional, default: empty string)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function autocomplete_attr_values(&$opts, $comp_word, $attr_value="", $multiple_value_delimiter="|", $quote_char='') {
|
public function autocomplete_attr_values(&$opts, $comp_word, $attr_value="", $multiple_value_delimiter="|", $quote_char='') {
|
||||||
return;
|
return;
|
||||||
|
@ -355,15 +355,14 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* CLI autocompleter helper to split form element attribute values
|
* CLI autocompleter helper to split form element attribute values
|
||||||
*
|
*
|
||||||
* @param[in] $attr_value string The current attribute value in command word to autocomplete
|
* @param string $attr_value The current attribute value in command word to autocomplete
|
||||||
* (optional, default: empty string)
|
* (optional, default: empty string)
|
||||||
* @param[in] $multiple_value_delimiter string The multiple value delimiter (optional, default: "|")
|
* @param string $multiple_value_delimiter The multiple value delimiter (optional, default: "|")
|
||||||
* @param[in] &$attr_values Reference of array Reference of array that will contain splited attribute
|
* @param array &$attr_values &array Array that will contain splited attribute values without
|
||||||
* values without last-one
|
* last-one
|
||||||
* @param[in] &$last_attr_value Reference of string Reference of array that will contain the last splited attribute
|
* @param string &$last_attr_value Array that will contain the last splited attribute value
|
||||||
* value
|
|
||||||
*
|
*
|
||||||
* @retval boolean True on success, False otherwise
|
* @return boolean True on success, False otherwise
|
||||||
*/
|
*/
|
||||||
protected function split_autocomplete_attr_values($attr_value, $multiple_value_delimiter, &$attr_values, &$last_attr_value) {
|
protected function split_autocomplete_attr_values($attr_value, $multiple_value_delimiter, &$attr_values, &$last_attr_value) {
|
||||||
$attr_values = explode($multiple_value_delimiter, $attr_value);
|
$attr_values = explode($multiple_value_delimiter, $attr_value);
|
||||||
|
@ -380,13 +379,13 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* CLI autocompleter helper to format and add form element attribute value option
|
* CLI autocompleter helper to format and add form element attribute value option
|
||||||
*
|
*
|
||||||
* @param[in] &$opts array Reference of array of avalaible autocomplete options
|
* @param array &$opts Array of avalaible autocomplete options
|
||||||
* @param[in] &$attr_values Reference of array Reference of array of splited attribute values without last-one
|
* @param array &$attr_values Array of splited attribute values without last-one
|
||||||
* @param[in] $value string The attribute value to add as option
|
* @param string $value The attribute value to add as option
|
||||||
* @param[in] $multiple_value_delimiter string The multiple value delimiter (optional, default: "|")
|
* @param string $multiple_value_delimiter The multiple value delimiter (optional, default: "|")
|
||||||
* @param[in] $quote_char string The quote character (optional, default: empty string)
|
* @param string $quote_char The quote character (optional, default: empty string)
|
||||||
*
|
*
|
||||||
* @retval boolean True on success, False otherwise
|
* @return boolean True on success, False otherwise
|
||||||
*/
|
*/
|
||||||
protected function add_autocomplete_attr_value_opts(&$opts, &$attr_values, $value, $multiple_value_delimiter='|', $quote_char='') {
|
protected function add_autocomplete_attr_value_opts(&$opts, &$attr_values, $value, $multiple_value_delimiter='|', $quote_char='') {
|
||||||
if (in_array($value, $attr_values)) {
|
if (in_array($value, $attr_values)) {
|
||||||
|
@ -404,10 +403,10 @@ class LSformElement extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Retrieve value as return in API response
|
* Retrieve value as return in API response
|
||||||
*
|
*
|
||||||
* @param[in] $details boolean If true, returned values will contain details if this field type
|
* @param boolean $onlyIfPresent If true, returned values will contain details if this field type
|
||||||
* support it (optional, default: false)
|
* support it (optional, default: false)
|
||||||
*
|
*
|
||||||
* @retval mixed API value(s) or null/empty array if no value
|
* @return mixed API value(s) or null/empty array if no value
|
||||||
*/
|
*/
|
||||||
public function getApiValue($details=false) {
|
public function getApiValue($details=false) {
|
||||||
if (method_exists($this, 'parseValue')) {
|
if (method_exists($this, 'parseValue')) {
|
||||||
|
|
|
@ -40,7 +40,7 @@ class LSformElement_boolean extends LSformElement {
|
||||||
*
|
*
|
||||||
* Cette méthode retourne les informations d'affichage de l'élement
|
* Cette méthode retourne les informations d'affichage de l'élement
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDisplay(){
|
public function getDisplay(){
|
||||||
$return = $this -> getLabelInfos();
|
$return = $this -> getLabelInfos();
|
||||||
|
@ -67,13 +67,13 @@ class LSformElement_boolean extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* CLI autocompleter for form element attribute values
|
* CLI autocompleter for form element attribute values
|
||||||
*
|
*
|
||||||
* @param[in] &$opts array Reference of array of avalaible autocomplete options
|
* @param array &$opts Array of avalaible autocomplete options
|
||||||
* @param[in] $comp_word string The (unquoted) command word to autocomplete
|
* @param string $comp_word The (unquoted) command word to autocomplete
|
||||||
* @param[in] $attr_value string The current attribute value in command word to autocomplete (optional, default: empty string)
|
* @param string $attr_value The current attribute value in command word to autocomplete (optional, default: empty string)
|
||||||
* @param[in] $multiple_value_delimiter string The multiple value delimiter (optional, default: "|")
|
* @param string $multiple_value_delimiter The multiple value delimiter (optional, default: "|")
|
||||||
* @param[in] $quote_char string The quote character detected (optional, default: empty string)
|
* @param string $quote_char The quote character detected (optional, default: empty string)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function autocomplete_attr_values(&$opts, $comp_word, $attr_value="", $multiple_value_delimiter="|", $quote_char='') {
|
public function autocomplete_attr_values(&$opts, $comp_word, $attr_value="", $multiple_value_delimiter="|", $quote_char='') {
|
||||||
// Split attribute values and retrieved splited value in $attr_values and $last_attr_value
|
// Split attribute values and retrieved splited value in $attr_values and $last_attr_value
|
||||||
|
|
|
@ -69,9 +69,9 @@ class LSformElement_date extends LSformElement {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] [<b>required</b>] string or array La futur valeur de l'élément
|
* @param string|array $data La futur valeur de l'élément
|
||||||
*
|
*
|
||||||
* @retval boolean Retourne True
|
* @return boolean Retourne True
|
||||||
*/
|
*/
|
||||||
public function setValue($data) {
|
public function setValue($data) {
|
||||||
$special_values = $this -> getSpecialValues();
|
$special_values = $this -> getSpecialValues();
|
||||||
|
@ -97,7 +97,7 @@ class LSformElement_date extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Exporte les valeurs de l'élément
|
* Exporte les valeurs de l'élément
|
||||||
*
|
*
|
||||||
* @retval Array Les valeurs de l'élement
|
* @return array Les valeurs de l'élement
|
||||||
*/
|
*/
|
||||||
public function exportValues(){
|
public function exportValues(){
|
||||||
$retval=array();
|
$retval=array();
|
||||||
|
@ -124,7 +124,7 @@ class LSformElement_date extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Retourne le format d'affichage de la date
|
* Retourne le format d'affichage de la date
|
||||||
*
|
*
|
||||||
* @retval string Le format de la date
|
* @return string Le format de la date
|
||||||
**/
|
**/
|
||||||
public function getFormat() {
|
public function getFormat() {
|
||||||
return $this -> getParam('html_options.format', ($this -> getParam('html_options.time', true)?'%d/%m/%Y, %T':'%d/%m/%Y'));
|
return $this -> getParam('html_options.format', ($this -> getParam('html_options.time', true)?'%d/%m/%Y, %T':'%d/%m/%Y'));
|
||||||
|
@ -133,7 +133,7 @@ class LSformElement_date extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Return date picker style value
|
* Return date picker style value
|
||||||
*
|
*
|
||||||
* @retval string The date picker style
|
* @return string The date picker style
|
||||||
**/
|
**/
|
||||||
public function getStyle() {
|
public function getStyle() {
|
||||||
$style = $this -> getParam('html_options.style', $this -> default_style, 'string');
|
$style = $this -> getParam('html_options.style', $this -> default_style, 'string');
|
||||||
|
@ -151,7 +151,7 @@ class LSformElement_date extends LSformElement {
|
||||||
*
|
*
|
||||||
* Cette méthode retourne les informations d'affichage de l'élement
|
* Cette méthode retourne les informations d'affichage de l'élement
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDisplay(){
|
public function getDisplay(){
|
||||||
$return = $this -> getLabelInfos();
|
$return = $this -> getLabelInfos();
|
||||||
|
@ -196,10 +196,10 @@ class LSformElement_date extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Retournne un template Smarty compilé dans le contexte d'un LSformElement
|
* Retournne un template Smarty compilé dans le contexte d'un LSformElement
|
||||||
*
|
*
|
||||||
* @param[in] string $template Le template à retourner
|
* @param string $template Le template à retourner
|
||||||
* @param[in] array $variables Variables Smarty à assigner avant l'affichage
|
* @param array $variables Variables Smarty à assigner avant l'affichage
|
||||||
*
|
*
|
||||||
* @retval string Le HTML compilé du template
|
* @return string Le HTML compilé du template
|
||||||
*/
|
*/
|
||||||
public function fetchTemplate($template=NULL, $variables=array()) {
|
public function fetchTemplate($template=NULL, $variables=array()) {
|
||||||
$variables['special_values'] = $this -> getSpecialValues();
|
$variables['special_values'] = $this -> getSpecialValues();
|
||||||
|
@ -212,11 +212,11 @@ class LSformElement_date extends LSformElement {
|
||||||
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
||||||
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
||||||
*
|
*
|
||||||
* @param[in] &$return array Reference of the array for retrieved values
|
* @param array &$return Reference of the array for retrieved values
|
||||||
* @param[in] $onlyIfPresent boolean If true and data of this element is not present in POST data,
|
* @param boolean $onlyIfPresent If true and data of this element is not present in POST data,
|
||||||
* just ignore it.
|
* just ignore it.
|
||||||
*
|
*
|
||||||
* @retval boolean true si la valeur est présente en POST, false sinon
|
* @return boolean true si la valeur est présente en POST, false sinon
|
||||||
*/
|
*/
|
||||||
public function getPostData(&$return, $onlyIfPresent=false) {
|
public function getPostData(&$return, $onlyIfPresent=false) {
|
||||||
if($this -> isFreeze()) {
|
if($this -> isFreeze()) {
|
||||||
|
@ -267,7 +267,7 @@ class LSformElement_date extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Convertis un format de date Php (strftime) en JS (jscalendar)
|
* Convertis un format de date Php (strftime) en JS (jscalendar)
|
||||||
*
|
*
|
||||||
* @retval mixed Format de date jscalendar (string) ou False si la convertion
|
* @return mixed Format de date jscalendar (string) ou False si la convertion
|
||||||
* n'a pas réussi.
|
* n'a pas réussi.
|
||||||
*/
|
*/
|
||||||
public function php2js_format($format) {
|
public function php2js_format($format) {
|
||||||
|
|
|
@ -40,7 +40,7 @@ class LSformElement_image extends LSformElement {
|
||||||
*
|
*
|
||||||
* Cette méthode retourne les informations d'affichage de l'élement
|
* Cette méthode retourne les informations d'affichage de l'élement
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDisplay(){
|
public function getDisplay(){
|
||||||
LStemplate :: addCssFile('LSformElement_image.css');
|
LStemplate :: addCssFile('LSformElement_image.css');
|
||||||
|
@ -86,11 +86,11 @@ class LSformElement_image extends LSformElement {
|
||||||
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
||||||
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
||||||
*
|
*
|
||||||
* @param[in] &$return array Reference of the array for retrieved values
|
* @param array &$return Reference of the array for retrieved values
|
||||||
* @param[in] $onlyIfPresent boolean If true and data of this element is not present in POST data,
|
* @param boolean $onlyIfPresent If true and data of this element is not present in POST data,
|
||||||
* just ignore it.
|
* just ignore it.
|
||||||
*
|
*
|
||||||
* @retval boolean true si la valeur est présente en POST, false sinon
|
* @return boolean true si la valeur est présente en POST, false sinon
|
||||||
*/
|
*/
|
||||||
public function getPostData(&$return, $onlyIfPresent=false) {
|
public function getPostData(&$return, $onlyIfPresent=false) {
|
||||||
if($this -> isFreeze()) {
|
if($this -> isFreeze()) {
|
||||||
|
@ -140,7 +140,7 @@ class LSformElement_image extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Get file upload error message
|
* Get file upload error message
|
||||||
*
|
*
|
||||||
* @retval string The translated file upload error message
|
* @return string The translated file upload error message
|
||||||
*/
|
*/
|
||||||
private function getFileUploadErrorMessage() {
|
private function getFileUploadErrorMessage() {
|
||||||
if (isset($_FILES[$this -> name]) && isset($_FILES[$this -> name]['error'])) {
|
if (isset($_FILES[$this -> name]) && isset($_FILES[$this -> name]['error'])) {
|
||||||
|
@ -167,10 +167,10 @@ class LSformElement_image extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Retrieve value as return in API response
|
* Retrieve value as return in API response
|
||||||
*
|
*
|
||||||
* @param[in] $details boolean If true, returned values will contain details if this field type
|
* @param boolean $onlyIfPresent If true, returned values will contain details if this field type
|
||||||
* support it (optional, default: false)
|
* support it (optional, default: false)
|
||||||
*
|
*
|
||||||
* @retval mixed API value(s) or null/empty array if no value
|
* @return mixed API value(s) or null/empty array if no value
|
||||||
*/
|
*/
|
||||||
public function getApiValue($details=false) {
|
public function getApiValue($details=false) {
|
||||||
if ($this -> isMultiple()) {
|
if ($this -> isMultiple()) {
|
||||||
|
|
|
@ -69,7 +69,7 @@ class LSformElement_jsonCompositeAttribute extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Parse values
|
* Parse values
|
||||||
*
|
*
|
||||||
* @retval array Parsed values
|
* @return array Parsed values
|
||||||
*/
|
*/
|
||||||
private function parseValues() {
|
private function parseValues() {
|
||||||
self :: log_trace('values: '.varDump($this -> values));
|
self :: log_trace('values: '.varDump($this -> values));
|
||||||
|
@ -94,7 +94,7 @@ class LSformElement_jsonCompositeAttribute extends LSformElement {
|
||||||
*
|
*
|
||||||
* Cette méthode retourne les informations d'affichage de l'élement
|
* Cette méthode retourne les informations d'affichage de l'élement
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDisplay(){
|
public function getDisplay(){
|
||||||
$return = $this -> getLabelInfos();
|
$return = $this -> getLabelInfos();
|
||||||
|
@ -126,10 +126,10 @@ class LSformElement_jsonCompositeAttribute extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Retournne un template Smarty compilé dans le contexte d'un LSformElement
|
* Retournne un template Smarty compilé dans le contexte d'un LSformElement
|
||||||
*
|
*
|
||||||
* @param[in] string $template Le template à retourner
|
* @param string $template Le template à retourner
|
||||||
* @param[in] array $variables Variables Smarty à assigner avant l'affichage
|
* @param string $template Variables Smarty à assigner avant l'affichage
|
||||||
*
|
*
|
||||||
* @retval string Le HTML compilé du template
|
* @return string Le HTML compilé du template
|
||||||
*/
|
*/
|
||||||
public function fetchTemplate($template=NULL,$variables=array()) {
|
public function fetchTemplate($template=NULL,$variables=array()) {
|
||||||
$components = $this -> components;
|
$components = $this -> components;
|
||||||
|
@ -150,11 +150,11 @@ class LSformElement_jsonCompositeAttribute extends LSformElement {
|
||||||
* - value : untranslated value
|
* - value : untranslated value
|
||||||
* - translated : translated value
|
* - translated : translated value
|
||||||
*
|
*
|
||||||
* @param[in] $c string The component name
|
* @param string $c The component name
|
||||||
* @param[in] $value string The value
|
* @param string $c The value
|
||||||
* @param[in] $inLoop boolean Internal param to control recursion
|
* @param boolean $inLoop Internal param to control recursion
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
**/
|
**/
|
||||||
protected function translateComponentValue($c,$value,$inLoop=false) {
|
protected function translateComponentValue($c,$value,$inLoop=false) {
|
||||||
if (!$inLoop && isset($this -> components[$c]['multiple']) && $this -> components[$c]['multiple']) {
|
if (!$inLoop && isset($this -> components[$c]['multiple']) && $this -> components[$c]['multiple']) {
|
||||||
|
@ -180,9 +180,9 @@ class LSformElement_jsonCompositeAttribute extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Retrieve possible values of an select_list component
|
* Retrieve possible values of an select_list component
|
||||||
*
|
*
|
||||||
* @param[in] $c string The component name
|
* @param string $c The component name
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
**/
|
**/
|
||||||
protected $_cache_getSelectListComponentPossibleValues=array();
|
protected $_cache_getSelectListComponentPossibleValues=array();
|
||||||
protected function getSelectListComponentPossibleValues($c) {
|
protected function getSelectListComponentPossibleValues($c) {
|
||||||
|
@ -203,10 +203,10 @@ class LSformElement_jsonCompositeAttribute extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Retrieve value's label of an select_list component
|
* Retrieve value's label of an select_list component
|
||||||
*
|
*
|
||||||
* @param[in] $c string The component name
|
* @param string $c The component name
|
||||||
* @param[in] $value string The value
|
* @param string $c The value
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
**/
|
**/
|
||||||
protected function getSelectListComponentValueLabel($c, $value) {
|
protected function getSelectListComponentValueLabel($c, $value) {
|
||||||
if ($this -> getSelectListComponentPossibleValues($c)) {
|
if ($this -> getSelectListComponentPossibleValues($c)) {
|
||||||
|
@ -229,11 +229,11 @@ class LSformElement_jsonCompositeAttribute extends LSformElement {
|
||||||
* This method check present of this element's value in POST data and retrieve
|
* This method check present of this element's value in POST data and retrieve
|
||||||
* it to feed the array passed in paramater.
|
* it to feed the array passed in paramater.
|
||||||
*
|
*
|
||||||
* @param[in] &$return array Reference of the array for retrieved values
|
* @param array &$return Reference of the array for retrieved values
|
||||||
* @param[in] $onlyIfPresent boolean If true and data of this element is not present in POST data,
|
* @param boolean $inLoop If true and data of this element is not present in POST data,
|
||||||
* just ignore it.
|
* just ignore it.
|
||||||
*
|
*
|
||||||
* @retval boolean true if value is in POST data, false instead
|
* @return boolean true if value is in POST data, false instead
|
||||||
*/
|
*/
|
||||||
public function getPostData(&$return, $onlyIfPresent=false) {
|
public function getPostData(&$return, $onlyIfPresent=false) {
|
||||||
if($this -> isFreeze()) {
|
if($this -> isFreeze()) {
|
||||||
|
@ -381,7 +381,7 @@ class LSformElement_jsonCompositeAttribute extends LSformElement {
|
||||||
* @param[] $c The component name
|
* @param[] $c The component name
|
||||||
* @param[] $value The values of the component
|
* @param[] $value The values of the component
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
private function checkComponentValues($c, $value) {
|
private function checkComponentValues($c, $value) {
|
||||||
// Check select_list component's values
|
// Check select_list component's values
|
||||||
|
@ -423,7 +423,7 @@ class LSformElement_jsonCompositeAttribute extends LSformElement {
|
||||||
* @param[] $c The component name
|
* @param[] $c The component name
|
||||||
* @param[] $value The value to check
|
* @param[] $value The value to check
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
private function checkSelectListComponentValue($c, $value) {
|
private function checkSelectListComponentValue($c, $value) {
|
||||||
if (!$this -> getSelectListComponentValueLabel($c, $value)) {
|
if (!$this -> getSelectListComponentValueLabel($c, $value)) {
|
||||||
|
@ -448,7 +448,7 @@ class LSformElement_jsonCompositeAttribute extends LSformElement {
|
||||||
* @param[] $default The default value (default : null)
|
* @param[] $default The default value (default : null)
|
||||||
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
||||||
*
|
*
|
||||||
* @retval mixed The configuration parameter value or default value if not set
|
* @return mixed The configuration parameter value or default value if not set
|
||||||
**/
|
**/
|
||||||
public function getComponentConfig($component, $param, $default=null, $cast=null) {
|
public function getComponentConfig($component, $param, $default=null, $cast=null) {
|
||||||
return LSconfig :: get(
|
return LSconfig :: get(
|
||||||
|
@ -460,10 +460,10 @@ class LSformElement_jsonCompositeAttribute extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Retrieve value as return in API response
|
* Retrieve value as return in API response
|
||||||
*
|
*
|
||||||
* @param[in] $details boolean If true, returned values will contain details if this field type
|
* @param boolean $inLoop If true, returned values will contain details if this field type
|
||||||
* support it (optional, default: false)
|
* support it (optional, default: false)
|
||||||
*
|
*
|
||||||
* @retval mixed API value(s) or null/empty array if no value
|
* @return mixed API value(s) or null/empty array if no value
|
||||||
*/
|
*/
|
||||||
public function getApiValue($details=false) {
|
public function getApiValue($details=false) {
|
||||||
$values = array();
|
$values = array();
|
||||||
|
|
|
@ -41,7 +41,7 @@ class LSformElement_labeledValue extends LSformElement {
|
||||||
*
|
*
|
||||||
* Cette méthode retourne les informations d'affichage de l'élement
|
* Cette méthode retourne les informations d'affichage de l'élement
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDisplay(){
|
public function getDisplay(){
|
||||||
$return = $this -> getLabelInfos();
|
$return = $this -> getLabelInfos();
|
||||||
|
@ -70,9 +70,9 @@ class LSformElement_labeledValue extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Return HTML code of an empty form field
|
* Return HTML code of an empty form field
|
||||||
*
|
*
|
||||||
* @param[in] $value_idx integer|null The value index (optional, default: null == 0)
|
* @param integer|null $value_idx The value index (optional, default: null == 0)
|
||||||
*
|
*
|
||||||
* @retval string The HTML code of an empty field
|
* @return string The HTML code of an empty field
|
||||||
*/
|
*/
|
||||||
public function getEmptyField($value_idx=null) {
|
public function getEmptyField($value_idx=null) {
|
||||||
return $this -> fetchTemplate(
|
return $this -> fetchTemplate(
|
||||||
|
@ -88,10 +88,10 @@ class LSformElement_labeledValue extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Parse one value
|
* Parse one value
|
||||||
*
|
*
|
||||||
* @param[in] $value string The value to parse
|
* @param string $value The value to parse
|
||||||
* @param[in] $details boolean Enable/disable details return (optional, default: true)
|
* @param boolean $details Enable/disable details return (optional, default: true)
|
||||||
*
|
*
|
||||||
* @retval array Parsed value
|
* @return array Parsed value
|
||||||
*/
|
*/
|
||||||
public function parseValue($value, $details=true) {
|
public function parseValue($value, $details=true) {
|
||||||
if (!$details)
|
if (!$details)
|
||||||
|
@ -110,11 +110,11 @@ class LSformElement_labeledValue extends LSformElement {
|
||||||
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
||||||
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
||||||
*
|
*
|
||||||
* @param[in] &$return array Reference of the array for retrieved values
|
* @param array &$return Reference of the array for retrieved values
|
||||||
* @param[in] $onlyIfPresent boolean If true and data of this element is not present in POST data,
|
* @param boolean $onlyIfPresent If true and data of this element is not present in POST data,
|
||||||
* just ignore it.
|
* just ignore it.
|
||||||
*
|
*
|
||||||
* @retval boolean true si la valeur est présente en POST, false sinon
|
* @return boolean true si la valeur est présente en POST, false sinon
|
||||||
*/
|
*/
|
||||||
public function getPostData(&$return, $onlyIfPresent=false) {
|
public function getPostData(&$return, $onlyIfPresent=false) {
|
||||||
if($this -> isFreeze()) {
|
if($this -> isFreeze()) {
|
||||||
|
|
|
@ -53,13 +53,13 @@ class LSformElement_mail extends LSformElement_text {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] &$form LSform The LSform parent object
|
* @param LSform &$form The LSform parent object
|
||||||
* @param[in] $name string The name of the element
|
* @param string $name The name of the element
|
||||||
* @param[in] $label string The label of the element
|
* @param string $label The label of the element
|
||||||
* @param[in] $params array The parameters of the element
|
* @param array $params The parameters of the element
|
||||||
* @param[in] &$attr_html LSattr_html The LSattr_html object of the corresponding attribute
|
* @param LSattr_html &$attr_html The LSattr_html object of the corresponding attribute
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct(&$form, $name, $label, $params, &$attr_html){
|
public function __construct(&$form, $name, $label, $params, &$attr_html){
|
||||||
parent::__construct($form, $name, $label, $params, $attr_html);
|
parent::__construct($form, $name, $label, $params, $attr_html);
|
||||||
|
@ -98,10 +98,10 @@ class LSformElement_mail extends LSformElement_text {
|
||||||
/**
|
/**
|
||||||
* Return HTML code of the LSformElement based on its (smarty) template file
|
* Return HTML code of the LSformElement based on its (smarty) template file
|
||||||
*
|
*
|
||||||
* @param[in] $template string The template filename (optional, default: $this -> template)
|
* @param string $template The template filename (optional, default: $this -> template)
|
||||||
* @param[in] $variables array Array of template variables to assign before template compilation (optional)
|
* @param array $variables Array of template variables to assign before template compilation (optional)
|
||||||
*
|
*
|
||||||
* @retval string HTML code of the LSformElement
|
* @return string HTML code of the LSformElement
|
||||||
*/
|
*/
|
||||||
public function fetchTemplate($template=NULL,$variables=array()) {
|
public function fetchTemplate($template=NULL,$variables=array()) {
|
||||||
if ($this -> getParam('html_options.disableMailSending', false, 'bool')) {
|
if ($this -> getParam('html_options.disableMailSending', false, 'bool')) {
|
||||||
|
|
|
@ -44,10 +44,10 @@ class LSformElement_mailQuota extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Parse one value
|
* Parse one value
|
||||||
*
|
*
|
||||||
* @param[in] $value string The value to parse
|
* @param string $value The value to parse
|
||||||
* @param[in] $details boolean Enable/disable details return (optional, default: true)
|
* @param boolean $details Enable/disable details return (optional, default: true)
|
||||||
*
|
*
|
||||||
* @retval array Parsed value
|
* @return array Parsed value
|
||||||
*/
|
*/
|
||||||
public function parseValue($value, $details=true) {
|
public function parseValue($value, $details=true) {
|
||||||
if (preg_match('/^([0-9]+)'.$this -> getSuffix().'$/', $value, $regs)) {
|
if (preg_match('/^([0-9]+)'.$this -> getSuffix().'$/', $value, $regs)) {
|
||||||
|
@ -84,7 +84,7 @@ class LSformElement_mailQuota extends LSformElement {
|
||||||
*
|
*
|
||||||
* Cette méthode retourne les informations d'affichage de l'élement
|
* Cette méthode retourne les informations d'affichage de l'élement
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDisplay(){
|
public function getDisplay(){
|
||||||
$return = $this -> getLabelInfos();
|
$return = $this -> getLabelInfos();
|
||||||
|
@ -118,9 +118,9 @@ class LSformElement_mailQuota extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Return HTML code of an empty form field
|
* Return HTML code of an empty form field
|
||||||
*
|
*
|
||||||
* @param[in] $value_idx integer|null The value index (optional, default: null == 0)
|
* @param integer|null $value_idx The value index (optional, default: null == 0)
|
||||||
*
|
*
|
||||||
* @retval string The HTML code of an empty field
|
* @return string The HTML code of an empty field
|
||||||
*/
|
*/
|
||||||
public function getEmptyField($value_idx=null) {
|
public function getEmptyField($value_idx=null) {
|
||||||
return $this -> fetchTemplate(
|
return $this -> fetchTemplate(
|
||||||
|
@ -136,7 +136,7 @@ class LSformElement_mailQuota extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Return suffix value
|
* Return suffix value
|
||||||
*
|
*
|
||||||
* @retval string Suffix value
|
* @return string Suffix value
|
||||||
**/
|
**/
|
||||||
public function getSuffix() {
|
public function getSuffix() {
|
||||||
return $this -> getParam('html_options.suffix', 'S', 'string');
|
return $this -> getParam('html_options.suffix', 'S', 'string');
|
||||||
|
@ -148,11 +148,11 @@ class LSformElement_mailQuota extends LSformElement {
|
||||||
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
||||||
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
||||||
*
|
*
|
||||||
* @param[in] &$return array Reference of the array for retrieved values
|
* @param array &$return Reference of the array for retrieved values
|
||||||
* @param[in] $onlyIfPresent boolean If true and data of this element is not present in POST data,
|
* @param boolean $onlyIfPresent If true and data of this element is not present in POST data,
|
||||||
* just ignore it.
|
* just ignore it.
|
||||||
*
|
*
|
||||||
* @retval boolean true si la valeur est présente en POST, false sinon
|
* @return boolean true si la valeur est présente en POST, false sinon
|
||||||
*/
|
*/
|
||||||
public function getPostData(&$return, $onlyIfPresent=false) {
|
public function getPostData(&$return, $onlyIfPresent=false) {
|
||||||
if($this -> isFreeze()) {
|
if($this -> isFreeze()) {
|
||||||
|
|
|
@ -80,11 +80,11 @@ class LSformElement_maildir extends LSformElement_text {
|
||||||
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
||||||
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
||||||
*
|
*
|
||||||
* @param[in] &$return array Reference of the array for retrieved values
|
* @param array &$return Reference of the array for retrieved values
|
||||||
* @param[in] $onlyIfPresent boolean If true and data of this element is not present in POST data,
|
* @param boolean $onlyIfPresent If true and data of this element is not present in POST data,
|
||||||
* just ignore it.
|
* just ignore it.
|
||||||
*
|
*
|
||||||
* @retval boolean true si la valeur est présente en POST, false sinon
|
* @return boolean true si la valeur est présente en POST, false sinon
|
||||||
*/
|
*/
|
||||||
public function getPostData(&$return, $onlyIfPresent=false) {
|
public function getPostData(&$return, $onlyIfPresent=false) {
|
||||||
// Récupère la valeur dans _POST, et les vérifie avec la fonction générale
|
// Récupère la valeur dans _POST, et les vérifie avec la fonction générale
|
||||||
|
|
|
@ -43,11 +43,11 @@ class LSformElement_password extends LSformElement {
|
||||||
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
||||||
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
||||||
*
|
*
|
||||||
* @param[in] &$return array Reference of the array for retrieved values
|
* @param array &$return Reference of the array for retrieved values
|
||||||
* @param[in] $onlyIfPresent boolean If true and data of this element is not present in POST data,
|
* @param boolean $onlyIfPresent If true and data of this element is not present in POST data,
|
||||||
* just ignore it.
|
* just ignore it.
|
||||||
*
|
*
|
||||||
* @retval boolean true si la valeur est présente en POST, false sinon
|
* @return boolean true si la valeur est présente en POST, false sinon
|
||||||
*/
|
*/
|
||||||
public function getPostData(&$return, $onlyIfPresent=false) {
|
public function getPostData(&$return, $onlyIfPresent=false) {
|
||||||
// Récupère la valeur dans _POST, et les vérifie avec la fonction générale
|
// Récupère la valeur dans _POST, et les vérifie avec la fonction générale
|
||||||
|
@ -166,7 +166,7 @@ class LSformElement_password extends LSformElement {
|
||||||
*
|
*
|
||||||
* Cette méthode retourne les informations d'affichage de l'élement
|
* Cette méthode retourne les informations d'affichage de l'élement
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDisplay(){
|
public function getDisplay(){
|
||||||
LStemplate :: addCssFile('LSformElement_password.css');
|
LStemplate :: addCssFile('LSformElement_password.css');
|
||||||
|
@ -444,13 +444,13 @@ class LSformElement_password extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* CLI autocompleter for form element attribute values
|
* CLI autocompleter for form element attribute values
|
||||||
*
|
*
|
||||||
* @param[in] &$opts array Reference of array of avalaible autocomplete options
|
* @param array &$opts Array of avalaible autocomplete options
|
||||||
* @param[in] $comp_word string The (unquoted) command word to autocomplete
|
* @param string $comp_word The (unquoted) command word to autocomplete
|
||||||
* @param[in] $attr_value string The current attribute value in command word to autocomplete (optional, default: empty string)
|
* @param string $attr_value The current attribute value in command word to autocomplete (optional, default: empty string)
|
||||||
* @param[in] $multiple_value_delimiter string The multiple value delimiter (optional, default: "|")
|
* @param string $multiple_value_delimiter The multiple value delimiter (optional, default: "|")
|
||||||
* @param[in] $quote_char string The quote character detected (optional, default: empty string)
|
* @param string $quote_char The quote character detected (optional, default: empty string)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function autocomplete_attr_values(&$opts, $comp_word, $attr_value="", $multiple_value_delimiter="|", $quote_char='') {
|
public function autocomplete_attr_values(&$opts, $comp_word, $attr_value="", $multiple_value_delimiter="|", $quote_char='') {
|
||||||
// Split attribute values and retrieved splited value in $attr_values and $last_attr_value
|
// Split attribute values and retrieved splited value in $attr_values and $last_attr_value
|
||||||
|
|
|
@ -37,7 +37,7 @@ class LSformElement_postaladdress extends LSformElement_textarea {
|
||||||
*
|
*
|
||||||
* Cette méthode retourne les informations d'affichage de l'élement
|
* Cette méthode retourne les informations d'affichage de l'élement
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDisplay(){
|
public function getDisplay(){
|
||||||
$return = parent :: getDisplay();
|
$return = parent :: getDisplay();
|
||||||
|
|
|
@ -37,7 +37,7 @@ class LSformElement_pre extends LSformElement_textarea {
|
||||||
*
|
*
|
||||||
* Cette méthode retourne les informations d'affichage de l'élement
|
* Cette méthode retourne les informations d'affichage de l'élement
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDisplay(){
|
public function getDisplay(){
|
||||||
$return = parent :: getDisplay();
|
$return = parent :: getDisplay();
|
||||||
|
|
|
@ -45,10 +45,10 @@ class LSformElement_quota extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Parse one value
|
* Parse one value
|
||||||
*
|
*
|
||||||
* @param[in] $value string The value to parse
|
* @param string $value The value to parse
|
||||||
* @param[in] $details boolean Enable/disable details return (optional, default: true)
|
* @param boolean $details Enable/disable details return (optional, default: true)
|
||||||
*
|
*
|
||||||
* @retval array Parsed value
|
* @return array Parsed value
|
||||||
*/
|
*/
|
||||||
public function parseValue($value, $details=true) {
|
public function parseValue($value, $details=true) {
|
||||||
if (preg_match('/^([0-9]+)$/', $value, $regs)) {
|
if (preg_match('/^([0-9]+)$/', $value, $regs)) {
|
||||||
|
@ -85,7 +85,7 @@ class LSformElement_quota extends LSformElement {
|
||||||
*
|
*
|
||||||
* Cette méthode retourne les informations d'affichage de l'élement
|
* Cette méthode retourne les informations d'affichage de l'élement
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDisplay(){
|
public function getDisplay(){
|
||||||
$return = $this -> getLabelInfos();
|
$return = $this -> getLabelInfos();
|
||||||
|
@ -119,9 +119,9 @@ class LSformElement_quota extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Return HTML code of an empty form field
|
* Return HTML code of an empty form field
|
||||||
*
|
*
|
||||||
* @param[in] $value_idx integer|null The value index (optional, default: null == 0)
|
* @param integer|null $value_idx The value index (optional, default: null == 0)
|
||||||
*
|
*
|
||||||
* @retval string The HTML code of an empty field
|
* @return string The HTML code of an empty field
|
||||||
*/
|
*/
|
||||||
public function getEmptyField($value_idx=null) {
|
public function getEmptyField($value_idx=null) {
|
||||||
return $this -> fetchTemplate(
|
return $this -> fetchTemplate(
|
||||||
|
@ -140,11 +140,11 @@ class LSformElement_quota extends LSformElement {
|
||||||
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
||||||
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
||||||
*
|
*
|
||||||
* @param[in] &$return array Reference of the array for retrieved values
|
* @param array &$return Reference of the array for retrieved values
|
||||||
* @param[in] $onlyIfPresent boolean If true and data of this element is not present in POST data,
|
* @param boolean $onlyIfPresent If true and data of this element is not present in POST data,
|
||||||
* just ignore it.
|
* just ignore it.
|
||||||
*
|
*
|
||||||
* @retval boolean true si la valeur est présente en POST, false sinon
|
* @return boolean true si la valeur est présente en POST, false sinon
|
||||||
*/
|
*/
|
||||||
public function getPostData(&$return, $onlyIfPresent=false) {
|
public function getPostData(&$return, $onlyIfPresent=false) {
|
||||||
if($this -> isFreeze()) {
|
if($this -> isFreeze()) {
|
||||||
|
@ -190,7 +190,7 @@ class LSformElement_quota extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Retrieve factor value
|
* Retrieve factor value
|
||||||
*
|
*
|
||||||
* @retval integer Factor value
|
* @return integer Factor value
|
||||||
*/
|
*/
|
||||||
private function getFactor() {
|
private function getFactor() {
|
||||||
return $this -> getParam('html_options.factor', 1, 'int');
|
return $this -> getParam('html_options.factor', 1, 'int');
|
||||||
|
|
|
@ -38,7 +38,7 @@ class LSformElement_sambaAcctFlags extends LSformElement_select_box {
|
||||||
*
|
*
|
||||||
* This method return display data of this element
|
* This method return display data of this element
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function isMultiple(){
|
public function isMultiple(){
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -40,7 +40,7 @@ class LSformElement_select extends LSformElement {
|
||||||
*
|
*
|
||||||
* This method return display data of this element
|
* This method return display data of this element
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDisplay(){
|
public function getDisplay(){
|
||||||
$return = $this -> getLabelInfos();
|
$return = $this -> getLabelInfos();
|
||||||
|
@ -66,9 +66,9 @@ class LSformElement_select extends LSformElement {
|
||||||
* This method check if a value is correct, that mean if it's one
|
* This method check if a value is correct, that mean if it's one
|
||||||
* of the possible values.
|
* of the possible values.
|
||||||
*
|
*
|
||||||
* @param[in] $value The value to check
|
* @param string $value The value to check
|
||||||
*
|
*
|
||||||
* @retval string or False The value's label or False if this value is incorrect
|
* @return string or False The value's label or False if this value is incorrect
|
||||||
*/
|
*/
|
||||||
public function isValidValue($value) {
|
public function isValidValue($value) {
|
||||||
return self :: _isValidValue($value, $this -> getParam('text_possible_values'));
|
return self :: _isValidValue($value, $this -> getParam('text_possible_values'));
|
||||||
|
@ -80,10 +80,10 @@ class LSformElement_select extends LSformElement {
|
||||||
* This method check if a value is correct, that mean if it's one
|
* This method check if a value is correct, that mean if it's one
|
||||||
* of the possible values.
|
* of the possible values.
|
||||||
*
|
*
|
||||||
* @param[in] $value The value to check
|
* @param string $value The value to check
|
||||||
* @param[in] $possible_values The possible values
|
* @param array $possible_values The possible values
|
||||||
*
|
*
|
||||||
* @retval string or False The value's label or False if this value is incorrect
|
* @return string or False The value's label or False if this value is incorrect
|
||||||
*/
|
*/
|
||||||
public static function _isValidValue($value, $possible_values) {
|
public static function _isValidValue($value, $possible_values) {
|
||||||
if (!is_array($possible_values)) {
|
if (!is_array($possible_values)) {
|
||||||
|
@ -116,13 +116,13 @@ class LSformElement_select extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* CLI autocompleter for form element attribute values
|
* CLI autocompleter for form element attribute values
|
||||||
*
|
*
|
||||||
* @param[in] &$opts array Reference of array of avalaible autocomplete options
|
* @param array &$opts Array of avalaible autocomplete options
|
||||||
* @param[in] $comp_word string The (unquoted) command word to autocomplete
|
* @param string $comp_word The (unquoted) command word to autocomplete
|
||||||
* @param[in] $attr_value string The current attribute value in command word to autocomplete (optional, default: empty string)
|
* @param string $comp_word The current attribute value in command word to autocomplete (optional, default: empty string)
|
||||||
* @param[in] $multiple_value_delimiter string The multiple value delimiter (optional, default: "|")
|
* @param string $comp_word The multiple value delimiter (optional, default: "|")
|
||||||
* @param[in] $quote_char string The quote character detected (optional, default: empty string)
|
* @param string $comp_word The quote character detected (optional, default: empty string)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function autocomplete_attr_values(&$opts, $comp_word, $attr_value="", $multiple_value_delimiter="|", $quote_char='') {
|
public function autocomplete_attr_values(&$opts, $comp_word, $attr_value="", $multiple_value_delimiter="|", $quote_char='') {
|
||||||
// Split attribute values and retrieved splited value in $attr_values and $last_attr_value
|
// Split attribute values and retrieved splited value in $attr_values and $last_attr_value
|
||||||
|
@ -145,10 +145,10 @@ class LSformElement_select extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Retrieve value as return in API response
|
* Retrieve value as return in API response
|
||||||
*
|
*
|
||||||
* @param[in] $details boolean If true, returned values will contain details if this field type
|
* @param boolean $details If true, returned values will contain details if this field type
|
||||||
* support it (optional, default: false)
|
* support it (optional, default: false)
|
||||||
*
|
*
|
||||||
* @retval mixed API value(s) or null/empty array if no value
|
* @return mixed API value(s) or null/empty array if no value
|
||||||
*/
|
*/
|
||||||
public function getApiValue($details=false) {
|
public function getApiValue($details=false) {
|
||||||
$values = array();
|
$values = array();
|
||||||
|
@ -187,10 +187,10 @@ class LSformElement_select extends LSformElement {
|
||||||
* - LSformElement_select_isValidValue_label :
|
* - LSformElement_select_isValidValue_label :
|
||||||
* The value's label
|
* The value's label
|
||||||
*
|
*
|
||||||
* @param[in] $params The template function parameters
|
* @param array $params The template function parameters
|
||||||
* @param[in] $template Smarty object
|
* @param Smarty $template Smarty object
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
function LSformElement_select_checkIsValidValue($params, $template) {
|
function LSformElement_select_checkIsValidValue($params, $template) {
|
||||||
$ret = LSformElement_select :: _isValidValue($params['value'], $params['possible_values']);
|
$ret = LSformElement_select :: _isValidValue($params['value'], $params['possible_values']);
|
||||||
|
|
|
@ -41,7 +41,7 @@ class LSformElement_select_box extends LSformElement_select {
|
||||||
*
|
*
|
||||||
* This method return display data of this element
|
* This method return display data of this element
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDisplay(){
|
public function getDisplay(){
|
||||||
if (!$this -> isFreeze()) {
|
if (!$this -> isFreeze()) {
|
||||||
|
|
|
@ -51,7 +51,7 @@ class LSformElement_select_object extends LSformElement {
|
||||||
*
|
*
|
||||||
* This method return the display informations of the element.
|
* This method return the display informations of the element.
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDisplay($refresh=NULL){
|
public function getDisplay($refresh=NULL){
|
||||||
LStemplate :: addCssFile('LSformElement_select_object.css');
|
LStemplate :: addCssFile('LSformElement_select_object.css');
|
||||||
|
@ -107,7 +107,7 @@ class LSformElement_select_object extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Init LSselect
|
* Init LSselect
|
||||||
*
|
*
|
||||||
* @retval boolean True if LSselect is initialized, false otherwise
|
* @return boolean True if LSselect is initialized, false otherwise
|
||||||
*/
|
*/
|
||||||
private function initLSselect() {
|
private function initLSselect() {
|
||||||
// Retrieve selectable objects configuratio from HTML attr
|
// Retrieve selectable objects configuratio from HTML attr
|
||||||
|
@ -142,10 +142,10 @@ class LSformElement_select_object extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Function use with uasort to sort two values
|
* Function use with uasort to sort two values
|
||||||
*
|
*
|
||||||
* @param[in] $va string One value
|
* @param string $va One value
|
||||||
* @param[in] $vb string One value
|
* @param string $va One value
|
||||||
*
|
*
|
||||||
* @retval int Value for uasort
|
* @return int Value for uasort
|
||||||
**/
|
**/
|
||||||
private function _sortTwoValues(&$va,&$vb) {
|
private function _sortTwoValues(&$va,&$vb) {
|
||||||
if ($this -> getParam('html_options.sortDirection') == 'DESC') {
|
if ($this -> getParam('html_options.sortDirection') == 'DESC') {
|
||||||
|
@ -169,7 +169,7 @@ class LSformElement_select_object extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Export the values of the element
|
* Export the values of the element
|
||||||
*
|
*
|
||||||
* @retval Array The values of the element
|
* @return array The values of the element
|
||||||
*/
|
*/
|
||||||
public function exportValues(){
|
public function exportValues(){
|
||||||
$values = $this -> attr_html -> getValuesFromFormValues($this -> values);
|
$values = $this -> attr_html -> getValuesFromFormValues($this -> values);
|
||||||
|
@ -181,9 +181,9 @@ class LSformElement_select_object extends LSformElement {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] [<b>required</b>] string or array The new value of the element
|
* @param string|array $data The new value of the element
|
||||||
*
|
*
|
||||||
* @retval boolean Return True
|
* @return boolean Return True
|
||||||
*/
|
*/
|
||||||
public function setValueFromPostData($data) {
|
public function setValueFromPostData($data) {
|
||||||
parent :: setValueFromPostData($data);
|
parent :: setValueFromPostData($data);
|
||||||
|
@ -196,9 +196,9 @@ class LSformElement_select_object extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Search the selectionable objects with a pattern
|
* Search the selectionable objects with a pattern
|
||||||
*
|
*
|
||||||
* @param[in] $pattern The pattern of the search
|
* @param string $pattern The pattern of the search
|
||||||
*
|
*
|
||||||
* @retval array(dn -> displayName) Found objects
|
* @return array(dn -> displayName) Found objects
|
||||||
*/
|
*/
|
||||||
public function searchAdd($pattern) {
|
public function searchAdd($pattern) {
|
||||||
$objs = array();
|
$objs = array();
|
||||||
|
@ -238,9 +238,9 @@ class LSformElement_select_object extends LSformElement {
|
||||||
* This ajax method is used to refresh the value display
|
* This ajax method is used to refresh the value display
|
||||||
* in the form element after the modify LSselect window is closed.
|
* in the form element after the modify LSselect window is closed.
|
||||||
*
|
*
|
||||||
* @param[in] $data The address to the array of data witch will be return by the ajax request
|
* @param array &$data The address to the array of data witch will be return by the ajax request
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function ajax_refresh(&$data) {
|
public static function ajax_refresh(&$data) {
|
||||||
if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['objectdn'])) && (isset($_REQUEST['idform'])) ) {
|
if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['objectdn'])) && (isset($_REQUEST['idform'])) ) {
|
||||||
|
@ -271,9 +271,9 @@ class LSformElement_select_object extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* This ajax method is used by the search-and-add function of the form element.
|
* This ajax method is used by the search-and-add function of the form element.
|
||||||
*
|
*
|
||||||
* @param[in] $data The address to the array of data witch will be return by the ajax request
|
* @param array &$data The address to the array of data witch will be return by the ajax request
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function ajax_searchAdd(&$data) {
|
public static function ajax_searchAdd(&$data) {
|
||||||
if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['pattern'])) && (isset($_REQUEST['idform'])) ) {
|
if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['pattern'])) && (isset($_REQUEST['idform'])) ) {
|
||||||
|
@ -289,13 +289,13 @@ class LSformElement_select_object extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* CLI autocompleter for form element attribute values
|
* CLI autocompleter for form element attribute values
|
||||||
*
|
*
|
||||||
* @param[in] &$opts array Reference of array of avalaible autocomplete options
|
* @param array &$opts Array of avalaible autocomplete options
|
||||||
* @param[in] $comp_word string The (unquoted) command word to autocomplete
|
* @param string $va The (unquoted) command word to autocomplete
|
||||||
* @param[in] $attr_value string The current attribute value in command word to autocomplete (optional, default: empty string)
|
* @param string $va The current attribute value in command word to autocomplete (optional, default: empty string)
|
||||||
* @param[in] $multiple_value_delimiter string The multiple value delimiter (optional, default: "|")
|
* @param string $va The multiple value delimiter (optional, default: "|")
|
||||||
* @param[in] $quote_char string The quote character detected (optional, default: empty string)
|
* @param string $va The quote character detected (optional, default: empty string)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function autocomplete_attr_values(&$opts, $comp_word, $attr_value="", $multiple_value_delimiter="|", $quote_char='') {
|
public function autocomplete_attr_values(&$opts, $comp_word, $attr_value="", $multiple_value_delimiter="|", $quote_char='') {
|
||||||
self :: log_debug("LSformElement :: autocomplete_opts([...], '$comp_word', '$attr_value', '$multiple_value_delimiter', '$quote_char')");
|
self :: log_debug("LSformElement :: autocomplete_opts([...], '$comp_word', '$attr_value', '$multiple_value_delimiter', '$quote_char')");
|
||||||
|
@ -325,10 +325,10 @@ class LSformElement_select_object extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Retrieve value as return in API response
|
* Retrieve value as return in API response
|
||||||
*
|
*
|
||||||
* @param[in] $details boolean If true, returned values will contain details if this field type
|
* @param boolean $details If true, returned values will contain details if this field type
|
||||||
* support it (optional, default: false)
|
* support it (optional, default: false)
|
||||||
*
|
*
|
||||||
* @retval mixed API value(s) or null/empty array if no value
|
* @return mixed API value(s) or null/empty array if no value
|
||||||
*/
|
*/
|
||||||
public function getApiValue($details=false) {
|
public function getApiValue($details=false) {
|
||||||
$values = ($details?$this -> values:array_keys(ensureIsArray($this -> values)));
|
$values = ($details?$this -> values:array_keys(ensureIsArray($this -> values)));
|
||||||
|
|
|
@ -39,10 +39,10 @@ class LSformElement_ssh_key extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Parse one value
|
* Parse one value
|
||||||
*
|
*
|
||||||
* @param[in] $value string The value to parse
|
* @param string $value The value to parse
|
||||||
* @param[in] $details boolean Enable/disable details return (optional, default: true)
|
* @param boolean $details Enable/disable details return (optional, default: true)
|
||||||
*
|
*
|
||||||
* @retval array Parsed value
|
* @return array Parsed value
|
||||||
*/
|
*/
|
||||||
public function parseValue($value, $details=true) {
|
public function parseValue($value, $details=true) {
|
||||||
if (!$details)
|
if (!$details)
|
||||||
|
@ -66,7 +66,7 @@ class LSformElement_ssh_key extends LSformElement {
|
||||||
*
|
*
|
||||||
* Cette méthode retourne les informations d'affichage de l'élement
|
* Cette méthode retourne les informations d'affichage de l'élement
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDisplay(){
|
public function getDisplay(){
|
||||||
LStemplate :: addCssFile('LSformElement_ssh_key.css');
|
LStemplate :: addCssFile('LSformElement_ssh_key.css');
|
||||||
|
|
|
@ -41,9 +41,9 @@ class LSformElement_supannAdressePostalePrivee extends LSformElement_supannLabel
|
||||||
/**
|
/**
|
||||||
* Parse une valeur
|
* Parse une valeur
|
||||||
*
|
*
|
||||||
* @param[in] $value La valeur
|
* @param string $value La valeur
|
||||||
*
|
*
|
||||||
* @retval array Un tableau cle->valeur contenant value, translated et label
|
* @return array Un tableau cle->valeur contenant value, translated et label
|
||||||
**/
|
**/
|
||||||
public function parseValue($value) {
|
public function parseValue($value) {
|
||||||
$retval = parent :: parseValue($value);
|
$retval = parent :: parseValue($value);
|
||||||
|
@ -60,7 +60,7 @@ class LSformElement_supannAdressePostalePrivee extends LSformElement_supannLabel
|
||||||
* pas des caractères '$'.
|
* pas des caractères '$'.
|
||||||
|
|
||||||
* @see LSformElement::getPostData()
|
* @see LSformElement::getPostData()
|
||||||
* @retval boolean true si la valeur est présente en POST, false sinon
|
* @return boolean true si la valeur est présente en POST, false sinon
|
||||||
*/
|
*/
|
||||||
public function getPostData(&$return, $onlyIfPresent=false) {
|
public function getPostData(&$return, $onlyIfPresent=false) {
|
||||||
$retval = parent :: getPostData($return, $onlyIfPresent);
|
$retval = parent :: getPostData($return, $onlyIfPresent);
|
||||||
|
|
|
@ -74,13 +74,13 @@ class LSformElement_supannCompositeAttribute extends LSformElement {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] &$form LSform The LSform parent object
|
* @param LSform &$form The LSform parent object
|
||||||
* @param[in] $name string The name of the element
|
* @param string $name The name of the element
|
||||||
* @param[in] $label string The label of the element
|
* @param string $name The label of the element
|
||||||
* @param[in] $params array The parameters of the element
|
* @param string $name The parameters of the element
|
||||||
* @param[in] &$attr_html LSattr_html The LSattr_html object of the corresponding attribute
|
* @param LSform &$form The LSattr_html object of the corresponding attribute
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct(&$form, $name, $label, $params, &$attr_html){
|
public function __construct(&$form, $name, $label, $params, &$attr_html){
|
||||||
parent :: __construct($form, $name, $label, $params, $attr_html);
|
parent :: __construct($form, $name, $label, $params, $attr_html);
|
||||||
|
@ -151,7 +151,7 @@ class LSformElement_supannCompositeAttribute extends LSformElement {
|
||||||
*
|
*
|
||||||
* Cette méthode retourne les informations d'affichage de l'élement
|
* Cette méthode retourne les informations d'affichage de l'élement
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDisplay(){
|
public function getDisplay(){
|
||||||
$return = $this -> getLabelInfos();
|
$return = $this -> getLabelInfos();
|
||||||
|
@ -218,9 +218,9 @@ class LSformElement_supannCompositeAttribute extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Return HTML code of an empty form field
|
* Return HTML code of an empty form field
|
||||||
*
|
*
|
||||||
* @param[in] $value_idx integer|null The value index (optional, default: null == 0)
|
* @param integer|null $value_idx The value index (optional, default: null == 0)
|
||||||
*
|
*
|
||||||
* @retval string The HTML code of an empty field
|
* @return string The HTML code of an empty field
|
||||||
*/
|
*/
|
||||||
public function getEmptyField($value_idx=null) {
|
public function getEmptyField($value_idx=null) {
|
||||||
return $this -> fetchTemplate(
|
return $this -> fetchTemplate(
|
||||||
|
@ -241,10 +241,10 @@ class LSformElement_supannCompositeAttribute extends LSformElement {
|
||||||
* - value : la valeur brute
|
* - value : la valeur brute
|
||||||
* - translated : la valeur traduite ou la valeur elle même
|
* - translated : la valeur traduite ou la valeur elle même
|
||||||
*
|
*
|
||||||
* @param[in] $c string Le nom du composant
|
* @param string $name Le nom du composant
|
||||||
* @param[in] $val string La valeur
|
* @param string $name La valeur
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
**/
|
**/
|
||||||
function translateComponentValue($c, $val) {
|
function translateComponentValue($c, $val) {
|
||||||
$retval = array (
|
$retval = array (
|
||||||
|
@ -322,11 +322,11 @@ class LSformElement_supannCompositeAttribute extends LSformElement {
|
||||||
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
||||||
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
||||||
*
|
*
|
||||||
* @param[in] &$return array Reference of the array for retrieved values
|
* @param array &$return Reference of the array for retrieved values
|
||||||
* @param[in] $onlyIfPresent boolean If true and data of this element is not present in POST data,
|
* @param boolean $onlyIfPresent If true and data of this element is not present in POST data,
|
||||||
* just ignore it.
|
* just ignore it.
|
||||||
*
|
*
|
||||||
* @retval boolean true si la valeur est présente en POST, false sinon
|
* @return boolean true si la valeur est présente en POST, false sinon
|
||||||
*/
|
*/
|
||||||
public function getPostData(&$return, $onlyIfPresent=false) {
|
public function getPostData(&$return, $onlyIfPresent=false) {
|
||||||
if($this -> isFreeze()) {
|
if($this -> isFreeze()) {
|
||||||
|
@ -508,9 +508,9 @@ class LSformElement_supannCompositeAttribute extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* This ajax method is used by the searchComponentPossibleValues function of the form element.
|
* This ajax method is used by the searchComponentPossibleValues function of the form element.
|
||||||
*
|
*
|
||||||
* @param[in] $data The address to the array of data witch will be return by the ajax request
|
* @param array &$data The address to the array of data witch will be return by the ajax request
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function ajax_searchComponentPossibleValues(&$data) {
|
public static function ajax_searchComponentPossibleValues(&$data) {
|
||||||
if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['component'])) && (isset($_REQUEST['pattern'])) && (isset($_REQUEST['idform'])) ) {
|
if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['component'])) && (isset($_REQUEST['pattern'])) && (isset($_REQUEST['idform'])) ) {
|
||||||
|
@ -564,10 +564,10 @@ class LSformElement_supannCompositeAttribute extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Retrieve value as return in API response
|
* Retrieve value as return in API response
|
||||||
*
|
*
|
||||||
* @param[in] $details boolean If true, returned values will contain details if this field type
|
* @param boolean $onlyIfPresent If true, returned values will contain details if this field type
|
||||||
* support it (optional, default: false)
|
* support it (optional, default: false)
|
||||||
*
|
*
|
||||||
* @retval mixed API value(s) or null/empty array if no value
|
* @return mixed API value(s) or null/empty array if no value
|
||||||
*/
|
*/
|
||||||
public function getApiValue($details=false) {
|
public function getApiValue($details=false) {
|
||||||
$values = array();
|
$values = array();
|
||||||
|
|
|
@ -48,7 +48,7 @@ class LSformElement_supannLabeledValue extends LSformElement {
|
||||||
*
|
*
|
||||||
* Cette méthode retourne les informations d'affichage de l'élement
|
* Cette méthode retourne les informations d'affichage de l'élement
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDisplay(){
|
public function getDisplay(){
|
||||||
$return = $this -> getLabelInfos();
|
$return = $this -> getLabelInfos();
|
||||||
|
@ -91,9 +91,9 @@ class LSformElement_supannLabeledValue extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Parse une valeur
|
* Parse une valeur
|
||||||
*
|
*
|
||||||
* @param[in] $value La valeur
|
* @param string $value La valeur
|
||||||
*
|
*
|
||||||
* @retval array Un tableau cle->valeur contenant value, translated et label
|
* @return array Un tableau cle->valeur contenant value, translated et label
|
||||||
**/
|
**/
|
||||||
public function parseValue($value) {
|
public function parseValue($value) {
|
||||||
$retval = array(
|
$retval = array(
|
||||||
|
@ -122,11 +122,11 @@ class LSformElement_supannLabeledValue extends LSformElement {
|
||||||
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
||||||
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
||||||
*
|
*
|
||||||
* @param[in] &$return array Reference of the array for retrieved values
|
* @param array &$return Reference of the array for retrieved values
|
||||||
* @param[in] $onlyIfPresent boolean If true and data of this element is not present in POST data,
|
* @param boolean $onlyIfPresent If true and data of this element is not present in POST data,
|
||||||
* just ignore it.
|
* just ignore it.
|
||||||
*
|
*
|
||||||
* @retval boolean true si la valeur est présente en POST, false sinon
|
* @return boolean true si la valeur est présente en POST, false sinon
|
||||||
*/
|
*/
|
||||||
public function getPostData(&$return, $onlyIfPresent=false) {
|
public function getPostData(&$return, $onlyIfPresent=false) {
|
||||||
$retval = parent :: getPostData($return, $onlyIfPresent);
|
$retval = parent :: getPostData($return, $onlyIfPresent);
|
||||||
|
@ -164,9 +164,9 @@ class LSformElement_supannLabeledValue extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* This ajax method is used by the searchPossibleValues function of the form element.
|
* This ajax method is used by the searchPossibleValues function of the form element.
|
||||||
*
|
*
|
||||||
* @param[in] $data The address to the array of data witch will be return by the ajax request
|
* @param array &$data The address to the array of data witch will be return by the ajax request
|
||||||
*
|
*
|
||||||
* @retval boolean True on success, False otherwise
|
* @return boolean True on success, False otherwise
|
||||||
**/
|
**/
|
||||||
public static function ajax_searchPossibleValues(&$data) {
|
public static function ajax_searchPossibleValues(&$data) {
|
||||||
// Check all parameters is provided
|
// Check all parameters is provided
|
||||||
|
@ -185,9 +185,9 @@ class LSformElement_supannLabeledValue extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Real private method to search possible values from pattern.
|
* Real private method to search possible values from pattern.
|
||||||
*
|
*
|
||||||
* @param[in] $pattern The search pattern
|
* @param string $pattern The search pattern
|
||||||
*
|
*
|
||||||
* @retval boolean|array Array of possible values, or False is case of error
|
* @return boolean|array Array of possible values, or False is case of error
|
||||||
**/
|
**/
|
||||||
private function searchPossibleValues($pattern) {
|
private function searchPossibleValues($pattern) {
|
||||||
if (!$this -> supannNomenclatureTable)
|
if (!$this -> supannNomenclatureTable)
|
||||||
|
@ -212,10 +212,10 @@ class LSformElement_supannLabeledValue extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Retrieve value as return in API response
|
* Retrieve value as return in API response
|
||||||
*
|
*
|
||||||
* @param[in] $details boolean If true, returned values will contain details if this field type
|
* @param boolean $details If true, returned values will contain details if this field type
|
||||||
* support it (optional, default: false)
|
* support it (optional, default: false)
|
||||||
*
|
*
|
||||||
* @retval mixed API value(s) or null/empty array if no value
|
* @return mixed API value(s) or null/empty array if no value
|
||||||
*/
|
*/
|
||||||
public function getApiValue($details=false) {
|
public function getApiValue($details=false) {
|
||||||
$values = array();
|
$values = array();
|
||||||
|
|
|
@ -47,7 +47,7 @@ class LSformElement_text extends LSformElement {
|
||||||
*
|
*
|
||||||
* Cette méthode retourne les informations d'affichage de l'élement
|
* Cette méthode retourne les informations d'affichage de l'élement
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDisplay(){
|
public function getDisplay(){
|
||||||
$return = $this -> getLabelInfos();
|
$return = $this -> getLabelInfos();
|
||||||
|
@ -81,10 +81,10 @@ class LSformElement_text extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Return HTML code of the LSformElement based on its (smarty) template file
|
* Return HTML code of the LSformElement based on its (smarty) template file
|
||||||
*
|
*
|
||||||
* @param[in] $template string The template filename (optional, default: $this -> template)
|
* @param string $template The template filename (optional, default: $this -> template)
|
||||||
* @param[in] $variables array Array of template variables to assign before template compilation (optional)
|
* @param string $template Array of template variables to assign before template compilation (optional)
|
||||||
*
|
*
|
||||||
* @retval string HTML code of the LSformElement
|
* @return string HTML code of the LSformElement
|
||||||
*/
|
*/
|
||||||
public function fetchTemplate($template=NULL,$variables=array()) {
|
public function fetchTemplate($template=NULL,$variables=array()) {
|
||||||
if ($this -> getParam('html_options.autocomplete.value_attributes', null, 'array')) {
|
if ($this -> getParam('html_options.autocomplete.value_attributes', null, 'array')) {
|
||||||
|
@ -97,9 +97,9 @@ class LSformElement_text extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Autocomplete value
|
* Autocomplete value
|
||||||
*
|
*
|
||||||
* @param[in] $pattern The pattern of the search
|
* @param string $pattern The pattern of the search
|
||||||
*
|
*
|
||||||
* @retval array(value -> displayName) Found values
|
* @return array(value -> displayName) Found values
|
||||||
*/
|
*/
|
||||||
public function autocomplete($pattern) {
|
public function autocomplete($pattern) {
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
@ -241,9 +241,9 @@ class LSformElement_text extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* This ajax method is used by the autocomplete function of the form element.
|
* This ajax method is used by the autocomplete function of the form element.
|
||||||
*
|
*
|
||||||
* @param[in] $data The address to the array of data witch will be return by the ajax request
|
* @param array &$data The address to the array of data witch will be return by the ajax request
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function ajax_autocomplete(&$data) {
|
public static function ajax_autocomplete(&$data) {
|
||||||
if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['pattern'])) && (isset($_REQUEST['idform'])) ) {
|
if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['pattern'])) && (isset($_REQUEST['idform'])) ) {
|
||||||
|
|
|
@ -40,7 +40,7 @@ class LSformElement_textarea extends LSformElement {
|
||||||
*
|
*
|
||||||
* Cette méthode retourne les informations d'affichage de l'élement
|
* Cette méthode retourne les informations d'affichage de l'élement
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDisplay(){
|
public function getDisplay(){
|
||||||
$return = $this -> getLabelInfos();
|
$return = $this -> getLabelInfos();
|
||||||
|
|
|
@ -37,7 +37,7 @@ class LSformElement_valueWithUnit extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Retourne les unites de l'attribut
|
* Retourne les unites de l'attribut
|
||||||
*
|
*
|
||||||
* @retval array|False Le tableau contenant en cle les seuils et en valeur les labels des unites.
|
* @return array|False Le tableau contenant en cle les seuils et en valeur les labels des unites.
|
||||||
* Si le parametre units n'est pas defini, cette fonction retournera False
|
* Si le parametre units n'est pas defini, cette fonction retournera False
|
||||||
**/
|
**/
|
||||||
public function getUnits() {
|
public function getUnits() {
|
||||||
|
@ -61,7 +61,7 @@ class LSformElement_valueWithUnit extends LSformElement {
|
||||||
* This method return take a number as paremeter and
|
* This method return take a number as paremeter and
|
||||||
* return it after formatting.
|
* return it after formatting.
|
||||||
*
|
*
|
||||||
* @param[in] int|float $number The number
|
* @param int|float $number The number
|
||||||
*
|
*
|
||||||
* @retbal string Formatted number
|
* @retbal string Formatted number
|
||||||
*/
|
*/
|
||||||
|
@ -77,10 +77,10 @@ class LSformElement_valueWithUnit extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Parse one value
|
* Parse one value
|
||||||
*
|
*
|
||||||
* @param[in] $value string The value to parse
|
* @param string $value The value to parse
|
||||||
* @param[in] $details boolean Enable/disable details return (optional, default: true)
|
* @param boolean $details Enable/disable details return (optional, default: true)
|
||||||
*
|
*
|
||||||
* @retval array Parsed value
|
* @return array Parsed value
|
||||||
*/
|
*/
|
||||||
public function parseValue($value, $details=true) {
|
public function parseValue($value, $details=true) {
|
||||||
if (preg_match('/^([0-9]*)$/' ,$value, $regs)) {
|
if (preg_match('/^([0-9]*)$/' ,$value, $regs)) {
|
||||||
|
@ -119,7 +119,7 @@ class LSformElement_valueWithUnit extends LSformElement {
|
||||||
*
|
*
|
||||||
* Cette méthode retourne les informations d'affichage de l'élement
|
* Cette méthode retourne les informations d'affichage de l'élement
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDisplay(){
|
public function getDisplay(){
|
||||||
$return = $this -> getLabelInfos();
|
$return = $this -> getLabelInfos();
|
||||||
|
@ -156,9 +156,9 @@ class LSformElement_valueWithUnit extends LSformElement {
|
||||||
/**
|
/**
|
||||||
* Return HTML code of an empty form field
|
* Return HTML code of an empty form field
|
||||||
*
|
*
|
||||||
* @param[in] $value_idx integer|null The value index (optional, default: null == 0)
|
* @param integer|null $value_idx The value index (optional, default: null == 0)
|
||||||
*
|
*
|
||||||
* @retval string The HTML code of an empty field
|
* @return string The HTML code of an empty field
|
||||||
*/
|
*/
|
||||||
public function getEmptyField($value_idx=null) {
|
public function getEmptyField($value_idx=null) {
|
||||||
return $this -> fetchTemplate(
|
return $this -> fetchTemplate(
|
||||||
|
@ -177,11 +177,11 @@ class LSformElement_valueWithUnit extends LSformElement {
|
||||||
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
* Cette méthode vérifie la présence en POST de la valeur de l'élément et la récupère
|
||||||
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
* pour la mettre dans le tableau passer en paramètre avec en clef le nom de l'élément
|
||||||
*
|
*
|
||||||
* @param[in] &$return array Reference of the array for retrieved values
|
* @param array &$return Reference of the array for retrieved values
|
||||||
* @param[in] $onlyIfPresent boolean If true and data of this element is not present in POST data,
|
* @param boolean $onlyIfPresent If true and data of this element is not present in POST data,
|
||||||
* just ignore it.
|
* just ignore it.
|
||||||
*
|
*
|
||||||
* @retval boolean true si la valeur est présente en POST, false sinon
|
* @return boolean true si la valeur est présente en POST, false sinon
|
||||||
*/
|
*/
|
||||||
public function getPostData(&$return, $onlyIfPresent=false) {
|
public function getPostData(&$return, $onlyIfPresent=false) {
|
||||||
if($this -> isFreeze()) {
|
if($this -> isFreeze()) {
|
||||||
|
|
|
@ -38,7 +38,7 @@ class LSformElement_wysiwyg extends LSformElement {
|
||||||
*
|
*
|
||||||
* Cette méthode retourne les informations d'affichage de l'élement
|
* Cette méthode retourne les informations d'affichage de l'élement
|
||||||
*
|
*
|
||||||
* @retval array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDisplay(){
|
public function getDisplay(){
|
||||||
$return = $this -> getLabelInfos();
|
$return = $this -> getLabelInfos();
|
||||||
|
|
|
@ -100,14 +100,14 @@ class LSformRule extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* CLI test_form_rule command
|
* CLI test_form_rule command
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array Command arguments :
|
* @param array $command_args Command arguments :
|
||||||
* - Positional arguments :
|
* - Positional arguments :
|
||||||
* - LSformRule type
|
* - LSformRule type
|
||||||
* - values to test
|
* - values to test
|
||||||
* - Optional arguments :
|
* - Optional arguments :
|
||||||
* - -p|--param: LSformRule parameters (format: param=value)
|
* - -p|--param: LSformRule parameters (format: param=value)
|
||||||
*
|
*
|
||||||
* @retval boolean True on success, false otherwise
|
* @return boolean True on success, false otherwise
|
||||||
**/
|
**/
|
||||||
public static function cli_test_form_rule($command_args) {
|
public static function cli_test_form_rule($command_args) {
|
||||||
$rule_name = null;
|
$rule_name = null;
|
||||||
|
@ -152,12 +152,12 @@ class LSformRule extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Args autocompleter for CLI test_form_rule command
|
* Args autocompleter for CLI test_form_rule command
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array List of already typed words of the command
|
* @param array $command_args List of already typed words of the command
|
||||||
* @param[in] $comp_word_num int The command word number to autocomplete
|
* @param array $command_args The command word number to autocomplete
|
||||||
* @param[in] $comp_word string The command word to autocomplete
|
* @param array $command_args The command word to autocomplete
|
||||||
* @param[in] $opts array List of global available options
|
* @param array $command_args List of global available options
|
||||||
*
|
*
|
||||||
* @retval array List of available options for the word to autocomplete
|
* @return array List of available options for the word to autocomplete
|
||||||
**/
|
**/
|
||||||
public static function cli_test_form_rule_args_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
public static function cli_test_form_rule_args_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
||||||
$opts = array_merge($opts, array('-p', '--param'));
|
$opts = array_merge($opts, array('-p', '--param'));
|
||||||
|
@ -236,10 +236,10 @@ class LSformRule extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Args autocompleter for parameter name of CLI test_form_rule command
|
* Args autocompleter for parameter name of CLI test_form_rule command
|
||||||
*
|
*
|
||||||
* @param[in] $prefix string Parameter name prefix (optional, default=empty string)
|
* @param array $command_args Parameter name prefix (optional, default=empty string)
|
||||||
* @param[in] $quote_char $quote_char string Quote character (optional, default=empty string)
|
* @param string $quote_char Quote character (optional, default=empty string)
|
||||||
*
|
*
|
||||||
* @retval array List of available options for the word to autocomplete
|
* @return array List of available options for the word to autocomplete
|
||||||
**/
|
**/
|
||||||
public static function cli_test_form_rule_param_name_autocompleter($prefix='', $quote_char='') {
|
public static function cli_test_form_rule_param_name_autocompleter($prefix='', $quote_char='') {
|
||||||
$opts = LScli :: autocomplete_opts(array_keys(static :: $cli_params_autocompleters), $prefix);
|
$opts = LScli :: autocomplete_opts(array_keys(static :: $cli_params_autocompleters), $prefix);
|
||||||
|
@ -252,11 +252,11 @@ class LSformRule extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Args autocompleter for parameter name of CLI test_form_rule command
|
* Args autocompleter for parameter name of CLI test_form_rule command
|
||||||
*
|
*
|
||||||
* @param[in] $param_name string The parameter name
|
* @param array $command_args The parameter name
|
||||||
* @param[in] $prefix string Parameter name prefix (optional, default=empty string)
|
* @param array $command_args Parameter name prefix (optional, default=empty string)
|
||||||
* @param[in] $quote_char $quote_char string Quote character (optional, default=empty string)
|
* @param string $quote_char Quote character (optional, default=empty string)
|
||||||
*
|
*
|
||||||
* @retval array List of available options for the word to autocomplete
|
* @return array List of available options for the word to autocomplete
|
||||||
**/
|
**/
|
||||||
public static function cli_test_form_rule_param_value_autocompleter($param_name, $prefix='', $quote_char='') {
|
public static function cli_test_form_rule_param_value_autocompleter($param_name, $prefix='', $quote_char='') {
|
||||||
if (
|
if (
|
||||||
|
|
|
@ -33,11 +33,11 @@ class LSio extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check if the form was posted by check POST data
|
* Check if the form was posted by check POST data
|
||||||
*
|
*
|
||||||
* @param[in] $action string The action name used as POST validate flag value
|
* @param string $action The action name used as POST validate flag value
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true if the form was posted, false otherwise
|
* @return boolean true if the form was posted, false otherwise
|
||||||
*/
|
*/
|
||||||
public static function isSubmit($action) {
|
public static function isSubmit($action) {
|
||||||
if (isset($_REQUEST['validate']) && ($_REQUEST['validate']==$action))
|
if (isset($_REQUEST['validate']) && ($_REQUEST['validate']==$action))
|
||||||
|
@ -49,7 +49,7 @@ class LSio extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Retrieve the post file
|
* Retrieve the post file
|
||||||
*
|
*
|
||||||
* @retval mixed The path of the temporary file, false on error
|
* @return mixed The path of the temporary file, false on error
|
||||||
*/
|
*/
|
||||||
public static function getPostFile() {
|
public static function getPostFile() {
|
||||||
if (is_uploaded_file($_FILES['importfile']['tmp_name'])) {
|
if (is_uploaded_file($_FILES['importfile']['tmp_name'])) {
|
||||||
|
@ -81,7 +81,7 @@ class LSio extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval mixed Array of POST data, false on error
|
* @return mixed Array of POST data, false on error
|
||||||
*/
|
*/
|
||||||
public static function getPostData() {
|
public static function getPostData() {
|
||||||
if (isset($_REQUEST['LSobject']) && isset($_POST['ioFormat'])) {
|
if (isset($_REQUEST['LSobject']) && isset($_POST['ioFormat'])) {
|
||||||
|
@ -106,7 +106,7 @@ class LSio extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval array Array of the import result
|
* @return array Array of the import result
|
||||||
* @see import()
|
* @see import()
|
||||||
*/
|
*/
|
||||||
public static function importFromPostData() {
|
public static function importFromPostData() {
|
||||||
|
@ -171,17 +171,17 @@ class LSio extends LSlog_staticLoggerClass {
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
* @param[in] $LSobject string The LSobject type
|
* @param string $action The LSobject type
|
||||||
* @param[in] $ioFormat string The LSioFormat name
|
* @param string $action The LSioFormat name
|
||||||
* @param[in] $input_file string|resource The input file path
|
* @param string|resource $input_file The input file path
|
||||||
* @param[in] $updateIfExists boolean If true and object to import already exists, update it. If false,
|
* @param boolean $updateIfExists If true and object to import already exists, update it. If false,
|
||||||
* an error will be triggered. (optional, default: false)
|
* an error will be triggered. (optional, default: false)
|
||||||
* @param[in] $justTry boolean If true, enable just-try mode: just check input data but do not really
|
* @param boolean $updateIfExists If true, enable just-try mode: just check input data but do not really
|
||||||
* import objects in LDAP directory. (optional, default: false)
|
* import objects in LDAP directory. (optional, default: false)
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval array Array of the import result
|
* @return array Array of the import result
|
||||||
*/
|
*/
|
||||||
public static function import($LSobject, $ioFormat, $input_file, $updateIfExists=false, $justTry=false) {
|
public static function import($LSobject, $ioFormat, $input_file, $updateIfExists=false, $justTry=false) {
|
||||||
$return = array(
|
$return = array(
|
||||||
|
@ -338,13 +338,13 @@ class LSio extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Export objects
|
* Export objects
|
||||||
*
|
*
|
||||||
* @param[in] $LSobject LSldapObject An instance of the object type
|
* @param LSldapObject $LSobject An instance of the object type
|
||||||
* @param[in] $ioFormat string The LSioFormat name
|
* @param string $action The LSioFormat name
|
||||||
* @param[in] $stream resource|null The output stream (optional, default: STDOUT)
|
* @param resource|null $stream The output stream (optional, default: STDOUT)
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean True on success, False otherwise
|
* @return boolean True on success, False otherwise
|
||||||
*/
|
*/
|
||||||
public static function export($object, $ioFormat, $stream=null) {
|
public static function export($object, $ioFormat, $stream=null) {
|
||||||
// Load LSobject
|
// Load LSobject
|
||||||
|
@ -401,7 +401,7 @@ class LSio extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* CLI import command
|
* CLI import command
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array Command arguments:
|
* @param string $action Command arguments:
|
||||||
* - Positional arguments:
|
* - Positional arguments:
|
||||||
* - LSobject type
|
* - LSobject type
|
||||||
* - LSioFormat name
|
* - LSioFormat name
|
||||||
|
@ -410,7 +410,7 @@ class LSio extends LSlog_staticLoggerClass {
|
||||||
* - -U|--update: Enable "update if exist"
|
* - -U|--update: Enable "update if exist"
|
||||||
* - -j|--just-try: Enable just-try mode
|
* - -j|--just-try: Enable just-try mode
|
||||||
*
|
*
|
||||||
* @retval boolean True on success, false otherwise
|
* @return boolean True on success, false otherwise
|
||||||
**/
|
**/
|
||||||
public static function cli_import($command_args) {
|
public static function cli_import($command_args) {
|
||||||
$objType = null;
|
$objType = null;
|
||||||
|
@ -506,12 +506,12 @@ class LSio extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Args autocompleter for CLI import command
|
* Args autocompleter for CLI import command
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array List of already typed words of the command
|
* @param string $action List of already typed words of the command
|
||||||
* @param[in] $comp_word_num int The command word number to autocomplete
|
* @param string $action The command word number to autocomplete
|
||||||
* @param[in] $comp_word string The command word to autocomplete
|
* @param string $action The command word to autocomplete
|
||||||
* @param[in] $opts array List of global available options
|
* @param string $action List of global available options
|
||||||
*
|
*
|
||||||
* @retval array List of available options for the word to autocomplete
|
* @return array List of available options for the word to autocomplete
|
||||||
**/
|
**/
|
||||||
public static function cli_import_args_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
public static function cli_import_args_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
||||||
$opts = array_merge($opts, array ('-i', '--input', '-U', '--update', '-j', '--just-try'));
|
$opts = array_merge($opts, array ('-i', '--input', '-U', '--update', '-j', '--just-try'));
|
||||||
|
@ -560,14 +560,14 @@ class LSio extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* CLI export command
|
* CLI export command
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array Command arguments:
|
* @param string $action Command arguments:
|
||||||
* - Positional arguments:
|
* - Positional arguments:
|
||||||
* - LSobject type
|
* - LSobject type
|
||||||
* - LSioFormat name
|
* - LSioFormat name
|
||||||
* - Optional arguments:
|
* - Optional arguments:
|
||||||
* - -o|--output: Output path ("-" == stdout, default: "-")
|
* - -o|--output: Output path ("-" == stdout, default: "-")
|
||||||
*
|
*
|
||||||
* @retval boolean True on success, false otherwise
|
* @return boolean True on success, false otherwise
|
||||||
**/
|
**/
|
||||||
public static function cli_export($command_args) {
|
public static function cli_export($command_args) {
|
||||||
$objType = null;
|
$objType = null;
|
||||||
|
@ -610,12 +610,12 @@ class LSio extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Args autocompleter for CLI export command
|
* Args autocompleter for CLI export command
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array List of already typed words of the command
|
* @param string $action List of already typed words of the command
|
||||||
* @param[in] $comp_word_num int The command word number to autocomplete
|
* @param string $action The command word number to autocomplete
|
||||||
* @param[in] $comp_word string The command word to autocomplete
|
* @param string $action The command word to autocomplete
|
||||||
* @param[in] $opts array List of global available options
|
* @param string $action List of global available options
|
||||||
*
|
*
|
||||||
* @retval array List of available options for the word to autocomplete
|
* @return array List of available options for the word to autocomplete
|
||||||
**/
|
**/
|
||||||
public static function cli_export_args_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
public static function cli_export_args_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
||||||
$opts = array_merge($opts, array ('-o', '--output'));
|
$opts = array_merge($opts, array ('-o', '--output'));
|
||||||
|
@ -664,7 +664,7 @@ class LSio extends LSlog_staticLoggerClass {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* LSio_implodeValues template function
|
* LSio_implodeValues template function
|
||||||
*
|
*
|
||||||
* This function permit to implode field values during
|
* This function permit to implode field values during
|
||||||
|
@ -672,10 +672,10 @@ class LSio extends LSlog_staticLoggerClass {
|
||||||
* (in $params) :
|
* (in $params) :
|
||||||
* - $values : the field's values to implode
|
* - $values : the field's values to implode
|
||||||
*
|
*
|
||||||
* @param[in] $params The template function parameters
|
* @param array $params The template function parameters
|
||||||
* @param[in] $template Smarty object
|
* @param Smarty $template Smarty object
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
function LSio_implodeValues($params, $template) {
|
function LSio_implodeValues($params, $template) {
|
||||||
extract($params);
|
extract($params);
|
||||||
|
|
|
@ -35,10 +35,10 @@ class LSioFormat extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param[in] string $LSobject The LSobject type name
|
* @param string $LSobject The LSobject type name
|
||||||
* @param[in] string $ioFormat The ioFormat name
|
* @param string $ioFormat The ioFormat name
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function __construct($LSobject, $ioFormat) {
|
public function __construct($LSobject, $ioFormat) {
|
||||||
$conf = LSconfig::get('LSobjects.'.$LSobject.".ioFormat.".$ioFormat);
|
$conf = LSconfig::get('LSobjects.'.$LSobject.".ioFormat.".$ioFormat);
|
||||||
|
@ -59,7 +59,7 @@ class LSioFormat extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check if ioFormat driver is ready
|
* Check if ioFormat driver is ready
|
||||||
*
|
*
|
||||||
* @retval boolean True if ioFormat driver is ready, false otherwise
|
* @return boolean True if ioFormat driver is ready, false otherwise
|
||||||
**/
|
**/
|
||||||
public function ready() {
|
public function ready() {
|
||||||
return (is_array($this -> config) && $this -> driver !== False);
|
return (is_array($this -> config) && $this -> driver !== False);
|
||||||
|
@ -72,7 +72,7 @@ class LSioFormat extends LSlog_staticLoggerClass {
|
||||||
* @param[] $default The default value (default : null)
|
* @param[] $default The default value (default : null)
|
||||||
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
||||||
*
|
*
|
||||||
* @retval mixed The configuration parameter value or default value if not set
|
* @return mixed The configuration parameter value or default value if not set
|
||||||
**/
|
**/
|
||||||
public function getConfig($param, $default=null, $cast=null) {
|
public function getConfig($param, $default=null, $cast=null) {
|
||||||
return LSconfig :: get($param, $default, $cast, (is_array($this -> config)?$this -> config:array()));
|
return LSconfig :: get($param, $default, $cast, (is_array($this -> config)?$this -> config:array()));
|
||||||
|
@ -81,9 +81,9 @@ class LSioFormat extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Load and valid file
|
* Load and valid file
|
||||||
*
|
*
|
||||||
* @param[in] string $file The file path to load
|
* @param string $file The file path to load
|
||||||
*
|
*
|
||||||
* @retval boolean True if file is loaded and valid, false otherwise
|
* @return boolean True if file is loaded and valid, false otherwise
|
||||||
**/
|
**/
|
||||||
public function loadFile($file) {
|
public function loadFile($file) {
|
||||||
if ($this -> driver -> loadFile($file)) {
|
if ($this -> driver -> loadFile($file)) {
|
||||||
|
@ -95,7 +95,7 @@ class LSioFormat extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Retrieve all objects contained by the loaded file
|
* Retrieve all objects contained by the loaded file
|
||||||
*
|
*
|
||||||
* @retval array The objects contained by the loaded file
|
* @return array The objects contained by the loaded file
|
||||||
**/
|
**/
|
||||||
public function getAll() {
|
public function getAll() {
|
||||||
return $this -> driver -> getAllFormated(
|
return $this -> driver -> getAllFormated(
|
||||||
|
@ -107,8 +107,8 @@ class LSioFormat extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Export objects
|
* Export objects
|
||||||
*
|
*
|
||||||
* @param $objects array of LSldapObject The objects to export
|
* @param array[LSldapObject] $objects The objects to export
|
||||||
* @param[in] $stream resource|null The output stream (optional, default: STDOUT)
|
* @param resource|null $stream The output stream (optional, default: STDOUT)
|
||||||
*
|
*
|
||||||
* @return boolean True on success, False otherwise
|
* @return boolean True on success, False otherwise
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -41,9 +41,9 @@ class LSioFormatCSV extends LSioFormatDriver {
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param[in] array $options Driver's options
|
* @param array $options Driver's options
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function __construct($options) {
|
public function __construct($options) {
|
||||||
parent :: __construct($options);
|
parent :: __construct($options);
|
||||||
|
@ -68,9 +68,9 @@ class LSioFormatCSV extends LSioFormatDriver {
|
||||||
/**
|
/**
|
||||||
* Load file
|
* Load file
|
||||||
*
|
*
|
||||||
* @param[in] string $file The file path to load
|
* @param array $options The file path to load
|
||||||
*
|
*
|
||||||
* @retval boolean True if file is loaded, false otherwise
|
* @return boolean True if file is loaded, false otherwise
|
||||||
**/
|
**/
|
||||||
public function loadFile($path) {
|
public function loadFile($path) {
|
||||||
self :: log_debug("loadFile($path)");
|
self :: log_debug("loadFile($path)");
|
||||||
|
@ -101,7 +101,7 @@ class LSioFormatCSV extends LSioFormatDriver {
|
||||||
/**
|
/**
|
||||||
* Check if loaded file data are valid
|
* Check if loaded file data are valid
|
||||||
*
|
*
|
||||||
* @retval boolean True if loaded file data are valid, false otherwise
|
* @return boolean True if loaded file data are valid, false otherwise
|
||||||
**/
|
**/
|
||||||
public function isValid() {
|
public function isValid() {
|
||||||
if (!is_array($this -> rows) && empty($this -> rows)) {
|
if (!is_array($this -> rows) && empty($this -> rows)) {
|
||||||
|
@ -144,7 +144,7 @@ class LSioFormatCSV extends LSioFormatDriver {
|
||||||
* ),
|
* ),
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
* @retval array The objects contained by the loaded file
|
* @return array The objects contained by the loaded file
|
||||||
**/
|
**/
|
||||||
public function getAll() {
|
public function getAll() {
|
||||||
$objects = array();
|
$objects = array();
|
||||||
|
@ -171,7 +171,7 @@ class LSioFormatCSV extends LSioFormatDriver {
|
||||||
* [...]
|
* [...]
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
* @retval array The fields names of the loaded file
|
* @return array The fields names of the loaded file
|
||||||
**/
|
**/
|
||||||
public function getFieldNames() {
|
public function getFieldNames() {
|
||||||
return $this -> headers;
|
return $this -> headers;
|
||||||
|
@ -181,9 +181,8 @@ class LSioFormatCSV extends LSioFormatDriver {
|
||||||
/**
|
/**
|
||||||
* Export objects data
|
* Export objects data
|
||||||
*
|
*
|
||||||
* @param[in] $stream The stream where objects's data have to be exported
|
* @param array $objects_data of objects data to export
|
||||||
* @param[in] $objects_data Array of objects data to export
|
* @param resource|null $stream The output stream (optional, default: STDOUT)
|
||||||
* @param[in] $stream resource|null The output stream (optional, default: STDOUT)
|
|
||||||
*
|
*
|
||||||
* @return boolean True on success, False otherwise
|
* @return boolean True on success, False otherwise
|
||||||
*/
|
*/
|
||||||
|
@ -223,12 +222,12 @@ class LSioFormatCSV extends LSioFormatDriver {
|
||||||
/**
|
/**
|
||||||
* Write CSV row to stream
|
* Write CSV row to stream
|
||||||
*
|
*
|
||||||
* @param[in] $stream The CSV file description reference
|
* @param resource $stream The CSV file description reference
|
||||||
* @param[in] $row An array of a CSV row fields to write
|
* @param array[string] $row An array of a CSV row fields to write
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean True if CSV row is successfully writed, false in other case
|
* @return boolean True if CSV row is successfully writed, false in other case
|
||||||
*/
|
*/
|
||||||
private function writeRow($stream, $row) {
|
private function writeRow($stream, $row) {
|
||||||
// Escape character could only be specified since php 5.5.4
|
// Escape character could only be specified since php 5.5.4
|
||||||
|
|
|
@ -34,9 +34,9 @@ class LSioFormatDriver extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param[in] array $options Driver's options
|
* @param array $options Driver's options
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function __construct($options) {
|
public function __construct($options) {
|
||||||
$this -> options = $options;
|
$this -> options = $options;
|
||||||
|
@ -45,9 +45,9 @@ class LSioFormatDriver extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Load file
|
* Load file
|
||||||
*
|
*
|
||||||
* @param[in] string $file The file path to load
|
* @param string $file The file path to load
|
||||||
*
|
*
|
||||||
* @retval boolean True if file is loaded, false otherwise
|
* @return boolean True if file is loaded, false otherwise
|
||||||
**/
|
**/
|
||||||
public function loadFile($path) {
|
public function loadFile($path) {
|
||||||
return False;
|
return False;
|
||||||
|
@ -56,7 +56,7 @@ class LSioFormatDriver extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check if loaded file data are valid
|
* Check if loaded file data are valid
|
||||||
*
|
*
|
||||||
* @retval boolean True if loaded file data are valid, false otherwise
|
* @return boolean True if loaded file data are valid, false otherwise
|
||||||
**/
|
**/
|
||||||
public function isValid() {
|
public function isValid() {
|
||||||
return False;
|
return False;
|
||||||
|
@ -80,7 +80,7 @@ class LSioFormatDriver extends LSlog_staticLoggerClass {
|
||||||
* ),
|
* ),
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
* @retval array The objects contained by the loaded file
|
* @return array The objects contained by the loaded file
|
||||||
**/
|
**/
|
||||||
public function getAll() {
|
public function getAll() {
|
||||||
return array();
|
return array();
|
||||||
|
@ -97,7 +97,7 @@ class LSioFormatDriver extends LSlog_staticLoggerClass {
|
||||||
* [...]
|
* [...]
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
* @retval array The fields names of the loaded file
|
* @return array The fields names of the loaded file
|
||||||
**/
|
**/
|
||||||
public function getFieldNames() {
|
public function getFieldNames() {
|
||||||
return array();
|
return array();
|
||||||
|
@ -109,10 +109,10 @@ class LSioFormatDriver extends LSlog_staticLoggerClass {
|
||||||
* This method format objects data using ioFormat configuration
|
* This method format objects data using ioFormat configuration
|
||||||
* given as parameters.
|
* given as parameters.
|
||||||
*
|
*
|
||||||
* @param[in] $fields Array of file's fields name mapping with object attribute
|
* @param array $fields of file's fields name mapping with object attribute
|
||||||
* @param[in] $generated_fields Array of object attribute to generate using other object data
|
* @param array $generated_fields of object attribute to generate using other object data
|
||||||
*
|
*
|
||||||
* @retval array All objects data of the loaded file formated
|
* @return array All objects data of the loaded file formated
|
||||||
**/
|
**/
|
||||||
public function getAllFormated($fields, $generated_fields) {
|
public function getAllFormated($fields, $generated_fields) {
|
||||||
if (!is_array($fields)) return False;
|
if (!is_array($fields)) return False;
|
||||||
|
@ -147,8 +147,8 @@ class LSioFormatDriver extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Export objects data
|
* Export objects data
|
||||||
*
|
*
|
||||||
* @param[in] $objects_data Array of objects data to export
|
* @param array $objects_data of objects data to export
|
||||||
* @param[in] $stream resource|null The output stream (optional, default: STDOUT)
|
* @param resource|null $stream The output stream (optional, default: STDOUT)
|
||||||
*
|
*
|
||||||
* @return boolean True on success, False otherwise
|
* @return boolean True on success, False otherwise
|
||||||
*/
|
*/
|
||||||
|
@ -164,7 +164,7 @@ class LSioFormatDriver extends LSlog_staticLoggerClass {
|
||||||
* @param[] $default The default value (default : null)
|
* @param[] $default The default value (default : null)
|
||||||
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
||||||
*
|
*
|
||||||
* @retval mixed The option parameter value or default value if not set
|
* @return mixed The option parameter value or default value if not set
|
||||||
**/
|
**/
|
||||||
public function getOption($param, $default=null, $cast=null) {
|
public function getOption($param, $default=null, $cast=null) {
|
||||||
return LSconfig :: get($param, $default, $cast, $this -> options);
|
return LSconfig :: get($param, $default, $cast, $this -> options);
|
||||||
|
|
|
@ -32,12 +32,12 @@ class LSlang extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Define current locale (and encoding)
|
* Define current locale (and encoding)
|
||||||
*
|
*
|
||||||
* @param[in] $lang string|null The lang (optional, default: default current LDAP
|
* @param string|null $lang The lang (optional, default: default current LDAP
|
||||||
* server lang, or default lang)
|
* server lang, or default lang)
|
||||||
* @param[in] $encoding string|null The encoding (optional, default: default current LDAP
|
* @param string|null $lang The encoding (optional, default: default current LDAP
|
||||||
* server encoding, or default encoding)
|
* server encoding, or default encoding)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function setLocale($lang=null, $encoding=null) {
|
public static function setLocale($lang=null, $encoding=null) {
|
||||||
// Handle $lang parameter
|
// Handle $lang parameter
|
||||||
|
@ -122,12 +122,12 @@ class LSlang extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return list of available languages
|
* Return list of available languages
|
||||||
*
|
*
|
||||||
* @param[in] $encoding string|null Specify encoding for lang selection. If null, use self :: encoding value,
|
* @param string|null $lang Specify encoding for lang selection. If null, use self :: encoding value,
|
||||||
* if false, do not filter on encoding, otherwise filter available lang for
|
* if false, do not filter on encoding, otherwise filter available lang for
|
||||||
* specified encoding (optional, default: null)
|
* specified encoding (optional, default: null)
|
||||||
* @params[in] $with_encoding Return available lang list with encoding (optional, default: false)
|
* @params[in] $with_encoding Return available lang list with encoding (optional, default: false)
|
||||||
*
|
*
|
||||||
* @retval array List of available languages.
|
* @return array List of available languages.
|
||||||
**/
|
**/
|
||||||
public static function getLangList($encoding=null, $with_encoding=false) {
|
public static function getLangList($encoding=null, $with_encoding=false) {
|
||||||
if (is_null($encoding))
|
if (is_null($encoding))
|
||||||
|
@ -170,10 +170,10 @@ class LSlang extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return current language
|
* Return current language
|
||||||
*
|
*
|
||||||
* @param[in] boolean If true, only return the two first characters of the language
|
* @param boolean $short If true, only return the two first characters of the language
|
||||||
* (For instance, 'fr' for 'fr_FR')
|
* (For instance, 'fr' for 'fr_FR')
|
||||||
*
|
*
|
||||||
* @retval string The current language (ex: fr_FR, or fr if $short==true)
|
* @return string The current language (ex: fr_FR, or fr if $short==true)
|
||||||
**/
|
**/
|
||||||
public static function getLang($short=false) {
|
public static function getLang($short=false) {
|
||||||
if ($short) {
|
if ($short) {
|
||||||
|
@ -185,7 +185,7 @@ class LSlang extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return current encoding
|
* Return current encoding
|
||||||
*
|
*
|
||||||
* @retval string The current encoding (ex: UTF8)
|
* @return string The current encoding (ex: UTF8)
|
||||||
**/
|
**/
|
||||||
public static function getEncoding() {
|
public static function getEncoding() {
|
||||||
return self :: $encoding;
|
return self :: $encoding;
|
||||||
|
@ -194,10 +194,10 @@ class LSlang extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check a locale exists
|
* Check a locale exists
|
||||||
*
|
*
|
||||||
* @param[in] $lang string The language (ex: fr_FR)
|
* @param string $lang The language (ex: fr_FR)
|
||||||
* @param[in] $encoding string The encoding (ex: UTF8)
|
* @param string $lang The encoding (ex: UTF8)
|
||||||
*
|
*
|
||||||
* @retval boolean True if the locale is available, False otherwise
|
* @return boolean True if the locale is available, False otherwise
|
||||||
**/
|
**/
|
||||||
public static function localeExist($lang, $encoding) {
|
public static function localeExist($lang, $encoding) {
|
||||||
if ( !$lang && !$encoding ) {
|
if ( !$lang && !$encoding ) {
|
||||||
|
@ -227,9 +227,9 @@ if (php_sapi_name() != "cli") return true;
|
||||||
/**
|
/**
|
||||||
* CLI generate_lang_file command
|
* CLI generate_lang_file command
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array Command arguments
|
* @param string $lang Command arguments
|
||||||
*
|
*
|
||||||
* @retval boolean True on success, false otherwise
|
* @return boolean True on success, false otherwise
|
||||||
**/
|
**/
|
||||||
global $LSlang_cli_logger, $available_onlys, $available_withouts;
|
global $LSlang_cli_logger, $available_onlys, $available_withouts;
|
||||||
|
|
||||||
|
@ -955,12 +955,12 @@ function cli_generate_lang_file($command_args) {
|
||||||
/**
|
/**
|
||||||
* Args autocompleter for CLI command generate_lang_file
|
* Args autocompleter for CLI command generate_lang_file
|
||||||
*
|
*
|
||||||
* @param[in] $comp_words array List of already typed words of the command
|
* @param string $lang List of already typed words of the command
|
||||||
* @param[in] $comp_word_num int The command word number to autocomplete
|
* @param string $lang The command word number to autocomplete
|
||||||
* @param[in] $comp_word string The command word to autocomplete
|
* @param string $lang The command word to autocomplete
|
||||||
* @param[in] $opts array List of global available options
|
* @param string $lang List of global available options
|
||||||
*
|
*
|
||||||
* @retval array List of available options for the word to autocomplete
|
* @return array List of available options for the word to autocomplete
|
||||||
**/
|
**/
|
||||||
function cli_generate_lang_file_args_autocompleter($comp_words, $comp_word_num, $comp_word, $opts) {
|
function cli_generate_lang_file_args_autocompleter($comp_words, $comp_word_num, $comp_word, $opts) {
|
||||||
global $available_withouts, $available_onlys;
|
global $available_withouts, $available_onlys;
|
||||||
|
@ -1039,9 +1039,9 @@ LScli :: add_command(
|
||||||
/**
|
/**
|
||||||
* CLI generate_ldapsaisie_pot command
|
* CLI generate_ldapsaisie_pot command
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array Command arguments
|
* @param string $lang Command arguments
|
||||||
*
|
*
|
||||||
* @retval boolean True on success, false otherwise
|
* @return boolean True on success, false otherwise
|
||||||
**/
|
**/
|
||||||
function cli_generate_ldapsaisie_pot($command_args) {
|
function cli_generate_ldapsaisie_pot($command_args) {
|
||||||
global $LSlang_cli_logger;
|
global $LSlang_cli_logger;
|
||||||
|
|
|
@ -41,9 +41,9 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $config array Configuration array as accepted by Net_LDAP2
|
* @param array $config Configuration array as accepted by Net_LDAP2
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function setConfig ($config) {
|
public static function setConfig ($config) {
|
||||||
self :: $config = $config;
|
self :: $config = $config;
|
||||||
|
@ -56,9 +56,9 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $config array LDAP configuration array in format of Net_LDAP2
|
* @param array $config LDAP configuration array in format of Net_LDAP2
|
||||||
*
|
*
|
||||||
* @retval boolean true if connected, false instead
|
* @return boolean true if connected, false instead
|
||||||
*/
|
*/
|
||||||
public static function connect($config = null) {
|
public static function connect($config = null) {
|
||||||
if ($config) {
|
if ($config) {
|
||||||
|
@ -78,12 +78,12 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $dn string Bind DN
|
* @param array $config Bind DN
|
||||||
* @param[in] $pwd array Bind password
|
* @param array $config Bind password
|
||||||
* @param[in] $config array LDAP configuration array in format of Net_LDAP2
|
* @param array $config LDAP configuration array in format of Net_LDAP2
|
||||||
* (optional, default: keep current)
|
* (optional, default: keep current)
|
||||||
*
|
*
|
||||||
* @retval boolean true if connected, false instead
|
* @return boolean true if connected, false instead
|
||||||
*/
|
*/
|
||||||
public static function reconnectAs($dn, $pwd, $config=null) {
|
public static function reconnectAs($dn, $pwd, $config=null) {
|
||||||
if ($config) {
|
if ($config) {
|
||||||
|
@ -109,9 +109,9 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $dn string Bind DN
|
* @param array $config Bind DN
|
||||||
*
|
*
|
||||||
* @retval boolean true if authz proxy controle is set, false otherwise
|
* @return boolean true if authz proxy controle is set, false otherwise
|
||||||
*/
|
*/
|
||||||
public static function setAuthzProxyControl($dn) {
|
public static function setAuthzProxyControl($dn) {
|
||||||
if (!self :: $cnx) {
|
if (!self :: $cnx) {
|
||||||
|
@ -143,7 +143,7 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function close() {
|
public static function close() {
|
||||||
self :: $cnx -> done();
|
self :: $cnx -> done();
|
||||||
|
@ -156,13 +156,13 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $filter [<b>required</b>] string The search LDAP filter
|
* @param string $filterThe search LDAP filter
|
||||||
* @param[in] $basedn string The base DN of the search
|
* @param array $config The base DN of the search
|
||||||
* @param[in] $params array Array to search parameters as accepted by Net_LDAP2::search()
|
* @param array $config Array to search parameters as accepted by Net_LDAP2::search()
|
||||||
*
|
*
|
||||||
* @see Net_LDAP2::search()
|
* @see Net_LDAP2::search()
|
||||||
*
|
*
|
||||||
* @retval array Return an array of entries returned by the LDAP directory. Each element
|
* @return array Return an array of entries returned by the LDAP directory. Each element
|
||||||
* of this array corresponded to one returned entry and is an array with
|
* of this array corresponded to one returned entry and is an array with
|
||||||
* the following keys:
|
* the following keys:
|
||||||
* - dn: The DN of the entry
|
* - dn: The DN of the entry
|
||||||
|
@ -207,13 +207,13 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $filter [<b>required</b>] string The search LDAP filter
|
* @param string $filterThe search LDAP filter
|
||||||
* @param[in] $basedn string The base DN of the search
|
* @param array $config The base DN of the search
|
||||||
* @param[in] $params array Array to search parameters as accepted by Net_LDAP2::search()
|
* @param array $config Array to search parameters as accepted by Net_LDAP2::search()
|
||||||
*
|
*
|
||||||
* @see Net_LDAP2::search()
|
* @see Net_LDAP2::search()
|
||||||
*
|
*
|
||||||
* @retval integer|null The number of matching entries on success, null otherwise
|
* @return integer|null The number of matching entries on success, null otherwise
|
||||||
*/
|
*/
|
||||||
public static function getNumberResult($filter, $basedn=NULL, $params=array()) {
|
public static function getNumberResult($filter, $basedn=NULL, $params=array()) {
|
||||||
if (empty($filter))
|
if (empty($filter))
|
||||||
|
@ -246,12 +246,12 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $dn string DN de l'entré Ldap
|
* @param array $config DN de l'entré Ldap
|
||||||
* @param[in] $filter string LDAP filter string (optional, default: null == '(objectClass=*)')
|
* @param array $config LDAP filter string (optional, default: null == '(objectClass=*)')
|
||||||
* @param[in] $attrs array|null Array of requested attribute (optional, default: null == all attributes, excepted internal)
|
* @param array|null $attrs Array of requested attribute (optional, default: null == all attributes, excepted internal)
|
||||||
* @param[in] $include_internal boolean If true, internal attributes will be included (default: false)
|
* @param boolean $include_internal If true, internal attributes will be included (default: false)
|
||||||
*
|
*
|
||||||
* @retval array|false Associative array of attributes values (with attribute name as key), or false on error
|
* @return array|false Associative array of attributes values (with attribute name as key), or false on error
|
||||||
*/
|
*/
|
||||||
public static function getAttrs($dn, $filter=null, $attrs=null, $include_internal=false) {
|
public static function getAttrs($dn, $filter=null, $attrs=null, $include_internal=false) {
|
||||||
$infos = ldap_explode_dn($dn,0);
|
$infos = ldap_explode_dn($dn,0);
|
||||||
|
@ -274,9 +274,9 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return a date string
|
* Return a date string
|
||||||
*
|
*
|
||||||
* @param[in] string LDAP date
|
* @param string $value LDAP date
|
||||||
*
|
*
|
||||||
* @retval string Date YYYY/MM/DD HH:mm:ss
|
* @return string Date YYYY/MM/DD HH:mm:ss
|
||||||
*/
|
*/
|
||||||
public static function parseDate($value) {
|
public static function parseDate($value) {
|
||||||
$datetime = date_create_from_format('YmdHis.uO', $value);
|
$datetime = date_create_from_format('YmdHis.uO', $value);
|
||||||
|
@ -290,10 +290,10 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Emmanuel Saracco <esaracco@easter-eggs.com>
|
* @author Emmanuel Saracco <esaracco@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $attrs array Array of LDAP attributes
|
* @param array $config Array of LDAP attributes
|
||||||
* @param[in] $name array Name of a attribute
|
* @param array $config Name of a attribute
|
||||||
*
|
*
|
||||||
* @retval boolean true if found
|
* @return boolean true if found
|
||||||
*/
|
*/
|
||||||
public static function attrExists($attrs, $name) {
|
public static function attrExists($attrs, $name) {
|
||||||
return array_key_exists(strtolower($name), array_change_key_case($attrs));
|
return array_key_exists(strtolower($name), array_change_key_case($attrs));
|
||||||
|
@ -306,11 +306,11 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Emmanuel Saracco <esaracco@easter-eggs.com>
|
* @author Emmanuel Saracco <esaracco@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $attrs array Array of LDAP attributes
|
* @param array $config Array of LDAP attributes
|
||||||
* @param[in] $name array Name of a attribute
|
* @param array $config Name of a attribute
|
||||||
* @param[in] $multiple boolean true if we must return array
|
* @param boolean $include_internal true if we must return array
|
||||||
*
|
*
|
||||||
* @retval mixed Found value (or array of values) or null
|
* @return mixed Found value (or array of values) or null
|
||||||
*/
|
*/
|
||||||
public static function getAttr($attrs, $name, $multiple = false) {
|
public static function getAttr($attrs, $name, $multiple = false) {
|
||||||
$name = strtolower($name);
|
$name = strtolower($name);
|
||||||
|
@ -327,10 +327,10 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $object_type string The object type
|
* @param array $config The object type
|
||||||
* @param[in] $dn string The DN of the LDAP entry
|
* @param array $config The DN of the LDAP entry
|
||||||
*
|
*
|
||||||
* @retval ldapentry|array A Net_LDAP2_Entry object or an array if
|
* @return Net_LDAP2_Entry|array A Net_LDAP2_Entry object or an array if
|
||||||
* it's a new entry:
|
* it's a new entry:
|
||||||
* Array (
|
* Array (
|
||||||
* 'entry' => Net_LDAP2_Entry,
|
* 'entry' => Net_LDAP2_Entry,
|
||||||
|
@ -366,10 +366,10 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $dn string DN of the requested LDAP entry
|
* @param array $config DN of the requested LDAP entry
|
||||||
* @param[in] $attrs array|null Array of requested attribute (optional, default: null == all attributes, excepted internal)
|
* @param array|null $attrs Array of requested attribute (optional, default: null == all attributes, excepted internal)
|
||||||
*
|
*
|
||||||
* @retval ldapentry|boolean A Net_LDAP2_Entry object or false if error occured
|
* @return Net_LDAP2_Entry|boolean A Net_LDAP2_Entry object or false if error occured
|
||||||
*/
|
*/
|
||||||
public static function getLdapEntry($dn, $attrs=null) {
|
public static function getLdapEntry($dn, $attrs=null) {
|
||||||
$entry = self :: $cnx -> getEntry($dn, (is_array($attrs)?$attrs:array()));
|
$entry = self :: $cnx -> getEntry($dn, (is_array($attrs)?$attrs:array()));
|
||||||
|
@ -386,9 +386,9 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $dn string DN of the LDAP entry to check
|
* @param array $config DN of the LDAP entry to check
|
||||||
*
|
*
|
||||||
* @retval boolean True if entry exists, false otherwise
|
* @return boolean True if entry exists, false otherwise
|
||||||
*/
|
*/
|
||||||
public static function exists($dn) {
|
public static function exists($dn) {
|
||||||
return is_a(self :: getLdapEntry($dn), 'Net_LDAP2_Entry');
|
return is_a(self :: getLdapEntry($dn), 'Net_LDAP2_Entry');
|
||||||
|
@ -397,11 +397,11 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return a new Net_LDAP2_Entry object
|
* Return a new Net_LDAP2_Entry object
|
||||||
*
|
*
|
||||||
* @param[in] $dn string The DN of the object
|
* @param array $config The DN of the object
|
||||||
* @param[in] $objectClass array Array of the object's object classes
|
* @param array $config Array of the object's object classes
|
||||||
* @param[in] $attrs array Array of object attributes values. Format: array('attr_name' => attr_value, ...)
|
* @param array $config Array of object attributes values. Format: array('attr_name' => attr_value, ...)
|
||||||
*
|
*
|
||||||
* @retval Net_LDAP2_Entry|False A Net_LDAP2_Entry object on success, False otherwise
|
* @return Net_LDAP2_Entry|False A Net_LDAP2_Entry object on success, False otherwise
|
||||||
*/
|
*/
|
||||||
public static function getNewEntry($dn, $objectClass, $attrs, $add=false) {
|
public static function getNewEntry($dn, $objectClass, $attrs, $add=false) {
|
||||||
$newentry = Net_LDAP2_Entry::createFresh(
|
$newentry = Net_LDAP2_Entry::createFresh(
|
||||||
|
@ -429,11 +429,11 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $object_type string The object type
|
* @param array $config The object type
|
||||||
* @param[in] $dn string DN of the LDAP object
|
* @param array $config DN of the LDAP object
|
||||||
* @param[in] $change array Array of object attributes changes
|
* @param array $config Array of object attributes changes
|
||||||
*
|
*
|
||||||
* @retval boolean True if object was updated, False otherwise.
|
* @return boolean True if object was updated, False otherwise.
|
||||||
*/
|
*/
|
||||||
public static function update($object_type, $dn, $change) {
|
public static function update($object_type, $dn, $change) {
|
||||||
self :: log_trace("update($object_type, $dn): change=".varDump($change));
|
self :: log_trace("update($object_type, $dn): change=".varDump($change));
|
||||||
|
@ -551,7 +551,7 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean True on bind success, False otherwise.
|
* @return boolean True on bind success, False otherwise.
|
||||||
*/
|
*/
|
||||||
public static function checkBind($dn,$pwd) {
|
public static function checkBind($dn,$pwd) {
|
||||||
$config = self :: $config;
|
$config = self :: $config;
|
||||||
|
@ -567,7 +567,7 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return the status of the LDAP connection
|
* Return the status of the LDAP connection
|
||||||
*
|
*
|
||||||
* @retval boolean True if connected on LDAP server, False otherwise
|
* @return boolean True if connected on LDAP server, False otherwise
|
||||||
*/
|
*/
|
||||||
public static function isConnected() {
|
public static function isConnected() {
|
||||||
return (self :: $cnx == NULL)?false:true;
|
return (self :: $cnx == NULL)?false:true;
|
||||||
|
@ -576,9 +576,9 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Drop an object in LDAP directory
|
* Drop an object in LDAP directory
|
||||||
*
|
*
|
||||||
* @param[in] string The DN of the object to remove
|
* @param string $dn The DN of the object to remove
|
||||||
*
|
*
|
||||||
* @retval boolean True if object was removed, False otherwise.
|
* @return boolean True if object was removed, False otherwise.
|
||||||
*/
|
*/
|
||||||
public static function remove($dn) {
|
public static function remove($dn) {
|
||||||
$ret = self :: $cnx -> delete($dn,array('recursive' => true));
|
$ret = self :: $cnx -> delete($dn,array('recursive' => true));
|
||||||
|
@ -592,10 +592,10 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Move an entry in LDAP directory
|
* Move an entry in LDAP directory
|
||||||
*
|
*
|
||||||
* @param[in] $old string The current object DN
|
* @param array $config The current object DN
|
||||||
* @param[in] $new string The new object DN
|
* @param array $config The new object DN
|
||||||
*
|
*
|
||||||
* @retval boolean True if object was moved, False otherwise.
|
* @return boolean True if object was moved, False otherwise.
|
||||||
*/
|
*/
|
||||||
public static function move($old, $new) {
|
public static function move($old, $new) {
|
||||||
$ret = self :: $cnx -> move($old, $new);
|
$ret = self :: $cnx -> move($old, $new);
|
||||||
|
@ -610,17 +610,17 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Combine LDAP Filters
|
* Combine LDAP Filters
|
||||||
*
|
*
|
||||||
* @param[in] $op string The combine logical operator. May be "and",
|
* @param array $config The combine logical operator. May be "and",
|
||||||
* "or", "not" or the subsequent logical
|
* "or", "not" or the subsequent logical
|
||||||
* equivalents "&", "|", "!".
|
* equivalents "&", "|", "!".
|
||||||
* @param[in] $filters array Array of LDAP filters (as string or
|
* @param array $config Array of LDAP filters (as string or
|
||||||
* Net_LDAP2_Filter object)
|
* Net_LDAP2_Filter object)
|
||||||
* @param[in] $asStr boolean Set to true if you want to retreive
|
* @param boolean $include_internal Set to true if you want to retreive
|
||||||
* combined filter as string instead of
|
* combined filter as string instead of
|
||||||
* as a Net_LDAP2_Filter object (optional,
|
* as a Net_LDAP2_Filter object (optional,
|
||||||
* default: false)
|
* default: false)
|
||||||
*
|
*
|
||||||
* @retval Net_LDAP2_Filter | False The combined filter or False
|
* @return Net_LDAP2_Filter | False The combined filter or False
|
||||||
**/
|
**/
|
||||||
public static function combineFilters($op, $filters, $asStr=false) {
|
public static function combineFilters($op, $filters, $asStr=false) {
|
||||||
if (is_array($filters) && !empty($filters)) {
|
if (is_array($filters) && !empty($filters)) {
|
||||||
|
@ -653,7 +653,7 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @params string A LDAP filter as string
|
* @params string A LDAP filter as string
|
||||||
*
|
*
|
||||||
* @retval boolean True only if the filter could be parsed
|
* @return boolean True only if the filter could be parsed
|
||||||
**/
|
**/
|
||||||
public static function isValidFilter($filter) {
|
public static function isValidFilter($filter) {
|
||||||
if (is_string($filter) && !empty($filter)) {
|
if (is_string($filter) && !empty($filter)) {
|
||||||
|
@ -672,13 +672,13 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* This method uses LDAP controls when possible (Net_LDAP2 does not).
|
* This method uses LDAP controls when possible (Net_LDAP2 does not).
|
||||||
*
|
*
|
||||||
* @param[in] $object_type string The object type
|
* @param array $config The object type
|
||||||
* @param[in] $changed_attrs array Array of changed attributes
|
* @param array $config Array of changed attributes
|
||||||
* @param[in] $dn string DN of the LDAP object
|
* @param array $config DN of the LDAP object
|
||||||
*
|
*
|
||||||
* @author Emmanuel Saracco <esaracco@easter-eggs.com>
|
* @author Emmanuel Saracco <esaracco@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval mixed New array of changed attributes or false
|
* @return mixed New array of changed attributes or false
|
||||||
**/
|
**/
|
||||||
private static function updateUserPassword($object_type, $changed_attrs, $dn) {
|
private static function updateUserPassword($object_type, $changed_attrs, $dn) {
|
||||||
if (self :: getConfig('version') < 3 || !function_exists('ldap_mod_replace_ext')) {
|
if (self :: getConfig('version') < 3 || !function_exists('ldap_mod_replace_ext')) {
|
||||||
|
@ -725,7 +725,7 @@ class LSldap extends LSlog_staticLoggerClass {
|
||||||
* @param[] $default The default value (default : null)
|
* @param[] $default The default value (default : null)
|
||||||
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
||||||
*
|
*
|
||||||
* @retval mixed The configuration parameter value or default value if not set
|
* @return mixed The configuration parameter value or default value if not set
|
||||||
**/
|
**/
|
||||||
private static function getConfig($param, $default=null, $cast=null) {
|
private static function getConfig($param, $default=null, $cast=null) {
|
||||||
return LSconfig :: get($param, $default, $cast, self :: $config);
|
return LSconfig :: get($param, $default, $cast, self :: $config);
|
||||||
|
|
|
@ -56,7 +56,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true si l'objet a été construit, false sinon.
|
* @return boolean true si l'objet a été construit, false sinon.
|
||||||
*/
|
*/
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$this -> type_name = get_class($this);
|
$this -> type_name = get_class($this);
|
||||||
|
@ -85,11 +85,11 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $dn string The object DN
|
* @param string $dn The object DN
|
||||||
* @param[in] $additional_filter string|Net_LDAP2_Filter|null A custom LDAP filter that LDAP object
|
* @param string|Net_LDAP2_Filter|null $additional_filter A custom LDAP filter that LDAP object
|
||||||
* must respect to permit its data loading
|
* must respect to permit its data loading
|
||||||
*
|
*
|
||||||
* @retval boolean True if object data loaded, false otherwise
|
* @return boolean True if object data loaded, false otherwise
|
||||||
*/
|
*/
|
||||||
public function loadData($dn, $additional_filter=null) {
|
public function loadData($dn, $additional_filter=null) {
|
||||||
$this -> dn = $dn;
|
$this -> dn = $dn;
|
||||||
|
@ -119,7 +119,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true si la rechargement a réussi, false sinon.
|
* @return boolean true si la rechargement a réussi, false sinon.
|
||||||
*/
|
*/
|
||||||
public function reloadData() {
|
public function reloadData() {
|
||||||
$data = LSldap :: getAttrs($this -> dn);
|
$data = LSldap :: getAttrs($this -> dn);
|
||||||
|
@ -135,7 +135,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval string Format d'affichage de l'objet.
|
* @return string Format d'affichage de l'objet.
|
||||||
*/
|
*/
|
||||||
public function getDisplayNameFormat() {
|
public function getDisplayNameFormat() {
|
||||||
return $this -> getConfig('display_name_format');
|
return $this -> getConfig('display_name_format');
|
||||||
|
@ -149,11 +149,11 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $spe [<i>optionnel</i>] string Format d'affichage de l'objet
|
* @param string $spe string Format d'affichage de l'objet
|
||||||
* @param[in] $full [<i>optionnel</i>] boolean True pour afficher en plus le
|
* @param bool $full boolean True pour afficher en plus le
|
||||||
* subDnName
|
* subDnName
|
||||||
*
|
*
|
||||||
* @retval string Valeur descriptive d'affichage de l'objet
|
* @return string Valeur descriptive d'affichage de l'objet
|
||||||
*/
|
*/
|
||||||
public function getDisplayName($spe=null, $full=false) {
|
public function getDisplayName($spe=null, $full=false) {
|
||||||
if (is_null($spe))
|
if (is_null($spe))
|
||||||
|
@ -173,9 +173,9 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $format string Format de la chaine
|
* @param string $dn Format de la chaine
|
||||||
*
|
*
|
||||||
* @retval string Valeur d'une chaine formatée
|
* @return string Valeur d'une chaine formatée
|
||||||
*/
|
*/
|
||||||
public function getFData($format) {
|
public function getFData($format) {
|
||||||
$format=getFData($format,$this,'getValue');
|
$format=getFData($format,$this,'getValue');
|
||||||
|
@ -190,9 +190,9 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $format string Format de la chaine
|
* @param string $dn Format de la chaine
|
||||||
*
|
*
|
||||||
* @retval string Valeur d'une chaine formatee
|
* @return string Valeur d'une chaine formatee
|
||||||
*/
|
*/
|
||||||
public function getDisplayFData($format) {
|
public function getDisplayFData($format) {
|
||||||
return getFData($format,$this,'getDisplayValue');
|
return getFData($format,$this,'getDisplayValue');
|
||||||
|
@ -203,13 +203,13 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* This method create a LSform from the object and its attributes configurations.
|
* This method create a LSform from the object and its attributes configurations.
|
||||||
*
|
*
|
||||||
* @param[in] $idForm string Form identifier (required)
|
* @param string $dn Form identifier (required)
|
||||||
* @param[in] $load string DN of a similar object. If defined, attributes values of this object will be loaded in the form.
|
* @param string $dn DN of a similar object. If defined, attributes values of this object will be loaded in the form.
|
||||||
* @param[in] $api_mode boolean Enable API mode (defaut: false)
|
* @param boolean $api_mode Enable API mode (defaut: false)
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval LSform The created LSform object
|
* @return LSform The created LSform object
|
||||||
*/
|
*/
|
||||||
public function getForm($idForm, $load=NULL, $api_mode=false) {
|
public function getForm($idForm, $load=NULL, $api_mode=false) {
|
||||||
LSsession :: loadLSclass('LSform');
|
LSsession :: loadLSclass('LSform');
|
||||||
|
@ -248,11 +248,11 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* This method create a LSform in view mode from the object and its attributes configurations.
|
* This method create a LSform in view mode from the object and its attributes configurations.
|
||||||
*
|
*
|
||||||
* @param[in] $api_mode boolean Enable API mode (defaut: false)
|
* @param boolean $api_mode Enable API mode (defaut: false)
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval LSform The created LSform object
|
* @return LSform The created LSform object
|
||||||
*/
|
*/
|
||||||
public function getView($api_mode=false) {
|
public function getView($api_mode=false) {
|
||||||
LSsession :: loadLSclass('LSform');
|
LSsession :: loadLSclass('LSform');
|
||||||
|
@ -269,11 +269,11 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* Cette méthode recharge les données d'un formulaire LSform.
|
* Cette méthode recharge les données d'un formulaire LSform.
|
||||||
*
|
*
|
||||||
* @param[in] $idForm [<b>required</b>] Identifiant du formulaire a créer
|
* @param string $idForm Identifiant du formulaire a créer
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true sile formulaire a été rafraichis, false sinon
|
* @return boolean true sile formulaire a été rafraichis, false sinon
|
||||||
*/
|
*/
|
||||||
public function refreshForm($idForm) {
|
public function refreshForm($idForm) {
|
||||||
$LSform = $this -> forms[$idForm][0];
|
$LSform = $this -> forms[$idForm][0];
|
||||||
|
@ -291,14 +291,14 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
* This method just valid form ID, extract form data and call
|
* This method just valid form ID, extract form data and call
|
||||||
* _updateData() protected method.
|
* _updateData() protected method.
|
||||||
*
|
*
|
||||||
* @param[in] $idForm Form ID
|
* @param string $idForm Form ID
|
||||||
* @param[in] $justCheck Boolean to enable just check mode
|
* @param boolean $api_mode to enable just check mode
|
||||||
*
|
*
|
||||||
* @see _updateData()
|
* @see _updateData()
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true if object data was updated, false otherwise
|
* @return boolean true if object data was updated, false otherwise
|
||||||
*/
|
*/
|
||||||
public function updateData($idForm=NULL, $justCheck=False) {
|
public function updateData($idForm=NULL, $justCheck=False) {
|
||||||
if($idForm!=NULL) {
|
if($idForm!=NULL) {
|
||||||
|
@ -333,13 +333,13 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
* This method implement the continuation and the end of the object data
|
* This method implement the continuation and the end of the object data
|
||||||
* udpate.
|
* udpate.
|
||||||
*
|
*
|
||||||
* @param[in] $new_data Array of object data
|
* @param string $dn of object data
|
||||||
* @param[in] $idForm Form ID
|
* @param string $idForm Form ID
|
||||||
* @param[in] $justCheck Boolean to enable just check mode
|
* @param boolean $api_mode to enable just check mode
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true if object data was updated, false otherwise
|
* @return boolean true if object data was updated, false otherwise
|
||||||
*
|
*
|
||||||
* @see updateData()
|
* @see updateData()
|
||||||
* @see validateAttrsData()
|
* @see validateAttrsData()
|
||||||
|
@ -403,12 +403,12 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Validate data returned by form
|
* Validate data returned by form
|
||||||
*
|
*
|
||||||
* @param[in] $idForm string The source LSform ID
|
* @param string $dn The source LSform ID
|
||||||
* @param[in] $justCheck Boolean to enable just check mode (do not validate data using LDAP search)
|
* @param boolean $api_mode to enable just check mode (do not validate data using LDAP search)
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean True if form data are valid, False otherwise
|
* @return boolean True if form data are valid, False otherwise
|
||||||
*/
|
*/
|
||||||
public function validateAttrsData($idForm=null, $justCheck=False) {
|
public function validateAttrsData($idForm=null, $justCheck=False) {
|
||||||
$retval = true;
|
$retval = true;
|
||||||
|
@ -456,13 +456,13 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Validate one attribute's data returned by form
|
* Validate one attribute's data returned by form
|
||||||
*
|
*
|
||||||
* @param[in] $idForm string The source LSform ID
|
* @param string $dn The source LSform ID
|
||||||
* @param[in] &$attr LSattribute The attribute to validate
|
* @param LSattribute &$attr The attribute to validate
|
||||||
* @param[in] $justCheck Boolean to enable just check mode (do not validate data using LDAP search)
|
* @param boolean $api_mode to enable just check mode (do not validate data using LDAP search)
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean True if form data for this attribute are valid, False otherwise
|
* @return boolean True if form data for this attribute are valid, False otherwise
|
||||||
*/
|
*/
|
||||||
public function validateAttrData(&$LSform, &$attr, $justCheck=false) {
|
public function validateAttrData(&$LSform, &$attr, $justCheck=false) {
|
||||||
$retval = true;
|
$retval = true;
|
||||||
|
@ -652,11 +652,11 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Submit changes made to LDAP directory
|
* Submit changes made to LDAP directory
|
||||||
*
|
*
|
||||||
* @param[in] $idForm string The source LSform ID
|
* @param string $dn The source LSform ID
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean True if changes are successfully push to LDAP directory, False otherwise
|
* @return boolean True if changes are successfully push to LDAP directory, False otherwise
|
||||||
*/
|
*/
|
||||||
public function submitChange($idForm) {
|
public function submitChange($idForm) {
|
||||||
$submitData=array();
|
$submitData=array();
|
||||||
|
@ -754,11 +754,11 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Retourne les informations issus d'un DN
|
* Retourne les informations issus d'un DN
|
||||||
*
|
*
|
||||||
* @param[in] $dn Un DN.
|
* @param string $dn Un DN.
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval array Tableau :
|
* @return array Tableau :
|
||||||
* - [0] : le premier paramètre
|
* - [0] : le premier paramètre
|
||||||
* - [1] : les paramètres suivants
|
* - [1] : les paramètres suivants
|
||||||
*/
|
*/
|
||||||
|
@ -783,7 +783,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval Net_LDAP2_Filter le filtre ldap correspondant au type de l'objet
|
* @return Net_LDAP2_Filter le filtre ldap correspondant au type de l'objet
|
||||||
*/
|
*/
|
||||||
public function getObjectFilter() {
|
public function getObjectFilter() {
|
||||||
return self :: _getObjectFilter($this -> type_name);
|
return self :: _getObjectFilter($this -> type_name);
|
||||||
|
@ -794,7 +794,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval Net_LDAP2_Filter le filtre ldap correspondant au type de l'objet
|
* @return Net_LDAP2_Filter le filtre ldap correspondant au type de l'objet
|
||||||
*/
|
*/
|
||||||
public static function _getObjectFilter($type) {
|
public static function _getObjectFilter($type) {
|
||||||
$oc=LSconfig::get("LSobjects.$type.objectclass");
|
$oc=LSconfig::get("LSobjects.$type.objectclass");
|
||||||
|
@ -821,10 +821,10 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $pattern string Le mot clé recherché
|
* @param string $dn Le mot clé recherché
|
||||||
* @param[in] $approx booléen Booléen activant ou non la recherche approximative
|
* @param bool $approx booléen Booléen activant ou non la recherche approximative
|
||||||
*
|
*
|
||||||
* @retval string le filtre ldap correspondant
|
* @return string le filtre ldap correspondant
|
||||||
*/
|
*/
|
||||||
public function getPatternFilter($pattern=null,$approx=null) {
|
public function getPatternFilter($pattern=null,$approx=null) {
|
||||||
if ($pattern) {
|
if ($pattern) {
|
||||||
|
@ -845,11 +845,11 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $filter array (ou string) Filtre de recherche Ldap / Tableau de filtres de recherche
|
* @param string $dn (ou string) Filtre de recherche Ldap / Tableau de filtres de recherche
|
||||||
* @param[in] $basedn string DN de base pour la recherche
|
* @param string $dn DN de base pour la recherche
|
||||||
* @param[in] $params array Paramètres de recherche au format Net_LDAP2::search()
|
* @param string $dn Paramètres de recherche au format Net_LDAP2::search()
|
||||||
*
|
*
|
||||||
* @retval array Tableau d'objets correspondant au resultat de la recherche
|
* @return array Tableau d'objets correspondant au resultat de la recherche
|
||||||
*/
|
*/
|
||||||
public function listObjects($filter=NULL,$basedn=NULL,$params=array()) {
|
public function listObjects($filter=NULL,$basedn=NULL,$params=array()) {
|
||||||
if (!LSsession :: loadLSclass('LSsearch')) {
|
if (!LSsession :: loadLSclass('LSsearch')) {
|
||||||
|
@ -880,12 +880,12 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $filter string Filtre de recherche Ldap
|
* @param string $dn Filtre de recherche Ldap
|
||||||
* @param[in] $basedn string DN de base pour la recherche
|
* @param string $dn DN de base pour la recherche
|
||||||
* @param[in] $params array Paramètres de recherche au format Net_LDAP2::search()
|
* @param string $dn Paramètres de recherche au format Net_LDAP2::search()
|
||||||
* @param[in] $displayFormat string Format d'affichage du nom des objets
|
* @param string $dn Format d'affichage du nom des objets
|
||||||
*
|
*
|
||||||
* @retval array Tableau dn => name correspondant au resultat de la recherche
|
* @return array Tableau dn => name correspondant au resultat de la recherche
|
||||||
*/
|
*/
|
||||||
public function listObjectsName($filter=NULL,$sbasedn=NULL,$sparams=array(),$displayFormat=false,$cache=true) {
|
public function listObjectsName($filter=NULL,$sbasedn=NULL,$sparams=array(),$displayFormat=false,$cache=true) {
|
||||||
if (!LSsession :: loadLSclass('LSsearch')) {
|
if (!LSsession :: loadLSclass('LSsearch')) {
|
||||||
|
@ -922,12 +922,12 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $name string Valeur de son RDN ou de la valeur pour composer le filtre
|
* @param string $dn Valeur de son RDN ou de la valeur pour composer le filtre
|
||||||
* @param[in] $basedn string Le DN de base de la recherche
|
* @param string $dn Le DN de base de la recherche
|
||||||
* @param[in] $filter string Le filtre de recherche de l'objet
|
* @param string $dn Le filtre de recherche de l'objet
|
||||||
* @param[in] $params array Tableau de paramètres
|
* @param string $dn Tableau de paramètres
|
||||||
*
|
*
|
||||||
* @retval array Tableau d'objets correspondant au resultat de la recherche
|
* @return array Tableau d'objets correspondant au resultat de la recherche
|
||||||
*/
|
*/
|
||||||
public function searchObject($name,$basedn=NULL,$filter=NULL,$params=NULL) {
|
public function searchObject($name,$basedn=NULL,$filter=NULL,$params=NULL) {
|
||||||
if (!$filter) {
|
if (!$filter) {
|
||||||
|
@ -952,11 +952,11 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $val string The requested value
|
* @param string $dn The requested value
|
||||||
* @param[in] $first boolean If true and the result is an array, return only the first value (optional, default: false)
|
* @param boolean $api_mode If true and the result is an array, return only the first value (optional, default: false)
|
||||||
* @param[in] $default mixed Default value if unknown (optional, default: a space caracter = ' ')
|
* @param string $dn Default value if unknown (optional, default: a space caracter = ' ')
|
||||||
*
|
*
|
||||||
* @retval mixed The requested value or $default if unknown
|
* @return mixed The requested value or $default if unknown
|
||||||
*/
|
*/
|
||||||
public function getValue($val, $first=false, $default=' ') {
|
public function getValue($val, $first=false, $default=' ') {
|
||||||
$return = $default;
|
$return = $default;
|
||||||
|
@ -989,9 +989,9 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $val string Le nom de la valeur demandee
|
* @param string $dn Le nom de la valeur demandee
|
||||||
*
|
*
|
||||||
* @retval mixed la valeur demandee ou ' ' si celle-ci est inconnue.
|
* @return mixed la valeur demandee ou ' ' si celle-ci est inconnue.
|
||||||
*/
|
*/
|
||||||
public function getDisplayValue($val) {
|
public function getDisplayValue($val) {
|
||||||
if(isset($this -> attrs[$val])){
|
if(isset($this -> attrs[$val])){
|
||||||
|
@ -1008,10 +1008,10 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Ajoute une valeur dans le tableau $this -> other_values
|
* Ajoute une valeur dans le tableau $this -> other_values
|
||||||
*
|
*
|
||||||
* @param[in] $name string Le nom de la valeur
|
* @param string $dn Le nom de la valeur
|
||||||
* @param[in] $value mixed La valeur
|
* @param string $dn La valeur
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function registerOtherValue($name,$value) {
|
public function registerOtherValue($name,$value) {
|
||||||
$this -> other_values[$name]=$value;
|
$this -> other_values[$name]=$value;
|
||||||
|
@ -1022,7 +1022,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval array('dn' => 'display')
|
* @return array('dn' => 'display')
|
||||||
*/
|
*/
|
||||||
public function getSelectArray($pattern=NULL,$topDn=NULL,$displayFormat=NULL,$approx=false,$cache=true,$filter=NULL,$sparams=array()) {
|
public function getSelectArray($pattern=NULL,$topDn=NULL,$displayFormat=NULL,$approx=false,$cache=true,$filter=NULL,$sparams=array()) {
|
||||||
$sparams['pattern']=$pattern;
|
$sparams['pattern']=$pattern;
|
||||||
|
@ -1037,7 +1037,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval string Le DN de l'objet
|
* @return string Le DN de l'objet
|
||||||
*/
|
*/
|
||||||
public function getDn() {
|
public function getDn() {
|
||||||
if($this -> dn) {
|
if($this -> dn) {
|
||||||
|
@ -1073,7 +1073,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval string Le container DN de l'objet
|
* @return string Le container DN de l'objet
|
||||||
*/
|
*/
|
||||||
public function getContainerDn() {
|
public function getContainerDn() {
|
||||||
$topDn = LSsession :: getTopDn();
|
$topDn = LSsession :: getTopDn();
|
||||||
|
@ -1108,7 +1108,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval string Le type de l'objet ($this -> type_name)
|
* @return string Le type de l'objet ($this -> type_name)
|
||||||
*/
|
*/
|
||||||
public function getType() {
|
public function getType() {
|
||||||
return $this -> type_name;
|
return $this -> type_name;
|
||||||
|
@ -1119,7 +1119,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval array Array of LSprofiles of connected user's LSprofiles on this object
|
* @return array Array of LSprofiles of connected user's LSprofiles on this object
|
||||||
*/
|
*/
|
||||||
public function whoami() {
|
public function whoami() {
|
||||||
if (!$this -> _whoami)
|
if (!$this -> _whoami)
|
||||||
|
@ -1130,11 +1130,11 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Retrieve object type translated label
|
* Retrieve object type translated label
|
||||||
*
|
*
|
||||||
* @param[in] $type string|null The object type (optional, default: called class name)
|
* @param string|Net_LDAP2_Filter|null $additional_filter The object type (optional, default: called class name)
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval string The translated object type label
|
* @return string The translated object type label
|
||||||
*/
|
*/
|
||||||
public static function getLabel($type=null) {
|
public static function getLabel($type=null) {
|
||||||
if (is_null($type))
|
if (is_null($type))
|
||||||
|
@ -1151,7 +1151,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean True si l'objet à été supprimé, false sinon
|
* @return boolean True si l'objet à été supprimé, false sinon
|
||||||
*/
|
*/
|
||||||
public function remove() {
|
public function remove() {
|
||||||
if ($this -> fireEvent('before_delete')) {
|
if ($this -> fireEvent('before_delete')) {
|
||||||
|
@ -1173,7 +1173,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean True si l'objet est nouveau, false sinon
|
* @return boolean True si l'objet est nouveau, false sinon
|
||||||
*/
|
*/
|
||||||
public function isNew() {
|
public function isNew() {
|
||||||
return (!$this -> dn);
|
return (!$this -> dn);
|
||||||
|
@ -1214,7 +1214,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
* Methode créant la liste des objets en relations avec l'objet courant et qui
|
* Methode créant la liste des objets en relations avec l'objet courant et qui
|
||||||
* la met en cache ($this -> _LSrelationsCache)
|
* la met en cache ($this -> _LSrelationsCache)
|
||||||
*
|
*
|
||||||
* @retval True en cas de cas ce succès, False sinon.
|
* @return True en cas de cas ce succès, False sinon.
|
||||||
*/
|
*/
|
||||||
private function updateLSrelationsCache() {
|
private function updateLSrelationsCache() {
|
||||||
$this -> _LSrelationsCache=array();
|
$this -> _LSrelationsCache=array();
|
||||||
|
@ -1248,7 +1248,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
* Cette méthode n'est qu'un exemple et elle doit être certainement réécrite
|
* Cette méthode n'est qu'un exemple et elle doit être certainement réécrite
|
||||||
* pour les objets plus complexe.
|
* pour les objets plus complexe.
|
||||||
*
|
*
|
||||||
* @retval True en cas de cas ce succès, False sinon.
|
* @return True en cas de cas ce succès, False sinon.
|
||||||
*/
|
*/
|
||||||
private function beforeRename() {
|
private function beforeRename() {
|
||||||
// LSrelations
|
// LSrelations
|
||||||
|
@ -1262,7 +1262,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
* Cette méthode n'est qu'un exemple et elle doit être certainement réécrite
|
* Cette méthode n'est qu'un exemple et elle doit être certainement réécrite
|
||||||
* pour les objets plus complexe.
|
* pour les objets plus complexe.
|
||||||
*
|
*
|
||||||
* @retval True en cas de cas ce succès, False sinon.
|
* @return True en cas de cas ce succès, False sinon.
|
||||||
*/
|
*/
|
||||||
private function afterRename() {
|
private function afterRename() {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
@ -1293,7 +1293,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
* Cette méthode n'est qu'un exemple et elle doit être certainement réécrite
|
* Cette méthode n'est qu'un exemple et elle doit être certainement réécrite
|
||||||
* pour les objets plus complexe.
|
* pour les objets plus complexe.
|
||||||
*
|
*
|
||||||
* @retval True en cas de cas ce succès, False sinon.
|
* @return True en cas de cas ce succès, False sinon.
|
||||||
*/
|
*/
|
||||||
private function beforeDelete() {
|
private function beforeDelete() {
|
||||||
$return = $this -> updateLSrelationsCache();
|
$return = $this -> updateLSrelationsCache();
|
||||||
|
@ -1314,7 +1314,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
* Cette méthode n'est qu'un exemple et elle doit être certainement réécrite
|
* Cette méthode n'est qu'un exemple et elle doit être certainement réécrite
|
||||||
* pour les objets plus complexe.
|
* pour les objets plus complexe.
|
||||||
*
|
*
|
||||||
* @retval True en cas de cas ce succès, False sinon.
|
* @return True en cas de cas ce succès, False sinon.
|
||||||
*/
|
*/
|
||||||
private function afterDelete() {
|
private function afterDelete() {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
@ -1354,7 +1354,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
* Cette méthode n'est qu'un exemple et elle doit être certainement réécrite
|
* Cette méthode n'est qu'un exemple et elle doit être certainement réécrite
|
||||||
* pour les objets plus complexe.
|
* pour les objets plus complexe.
|
||||||
*
|
*
|
||||||
* @retval True en cas de cas ce succès, False sinon.
|
* @return True en cas de cas ce succès, False sinon.
|
||||||
*/
|
*/
|
||||||
private function afterCreate() {
|
private function afterCreate() {
|
||||||
self :: log_debug('after');
|
self :: log_debug('after');
|
||||||
|
@ -1402,7 +1402,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
* Cette méthode n'est qu'un exemple et elle doit être certainement réécrite
|
* Cette méthode n'est qu'un exemple et elle doit être certainement réécrite
|
||||||
* pour les objets plus complexe.
|
* pour les objets plus complexe.
|
||||||
*
|
*
|
||||||
* @retval True en cas de cas ce succès, False sinon.
|
* @return True en cas de cas ce succès, False sinon.
|
||||||
*/
|
*/
|
||||||
private function afterModify() {
|
private function afterModify() {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
@ -1418,13 +1418,13 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Retourne la valeur clef d'un objet en relation
|
* Retourne la valeur clef d'un objet en relation
|
||||||
*
|
*
|
||||||
* @param[in] $object Un object de type $objectType
|
* @param LSldapObject $object Un object de type $objectType
|
||||||
* @param[in] $objectType Le type d'objet en relation
|
* @param string $objectType Le type d'objet en relation
|
||||||
* @param[in] $attrValues La/les valeur(s) que doit/peut avoir l'attribut :
|
* @param array|string $attrValues La/les valeur(s) que doit/peut avoir l'attribut :
|
||||||
* - soit le dn (par defaut)
|
* - soit le dn (par defaut)
|
||||||
* - soit une des valeurs d'un attribut
|
* - soit une des valeurs d'un attribut
|
||||||
*
|
*
|
||||||
* @retval Mixed La valeur clef d'un objet en relation
|
* @return Mixed La valeur clef d'un objet en relation
|
||||||
**/
|
**/
|
||||||
public static function getObjectKeyValueInRelation($object, $objectType, $attrValues='dn') {
|
public static function getObjectKeyValueInRelation($object, $objectType, $attrValues='dn') {
|
||||||
if (!$objectType) {
|
if (!$objectType) {
|
||||||
|
@ -1458,14 +1458,14 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
* est établis par la présence de la valeur de référence à l'objet dans
|
* est établis par la présence de la valeur de référence à l'objet dans
|
||||||
* l'attribut des objets de type $objectType.
|
* l'attribut des objets de type $objectType.
|
||||||
*
|
*
|
||||||
* @param[in] $object Un object de type $objectType
|
* @param LSldapObject $object Un object de type $objectType
|
||||||
* @param[in] $attr L'attribut dans lequel l'objet doit apparaitre
|
* @param string $attr L'attribut dans lequel l'objet doit apparaitre
|
||||||
* @param[in] $objectType Le type d'objet en relation
|
* @param string $objectType Le type d'objet en relation
|
||||||
* @param[in] $attrValues La/les valeur(s) que doit/peut avoir l'attribut :
|
* @param array|string $attrValues La/les valeur(s) que doit/peut avoir l'attribut :
|
||||||
* - soit le dn (par defaut)
|
* - soit le dn (par defaut)
|
||||||
* - soit une des valeurs d'un attribut
|
* - soit une des valeurs d'un attribut
|
||||||
*
|
*
|
||||||
* @retval Array of $objectType Les objets en relations
|
* @return array of $objectType Les objets en relations
|
||||||
**/
|
**/
|
||||||
public function listObjectsInRelation($object, $attr, $objectType, $attrValues='dn') {
|
public function listObjectsInRelation($object, $attr, $objectType, $attrValues='dn') {
|
||||||
if ((!$attr)||(!$objectType)) {
|
if ((!$attr)||(!$objectType)) {
|
||||||
|
@ -1497,16 +1497,16 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Ajoute un objet en relation dans l'attribut $attr de $this
|
* Ajoute un objet en relation dans l'attribut $attr de $this
|
||||||
*
|
*
|
||||||
* @param[in] $object Un objet de type $objectType à ajouter
|
* @param LSldapObject $object Un objet de type $objectType à ajouter
|
||||||
* @param[in] $attr L'attribut dans lequel l'objet doit être ajouté
|
* @param string $attr L'attribut dans lequel l'objet doit être ajouté
|
||||||
* @param[in] $objectType Le type d'objet en relation
|
* @param string $objectType Le type d'objet en relation
|
||||||
* @param[in] $attrValue La valeur que doit avoir l'attribut :
|
* @param array|string $attrValue La valeur que doit avoir l'attribut :
|
||||||
* - soit le dn (par defaut)
|
* - soit le dn (par defaut)
|
||||||
* - soit la valeur [0] d'un attribut
|
* - soit la valeur [0] d'un attribut
|
||||||
* @param[in] $canEditFunction Le nom de la fonction pour vérifier que la
|
* @param string $canEditFunction Le nom de la fonction pour vérifier que la
|
||||||
* relation avec l'objet est éditable par le user
|
* relation avec l'objet est éditable par le user
|
||||||
*
|
*
|
||||||
* @retval boolean true si l'objet à été ajouté, False sinon
|
* @return boolean true si l'objet à été ajouté, False sinon
|
||||||
**/
|
**/
|
||||||
public function addOneObjectInRelation($object,$attr,$objectType,$attrValue='dn',$canEditFunction=NULL) {
|
public function addOneObjectInRelation($object,$attr,$objectType,$attrValue='dn',$canEditFunction=NULL) {
|
||||||
if ((!$attr)||(!$objectType)) {
|
if ((!$attr)||(!$objectType)) {
|
||||||
|
@ -1559,19 +1559,19 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Supprime un objet en relation dans l'attribut $attr de $this
|
* Supprime un objet en relation dans l'attribut $attr de $this
|
||||||
*
|
*
|
||||||
* @param[in] $object Un objet de type $objectType à supprimer
|
* @param LSldapObject $object Un objet de type $objectType à supprimer
|
||||||
* @param[in] $attr L'attribut dans lequel l'objet doit être supprimé
|
* @param string $attr L'attribut dans lequel l'objet doit être supprimé
|
||||||
* @param[in] $objectType Le type d'objet en relation
|
* @param string $objectType Le type d'objet en relation
|
||||||
* @param[in] $attrValue La valeur que doit avoir l'attribut :
|
* @param string $attrValue La valeur que doit avoir l'attribut :
|
||||||
* - soit le dn (par defaut)
|
* - soit le dn (par defaut)
|
||||||
* - soit la valeur [0] d'un attribut
|
* - soit la valeur [0] d'un attribut
|
||||||
* @param[in] $canEditFunction Le nom de la fonction pour vérifier que la
|
* @param string $canEditFunction Le nom de la fonction pour vérifier que la
|
||||||
* relation avec l'objet est éditable par le user
|
* relation avec l'objet est éditable par le user
|
||||||
* @param[in] $attrValues L'ensembe des valeurs que peut avoir l'attribut avant mise à jour :
|
* @param array $attrValues L'ensembe des valeurs que peut avoir l'attribut avant mise à jour :
|
||||||
* - soit le dn (par defaut)
|
* - soit le dn (par defaut)
|
||||||
* - soit une des valeurs d'un attribut
|
* - soit une des valeurs d'un attribut
|
||||||
*
|
*
|
||||||
* @retval boolean true si l'objet à été supprimé, False sinon
|
* @return boolean true si l'objet à été supprimé, False sinon
|
||||||
**/
|
**/
|
||||||
public function deleteOneObjectInRelation($object,$attr,$objectType,$attrValue='dn',$canEditFunction=NULL,$attrValues=null) {
|
public function deleteOneObjectInRelation($object,$attr,$objectType,$attrValue='dn',$canEditFunction=NULL,$attrValues=null) {
|
||||||
if ((!$attr)||(!$objectType)) {
|
if ((!$attr)||(!$objectType)) {
|
||||||
|
@ -1611,16 +1611,16 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Renome un objet en relation dans l'attribut $attr de $this
|
* Renome un objet en relation dans l'attribut $attr de $this
|
||||||
*
|
*
|
||||||
* @param[in] $object Un objet de type $objectType à renomer
|
* @param LSldapObject $object Un objet de type $objectType à renomer
|
||||||
* @param[in] $oldValues array|string Le(s) ancienne(s) valeur(s possible(s)
|
* @param string|Net_LDAP2_Filter|null $additional_filter Le(s) ancienne(s) valeur(s possible(s)
|
||||||
* faisant référence à l'objet
|
* faisant référence à l'objet
|
||||||
* @param[in] $attr L'attribut dans lequel l'objet doit être supprimé
|
* @param string $attr L'attribut dans lequel l'objet doit être supprimé
|
||||||
* @param[in] $objectType Le type d'objet en relation
|
* @param string $objectType Le type d'objet en relation
|
||||||
* @param[in] $attrValue La valeur que doit avoir l'attribut :
|
* @param array $attrValue La valeur que doit avoir l'attribut :
|
||||||
* - soit le dn (par defaut)
|
* - soit le dn (par defaut)
|
||||||
* - soit la valeur [0] d'un attribut
|
* - soit la valeur [0] d'un attribut
|
||||||
*
|
*
|
||||||
* @retval boolean True en cas de succès, False sinon
|
* @return boolean True en cas de succès, False sinon
|
||||||
*/
|
*/
|
||||||
public function renameOneObjectInRelation($object, $oldValues, $attr, $objectType, $attrValue='dn') {
|
public function renameOneObjectInRelation($object, $oldValues, $attr, $objectType, $attrValue='dn') {
|
||||||
if ((!$attr)||(!$objectType)) {
|
if ((!$attr)||(!$objectType)) {
|
||||||
|
@ -1659,20 +1659,20 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
* de type $objectType en modifiant la valeur de leur attribut $attr des objets
|
* de type $objectType en modifiant la valeur de leur attribut $attr des objets
|
||||||
* en relation
|
* en relation
|
||||||
*
|
*
|
||||||
* @param[in] $object Mixed Un object (type : $this -> userObjectType) : l'utilisateur
|
* @param string $dn Un object (type : $this -> userObjectType) : l'utilisateur
|
||||||
* @param[in] $listDns Array(string) Un tableau des DNs des objets en relation
|
* @param array[string] $listDns Un tableau des DNs des objets en relation
|
||||||
* @param[in] $attr L'attribut dans lequel l'utilisateur doit apparaitre
|
* @param string $attr L'attribut dans lequel l'utilisateur doit apparaitre
|
||||||
* @param[in] $objectType Le type d'objet en relation
|
* @param string $objectType Le type d'objet en relation
|
||||||
* @param[in] $attrValue La valeur que doit avoir l'attribut :
|
* @param string $attrValue La valeur que doit avoir l'attribut :
|
||||||
* - soit le dn (par defaut)
|
* - soit le dn (par defaut)
|
||||||
* - soit la valeur [0] d'un attribut
|
* - soit la valeur [0] d'un attribut
|
||||||
* @param[in] $canEditFunction Le nom de la fonction pour vérifier que la
|
* @param string $canEditFunction Le nom de la fonction pour vérifier que la
|
||||||
* relation avec l'objet est éditable par le user
|
* relation avec l'objet est éditable par le user
|
||||||
* @param[in] $attrValues L'ensembe des valeurs que peut avoir l'attribut avant mise à jour :
|
* @param array|string $attrValues L'ensembe des valeurs que peut avoir l'attribut avant mise à jour :
|
||||||
* - soit le dn (par defaut)
|
* - soit le dn (par defaut)
|
||||||
* - soit une des valeurs d'un attribut
|
* - soit une des valeurs d'un attribut
|
||||||
*
|
*
|
||||||
* @retval boolean true si tout c'est bien passé, False sinon
|
* @return boolean true si tout c'est bien passé, False sinon
|
||||||
**/
|
**/
|
||||||
public function updateObjectsInRelation($object,$listDns,$attr,$objectType,$attrValue='dn',$canEditFunction=NULL,$attrValues=null) {
|
public function updateObjectsInRelation($object,$listDns,$attr,$objectType,$attrValue='dn',$canEditFunction=NULL,$attrValues=null) {
|
||||||
if ((!$attr)||(!$objectType)) {
|
if ((!$attr)||(!$objectType)) {
|
||||||
|
@ -1718,12 +1718,12 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Ajouter une action lors d'un événement
|
* Ajouter une action lors d'un événement
|
||||||
*
|
*
|
||||||
* @param[in] $event string Le nom de l'événement
|
* @param string $dn Le nom de l'événement
|
||||||
* @param[in] $fct string Le nom de la fonction à exectuer
|
* @param string $dn Le nom de la fonction à exectuer
|
||||||
* @param[in] $param mixed Paramètre pour le lancement de la fonction
|
* @param string $dn Paramètre pour le lancement de la fonction
|
||||||
* @param[in] $class Nom de la classe possèdant la méthode $fct à executer
|
* @param string $class Nom de la classe possèdant la méthode $fct à executer
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function addEvent($event,$fct,$param=NULL,$class=NULL) {
|
public function addEvent($event,$fct,$param=NULL,$class=NULL) {
|
||||||
$this -> _events[$event][] = array(
|
$this -> _events[$event][] = array(
|
||||||
|
@ -1736,12 +1736,12 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Ajouter une action sur un objet lors d'un événement
|
* Ajouter une action sur un objet lors d'un événement
|
||||||
*
|
*
|
||||||
* @param[in] $event string Le nom de l'événement
|
* @param string $dn Le nom de l'événement
|
||||||
* @param[in] $obj object L'objet dont la méthode doit être executé
|
* @param object $obj L'objet dont la méthode doit être executé
|
||||||
* @param[in] $meth string Le nom de la méthode
|
* @param string $dn Le nom de la méthode
|
||||||
* @param[in] $param mixed Paramètre d'execution de la méthode
|
* @param string $dn Paramètre d'execution de la méthode
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function addObjectEvent($event,&$obj,$meth,$param=NULL) {
|
public function addObjectEvent($event,&$obj,$meth,$param=NULL) {
|
||||||
$this -> _objectEvents[$event][] = array(
|
$this -> _objectEvents[$event][] = array(
|
||||||
|
@ -1754,9 +1754,9 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Lance les actions à executer lors d'un événement
|
* Lance les actions à executer lors d'un événement
|
||||||
*
|
*
|
||||||
* @param[in] $event string Le nom de l'événement
|
* @param string $dn Le nom de l'événement
|
||||||
*
|
*
|
||||||
* @retval boolean True si tout c'est bien passé, false sinon
|
* @return boolean True si tout c'est bien passé, false sinon
|
||||||
*/
|
*/
|
||||||
public function fireEvent($event) {
|
public function fireEvent($event) {
|
||||||
self :: log_debug(strval($this)." -> fireEvent($event)");
|
self :: log_debug(strval($this)." -> fireEvent($event)");
|
||||||
|
@ -1858,9 +1858,9 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Lance les actions à executer lors d'un événement sur l'objet lui-même
|
* Lance les actions à executer lors d'un événement sur l'objet lui-même
|
||||||
*
|
*
|
||||||
* @param[in] $event string Le nom de l'événement
|
* @param string $dn Le nom de l'événement
|
||||||
*
|
*
|
||||||
* @retval boolean True si tout c'est bien passé, false sinon
|
* @return boolean True si tout c'est bien passé, false sinon
|
||||||
**/
|
**/
|
||||||
public function fireObjectEvent($event) {
|
public function fireObjectEvent($event) {
|
||||||
switch($event) {
|
switch($event) {
|
||||||
|
@ -1891,9 +1891,9 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Access to infos of the object
|
* Access to infos of the object
|
||||||
*
|
*
|
||||||
* @param[in] $key string The name of the value
|
* @param string $dn The name of the value
|
||||||
*
|
*
|
||||||
* @retval mixed The value
|
* @return mixed The value
|
||||||
**/
|
**/
|
||||||
public function __get($key) {
|
public function __get($key) {
|
||||||
if ($key=='subDnValue') {
|
if ($key=='subDnValue') {
|
||||||
|
@ -1928,7 +1928,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check if object type have a specified attribute
|
* Check if object type have a specified attribute
|
||||||
*
|
*
|
||||||
* @param[in] $attr_name string The attribute name
|
* @param string $dn The attribute name
|
||||||
*
|
*
|
||||||
* @teval boolean True if object type have a attribute of this name, False otherwise
|
* @teval boolean True if object type have a attribute of this name, False otherwise
|
||||||
*/
|
*/
|
||||||
|
@ -1939,7 +1939,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* List IOformats of this object type
|
* List IOformats of this object type
|
||||||
*
|
*
|
||||||
* @retval mixed Array of valid IOformats of this object type
|
* @return mixed Array of valid IOformats of this object type
|
||||||
**/
|
**/
|
||||||
public function listValidIOformats() {
|
public function listValidIOformats() {
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
@ -1955,9 +1955,9 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check if an IOformat is valid for this object type
|
* Check if an IOformat is valid for this object type
|
||||||
*
|
*
|
||||||
* @param[in] $f string The IOformat name to check
|
* @param string $dn The IOformat name to check
|
||||||
*
|
*
|
||||||
* @retval boolean True if it's a valid IOformat, false otherwise
|
* @return boolean True if it's a valid IOformat, false otherwise
|
||||||
**/
|
**/
|
||||||
public function isValidIOformat($f) {
|
public function isValidIOformat($f) {
|
||||||
return is_array($this -> getConfig("ioFormat.$f"));
|
return is_array($this -> getConfig("ioFormat.$f"));
|
||||||
|
@ -1970,7 +1970,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
* @param[] $default The default value (default : null)
|
* @param[] $default The default value (default : null)
|
||||||
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
||||||
*
|
*
|
||||||
* @retval mixed The configuration parameter value or default value if not set
|
* @return mixed The configuration parameter value or default value if not set
|
||||||
**/
|
**/
|
||||||
public function getConfig($param, $default=null, $cast=null) {
|
public function getConfig($param, $default=null, $cast=null) {
|
||||||
return LSconfig :: get($param, $default, $cast, $this -> config);
|
return LSconfig :: get($param, $default, $cast, $this -> config);
|
||||||
|
@ -1979,7 +1979,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Allow conversion of LdapObject to string
|
* Allow conversion of LdapObject to string
|
||||||
*
|
*
|
||||||
* @retval string The string representation of the LdapObject
|
* @return string The string representation of the LdapObject
|
||||||
*/
|
*/
|
||||||
public function __toString() {
|
public function __toString() {
|
||||||
return $this -> toString(true);
|
return $this -> toString(true);
|
||||||
|
@ -1988,9 +1988,9 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return string representation of the object
|
* Return string representation of the object
|
||||||
*
|
*
|
||||||
* @param[in] $enclosed boolean If true, result will be enclosed using "< >" (optional, default: true)
|
* @param boolean $api_mode If true, result will be enclosed using "< >" (optional, default: true)
|
||||||
*
|
*
|
||||||
* @retval string The string representation of the LdapObject
|
* @return string The string representation of the LdapObject
|
||||||
*/
|
*/
|
||||||
public function toString($enclosed=true) {
|
public function toString($enclosed=true) {
|
||||||
$str = "LdapObject ".$this -> getType();
|
$str = "LdapObject ".$this -> getType();
|
||||||
|
@ -2013,14 +2013,14 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* CLI show command
|
* CLI show command
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array Command arguments :
|
* @param string $dn Command arguments :
|
||||||
* - Positional arguments :
|
* - Positional arguments :
|
||||||
* - LSobject type
|
* - LSobject type
|
||||||
* - object DN
|
* - object DN
|
||||||
* - Optional arguments :
|
* - Optional arguments :
|
||||||
* - -r|--raw-values : show raw values (instead of display ones)
|
* - -r|--raw-values : show raw values (instead of display ones)
|
||||||
*
|
*
|
||||||
* @retval boolean True on success, false otherwise
|
* @return boolean True on success, false otherwise
|
||||||
**/
|
**/
|
||||||
public static function cli_show($command_args) {
|
public static function cli_show($command_args) {
|
||||||
$objType = null;
|
$objType = null;
|
||||||
|
@ -2067,12 +2067,12 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Args autocompleter for CLI show search
|
* Args autocompleter for CLI show search
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array List of already typed words of the command
|
* @param string $dn List of already typed words of the command
|
||||||
* @param[in] $comp_word_num int The command word number to autocomplete
|
* @param string $dn The command word number to autocomplete
|
||||||
* @param[in] $comp_word string The command word to autocomplete
|
* @param string $dn The command word to autocomplete
|
||||||
* @param[in] $opts array List of global available options
|
* @param string $dn List of global available options
|
||||||
*
|
*
|
||||||
* @retval array List of available options for the word to autocomplete
|
* @return array List of available options for the word to autocomplete
|
||||||
**/
|
**/
|
||||||
public static function cli_show_args_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
public static function cli_show_args_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
||||||
$opts = array_merge($opts, array ('-r', '--raw-values', '-j', '--json', '-p', '--pretty'));
|
$opts = array_merge($opts, array ('-r', '--raw-values', '-j', '--json', '-p', '--pretty'));
|
||||||
|
@ -2121,9 +2121,9 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* CLI helper to show the object info
|
* CLI helper to show the object info
|
||||||
*
|
*
|
||||||
* @param[in] $raw_values bool Show attributes raw values (instead of display ones)
|
* @param string $dn Show attributes raw values (instead of display ones)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function _cli_show($raw_values=false) {
|
public function _cli_show($raw_values=false) {
|
||||||
echo $this -> type_name." (".($this -> dn?$this -> dn:'new').") :\n";
|
echo $this -> type_name." (".($this -> dn?$this -> dn:'new').") :\n";
|
||||||
|
@ -2170,11 +2170,11 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* CLI helper to show the attribute
|
* CLI helper to show the attribute
|
||||||
*
|
*
|
||||||
* @param[in] $attr_name string The attribute name
|
* @param string $dn The attribute name
|
||||||
* @param[in] $raw_values bool Show attributes raw values (instead of display ones)
|
* @param string $dn Show attributes raw values (instead of display ones)
|
||||||
* @param[in] $prefix string Prefix for each line displayed (optional, default: no prefix)
|
* @param string $dn Prefix for each line displayed (optional, default: no prefix)
|
||||||
*
|
*
|
||||||
* @retval string The formated attribute message
|
* @return string The formated attribute message
|
||||||
**/
|
**/
|
||||||
private function _cli_show_attr($attr_name, $raw_values=false, $prefix="") {
|
private function _cli_show_attr($attr_name, $raw_values=false, $prefix="") {
|
||||||
if (!isset($this -> attrs[$attr_name]))
|
if (!isset($this -> attrs[$attr_name]))
|
||||||
|
@ -2186,11 +2186,11 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* CLI helper to show the attribute values
|
* CLI helper to show the attribute values
|
||||||
*
|
*
|
||||||
* @param[in] $attr_name string The attribute name
|
* @param string $dn The attribute name
|
||||||
* @param[in] $values array Attribute values
|
* @param string $dn Attribute values
|
||||||
* @param[in] $prefix string Prefix for each line displayed (optional, default: no prefix)
|
* @param string $dn Prefix for each line displayed (optional, default: no prefix)
|
||||||
*
|
*
|
||||||
* @retval string The formated attribute values message
|
* @return string The formated attribute values message
|
||||||
**/
|
**/
|
||||||
private function _cli_show_attr_values($attr_name, $values, $prefix="") {
|
private function _cli_show_attr_values($attr_name, $values, $prefix="") {
|
||||||
$return = "$prefix - ".$this -> attrs[$attr_name]->getLabel()." ($attr_name) :";
|
$return = "$prefix - ".$this -> attrs[$attr_name]->getLabel()." ($attr_name) :";
|
||||||
|
@ -2211,11 +2211,11 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* CLI helper to show the attributes values
|
* CLI helper to show the attributes values
|
||||||
*
|
*
|
||||||
* @param[in] $attrs_values attrs The attributes values
|
* @param array $attrs_values attrs The attributes values
|
||||||
* @param[in] $label string|null The label text to show before attributes values
|
* @param string|Net_LDAP2_Filter|null $additional_filter The label text to show before attributes values
|
||||||
* @param[in] $prefix string Prefix for each line displayed (optional, default: no prefix)
|
* @param string $dn Prefix for each line displayed (optional, default: no prefix)
|
||||||
*
|
*
|
||||||
* @retval string The formated attributes values message
|
* @return string The formated attributes values message
|
||||||
**/
|
**/
|
||||||
private function _cli_show_attrs_values($attrs_values, $label=null, $prefix="") {
|
private function _cli_show_attrs_values($attrs_values, $label=null, $prefix="") {
|
||||||
$return = "";
|
$return = "";
|
||||||
|
@ -2230,10 +2230,10 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* CLI helper to export the object info as JSON
|
* CLI helper to export the object info as JSON
|
||||||
*
|
*
|
||||||
* @param[in] $raw_values bool Export attributes raw values (instead of display ones)
|
* @param string $dn Export attributes raw values (instead of display ones)
|
||||||
* @param[in] $pretty bool Prettify JSON export
|
* @param string $dn Prettify JSON export
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
private function _cli_json_export($raw_values=false, $pretty=false) {
|
private function _cli_json_export($raw_values=false, $pretty=false) {
|
||||||
$export = array(
|
$export = array(
|
||||||
|
@ -2293,14 +2293,14 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* CLI remove command
|
* CLI remove command
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array Command arguments :
|
* @param string $dn Command arguments :
|
||||||
* - Positional arguments :
|
* - Positional arguments :
|
||||||
* - LSobject type
|
* - LSobject type
|
||||||
* - object DN
|
* - object DN
|
||||||
* - Optional arguments :
|
* - Optional arguments :
|
||||||
* - -N|--no-confirm : Do not ask for confirmation
|
* - -N|--no-confirm : Do not ask for confirmation
|
||||||
*
|
*
|
||||||
* @retval boolean True on success, false otherwise
|
* @return boolean True on success, false otherwise
|
||||||
**/
|
**/
|
||||||
public static function cli_remove($command_args) {
|
public static function cli_remove($command_args) {
|
||||||
$objType = null;
|
$objType = null;
|
||||||
|
@ -2349,12 +2349,12 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Args autocompleter for CLI remove command
|
* Args autocompleter for CLI remove command
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array List of already typed words of the command
|
* @param string $dn List of already typed words of the command
|
||||||
* @param[in] $comp_word_num int The command word number to autocomplete
|
* @param string $dn The command word number to autocomplete
|
||||||
* @param[in] $comp_word string The command word to autocomplete
|
* @param string $dn The command word to autocomplete
|
||||||
* @param[in] $opts array List of global available options
|
* @param string $dn List of global available options
|
||||||
*
|
*
|
||||||
* @retval array List of available options for the word to autocomplete
|
* @return array List of available options for the word to autocomplete
|
||||||
**/
|
**/
|
||||||
public static function cli_remove_args_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
public static function cli_remove_args_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
||||||
$opts = array_merge($opts, array ('-N', '--no-confirm'));
|
$opts = array_merge($opts, array ('-N', '--no-confirm'));
|
||||||
|
@ -2405,12 +2405,12 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* attr=value1|value2
|
* attr=value1|value2
|
||||||
*
|
*
|
||||||
* @param[in] $obj LSldapObject The LDAP object
|
* @param LSattribute &$attr The LDAP object
|
||||||
* @param[in] &$attrs_values array The reference of the array that store attributes values
|
* @param array &$attrs_values The reference of the array that store attributes values
|
||||||
* @param[in] $command_arg string The command argument to parse
|
* @param string $dn The command argument to parse
|
||||||
* @param[in] $delimiter string The delimiter of multiple-value attribute (optional, default: '|')
|
* @param string $dn The delimiter of multiple-value attribute (optional, default: '|')
|
||||||
*
|
*
|
||||||
* @retval boolean True if attribute values successfully parsed, False otherwise
|
* @return boolean True if attribute values successfully parsed, False otherwise
|
||||||
**/
|
**/
|
||||||
function _cli_parse_attr_values($obj, &$attrs_values, $command_arg, $delimiter='|') {
|
function _cli_parse_attr_values($obj, &$attrs_values, $command_arg, $delimiter='|') {
|
||||||
$arg_parts = explode('=', $command_arg);
|
$arg_parts = explode('=', $command_arg);
|
||||||
|
@ -2435,7 +2435,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* CLI create command
|
* CLI create command
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array Command arguments :
|
* @param string $dn Command arguments :
|
||||||
* - Positional arguments :
|
* - Positional arguments :
|
||||||
* - LSobject type
|
* - LSobject type
|
||||||
* - object DN
|
* - object DN
|
||||||
|
@ -2449,7 +2449,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
* Note: for multiple-values attributes, you also could specify attribute and value
|
* Note: for multiple-values attributes, you also could specify attribute and value
|
||||||
* multiple time, for instance : attr1=value1 attr1=value2
|
* multiple time, for instance : attr1=value1 attr1=value2
|
||||||
*
|
*
|
||||||
* @retval boolean True on success, false otherwise
|
* @return boolean True on success, false otherwise
|
||||||
**/
|
**/
|
||||||
public static function cli_create($command_args) {
|
public static function cli_create($command_args) {
|
||||||
$objType = $obj = null;
|
$objType = $obj = null;
|
||||||
|
@ -2536,12 +2536,12 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Args autocompleter for CLI create command
|
* Args autocompleter for CLI create command
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array List of already typed words of the command
|
* @param string $dn List of already typed words of the command
|
||||||
* @param[in] $comp_word_num int The command word number to autocomplete
|
* @param string $dn The command word number to autocomplete
|
||||||
* @param[in] $comp_word string The command word to autocomplete
|
* @param string $dn The command word to autocomplete
|
||||||
* @param[in] $opts array List of global available options
|
* @param string $dn List of global available options
|
||||||
*
|
*
|
||||||
* @retval array List of available options for the word to autocomplete
|
* @return array List of available options for the word to autocomplete
|
||||||
**/
|
**/
|
||||||
public static function cli_create_args_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
public static function cli_create_args_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
||||||
$opts = array_merge($opts, array ('-j', '--just-try', '-D', '--delimiter', '-N', '--no-confirm'));
|
$opts = array_merge($opts, array ('-j', '--just-try', '-D', '--delimiter', '-N', '--no-confirm'));
|
||||||
|
@ -2600,7 +2600,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* CLI modify command
|
* CLI modify command
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array Command arguments :
|
* @param string $dn Command arguments :
|
||||||
* - Positional arguments :
|
* - Positional arguments :
|
||||||
* - LSobject type
|
* - LSobject type
|
||||||
* - object DN
|
* - object DN
|
||||||
|
@ -2613,7 +2613,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
* Note: for multiple-values attributes, you also could specify attribute and value
|
* Note: for multiple-values attributes, you also could specify attribute and value
|
||||||
* multiple time, for instance : attr1=value1 attr1=value2
|
* multiple time, for instance : attr1=value1 attr1=value2
|
||||||
*
|
*
|
||||||
* @retval boolean True on success, false otherwise
|
* @return boolean True on success, false otherwise
|
||||||
**/
|
**/
|
||||||
public static function cli_modify($command_args) {
|
public static function cli_modify($command_args) {
|
||||||
$objType = $obj = null;
|
$objType = $obj = null;
|
||||||
|
@ -2705,12 +2705,12 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Args autocompleter for CLI modify command
|
* Args autocompleter for CLI modify command
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array List of already typed words of the command
|
* @param string $dn List of already typed words of the command
|
||||||
* @param[in] $comp_word_num int The command word number to autocomplete
|
* @param string $dn The command word number to autocomplete
|
||||||
* @param[in] $comp_word string The command word to autocomplete
|
* @param string $dn The command word to autocomplete
|
||||||
* @param[in] $opts array List of global available options
|
* @param string $dn List of global available options
|
||||||
*
|
*
|
||||||
* @retval array List of available options for the word to autocomplete
|
* @return array List of available options for the word to autocomplete
|
||||||
**/
|
**/
|
||||||
public static function cli_modify_args_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
public static function cli_modify_args_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
||||||
$opts = array_merge($opts, array ('-j', '--just-try', '-D', '--delimiter', '-N', '--no-confirm'));
|
$opts = array_merge($opts, array ('-j', '--just-try', '-D', '--delimiter', '-N', '--no-confirm'));
|
||||||
|
@ -2785,7 +2785,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* CLI relation command
|
* CLI relation command
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array Command arguments :
|
* @param string $dn Command arguments :
|
||||||
* - Positional arguments :
|
* - Positional arguments :
|
||||||
* - LSobject type
|
* - LSobject type
|
||||||
* - object DN
|
* - object DN
|
||||||
|
@ -2794,7 +2794,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
* - -a|--add : Add related object (specified by DN)
|
* - -a|--add : Add related object (specified by DN)
|
||||||
* - -r|--remove : Remove related object (specified by DN)
|
* - -r|--remove : Remove related object (specified by DN)
|
||||||
*
|
*
|
||||||
* @retval boolean True on success, false otherwise
|
* @return boolean True on success, false otherwise
|
||||||
**/
|
**/
|
||||||
public static function cli_relation($command_args) {
|
public static function cli_relation($command_args) {
|
||||||
$objType = null;
|
$objType = null;
|
||||||
|
@ -2917,12 +2917,12 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Args autocompleter for CLI relation command
|
* Args autocompleter for CLI relation command
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array List of already typed words of the command
|
* @param string $dn List of already typed words of the command
|
||||||
* @param[in] $comp_word_num int The command word number to autocomplete
|
* @param string $dn The command word number to autocomplete
|
||||||
* @param[in] $comp_word string The command word to autocomplete
|
* @param string $dn The command word to autocomplete
|
||||||
* @param[in] $opts array List of global available options
|
* @param string $dn List of global available options
|
||||||
*
|
*
|
||||||
* @retval array List of available options for the word to autocomplete
|
* @return array List of available options for the word to autocomplete
|
||||||
**/
|
**/
|
||||||
public static function cli_relation_args_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
public static function cli_relation_args_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
||||||
$opts = array_merge($opts, array ('-a', '--add', '-r', '--remove'));
|
$opts = array_merge($opts, array ('-a', '--add', '-r', '--remove'));
|
||||||
|
@ -3045,9 +3045,9 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
* A LSobjet type name must only contain letter, digits or dash or
|
* A LSobjet type name must only contain letter, digits or dash or
|
||||||
* underscore.
|
* underscore.
|
||||||
*
|
*
|
||||||
* @param[in] $name string The LSobject type name to check
|
* @param string $dn The LSobject type name to check
|
||||||
*
|
*
|
||||||
* @retval boolean True is type name is valid, False otherwise
|
* @return boolean True is type name is valid, False otherwise
|
||||||
*/
|
*/
|
||||||
public static function isValidTypeName($name) {
|
public static function isValidTypeName($name) {
|
||||||
if (preg_match('/^[a-zA-Z0-9\_\-]+$/', $name))
|
if (preg_match('/^[a-zA-Z0-9\_\-]+$/', $name))
|
||||||
|
|
|
@ -60,7 +60,7 @@ class LSlog {
|
||||||
/**
|
/**
|
||||||
* Start/initialize logging
|
* Start/initialize logging
|
||||||
*
|
*
|
||||||
* @retval bool True on success, False otherwise
|
* @return bool True on success, False otherwise
|
||||||
**/
|
**/
|
||||||
public static function start() {
|
public static function start() {
|
||||||
// Load configuration
|
// Load configuration
|
||||||
|
@ -98,10 +98,10 @@ class LSlog {
|
||||||
/**
|
/**
|
||||||
* Add handler
|
* Add handler
|
||||||
*
|
*
|
||||||
* @param[in] $handler string The handler name
|
* @param string $handler The handler name
|
||||||
* @param[in] $handler_config array The handler configuration (optional)
|
* @param array $handler_config The handler configuration (optional)
|
||||||
*
|
*
|
||||||
* @retval boolean True if handler added, false otherwise
|
* @return boolean True if handler added, false otherwise
|
||||||
**/
|
**/
|
||||||
public static function add_handler($handler, $handler_config = array()) {
|
public static function add_handler($handler, $handler_config = array()) {
|
||||||
if (!LSconfig :: get('enabled', true, 'bool', $handler_config))
|
if (!LSconfig :: get('enabled', true, 'bool', $handler_config))
|
||||||
|
@ -126,9 +126,9 @@ class LSlog {
|
||||||
/**
|
/**
|
||||||
* Enable console handler (if not already enabled)
|
* Enable console handler (if not already enabled)
|
||||||
*
|
*
|
||||||
* @param[in] $level string|null The log level of the console handler
|
* @param string|null $level The log level of the console handler
|
||||||
*
|
*
|
||||||
* @retval boolean True if log on console enabled, false otherwise
|
* @return boolean True if log on console enabled, false otherwise
|
||||||
**/
|
**/
|
||||||
public static function logOnConsole($level=null) {
|
public static function logOnConsole($level=null) {
|
||||||
for ($i=0; $i < count(self :: $handlers); $i++) {
|
for ($i=0; $i < count(self :: $handlers); $i++) {
|
||||||
|
@ -144,7 +144,7 @@ class LSlog {
|
||||||
/**
|
/**
|
||||||
* Disable console handler (if already enabled)
|
* Disable console handler (if already enabled)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function disableLogOnConsole() {
|
public static function disableLogOnConsole() {
|
||||||
for ($i=0; $i < count(self :: $handlers); $i++) {
|
for ($i=0; $i < count(self :: $handlers); $i++) {
|
||||||
|
@ -158,9 +158,9 @@ class LSlog {
|
||||||
/**
|
/**
|
||||||
* Set log level
|
* Set log level
|
||||||
*
|
*
|
||||||
* @param[in] $level string|null The log level (optional, default: from configuration or 'WARNING')
|
* @param string|null $level The log level (optional, default: from configuration or 'WARNING')
|
||||||
*
|
*
|
||||||
* @retval boolean True if log level set, false otherwise
|
* @return boolean True if log level set, false otherwise
|
||||||
**/
|
**/
|
||||||
public static function setLevel($level=null) {
|
public static function setLevel($level=null) {
|
||||||
if (!$level) {
|
if (!$level) {
|
||||||
|
@ -187,14 +187,14 @@ class LSlog {
|
||||||
/**
|
/**
|
||||||
* Get a configuration variable value
|
* Get a configuration variable value
|
||||||
*
|
*
|
||||||
* @param[in] $var string The configuration variable name
|
* @param string $var The configuration variable name
|
||||||
* @param[in] $default mixed The default value to return if configuration variable
|
* @param mixed $default The default value to return if configuration variable
|
||||||
* is not set (Default : null)
|
* is not set (Default : null)
|
||||||
* @param[in] $cast string The type of expected value. The configuration variable
|
* @param string $cast The type of expected value. The configuration variable
|
||||||
* value will be cast as this type. Could be : bool, int,
|
* value will be cast as this type. Could be : bool, int,
|
||||||
* float or string. (Optional, default : raw value)
|
* float or string. (Optional, default : raw value)
|
||||||
*
|
*
|
||||||
* @retval mixed The configuration variable value
|
* @return mixed The configuration variable value
|
||||||
**/
|
**/
|
||||||
public static function getConfig($var, $default=null, $cast=null) {
|
public static function getConfig($var, $default=null, $cast=null) {
|
||||||
return LSconfig :: get($var, $default, $cast, ((isset($GLOBALS['LSlog']) && is_array($GLOBALS['LSlog']))?$GLOBALS['LSlog']:array()));
|
return LSconfig :: get($var, $default, $cast, ((isset($GLOBALS['LSlog']) && is_array($GLOBALS['LSlog']))?$GLOBALS['LSlog']:array()));
|
||||||
|
@ -203,11 +203,11 @@ class LSlog {
|
||||||
/**
|
/**
|
||||||
* Log a message
|
* Log a message
|
||||||
*
|
*
|
||||||
* @param[in] $level string The message level
|
* @param string $level The message level
|
||||||
* @param[in] $message string The message
|
* @param string $message The message
|
||||||
* @param[in] $logger string|null The logger name (optional, default: null)
|
* @param string|null $logger The logger name (optional, default: null)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function logging($level, $message, $logger=null) {
|
public static function logging($level, $message, $logger=null) {
|
||||||
// Check LSlog is enabled
|
// Check LSlog is enabled
|
||||||
|
@ -251,10 +251,10 @@ class LSlog {
|
||||||
/**
|
/**
|
||||||
* Check level against configured level
|
* Check level against configured level
|
||||||
*
|
*
|
||||||
* @param[in] $level string The level
|
* @param string $level The level
|
||||||
* @param[in] $configured_level string|null The configured level (optional, default : self :: $level)
|
* @param string|null $configured_level The configured level (optional, default : self :: $level)
|
||||||
*
|
*
|
||||||
* @retval bool True if a message with this level have to be logged, False otherwise
|
* @return bool True if a message with this level have to be logged, False otherwise
|
||||||
**/
|
**/
|
||||||
public static function checkLevel($level, $configured_level=null) {
|
public static function checkLevel($level, $configured_level=null) {
|
||||||
if (is_null($configured_level) || !array_key_exists($configured_level, self :: $levels))
|
if (is_null($configured_level) || !array_key_exists($configured_level, self :: $levels))
|
||||||
|
@ -270,9 +270,9 @@ class LSlog {
|
||||||
/**
|
/**
|
||||||
* Check if a log level exists
|
* Check if a log level exists
|
||||||
*
|
*
|
||||||
* @param[in] $level string The level
|
* @param string $level The level
|
||||||
*
|
*
|
||||||
* @retval bool True if the specified log level exists, False otherwise
|
* @return bool True if the specified log level exists, False otherwise
|
||||||
**/
|
**/
|
||||||
public static function checkLevelExists($level) {
|
public static function checkLevelExists($level) {
|
||||||
return array_key_exists($level, self :: $levels);
|
return array_key_exists($level, self :: $levels);
|
||||||
|
@ -285,7 +285,7 @@ class LSlog {
|
||||||
/**
|
/**
|
||||||
* Generate current context backtrace
|
* Generate current context backtrace
|
||||||
*
|
*
|
||||||
* @retval string Current context backtrace
|
* @return string Current context backtrace
|
||||||
**/
|
**/
|
||||||
public static function get_debug_backtrace_context() {
|
public static function get_debug_backtrace_context() {
|
||||||
$traces = debug_backtrace();
|
$traces = debug_backtrace();
|
||||||
|
@ -315,12 +315,12 @@ class LSlog {
|
||||||
* Could be used as PHP set_exception_handler callable
|
* Could be used as PHP set_exception_handler callable
|
||||||
* @see https://www.php.net/set_exception_handler
|
* @see https://www.php.net/set_exception_handler
|
||||||
*
|
*
|
||||||
* @param[in] $exception Exception The exception to log
|
* @param Exception $exceptionThe exception to log
|
||||||
* @param[in] $prefix string|null Custom message prefix (optional, default: "An exception occured :\n")
|
* @param string|null $prefix Custom message prefix (optional, default: "An exception occured :\n")
|
||||||
* @param[in] $fatal boolean Log exception as a fatal error (optional, default: true)
|
* @param boolean $fatal Log exception as a fatal error (optional, default: true)
|
||||||
* @param[in] $logger string|null The logger name (optional, default: null)
|
* @param string|null $logger The logger name (optional, default: null)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function exception($exception, $prefix=null, $fatal=true, $logger=null) {
|
public static function exception($exception, $prefix=null, $fatal=true, $logger=null) {
|
||||||
$message =
|
$message =
|
||||||
|
@ -386,9 +386,9 @@ class LSlog {
|
||||||
/**
|
/**
|
||||||
* Get logger for a specific name
|
* Get logger for a specific name
|
||||||
*
|
*
|
||||||
* @param[in] $name The logger name
|
* @param string $name The logger name
|
||||||
*
|
*
|
||||||
* @retval LSlog_logger The logger
|
* @return LSlog_logger The logger
|
||||||
**/
|
**/
|
||||||
public static function &get_logger($name) {
|
public static function &get_logger($name) {
|
||||||
if (!LSsession :: loadLSclass('LSlog_logger'))
|
if (!LSsession :: loadLSclass('LSlog_logger'))
|
||||||
|
@ -409,9 +409,9 @@ class LSlog {
|
||||||
/**
|
/**
|
||||||
* Log a message with level TRACE
|
* Log a message with level TRACE
|
||||||
*
|
*
|
||||||
* @param[in] $message The message to log
|
* @param string $message The message to log
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function trace($message) {
|
public static function trace($message) {
|
||||||
self :: logging('TRACE', $message);
|
self :: logging('TRACE', $message);
|
||||||
|
@ -420,9 +420,9 @@ class LSlog {
|
||||||
/**
|
/**
|
||||||
* Log a message with level DEBUG
|
* Log a message with level DEBUG
|
||||||
*
|
*
|
||||||
* @param[in] $message The message to log
|
* @param string $message The message to log
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function debug($message) {
|
public static function debug($message) {
|
||||||
self :: logging('DEBUG', $message);
|
self :: logging('DEBUG', $message);
|
||||||
|
@ -431,9 +431,9 @@ class LSlog {
|
||||||
/**
|
/**
|
||||||
* Log a message with level INFO
|
* Log a message with level INFO
|
||||||
*
|
*
|
||||||
* @param[in] $message The message to log
|
* @param string $message The message to log
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function info($message) {
|
public static function info($message) {
|
||||||
self :: logging('INFO', $message);
|
self :: logging('INFO', $message);
|
||||||
|
@ -442,9 +442,9 @@ class LSlog {
|
||||||
/**
|
/**
|
||||||
* Log a message with level WARNING
|
* Log a message with level WARNING
|
||||||
*
|
*
|
||||||
* @param[in] $message The message to log
|
* @param string $message The message to log
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function warning($message) {
|
public static function warning($message) {
|
||||||
self :: logging('WARNING', $message);
|
self :: logging('WARNING', $message);
|
||||||
|
@ -453,9 +453,9 @@ class LSlog {
|
||||||
/**
|
/**
|
||||||
* Log a message with level ERROR
|
* Log a message with level ERROR
|
||||||
*
|
*
|
||||||
* @param[in] $message The message to log
|
* @param string $message The message to log
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function error($message) {
|
public static function error($message) {
|
||||||
self :: logging('ERROR', $message);
|
self :: logging('ERROR', $message);
|
||||||
|
@ -464,9 +464,9 @@ class LSlog {
|
||||||
/**
|
/**
|
||||||
* Log a message with level FATAL
|
* Log a message with level FATAL
|
||||||
*
|
*
|
||||||
* @param[in] $message The message to log
|
* @param string $message The message to log
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function fatal($message) {
|
public static function fatal($message) {
|
||||||
self :: logging('FATAL', $message);
|
self :: logging('FATAL', $message);
|
||||||
|
|
|
@ -34,9 +34,9 @@ class LSlog_console extends LSlog_handler {
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param[in] $config array The handler configuration
|
* @param array $config The handler configuration
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function __construct($config) {
|
public function __construct($config) {
|
||||||
parent :: __construct($config);
|
parent :: __construct($config);
|
||||||
|
@ -49,11 +49,11 @@ class LSlog_console extends LSlog_handler {
|
||||||
/**
|
/**
|
||||||
* Log a message
|
* Log a message
|
||||||
*
|
*
|
||||||
* @param[in] $level string The message level
|
* @param array $config The message level
|
||||||
* @param[in] $message string The message
|
* @param array $config The message
|
||||||
* @param[in] $logger string|null The logger name (optional, default: null)
|
* @param string|null $logger The logger name (optional, default: null)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function logging($level, $message, $logger=null) {
|
public function logging($level, $message, $logger=null) {
|
||||||
return fwrite(
|
return fwrite(
|
||||||
|
|
|
@ -36,9 +36,9 @@ class LSlog_email extends LSlog_handler {
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param[in] $config array The handler configuration
|
* @param array $config The handler configuration
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function __construct($config) {
|
public function __construct($config) {
|
||||||
parent :: __construct($config);
|
parent :: __construct($config);
|
||||||
|
@ -50,7 +50,7 @@ class LSlog_email extends LSlog_handler {
|
||||||
/**
|
/**
|
||||||
* Return list of details for the string representation of the LSlog_email
|
* Return list of details for the string representation of the LSlog_email
|
||||||
*
|
*
|
||||||
* @retval array List of details for the string representation of the LSlog_email
|
* @return array List of details for the string representation of the LSlog_email
|
||||||
*/
|
*/
|
||||||
public function __toStringDetails() {
|
public function __toStringDetails() {
|
||||||
return array_merge(
|
return array_merge(
|
||||||
|
@ -62,11 +62,11 @@ class LSlog_email extends LSlog_handler {
|
||||||
/**
|
/**
|
||||||
* Log a message
|
* Log a message
|
||||||
*
|
*
|
||||||
* @param[in] $level string The message level
|
* @param array $config The message level
|
||||||
* @param[in] $message string The message
|
* @param array $config The message
|
||||||
* @param[in] $logger string|null The logger name (optional, default: null)
|
* @param string|null $logger The logger name (optional, default: null)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function logging($level, $message, $logger=null) {
|
public function logging($level, $message, $logger=null) {
|
||||||
if ($this -> recipient)
|
if ($this -> recipient)
|
||||||
|
|
|
@ -33,9 +33,9 @@ class LSlog_file extends LSlog_handler {
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param[in] $config array The handler configuration
|
* @param array $config The handler configuration
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function __construct($config) {
|
public function __construct($config) {
|
||||||
parent :: __construct($config);
|
parent :: __construct($config);
|
||||||
|
@ -50,7 +50,7 @@ class LSlog_file extends LSlog_handler {
|
||||||
/**
|
/**
|
||||||
* Return list of details for the string representation of the LSlog_file
|
* Return list of details for the string representation of the LSlog_file
|
||||||
*
|
*
|
||||||
* @retval array List of details for the string representation of the LSlog_file
|
* @return array List of details for the string representation of the LSlog_file
|
||||||
*/
|
*/
|
||||||
public function __toStringDetails() {
|
public function __toStringDetails() {
|
||||||
return array_merge(
|
return array_merge(
|
||||||
|
@ -62,11 +62,11 @@ class LSlog_file extends LSlog_handler {
|
||||||
/**
|
/**
|
||||||
* Log a message
|
* Log a message
|
||||||
*
|
*
|
||||||
* @param[in] $level string The message level
|
* @param array $config The message level
|
||||||
* @param[in] $message string The message
|
* @param array $config The message
|
||||||
* @param[in] $logger string|null The logger name (optional, default: null)
|
* @param string|null $logger The logger name (optional, default: null)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function logging($level, $message, $logger=null) {
|
public function logging($level, $message, $logger=null) {
|
||||||
return error_log(
|
return error_log(
|
||||||
|
|
|
@ -52,9 +52,9 @@ class LSlog_handler extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param[in] $config array The handler configuration
|
* @param array $config The handler configuration
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function __construct($config) {
|
public function __construct($config) {
|
||||||
$this -> config = $config;
|
$this -> config = $config;
|
||||||
|
@ -70,7 +70,7 @@ class LSlog_handler extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Allow conversion of LSlog_handler to string
|
* Allow conversion of LSlog_handler to string
|
||||||
*
|
*
|
||||||
* @retval string The string representation of the LSlog_handler
|
* @return string The string representation of the LSlog_handler
|
||||||
*/
|
*/
|
||||||
public function __toString() {
|
public function __toString() {
|
||||||
return "<".get_class($this)." ".implode(', ', $this -> __toStringDetails()).">";
|
return "<".get_class($this)." ".implode(', ', $this -> __toStringDetails()).">";
|
||||||
|
@ -79,7 +79,7 @@ class LSlog_handler extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return list of details for the string representation of the LSlog_handler
|
* Return list of details for the string representation of the LSlog_handler
|
||||||
*
|
*
|
||||||
* @retval array List of details for the string representation of the LSlog_handler
|
* @return array List of details for the string representation of the LSlog_handler
|
||||||
*/
|
*/
|
||||||
public function __toStringDetails() {
|
public function __toStringDetails() {
|
||||||
return array(
|
return array(
|
||||||
|
@ -92,9 +92,9 @@ class LSlog_handler extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Get handler info
|
* Get handler info
|
||||||
*
|
*
|
||||||
* @param[in] $key string The info name
|
* @param array $config The info name
|
||||||
*
|
*
|
||||||
* @retval mixed The info value
|
* @return mixed The info value
|
||||||
**/
|
**/
|
||||||
public function __get($key) {
|
public function __get($key) {
|
||||||
switch ($key) {
|
switch ($key) {
|
||||||
|
@ -122,7 +122,7 @@ class LSlog_handler extends LSlog_staticLoggerClass {
|
||||||
* just omit this handler if system is incompatible. You have to
|
* just omit this handler if system is incompatible. You have to
|
||||||
* trigger it with this method if you want.
|
* trigger it with this method if you want.
|
||||||
*
|
*
|
||||||
* @retval bool True if system is compatible, False otherwise
|
* @return bool True if system is compatible, False otherwise
|
||||||
**/
|
**/
|
||||||
public function checkCompatibility() {
|
public function checkCompatibility() {
|
||||||
return True;
|
return True;
|
||||||
|
@ -131,14 +131,14 @@ class LSlog_handler extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Get a configuration variable value
|
* Get a configuration variable value
|
||||||
*
|
*
|
||||||
* @param[in] $var string The configuration variable name
|
* @param array $config The configuration variable name
|
||||||
* @param[in] $default mixed The default value to return if configuration variable
|
* @param array $config The default value to return if configuration variable
|
||||||
* is not set (Default : null)
|
* is not set (Default : null)
|
||||||
* @param[in] $cast string The type of expected value. The configuration variable
|
* @param array $config The type of expected value. The configuration variable
|
||||||
* value will be cast as this type. Could be : bool, int,
|
* value will be cast as this type. Could be : bool, int,
|
||||||
* float or string. (Optional, default : raw value)
|
* float or string. (Optional, default : raw value)
|
||||||
*
|
*
|
||||||
* @retval mixed The configuration variable value
|
* @return mixed The configuration variable value
|
||||||
**/
|
**/
|
||||||
public function getConfig($var, $default=null, $cast=null) {
|
public function getConfig($var, $default=null, $cast=null) {
|
||||||
return LSconfig :: get($var, $default, $cast, $this -> config);
|
return LSconfig :: get($var, $default, $cast, $this -> config);
|
||||||
|
@ -147,9 +147,9 @@ class LSlog_handler extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Set log level
|
* Set log level
|
||||||
*
|
*
|
||||||
* @param[in] $level string The level
|
* @param array $config The level
|
||||||
*
|
*
|
||||||
* @retval bool True if log level set, False otherwise
|
* @return bool True if log level set, False otherwise
|
||||||
**/
|
**/
|
||||||
public function setLevel($level) {
|
public function setLevel($level) {
|
||||||
if (!is_null($level) && !LSlog :: checkLevelExists($level)) {
|
if (!is_null($level) && !LSlog :: checkLevelExists($level)) {
|
||||||
|
@ -163,9 +163,9 @@ class LSlog_handler extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check level against configured level
|
* Check level against configured level
|
||||||
*
|
*
|
||||||
* @param[in] $level string The level
|
* @param array $config The level
|
||||||
*
|
*
|
||||||
* @retval bool True if a message with this level have to be logged, False otherwise
|
* @return bool True if a message with this level have to be logged, False otherwise
|
||||||
**/
|
**/
|
||||||
public function checkLevel($level) {
|
public function checkLevel($level) {
|
||||||
return LSlog :: checkLevel($level, $this -> level);
|
return LSlog :: checkLevel($level, $this -> level);
|
||||||
|
@ -174,9 +174,9 @@ class LSlog_handler extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check logger against configured loggers filters
|
* Check logger against configured loggers filters
|
||||||
*
|
*
|
||||||
* @param[in] $logger string The logger
|
* @param array $config The logger
|
||||||
*
|
*
|
||||||
* @retval bool True if message of this logger have to be logged, False otherwise
|
* @return bool True if message of this logger have to be logged, False otherwise
|
||||||
**/
|
**/
|
||||||
public function checkLogger($logger) {
|
public function checkLogger($logger) {
|
||||||
if (!$this -> loggers && !$this -> excluded_loggers)
|
if (!$this -> loggers && !$this -> excluded_loggers)
|
||||||
|
@ -191,11 +191,11 @@ class LSlog_handler extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Log a message
|
* Log a message
|
||||||
*
|
*
|
||||||
* @param[in] $level string The message level
|
* @param array $config The message level
|
||||||
* @param[in] $message string The message
|
* @param array $config The message
|
||||||
* @param[in] $logger string|null The logger name (optional, default: null)
|
* @param string|null $logger The logger name (optional, default: null)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function logging($level, $message, $logger=null) {
|
public function logging($level, $message, $logger=null) {
|
||||||
return;
|
return;
|
||||||
|
@ -204,11 +204,11 @@ class LSlog_handler extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Format a message
|
* Format a message
|
||||||
*
|
*
|
||||||
* @param[in] $level string The message level
|
* @param array $config The message level
|
||||||
* @param[in] $message string The message
|
* @param array $config The message
|
||||||
* @param[in] $logger string|null The logger name (optional, default: null)
|
* @param string|null $logger The logger name (optional, default: null)
|
||||||
*
|
*
|
||||||
* @retval string The formated message to log
|
* @return string The formated message to log
|
||||||
**/
|
**/
|
||||||
protected function format($level, $message, $logger=null) {
|
protected function format($level, $message, $logger=null) {
|
||||||
global $argv;
|
global $argv;
|
||||||
|
@ -230,7 +230,7 @@ class LSlog_handler extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Helper to retrieve current LDAP server name
|
* Helper to retrieve current LDAP server name
|
||||||
*
|
*
|
||||||
* @retval string Current LDAP server name
|
* @return string Current LDAP server name
|
||||||
**/
|
**/
|
||||||
private static function getLdapServerName() {
|
private static function getLdapServerName() {
|
||||||
if (LSsession :: $ldapServer) {
|
if (LSsession :: $ldapServer) {
|
||||||
|
@ -245,7 +245,7 @@ class LSlog_handler extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Helper to retrieve current authenticated user DN
|
* Helper to retrieve current authenticated user DN
|
||||||
*
|
*
|
||||||
* @retval string Current authenticated user DN
|
* @return string Current authenticated user DN
|
||||||
**/
|
**/
|
||||||
private static function getAuthenticatedUserDN() {
|
private static function getAuthenticatedUserDN() {
|
||||||
$auth_dn = LSsession :: getLSuserObjectDn();
|
$auth_dn = LSsession :: getLSuserObjectDn();
|
||||||
|
|
|
@ -44,10 +44,10 @@ class LSlog_logger extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param[in] $name string The logger name
|
* @param string $name The logger name
|
||||||
* @param[in] $config array The handler configuration (optional, default: array())
|
* @param array $config The handler configuration (optional, default: array())
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function __construct($name, $config=array()) {
|
public function __construct($name, $config=array()) {
|
||||||
$this -> name = $name;
|
$this -> name = $name;
|
||||||
|
@ -59,7 +59,7 @@ class LSlog_logger extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Allow conversion of LSlog_logger to string
|
* Allow conversion of LSlog_logger to string
|
||||||
*
|
*
|
||||||
* @retval string The string representation of the LSlog_logger
|
* @return string The string representation of the LSlog_logger
|
||||||
*/
|
*/
|
||||||
public function __toString() {
|
public function __toString() {
|
||||||
return "<".get_class($this)." ".$this -> name.">";
|
return "<".get_class($this)." ".$this -> name.">";
|
||||||
|
@ -68,14 +68,14 @@ class LSlog_logger extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Get a configuration variable value
|
* Get a configuration variable value
|
||||||
*
|
*
|
||||||
* @param[in] $var string The configuration variable name
|
* @param string $var The configuration variable name
|
||||||
* @param[in] $default mixed The default value to return if configuration variable
|
* @param mixed $default The default value to return if configuration variable
|
||||||
* is not set (Default : null)
|
* is not set (Default : null)
|
||||||
* @param[in] $cast string The type of expected value. The configuration variable
|
* @param string $cast The type of expected value. The configuration variable
|
||||||
* value will be cast as this type. Could be : bool, int,
|
* value will be cast as this type. Could be : bool, int,
|
||||||
* float or string. (Optional, default : raw value)
|
* float or string. (Optional, default : raw value)
|
||||||
*
|
*
|
||||||
* @retval mixed The configuration variable value
|
* @return mixed The configuration variable value
|
||||||
**/
|
**/
|
||||||
public function getConfig($var, $default=null, $cast=null) {
|
public function getConfig($var, $default=null, $cast=null) {
|
||||||
return LSconfig :: get($var, $default, $cast, $this -> config);
|
return LSconfig :: get($var, $default, $cast, $this -> config);
|
||||||
|
@ -84,9 +84,9 @@ class LSlog_logger extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Get logger info
|
* Get logger info
|
||||||
*
|
*
|
||||||
* @param[in] $key string The info name
|
* @param string $key The info name
|
||||||
*
|
*
|
||||||
* @retval mixed The info value
|
* @return mixed The info value
|
||||||
**/
|
**/
|
||||||
public function __get($key) {
|
public function __get($key) {
|
||||||
switch ($key) {
|
switch ($key) {
|
||||||
|
@ -105,9 +105,9 @@ class LSlog_logger extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check level against configured level
|
* Check level against configured level
|
||||||
*
|
*
|
||||||
* @param[in] $level string The level
|
* @param string $level The level
|
||||||
*
|
*
|
||||||
* @retval bool True if a message with this level have to be logged, False otherwise
|
* @return bool True if a message with this level have to be logged, False otherwise
|
||||||
**/
|
**/
|
||||||
public function checkLevel($level) {
|
public function checkLevel($level) {
|
||||||
// If no level configured, always log
|
// If no level configured, always log
|
||||||
|
@ -119,10 +119,10 @@ class LSlog_logger extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Log a message
|
* Log a message
|
||||||
*
|
*
|
||||||
* @param[in] $level string The message level
|
* @param string $level The message level
|
||||||
* @param[in] $message string The message
|
* @param string $message The message
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function logging($level, $message) {
|
public function logging($level, $message) {
|
||||||
if (!$this -> enabled || !$this -> checkLevel($level))
|
if (!$this -> enabled || !$this -> checkLevel($level))
|
||||||
|
@ -137,9 +137,9 @@ class LSlog_logger extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Log a message with level DEBUG
|
* Log a message with level DEBUG
|
||||||
*
|
*
|
||||||
* @param[in] $message The message to log
|
* @param string $message The message to log
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function trace($message) {
|
public function trace($message) {
|
||||||
$this -> logging('TRACE', $message);
|
$this -> logging('TRACE', $message);
|
||||||
|
@ -148,9 +148,9 @@ class LSlog_logger extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Log a message with level DEBUG
|
* Log a message with level DEBUG
|
||||||
*
|
*
|
||||||
* @param[in] $message The message to log
|
* @param string $message The message to log
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function debug($message) {
|
public function debug($message) {
|
||||||
$this -> logging('DEBUG', $message);
|
$this -> logging('DEBUG', $message);
|
||||||
|
@ -159,9 +159,9 @@ class LSlog_logger extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Log a message with level INFO
|
* Log a message with level INFO
|
||||||
*
|
*
|
||||||
* @param[in] $message The message to log
|
* @param string $message The message to log
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function info($message) {
|
public function info($message) {
|
||||||
$this -> logging('INFO', $message);
|
$this -> logging('INFO', $message);
|
||||||
|
@ -170,9 +170,9 @@ class LSlog_logger extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Log a message with level WARNING
|
* Log a message with level WARNING
|
||||||
*
|
*
|
||||||
* @param[in] $message The message to log
|
* @param string $message The message to log
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function warning($message) {
|
public function warning($message) {
|
||||||
$this -> logging('WARNING', $message);
|
$this -> logging('WARNING', $message);
|
||||||
|
@ -181,9 +181,9 @@ class LSlog_logger extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Log a message with level ERROR
|
* Log a message with level ERROR
|
||||||
*
|
*
|
||||||
* @param[in] $message The message to log
|
* @param string $message The message to log
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function error($message) {
|
public function error($message) {
|
||||||
$this -> logging('ERROR', $message);
|
$this -> logging('ERROR', $message);
|
||||||
|
@ -192,9 +192,9 @@ class LSlog_logger extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Log a message with level FATAL
|
* Log a message with level FATAL
|
||||||
*
|
*
|
||||||
* @param[in] $message The message to log
|
* @param string $message The message to log
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function fatal($message) {
|
public function fatal($message) {
|
||||||
$this -> logging('FATAL', $message);
|
$this -> logging('FATAL', $message);
|
||||||
|
@ -203,11 +203,11 @@ class LSlog_logger extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Log an exception
|
* Log an exception
|
||||||
*
|
*
|
||||||
* @param[in] $exception Exception The exception to log
|
* @param Exception $exceptionThe exception to log
|
||||||
* @param[in] $prefix string|null Custom message prefix (optional, see LSlog :: exception())
|
* @param string|null $prefix Custom message prefix (optional, see LSlog :: exception())
|
||||||
* @param[in] $fatal boolean Log exception as a fatal error (optional, default: true)
|
* @param boolean $fatal Log exception as a fatal error (optional, default: true)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function exception($exception, $prefix=null, $fatal=true) {
|
public function exception($exception, $prefix=null, $fatal=true) {
|
||||||
if (!$this -> enabled)
|
if (!$this -> enabled)
|
||||||
|
|
|
@ -30,10 +30,10 @@ class LSlog_staticLoggerClass {
|
||||||
/*
|
/*
|
||||||
* Log a message via class logger
|
* Log a message via class logger
|
||||||
*
|
*
|
||||||
* @param[in] $level string The log level (see LSlog)
|
* @param string $level The log level (see LSlog)
|
||||||
* @param[in] $message string The message to log
|
* @param string $message The message to log
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
protected static function log($level, $message) {
|
protected static function log($level, $message) {
|
||||||
LSlog :: get_logger(get_called_class()) -> logging($level, $message);
|
LSlog :: get_logger(get_called_class()) -> logging($level, $message);
|
||||||
|
@ -42,11 +42,11 @@ class LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Log an exception via class logger
|
* Log an exception via class logger
|
||||||
*
|
*
|
||||||
* @param[in] $exception Exception The exception to log
|
* @param Exception $exceptionThe exception to log
|
||||||
* @param[in] $prefix string|null Custom message prefix (optional, see self :: log_exception())
|
* @param string|null $prefix Custom message prefix (optional, see self :: log_exception())
|
||||||
* @param[in] $fatal boolean Log exception as a fatal error (optional, default: true)
|
* @param boolean $fatal Log exception as a fatal error (optional, default: true)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
protected static function log_exception($exception, $prefix=null, $fatal=true) {
|
protected static function log_exception($exception, $prefix=null, $fatal=true) {
|
||||||
LSlog :: get_logger(get_called_class()) -> exception($exception, $prefix, $fatal);
|
LSlog :: get_logger(get_called_class()) -> exception($exception, $prefix, $fatal);
|
||||||
|
@ -55,9 +55,9 @@ class LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Log a message with level TRACE
|
* Log a message with level TRACE
|
||||||
*
|
*
|
||||||
* @param[in] $message The message to log
|
* @param string $message The message to log
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
protected static function log_trace($message) {
|
protected static function log_trace($message) {
|
||||||
self :: log('TRACE', $message);
|
self :: log('TRACE', $message);
|
||||||
|
@ -66,9 +66,9 @@ class LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Log a message with level DEBUG
|
* Log a message with level DEBUG
|
||||||
*
|
*
|
||||||
* @param[in] $message The message to log
|
* @param string $message The message to log
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
protected static function log_debug($message) {
|
protected static function log_debug($message) {
|
||||||
self :: log('DEBUG', $message);
|
self :: log('DEBUG', $message);
|
||||||
|
@ -77,9 +77,9 @@ class LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Log a message with level INFO
|
* Log a message with level INFO
|
||||||
*
|
*
|
||||||
* @param[in] $message The message to log
|
* @param string $message The message to log
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
protected static function log_info($message) {
|
protected static function log_info($message) {
|
||||||
self :: log('INFO', $message);
|
self :: log('INFO', $message);
|
||||||
|
@ -88,9 +88,9 @@ class LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Log a message with level WARNING
|
* Log a message with level WARNING
|
||||||
*
|
*
|
||||||
* @param[in] $message The message to log
|
* @param string $message The message to log
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
protected static function log_warning($message) {
|
protected static function log_warning($message) {
|
||||||
self :: log('WARNING', $message);
|
self :: log('WARNING', $message);
|
||||||
|
@ -99,9 +99,9 @@ class LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Log a message with level ERROR
|
* Log a message with level ERROR
|
||||||
*
|
*
|
||||||
* @param[in] $message The message to log
|
* @param string $message The message to log
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
protected static function log_error($message) {
|
protected static function log_error($message) {
|
||||||
self :: log('ERROR', $message);
|
self :: log('ERROR', $message);
|
||||||
|
@ -110,9 +110,9 @@ class LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Log a message with level FATAL
|
* Log a message with level FATAL
|
||||||
*
|
*
|
||||||
* @param[in] $message The message to log
|
* @param string $message The message to log
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
protected static function log_fatal($message) {
|
protected static function log_fatal($message) {
|
||||||
self :: log('FATAL', $message);
|
self :: log('FATAL', $message);
|
||||||
|
|
|
@ -52,9 +52,9 @@ class LSlog_syslog extends LSlog_handler {
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param[in] $config array The handler configuration
|
* @param array $config The handler configuration
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function __construct($config) {
|
public function __construct($config) {
|
||||||
parent :: __construct($config);
|
parent :: __construct($config);
|
||||||
|
@ -66,7 +66,7 @@ class LSlog_syslog extends LSlog_handler {
|
||||||
/**
|
/**
|
||||||
* Return list of details for the string representation of the LSlog_email
|
* Return list of details for the string representation of the LSlog_email
|
||||||
*
|
*
|
||||||
* @retval array List of details for the string representation of the LSlog_email
|
* @return array List of details for the string representation of the LSlog_email
|
||||||
*/
|
*/
|
||||||
public function __toStringDetails() {
|
public function __toStringDetails() {
|
||||||
return array_merge(
|
return array_merge(
|
||||||
|
@ -78,7 +78,7 @@ class LSlog_syslog extends LSlog_handler {
|
||||||
/**
|
/**
|
||||||
* Check system compatibility with this handler
|
* Check system compatibility with this handler
|
||||||
*
|
*
|
||||||
* @retval bool True if system is compatible, False otherwise
|
* @return bool True if system is compatible, False otherwise
|
||||||
**/
|
**/
|
||||||
public function checkCompatibility() {
|
public function checkCompatibility() {
|
||||||
return function_exists('syslog');
|
return function_exists('syslog');
|
||||||
|
@ -87,11 +87,11 @@ class LSlog_syslog extends LSlog_handler {
|
||||||
/**
|
/**
|
||||||
* Log a message
|
* Log a message
|
||||||
*
|
*
|
||||||
* @param[in] $level string The message level
|
* @param array $config The message level
|
||||||
* @param[in] $message string The message
|
* @param array $config The message
|
||||||
* @param[in] $logger string|null The logger name (optional, default: null)
|
* @param string|null $logger The logger name (optional, default: null)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function logging($level, $message, $logger=null) {
|
public function logging($level, $message, $logger=null) {
|
||||||
return syslog(
|
return syslog(
|
||||||
|
@ -103,9 +103,9 @@ class LSlog_syslog extends LSlog_handler {
|
||||||
/**
|
/**
|
||||||
* Get syslog corresponding priority to a specific log level
|
* Get syslog corresponding priority to a specific log level
|
||||||
*
|
*
|
||||||
* @param[in] $level string The log level
|
* @param array $config The log level
|
||||||
*
|
*
|
||||||
* @retval int Syslog corresponding priority
|
* @return int Syslog corresponding priority
|
||||||
**/
|
**/
|
||||||
private function level2priority($level) {
|
private function level2priority($level) {
|
||||||
if ($this -> priority && $level != $this -> priority)
|
if ($this -> priority && $level != $this -> priority)
|
||||||
|
|
|
@ -33,9 +33,9 @@ class LSlog_system extends LSlog_handler {
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param[in] $config array The handler configuration
|
* @param array $config The handler configuration
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function __construct($config) {
|
public function __construct($config) {
|
||||||
parent :: __construct($config);
|
parent :: __construct($config);
|
||||||
|
@ -46,11 +46,11 @@ class LSlog_system extends LSlog_handler {
|
||||||
/**
|
/**
|
||||||
* Log a message
|
* Log a message
|
||||||
*
|
*
|
||||||
* @param[in] $level string The message level
|
* @param array $config The message level
|
||||||
* @param[in] $message string The message
|
* @param array $config The message
|
||||||
* @param[in] $logger string|null The logger name (optional, default: null)
|
* @param string|null $logger The logger name (optional, default: null)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function logging($level, $message, $logger=null) {
|
public function logging($level, $message, $logger=null) {
|
||||||
error_log(
|
error_log(
|
||||||
|
|
|
@ -25,7 +25,7 @@ class LSmail {
|
||||||
/*
|
/*
|
||||||
* Méthode chargeant les dépendances d'affichage
|
* Méthode chargeant les dépendances d'affichage
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function loadDependenciesDisplay() {
|
public static function loadDependenciesDisplay() {
|
||||||
if (LSsession :: loadLSclass('LSsmoothbox')) {
|
if (LSsession :: loadLSclass('LSsmoothbox')) {
|
||||||
|
|
|
@ -35,9 +35,9 @@ class LSgroup extends LSldapObject {
|
||||||
/**
|
/**
|
||||||
* Retourne la valeur clef d'un membre
|
* Retourne la valeur clef d'un membre
|
||||||
*
|
*
|
||||||
* @param[in] $object Un object utilisateur
|
* @param LSldapObject $object Un object utilisateur
|
||||||
*
|
*
|
||||||
* @retval Mixed La valeur clef d'un membre
|
* @return Mixed La valeur clef d'un membre
|
||||||
**/
|
**/
|
||||||
public function getMemberKeyValue($object) {
|
public function getMemberKeyValue($object) {
|
||||||
return $this -> getObjectKeyValueInRelation($object,$this -> userObjectType,$this -> memberAttrValue);
|
return $this -> getObjectKeyValueInRelation($object,$this -> userObjectType,$this -> memberAttrValue);
|
||||||
|
@ -49,9 +49,9 @@ class LSgroup extends LSldapObject {
|
||||||
* Retourne un tableau de LSgroup correspondant aux groupes
|
* Retourne un tableau de LSgroup correspondant aux groupes
|
||||||
* auxquels appartient un utilisateur
|
* auxquels appartient un utilisateur
|
||||||
*
|
*
|
||||||
* @param[in] $userObject Un object user (type : $this -> userObjectType)
|
* @param LSldapObject $userObject Un object user (type : $this -> userObjectType)
|
||||||
*
|
*
|
||||||
* @retval Array of LSgroup Les groupes de l'utilisateur
|
* @return array[LSgroup] Les groupes de l'utilisateur
|
||||||
**/
|
**/
|
||||||
public function listUserGroups($userObject) {
|
public function listUserGroups($userObject) {
|
||||||
return $this -> listObjectsInRelation($userObject,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue);
|
return $this -> listObjectsInRelation($userObject,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue);
|
||||||
|
@ -60,9 +60,9 @@ class LSgroup extends LSldapObject {
|
||||||
/**
|
/**
|
||||||
* Ajoute un utilisateur au groupe
|
* Ajoute un utilisateur au groupe
|
||||||
*
|
*
|
||||||
* @param[in] $object Un object user ($this -> userObjectType) : l'utilisateur à ajouter
|
* @param LSldapObject $object Un object user ($this -> userObjectType) : l'utilisateur à ajouter
|
||||||
*
|
*
|
||||||
* @retval boolean true si l'utilisateur à été ajouté, False sinon
|
* @return boolean true si l'utilisateur à été ajouté, False sinon
|
||||||
**/
|
**/
|
||||||
public function addOneMember($object) {
|
public function addOneMember($object) {
|
||||||
return $this -> addOneObjectInRelation($object,$this -> memberAttr, $this -> userObjectType,$this -> memberAttrValue,'canEditGroupRelation');
|
return $this -> addOneObjectInRelation($object,$this -> memberAttr, $this -> userObjectType,$this -> memberAttrValue,'canEditGroupRelation');
|
||||||
|
@ -71,9 +71,9 @@ class LSgroup extends LSldapObject {
|
||||||
/**
|
/**
|
||||||
* Supprime un utilisateur du groupe
|
* Supprime un utilisateur du groupe
|
||||||
*
|
*
|
||||||
* @param[in] $object Un object (type : $this -> userObjectType) : l'utilisateur à supprimer
|
* @param LSldapObject $object Un object (type : $this -> userObjectType) : l'utilisateur à supprimer
|
||||||
*
|
*
|
||||||
* @retval boolean true si l'utilisateur à été supprimé, False sinon
|
* @return boolean true si l'utilisateur à été supprimé, False sinon
|
||||||
**/
|
**/
|
||||||
public function deleteOneMember($object) {
|
public function deleteOneMember($object) {
|
||||||
return $this -> deleteOneObjectInRelation($object,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue,'canEditGroupRelation');
|
return $this -> deleteOneObjectInRelation($object,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue,'canEditGroupRelation');
|
||||||
|
@ -82,10 +82,10 @@ class LSgroup extends LSldapObject {
|
||||||
/**
|
/**
|
||||||
* Renome un utilisateur du groupe
|
* Renome un utilisateur du groupe
|
||||||
*
|
*
|
||||||
* @param[in] $object Un object (type : $this -> userObjectType) : l'utilisateur à renomer
|
* @param LSldapObject $object Un object (type : $this -> userObjectType) : l'utilisateur à renomer
|
||||||
* @param[in] $oldDn string L'ancien DN de l'utilisateur
|
* @param string $oldDn L'ancien DN de l'utilisateur
|
||||||
*
|
*
|
||||||
* @retval boolean True en cas de succès, False sinon
|
* @return boolean True en cas de succès, False sinon
|
||||||
*/
|
*/
|
||||||
public function renameOneMember($object,$oldDn) {
|
public function renameOneMember($object,$oldDn) {
|
||||||
return $this -> renameOneObjectInRelation($object,$oldDn,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue);
|
return $this -> renameOneObjectInRelation($object,$oldDn,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue);
|
||||||
|
@ -94,10 +94,10 @@ class LSgroup extends LSldapObject {
|
||||||
/**
|
/**
|
||||||
* Met à jour les groupes d'un utilisateur
|
* Met à jour les groupes d'un utilisateur
|
||||||
*
|
*
|
||||||
* @param[in] $object Mixed Un object (type : $this -> userObjectType) : l'utilisateur
|
* @param Mixed $object Un object (type : $this -> userObjectType) : l'utilisateur
|
||||||
* @param[in] $listDns Array(string) Un tableau des DNs des groupes de l'utilisateur
|
* @param array[string] $listDns Array(string) Un tableau des DNs des groupes de l'utilisateur
|
||||||
*
|
*
|
||||||
* @retval boolean true si tout c'est bien passé, False sinon
|
* @return boolean true si tout c'est bien passé, False sinon
|
||||||
**/
|
**/
|
||||||
public function updateUserGroups($object,$listDns) {
|
public function updateUserGroups($object,$listDns) {
|
||||||
return $this -> updateObjectsInRelation($object,$listDns,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue,'canEditGroupRelation');
|
return $this -> updateObjectsInRelation($object,$listDns,$this -> memberAttr,$this -> userObjectType,$this -> memberAttrValue,'canEditGroupRelation');
|
||||||
|
@ -106,7 +106,7 @@ class LSgroup extends LSldapObject {
|
||||||
/**
|
/**
|
||||||
* Test si l'utilisateur peut d'editer la relation avec ce groupe
|
* Test si l'utilisateur peut d'editer la relation avec ce groupe
|
||||||
*
|
*
|
||||||
* @retval boolean true si tout l'utilisateur peut éditer la relation, False sinon
|
* @return boolean true si tout l'utilisateur peut éditer la relation, False sinon
|
||||||
**/
|
**/
|
||||||
public function canEditGroupRelation($dn=NULL) {
|
public function canEditGroupRelation($dn=NULL) {
|
||||||
if (!$dn) {
|
if (!$dn) {
|
||||||
|
|
|
@ -40,10 +40,10 @@ class LSrelation extends LSlog_staticLoggerClass {
|
||||||
* object. All non-static method are designed to manipulate this type
|
* object. All non-static method are designed to manipulate this type
|
||||||
* of relation of the object specified at constuct time.
|
* of relation of the object specified at constuct time.
|
||||||
*
|
*
|
||||||
* @param[in] &$obj LSldapObject A reference to the LSldapObject
|
* @param LSldapObject &$obj A reference to the LSldapObject
|
||||||
* @param [in] $relationName string The relation name
|
* @param [in] $relationName string The relation name
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct(&$obj, $relationName) {
|
public function __construct(&$obj, $relationName) {
|
||||||
$this -> obj =& $obj;
|
$this -> obj =& $obj;
|
||||||
|
@ -64,7 +64,7 @@ class LSrelation extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Allow conversion of LSrelation to string
|
* Allow conversion of LSrelation to string
|
||||||
*
|
*
|
||||||
* @retval string The string representation of the LSrelation
|
* @return string The string representation of the LSrelation
|
||||||
*/
|
*/
|
||||||
public function __toString() {
|
public function __toString() {
|
||||||
return "<LSrelation ".$this -> name." on ".$this -> obj -> toString(false).">";
|
return "<LSrelation ".$this -> name." on ".$this -> obj -> toString(false).">";
|
||||||
|
@ -77,7 +77,7 @@ class LSrelation extends LSlog_staticLoggerClass {
|
||||||
* @param[] $default The default value (default : null)
|
* @param[] $default The default value (default : null)
|
||||||
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
||||||
*
|
*
|
||||||
* @retval mixed The configuration parameter value or default value if not set
|
* @return mixed The configuration parameter value or default value if not set
|
||||||
**/
|
**/
|
||||||
public function getConfig($param, $default=null, $cast=null) {
|
public function getConfig($param, $default=null, $cast=null) {
|
||||||
// Check relation is correctly configured
|
// Check relation is correctly configured
|
||||||
|
@ -89,9 +89,9 @@ class LSrelation extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Get relation info
|
* Get relation info
|
||||||
*
|
*
|
||||||
* @param[in] $key string The info name
|
* @param string $key The info name
|
||||||
*
|
*
|
||||||
* @retval mixed The info value
|
* @return mixed The info value
|
||||||
*/
|
*/
|
||||||
public function __get($key) {
|
public function __get($key) {
|
||||||
switch ($key) {
|
switch ($key) {
|
||||||
|
@ -129,7 +129,7 @@ class LSrelation extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check relation configuration
|
* Check relation configuration
|
||||||
*
|
*
|
||||||
* @retval boolean True if relation is properly configured, False otherwise
|
* @return boolean True if relation is properly configured, False otherwise
|
||||||
*/
|
*/
|
||||||
public function checkConfig() {
|
public function checkConfig() {
|
||||||
// Check LSobject parameter
|
// Check LSobject parameter
|
||||||
|
@ -228,10 +228,10 @@ class LSrelation extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check a relation exist
|
* Check a relation exist
|
||||||
*
|
*
|
||||||
* @param[in] $object_type string The object type
|
* @param string $object_type The object type
|
||||||
* @param[in] $relation_name string The relation name
|
* @param string $relation_name The relation name
|
||||||
*
|
*
|
||||||
* @retval boolean True if relation exist, false otherwise
|
* @return boolean True if relation exist, false otherwise
|
||||||
*/
|
*/
|
||||||
public static function exists($object_type, $relation_name) {
|
public static function exists($object_type, $relation_name) {
|
||||||
if ($object_type && LSsession :: loadLSobject($object_type)) {
|
if ($object_type && LSsession :: loadLSobject($object_type)) {
|
||||||
|
@ -243,7 +243,7 @@ class LSrelation extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Get relation name
|
* Get relation name
|
||||||
*
|
*
|
||||||
* @retval string The relation name
|
* @return string The relation name
|
||||||
*/
|
*/
|
||||||
public function getName() {
|
public function getName() {
|
||||||
return $this -> name;
|
return $this -> name;
|
||||||
|
@ -252,7 +252,7 @@ class LSrelation extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check if user can edit this relation
|
* Check if user can edit this relation
|
||||||
*
|
*
|
||||||
* @retval boolean True if user can edit this relation, false otherwise
|
* @return boolean True if user can edit this relation, false otherwise
|
||||||
*/
|
*/
|
||||||
public function canEdit() {
|
public function canEdit() {
|
||||||
return LSsession :: relationCanEdit($this -> obj -> getValue('dn'),$this -> obj -> getType(),$this -> name);
|
return LSsession :: relationCanEdit($this -> obj -> getValue('dn'),$this -> obj -> getType(),$this -> name);
|
||||||
|
@ -261,7 +261,7 @@ class LSrelation extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check if user can create a related object
|
* Check if user can create a related object
|
||||||
*
|
*
|
||||||
* @retval boolean True if user can create a related object, false otherwise
|
* @return boolean True if user can create a related object, false otherwise
|
||||||
*/
|
*/
|
||||||
public function canCreate() {
|
public function canCreate() {
|
||||||
return LSsession :: canCreate($this -> LSobject);
|
return LSsession :: canCreate($this -> LSobject);
|
||||||
|
@ -270,7 +270,7 @@ class LSrelation extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* List related objects
|
* List related objects
|
||||||
*
|
*
|
||||||
* @retval array|false An array of related objects (LSldapObject), of false in case of error
|
* @return array|false An array of related objects (LSldapObject), of false in case of error
|
||||||
*/
|
*/
|
||||||
public function listRelatedObjects() {
|
public function listRelatedObjects() {
|
||||||
// Check relation is correctly configured
|
// Check relation is correctly configured
|
||||||
|
@ -337,7 +337,7 @@ class LSrelation extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Get the value to store to created the relation with $this -> obj
|
* Get the value to store to created the relation with $this -> obj
|
||||||
*
|
*
|
||||||
* @retval array List of value of the link attribute
|
* @return array List of value of the link attribute
|
||||||
*/
|
*/
|
||||||
public function getRelatedKeyValue() {
|
public function getRelatedKeyValue() {
|
||||||
// Check relation is correctly configured
|
// Check relation is correctly configured
|
||||||
|
@ -403,9 +403,9 @@ class LSrelation extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check if user can edit the relation with the specified object
|
* Check if user can edit the relation with the specified object
|
||||||
*
|
*
|
||||||
* @param[in] &$objRel LSldapObject A reference to the related object
|
* @param LSldapObject &$objRel A reference to the related object
|
||||||
*
|
*
|
||||||
* @retval boolean True if user can edit the relation with the specified object, false otherwise
|
* @return boolean True if user can edit the relation with the specified object, false otherwise
|
||||||
*/
|
*/
|
||||||
public function canEditRelationWithObject(&$objRel) {
|
public function canEditRelationWithObject(&$objRel) {
|
||||||
// Check relation is correctly configured
|
// Check relation is correctly configured
|
||||||
|
@ -455,9 +455,9 @@ class LSrelation extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Remove relation with the specified object
|
* Remove relation with the specified object
|
||||||
*
|
*
|
||||||
* @param[in] &$objRel LSldapObject A reference to the related object
|
* @param LSldapObject &$objRel A reference to the related object
|
||||||
*
|
*
|
||||||
* @retval boolean True if relation removed, false otherwise
|
* @return boolean True if relation removed, false otherwise
|
||||||
*/
|
*/
|
||||||
public function removeRelationWithObject(&$objRel) {
|
public function removeRelationWithObject(&$objRel) {
|
||||||
// Check relation is correctly configured
|
// Check relation is correctly configured
|
||||||
|
@ -504,10 +504,10 @@ class LSrelation extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Rename relation with the specified object
|
* Rename relation with the specified object
|
||||||
*
|
*
|
||||||
* @param[in] &$objRel LSldapObject A reference to the related object
|
* @param LSldapObject &$objRel A reference to the related object
|
||||||
* @param[in] $oldKeyValue string The old key value of the relation
|
* @param string $oldKeyValue The old key value of the relation
|
||||||
*
|
*
|
||||||
* @retval boolean True if relation rename, false otherwise
|
* @return boolean True if relation rename, false otherwise
|
||||||
*/
|
*/
|
||||||
public function renameRelationWithObject(&$objRel, $oldKeyValue) {
|
public function renameRelationWithObject(&$objRel, $oldKeyValue) {
|
||||||
// Check relation is correctly configured
|
// Check relation is correctly configured
|
||||||
|
@ -557,9 +557,9 @@ class LSrelation extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Update relation with the specified DN objects list
|
* Update relation with the specified DN objects list
|
||||||
*
|
*
|
||||||
* @param[in] $listDns array Array of DN of the related objects
|
* @param array $listDns Array of DN of the related objects
|
||||||
*
|
*
|
||||||
* @retval boolean True if relations updated, false otherwise
|
* @return boolean True if relations updated, false otherwise
|
||||||
*/
|
*/
|
||||||
public function updateRelations($listDns) {
|
public function updateRelations($listDns) {
|
||||||
// Check relation is correctly configured
|
// Check relation is correctly configured
|
||||||
|
@ -629,7 +629,7 @@ class LSrelation extends LSlog_staticLoggerClass {
|
||||||
/*
|
/*
|
||||||
* Load display dependencies
|
* Load display dependencies
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function loadDependenciesDisplay() {
|
public static function loadDependenciesDisplay() {
|
||||||
if (LSsession :: loadLSclass('LSselect')) {
|
if (LSsession :: loadLSclass('LSselect')) {
|
||||||
|
@ -650,9 +650,9 @@ class LSrelation extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* LSrelations information are provided to template by usind LSrelations variable.
|
* LSrelations information are provided to template by usind LSrelations variable.
|
||||||
*
|
*
|
||||||
* @param[in] $object LSldapObject L'objet dont on cherche les LSrelations
|
* @param LSldapObject $object L'objet dont on cherche les LSrelations
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function displayInLSview($object) {
|
public static function displayInLSview($object) {
|
||||||
if (!($object instanceof LSldapObject))
|
if (!($object instanceof LSldapObject))
|
||||||
|
@ -748,10 +748,10 @@ class LSrelation extends LSlog_staticLoggerClass {
|
||||||
* Helper to check AJAX method call and instanciate corresponding
|
* Helper to check AJAX method call and instanciate corresponding
|
||||||
* LSldapObject and LSrelation objects.
|
* LSldapObject and LSrelation objects.
|
||||||
*
|
*
|
||||||
* @param[in] &$data array Reference to AJAX returned data array
|
* @param array &$data Reference to AJAX returned data array
|
||||||
* @param[in] $additional_parameters array|string|null List of additional required parameter
|
* @param array|string|null $additional_parameters List of additional required parameter
|
||||||
*
|
*
|
||||||
* @retval array|false Array with LSobject and LSrelation
|
* @return array|false Array with LSobject and LSrelation
|
||||||
*/
|
*/
|
||||||
public static function _ajax_check_call(&$data, &$conf, &$object, &$relation, $additional_required_parameters=null) {
|
public static function _ajax_check_call(&$data, &$conf, &$object, &$relation, $additional_required_parameters=null) {
|
||||||
$data['success'] = false;
|
$data['success'] = false;
|
||||||
|
@ -822,9 +822,9 @@ class LSrelation extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Init LSselect for a relation
|
* Init LSselect for a relation
|
||||||
*
|
*
|
||||||
* @param[in] &$data Reference to returned data array
|
* @param array &$data Reference to returned data array
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function ajax_initSelection(&$data) {
|
public static function ajax_initSelection(&$data) {
|
||||||
$conf = null;
|
$conf = null;
|
||||||
|
@ -874,9 +874,9 @@ class LSrelation extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Update related object from LSselect result
|
* Update related object from LSselect result
|
||||||
*
|
*
|
||||||
* @param[in] &$data Reference to returned data array
|
* @param array &$data Reference to returned data array
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function ajax_updateFromSelection(&$data) {
|
public static function ajax_updateFromSelection(&$data) {
|
||||||
$conf = null;
|
$conf = null;
|
||||||
|
@ -938,9 +938,9 @@ class LSrelation extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Remove related object specify by DN
|
* Remove related object specify by DN
|
||||||
*
|
*
|
||||||
* @param[in] &$data Reference to returned data array
|
* @param array &$data Reference to returned data array
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function ajax_deleteByDn(&$data) {
|
public static function ajax_deleteByDn(&$data) {
|
||||||
$conf = null;
|
$conf = null;
|
||||||
|
|
|
@ -78,10 +78,10 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param[in] $LSobject string The LdapObject type of search
|
* @param string $LSobject The LdapObject type of search
|
||||||
* @param[in] $context string Context of search (LSrelation / LSldapObject/ ...)
|
* @param string $LSobject Context of search (LSrelation / LSldapObject/ ...)
|
||||||
* @param[in] $params array Parameters of search
|
* @param string $LSobject Parameters of search
|
||||||
* @param[in] $purgeParams boolean If params in session have to be purged
|
* @param boolean $purgeParams If params in session have to be purged
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
public function __construct($LSobject,$context,$params=null,$purgeParams=false) {
|
public function __construct($LSobject,$context,$params=null,$purgeParams=false) {
|
||||||
|
@ -117,7 +117,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Allow conversion of LSsearch to string
|
* Allow conversion of LSsearch to string
|
||||||
*
|
*
|
||||||
* @retval string The string representation of the LSsearch
|
* @return string The string representation of the LSsearch
|
||||||
*/
|
*/
|
||||||
public function __toString() {
|
public function __toString() {
|
||||||
$search_params = $this -> formatSearchParams();
|
$search_params = $this -> formatSearchParams();
|
||||||
|
@ -127,7 +127,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Load configuration from LSconfig
|
* Load configuration from LSconfig
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function loadConfig() {
|
private function loadConfig() {
|
||||||
$this -> config = LSconfig::get("LSobjects.".$this -> LSobject.".LSsearch");
|
$this -> config = LSconfig::get("LSobjects.".$this -> LSobject.".LSsearch");
|
||||||
|
@ -144,7 +144,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Load default search parameters from configuration
|
* Load default search parameters from configuration
|
||||||
*
|
*
|
||||||
* @retval boolean True on success or False
|
* @return boolean True on success or False
|
||||||
*/
|
*/
|
||||||
private function loadDefaultParameters() {
|
private function loadDefaultParameters() {
|
||||||
if (isset($this -> config['params']) && is_array($this -> config['params'])) {
|
if (isset($this -> config['params']) && is_array($this -> config['params'])) {
|
||||||
|
@ -159,7 +159,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Load search parameters from session
|
* Load search parameters from session
|
||||||
*
|
*
|
||||||
* @retval boolean True if params has been loaded from session or False
|
* @return boolean True if params has been loaded from session or False
|
||||||
*/
|
*/
|
||||||
private function loadParamsFromSession() {
|
private function loadParamsFromSession() {
|
||||||
if (isset($_SESSION['LSsession']['LSsearch'][$this -> LSobject]['params'][$this -> context]) && is_array($_SESSION['LSsession']['LSsearch'][$this -> LSobject]['params'][$this -> context])) {
|
if (isset($_SESSION['LSsession']['LSsearch'][$this -> LSobject]['params'][$this -> context]) && is_array($_SESSION['LSsession']['LSsearch'][$this -> LSobject]['params'][$this -> context])) {
|
||||||
|
@ -181,7 +181,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Save search parameters in session
|
* Save search parameters in session
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function saveParamsInSession() {
|
private function saveParamsInSession() {
|
||||||
self :: log_debug('Save context params session '.$this -> context);
|
self :: log_debug('Save context params session '.$this -> context);
|
||||||
|
@ -201,9 +201,9 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Purge parameters in session
|
* Purge parameters in session
|
||||||
*
|
*
|
||||||
* @param[in] $LSobject string The LSobject type
|
* @param string $LSobject The LSobject type
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function purgeParams($LSobject) {
|
public static function purgeParams($LSobject) {
|
||||||
unset($_SESSION['LSsession']['LSsearch'][$LSobject]['params']);
|
unset($_SESSION['LSsession']['LSsearch'][$LSobject]['params']);
|
||||||
|
@ -212,7 +212,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Purge cache
|
* Purge cache
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function purgeCache($LSobject) {
|
public static function purgeCache($LSobject) {
|
||||||
unset($_SESSION['LSsession']['LSsearch'][$LSobject]);
|
unset($_SESSION['LSsession']['LSsearch'][$LSobject]);
|
||||||
|
@ -221,7 +221,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Purge session
|
* Purge session
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function purgeSession() {
|
private function purgeSession() {
|
||||||
unset($_SESSION['LSsession']['LSsearch']);
|
unset($_SESSION['LSsession']['LSsearch']);
|
||||||
|
@ -230,10 +230,10 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Define one search parameter
|
* Define one search parameter
|
||||||
*
|
*
|
||||||
* @param[in] $param string The parameter name
|
* @param string $LSobject The parameter name
|
||||||
* @param[in] $value mixed The parameter value
|
* @param string $LSobject The parameter value
|
||||||
*
|
*
|
||||||
* @retval boolean True on success or False
|
* @return boolean True on success or False
|
||||||
*/
|
*/
|
||||||
public function setParam($param,$value) {
|
public function setParam($param,$value) {
|
||||||
return $this -> setParams(array($param => $value));
|
return $this -> setParams(array($param => $value));
|
||||||
|
@ -242,9 +242,9 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Define search parameters
|
* Define search parameters
|
||||||
*
|
*
|
||||||
* @param[in] $params array Parameters of search
|
* @param string $LSobject Parameters of search
|
||||||
*
|
*
|
||||||
* @retval boolean True on success or False
|
* @return boolean True on success or False
|
||||||
*/
|
*/
|
||||||
public function setParams($params) {
|
public function setParams($params) {
|
||||||
$OK=true;
|
$OK=true;
|
||||||
|
@ -548,7 +548,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return true only if the form is submited
|
* Return true only if the form is submited
|
||||||
*
|
*
|
||||||
* @retval boolean True only if the is submited
|
* @return boolean True only if the is submited
|
||||||
**/
|
**/
|
||||||
private function formIsSubmited() {
|
private function formIsSubmited() {
|
||||||
return isset($_REQUEST['LSsearch_submit']);
|
return isset($_REQUEST['LSsearch_submit']);
|
||||||
|
@ -557,7 +557,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Define search parameters by reading request data ($_REQUEST)
|
* Define search parameters by reading request data ($_REQUEST)
|
||||||
*
|
*
|
||||||
* @retval boolean True if all parameters found in request data are handled, False otherwise
|
* @return boolean True if all parameters found in request data are handled, False otherwise
|
||||||
*/
|
*/
|
||||||
public function setParamsFromRequest() {
|
public function setParamsFromRequest() {
|
||||||
$allowedParams = array(
|
$allowedParams = array(
|
||||||
|
@ -646,7 +646,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Toggle the sort direction
|
* Toggle the sort direction
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
private function toggleSortDirection() {
|
private function toggleSortDirection() {
|
||||||
if ($this -> params['sortDirection']=="ASC") {
|
if ($this -> params['sortDirection']=="ASC") {
|
||||||
|
@ -660,9 +660,9 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Make a filter object with a pattern of search
|
* Make a filter object with a pattern of search
|
||||||
*
|
*
|
||||||
* @param[in] $pattern The pattern of search. If is null, the pattern in params will be used.
|
* @param string $pattern The pattern of search. If is null, the pattern in params will be used.
|
||||||
*
|
*
|
||||||
* @retval mixed Net_LDAP2_Filter on success or False
|
* @return mixed Net_LDAP2_Filter on success or False
|
||||||
*/
|
*/
|
||||||
public function getFilterFromPattern($pattern=NULL) {
|
public function getFilterFromPattern($pattern=NULL) {
|
||||||
if ($pattern==NULL) {
|
if ($pattern==NULL) {
|
||||||
|
@ -738,9 +738,9 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check if search pattern is valid
|
* Check if search pattern is valid
|
||||||
*
|
*
|
||||||
* @param[in] $pattern string The pattern
|
* @param string $LSobject The pattern
|
||||||
*
|
*
|
||||||
* @retval boolean True if pattern is valid or False
|
* @return boolean True if pattern is valid or False
|
||||||
**/
|
**/
|
||||||
public function isValidPattern($pattern) {
|
public function isValidPattern($pattern) {
|
||||||
if (is_string($pattern) && $pattern!= "") {
|
if (is_string($pattern) && $pattern!= "") {
|
||||||
|
@ -755,7 +755,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check if cache is enabled
|
* Check if cache is enabled
|
||||||
*
|
*
|
||||||
* @retval boolean True if cache is enabled or False
|
* @return boolean True if cache is enabled or False
|
||||||
**/
|
**/
|
||||||
public function cacheIsEnabled() {
|
public function cacheIsEnabled() {
|
||||||
if (isset($this -> config['cache'])) {
|
if (isset($this -> config['cache'])) {
|
||||||
|
@ -773,9 +773,9 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Methode for parameters value access
|
* Methode for parameters value access
|
||||||
*
|
*
|
||||||
* @param[in] $key string The parameter name
|
* @param string $LSobject The parameter name
|
||||||
*
|
*
|
||||||
* @retval mixed The parameter value or NULL
|
* @return mixed The parameter value or NULL
|
||||||
**/
|
**/
|
||||||
public function getParam($key) {
|
public function getParam($key) {
|
||||||
if(in_array($key,array_keys($this -> params))) {
|
if(in_array($key,array_keys($this -> params))) {
|
||||||
|
@ -790,7 +790,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return hidden fileds to add in search form
|
* Return hidden fileds to add in search form
|
||||||
*
|
*
|
||||||
* @retval array The hield fields whith their values
|
* @return array The hield fields whith their values
|
||||||
**/
|
**/
|
||||||
public function getHiddenFieldForm() {
|
public function getHiddenFieldForm() {
|
||||||
return array (
|
return array (
|
||||||
|
@ -803,7 +803,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
* passed to Net_LDAP2 for the LDAP search. This array will be store in
|
* passed to Net_LDAP2 for the LDAP search. This array will be store in
|
||||||
* $this -> _searchParams private variable.
|
* $this -> _searchParams private variable.
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
private function generateSearchParams() {
|
private function generateSearchParams() {
|
||||||
// Base
|
// Base
|
||||||
|
@ -935,7 +935,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Format search parameters for logging
|
* Format search parameters for logging
|
||||||
*
|
*
|
||||||
* @retval string|null Formated search parameters is defined, or null if not
|
* @return string|null Formated search parameters is defined, or null if not
|
||||||
**/
|
**/
|
||||||
private function formatSearchParams() {
|
private function formatSearchParams() {
|
||||||
if (!$this -> _searchParams)
|
if (!$this -> _searchParams)
|
||||||
|
@ -960,7 +960,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Get search attributes
|
* Get search attributes
|
||||||
*
|
*
|
||||||
* @retval array The attributes asked in this search
|
* @return array The attributes asked in this search
|
||||||
**/
|
**/
|
||||||
public function getAttributes() {
|
public function getAttributes() {
|
||||||
if (!$this -> _searchParams)
|
if (!$this -> _searchParams)
|
||||||
|
@ -971,9 +971,9 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Run the search
|
* Run the search
|
||||||
*
|
*
|
||||||
* @param[in] $cache boolean Define if the cache can be used
|
* @param boolean $purgeParams Define if the cache can be used
|
||||||
*
|
*
|
||||||
* @retval boolean True on success or False
|
* @return boolean True on success or False
|
||||||
*/
|
*/
|
||||||
public function run($cache=true) {
|
public function run($cache=true) {
|
||||||
$this -> generateSearchParams();
|
$this -> generateSearchParams();
|
||||||
|
@ -1038,10 +1038,10 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return an hash corresponding to the parameters of the search
|
* Return an hash corresponding to the parameters of the search
|
||||||
*
|
*
|
||||||
* @param[in] $searchParams array An optional search params array
|
* @param string $LSobject An optional search params array
|
||||||
* @param[in] $onlyAccessible boolean An optional onlyAccessible boolean flag
|
* @param boolean $purgeParams An optional onlyAccessible boolean flag
|
||||||
*
|
*
|
||||||
* @retval string The hash of the parameters of the search
|
* @return string The hash of the parameters of the search
|
||||||
**/
|
**/
|
||||||
public function getHash($searchParams=null, $onlyAccessible=null) {
|
public function getHash($searchParams=null, $onlyAccessible=null) {
|
||||||
if (is_null($searchParams)) {
|
if (is_null($searchParams)) {
|
||||||
|
@ -1063,7 +1063,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Add the result of the search to cache of the session
|
* Add the result of the search to cache of the session
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function addResultToCache() {
|
public function addResultToCache() {
|
||||||
if ($this -> cacheIsEnabled()) {
|
if ($this -> cacheIsEnabled()) {
|
||||||
|
@ -1078,7 +1078,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Get the result of the search from cache of the session
|
* Get the result of the search from cache of the session
|
||||||
*
|
*
|
||||||
* @retval array | False The array of the result of the search or False
|
* @return array | False The array of the result of the search or False
|
||||||
**/
|
**/
|
||||||
private function getResultFromCache() {
|
private function getResultFromCache() {
|
||||||
if ($this -> cacheIsEnabled()) {
|
if ($this -> cacheIsEnabled()) {
|
||||||
|
@ -1097,9 +1097,9 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Get page informations to display
|
* Get page informations to display
|
||||||
*
|
*
|
||||||
* @param[in] $page integer The number of the page
|
* @param boolean $purgeParams The number of the page
|
||||||
*
|
*
|
||||||
* @retval array The information of the page
|
* @return array The information of the page
|
||||||
**/
|
**/
|
||||||
public function getPage($page=1) {
|
public function getPage($page=1) {
|
||||||
if (!LSsession::loadLSclass('LSsearchEntry')) {
|
if (!LSsession::loadLSclass('LSsearchEntry')) {
|
||||||
|
@ -1147,7 +1147,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Get search entries
|
* Get search entries
|
||||||
*
|
*
|
||||||
* @retval array The entries
|
* @return array The entries
|
||||||
**/
|
**/
|
||||||
public function getSearchEntries() {
|
public function getSearchEntries() {
|
||||||
if (!LSsession::loadLSclass('LSsearchEntry')) {
|
if (!LSsession::loadLSclass('LSsearchEntry')) {
|
||||||
|
@ -1174,9 +1174,9 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Access to information of this object
|
* Access to information of this object
|
||||||
*
|
*
|
||||||
* @param[in] $key string The key of the info
|
* @param string $LSobject The key of the info
|
||||||
*
|
*
|
||||||
* @retval mixed The info
|
* @return mixed The info
|
||||||
**/
|
**/
|
||||||
public function __get($key) {
|
public function __get($key) {
|
||||||
$params = array (
|
$params = array (
|
||||||
|
@ -1275,10 +1275,10 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Function use with uasort to sort two entry
|
* Function use with uasort to sort two entry
|
||||||
*
|
*
|
||||||
* @param[in] $a array One line of result
|
* @param string $LSobject One line of result
|
||||||
* @param[in] $b array One line of result
|
* @param string $LSobject One line of result
|
||||||
*
|
*
|
||||||
* @retval int Value for uasort
|
* @return int Value for uasort
|
||||||
**/
|
**/
|
||||||
private function _sortTwoEntry(&$a,&$b) {
|
private function _sortTwoEntry(&$a,&$b) {
|
||||||
$sortBy = $this -> params['sortBy'];
|
$sortBy = $this -> params['sortBy'];
|
||||||
|
@ -1305,7 +1305,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* IT'S FUNCTION IS VERY IMPORTANT !!!
|
* IT'S FUNCTION IS VERY IMPORTANT !!!
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function afterUsingResult() {
|
public function afterUsingResult() {
|
||||||
$this -> addResultToCache();
|
$this -> addResultToCache();
|
||||||
|
@ -1314,7 +1314,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Redirect user to object view if the search have only one result
|
* Redirect user to object view if the search have only one result
|
||||||
*
|
*
|
||||||
* @retval boolean True only if user have been redirected
|
* @return boolean True only if user have been redirected
|
||||||
**/
|
**/
|
||||||
public function redirectWhenOnlyOneResult() {
|
public function redirectWhenOnlyOneResult() {
|
||||||
if ($this -> total == 1 && $this -> result && self::formIsSubmited()) {
|
if ($this -> total == 1 && $this -> result && self::formIsSubmited()) {
|
||||||
|
@ -1326,7 +1326,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Run the sort if it's enabled and if the result is not in the cache
|
* Run the sort if it's enabled and if the result is not in the cache
|
||||||
*
|
*
|
||||||
* @retval boolean True on success or false
|
* @return boolean True on success or false
|
||||||
**/
|
**/
|
||||||
private function doSort() {
|
private function doSort() {
|
||||||
if (!$this -> sort) {
|
if (!$this -> sort) {
|
||||||
|
@ -1373,7 +1373,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
* Returns the id of table rows in the result sorted according to criteria
|
* Returns the id of table rows in the result sorted according to criteria
|
||||||
* defined in the parameters
|
* defined in the parameters
|
||||||
*
|
*
|
||||||
* @retval array The Table of id lines of results sorted
|
* @return array The Table of id lines of results sorted
|
||||||
**/
|
**/
|
||||||
public function getSortTable() {
|
public function getSortTable() {
|
||||||
if (isset($this -> result['sort'][$this -> params['sortBy']][$this -> params['sortDirection']])) {
|
if (isset($this -> result['sort'][$this -> params['sortBy']][$this -> params['sortDirection']])) {
|
||||||
|
@ -1385,7 +1385,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* List LSsearchEntry objects
|
* List LSsearchEntry objects
|
||||||
*
|
*
|
||||||
* @retval Array DN associate with name
|
* @return array DN associate with name
|
||||||
**/
|
**/
|
||||||
public function listEntries() {
|
public function listEntries() {
|
||||||
if (!LSsession::loadLSclass('LSsearchEntry')) {
|
if (!LSsession::loadLSclass('LSsearchEntry')) {
|
||||||
|
@ -1416,7 +1416,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* List objects name
|
* List objects name
|
||||||
*
|
*
|
||||||
* @retval Array DN associate with name
|
* @return array DN associate with name
|
||||||
**/
|
**/
|
||||||
public function listObjectsName() {
|
public function listObjectsName() {
|
||||||
$entries = $this -> listEntries();
|
$entries = $this -> listEntries();
|
||||||
|
@ -1431,7 +1431,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* List LSldapObjects
|
* List LSldapObjects
|
||||||
*
|
*
|
||||||
* @retval Array of LSldapObjects
|
* @return array of LSldapObjects
|
||||||
**/
|
**/
|
||||||
public function listObjects() {
|
public function listObjects() {
|
||||||
$retval=array();
|
$retval=array();
|
||||||
|
@ -1453,7 +1453,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* List objects dn
|
* List objects dn
|
||||||
*
|
*
|
||||||
* @retval Array of DN
|
* @return array of DN
|
||||||
**/
|
**/
|
||||||
public function listObjectsDn() {
|
public function listObjectsDn() {
|
||||||
$retval=array();
|
$retval=array();
|
||||||
|
@ -1474,7 +1474,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* CLI search command
|
* CLI search command
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array Command arguments :
|
* @param string $LSobject Command arguments :
|
||||||
* - Positional arguments :
|
* - Positional arguments :
|
||||||
* - LSobject type
|
* - LSobject type
|
||||||
* - patterns
|
* - patterns
|
||||||
|
@ -1495,7 +1495,7 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
* - -e|--extra-columns : Display extra columns
|
* - -e|--extra-columns : Display extra columns
|
||||||
* - -p|--page : page number to show (starting by 1, default: first one)
|
* - -p|--page : page number to show (starting by 1, default: first one)
|
||||||
*
|
*
|
||||||
* @retval boolean True on success, false otherwise
|
* @return boolean True on success, false otherwise
|
||||||
**/
|
**/
|
||||||
public static function cli_search($command_args) {
|
public static function cli_search($command_args) {
|
||||||
$objType = null;
|
$objType = null;
|
||||||
|
@ -1716,12 +1716,12 @@ class LSsearch extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Args autocompleter for CLI command search
|
* Args autocompleter for CLI command search
|
||||||
*
|
*
|
||||||
* @param[in] $command_args array List of already typed words of the command
|
* @param string $LSobject List of already typed words of the command
|
||||||
* @param[in] $comp_word_num int The command word number to autocomplete
|
* @param string $LSobject The command word number to autocomplete
|
||||||
* @param[in] $comp_word string The command word to autocomplete
|
* @param string $LSobject The command word to autocomplete
|
||||||
* @param[in] $opts array List of global available options
|
* @param string $LSobject List of global available options
|
||||||
*
|
*
|
||||||
* @retval array List of available options for the word to autocomplete
|
* @return array List of available options for the word to autocomplete
|
||||||
**/
|
**/
|
||||||
public static function cli_search_args_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
public static function cli_search_args_autocompleter($command_args, $comp_word_num, $comp_word, $opts) {
|
||||||
$command_opts = array (
|
$command_opts = array (
|
||||||
|
|
|
@ -59,9 +59,9 @@ class LSsearchEntry extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param[in] $LSobject string The LdapObject type of search
|
* @param string $LSobject The LdapObject type of search
|
||||||
* @param[in] $params array Parameters of search
|
* @param string $LSobject Parameters of search
|
||||||
* @param[in] $resultEntry array The data of the result entry
|
* @param string $LSobject The data of the result entry
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
public function __construct(&$LSsearch, $LSobject, $params, &$result, $id) {
|
public function __construct(&$LSsearch, $LSobject, $params, &$result, $id) {
|
||||||
|
@ -81,7 +81,7 @@ class LSsearchEntry extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Allow conversion of LSsearchEntry to string
|
* Allow conversion of LSsearchEntry to string
|
||||||
*
|
*
|
||||||
* @retval string The string representation of the LSsearchEntry
|
* @return string The string representation of the LSsearchEntry
|
||||||
*/
|
*/
|
||||||
public function __toString() {
|
public function __toString() {
|
||||||
return $this -> LSsearch." -> <LSsearchEntry of ".$this -> dn." (ID #".$this -> id.")>";
|
return $this -> LSsearch." -> <LSsearchEntry of ".$this -> dn." (ID #".$this -> id.")>";
|
||||||
|
@ -90,9 +90,9 @@ class LSsearchEntry extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Get text value of entry
|
* Get text value of entry
|
||||||
*
|
*
|
||||||
* @param[in] $key string The name of the value
|
* @param string $LSobject The name of the value
|
||||||
*
|
*
|
||||||
* @retval mixed The value
|
* @return mixed The value
|
||||||
**/
|
**/
|
||||||
public function get($key) {
|
public function get($key) {
|
||||||
if (in_array($key,array_keys($this -> attrs))) {
|
if (in_array($key,array_keys($this -> attrs))) {
|
||||||
|
@ -112,10 +112,10 @@ class LSsearchEntry extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Add value in array $this -> other_values
|
* Add value in array $this -> other_values
|
||||||
*
|
*
|
||||||
* @param[in] $name string The value name
|
* @param string $LSobject The value name
|
||||||
* @param[in] $value mixed The value
|
* @param string $LSobject The value
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public function registerOtherValue($name,$value) {
|
public function registerOtherValue($name,$value) {
|
||||||
$this -> other_values[$name]=$value;
|
$this -> other_values[$name]=$value;
|
||||||
|
@ -124,9 +124,9 @@ class LSsearchEntry extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Get formated text value of entry
|
* Get formated text value of entry
|
||||||
*
|
*
|
||||||
* @param[in] $format string The format of the value
|
* @param string $LSobject The format of the value
|
||||||
*
|
*
|
||||||
* @retval mixed The formated value
|
* @return mixed The formated value
|
||||||
**/
|
**/
|
||||||
public function getFData($format) {
|
public function getFData($format) {
|
||||||
return getFData($format,$this,'get');
|
return getFData($format,$this,'get');
|
||||||
|
@ -136,9 +136,9 @@ class LSsearchEntry extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Access to infos of the entry
|
* Access to infos of the entry
|
||||||
*
|
*
|
||||||
* @param[in] $key string The name of the value
|
* @param string $LSobject The name of the value
|
||||||
*
|
*
|
||||||
* @retval mixed The value
|
* @return mixed The value
|
||||||
**/
|
**/
|
||||||
public function __get($key) {
|
public function __get($key) {
|
||||||
if ($key=='displayName') {
|
if ($key=='displayName') {
|
||||||
|
@ -271,7 +271,7 @@ class LSsearchEntry extends LSlog_staticLoggerClass {
|
||||||
* @param[] $default The default value (default : null)
|
* @param[] $default The default value (default : null)
|
||||||
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
||||||
*
|
*
|
||||||
* @retval mixed The configuration parameter value or default value if not set
|
* @return mixed The configuration parameter value or default value if not set
|
||||||
**/
|
**/
|
||||||
function getConfig($param, $default=null, $cast=null) {
|
function getConfig($param, $default=null, $cast=null) {
|
||||||
return LSconfig :: get($param, $default, $cast, $this -> params);
|
return LSconfig :: get($param, $default, $cast, $this -> params);
|
||||||
|
|
|
@ -27,7 +27,7 @@ class LSselect extends LSlog_staticLoggerClass {
|
||||||
/*
|
/*
|
||||||
* Méthode chargeant les dépendances d'affichage
|
* Méthode chargeant les dépendances d'affichage
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function loadDependenciesDisplay() {
|
public static function loadDependenciesDisplay() {
|
||||||
if (LSsession :: loadLSclass('LSsmoothbox')) {
|
if (LSsession :: loadLSclass('LSsmoothbox')) {
|
||||||
|
@ -39,8 +39,8 @@ class LSselect extends LSlog_staticLoggerClass {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Init a LSobjects selection
|
* Init a LSobjects selection
|
||||||
* @param[in] $id string The LSselect ID
|
* @param string $id The LSselect ID
|
||||||
* @param[in] $LSobjects array Selectable LSobject types configuration. Must be an array
|
* @param array $LSobjects Selectable LSobject types configuration. Must be an array
|
||||||
* with object type as key and configuration as value with the
|
* with object type as key and configuration as value with the
|
||||||
* following info:
|
* following info:
|
||||||
* - object_type: the LSobject type (same as key, required)
|
* - object_type: the LSobject type (same as key, required)
|
||||||
|
@ -48,9 +48,9 @@ class LSselect extends LSlog_staticLoggerClass {
|
||||||
* - filter: LDAP filter string for selectable objects (optional, default: no filter)
|
* - filter: LDAP filter string for selectable objects (optional, default: no filter)
|
||||||
* - onlyAccessible: filter on only accessible objects (optional, default: false)
|
* - onlyAccessible: filter on only accessible objects (optional, default: false)
|
||||||
* - editableAttr: attribute name of object that must be writable to the object be selectable (optional)
|
* - editableAttr: attribute name of object that must be writable to the object be selectable (optional)
|
||||||
* @param[in] $multiple boolean True if this selection permit to select more than one object, False otherwise (optional,
|
* @param boolean $multiple True if this selection permit to select more than one object, False otherwise (optional,
|
||||||
* default: false)
|
* default: false)
|
||||||
* @param[in] $current_selected_objects array|null Array of current selected objects (optional, see setSelectedObjects for format specification)
|
* @param array|null $current_selected_objects Array of current selected objects (optional, see setSelectedObjects for format specification)
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function init($id, $LSobjects, $multiple=false, $current_selected_objects=null) {
|
public static function init($id, $LSobjects, $multiple=false, $current_selected_objects=null) {
|
||||||
|
@ -69,9 +69,9 @@ class LSselect extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check a LSselect exist by ID
|
* Check a LSselect exist by ID
|
||||||
*
|
*
|
||||||
* @param[in] $id string The LSselect ID
|
* @param string $id The LSselect ID
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public static function exists($id) {
|
public static function exists($id) {
|
||||||
if (isset($_SESSION['LSselect']) && is_array($_SESSION['LSselect']) &&
|
if (isset($_SESSION['LSselect']) && is_array($_SESSION['LSselect']) &&
|
||||||
|
@ -89,7 +89,7 @@ class LSselect extends LSlog_staticLoggerClass {
|
||||||
* @param[] $cast Cast string|null resulting value in specific type
|
* @param[] $cast Cast string|null resulting value in specific type
|
||||||
* (optional, default : null=disabled)
|
* (optional, default : null=disabled)
|
||||||
*
|
*
|
||||||
* @retval mixed The configuration parameter value or default value if not set
|
* @return mixed The configuration parameter value or default value if not set
|
||||||
**/
|
**/
|
||||||
public static function getConfig($id, $key, $default=null, $cast=null) {
|
public static function getConfig($id, $key, $default=null, $cast=null) {
|
||||||
if (!self :: exists($id))
|
if (!self :: exists($id))
|
||||||
|
@ -100,9 +100,9 @@ class LSselect extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check if LSselect exist and is multiple
|
* Check if LSselect exist and is multiple
|
||||||
*
|
*
|
||||||
* @param[in] $id string The LSselect ID
|
* @param string $id The LSselect ID
|
||||||
*
|
*
|
||||||
* @retval boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public static function isMultiple($id) {
|
public static function isMultiple($id) {
|
||||||
return self :: getConfig($id, 'multiple', false, 'bool');
|
return self :: getConfig($id, 'multiple', false, 'bool');
|
||||||
|
@ -111,11 +111,11 @@ class LSselect extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Get LSsearch object corresponding to the specified selection
|
* Get LSsearch object corresponding to the specified selection
|
||||||
*
|
*
|
||||||
* @param[in] $id string The LSselect ID
|
* @param string $id The LSselect ID
|
||||||
* @param[in] $object_type string|null The object type of the search (optional,
|
* @param string|null $object_type The object type of the search (optional,
|
||||||
* default: first one object type configured)
|
* default: first one object type configured)
|
||||||
*
|
*
|
||||||
* @retval LSsearch|false The LSsearch object, or false in case of error
|
* @return LSsearch|false The LSsearch object, or false in case of error
|
||||||
*/
|
*/
|
||||||
public static function &getSearch($id, $object_type=null) {
|
public static function &getSearch($id, $object_type=null) {
|
||||||
// Check parameters
|
// Check parameters
|
||||||
|
@ -176,9 +176,9 @@ class LSselect extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Get selectable object types
|
* Get selectable object types
|
||||||
*
|
*
|
||||||
* @param[in] $id string The LSselect ID
|
* @param string $id The LSselect ID
|
||||||
*
|
*
|
||||||
* @retval array|false Array of selectable object types with name as key
|
* @return array|false Array of selectable object types with name as key
|
||||||
* and label as value, or false if LSselect doesn't exists.
|
* and label as value, or false if LSselect doesn't exists.
|
||||||
*/
|
*/
|
||||||
public static function getSelectableObjectTypes($id) {
|
public static function getSelectableObjectTypes($id) {
|
||||||
|
@ -194,9 +194,9 @@ class LSselect extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Get selectable objects info
|
* Get selectable objects info
|
||||||
*
|
*
|
||||||
* @param[in] $id string The LSselect ID
|
* @param string $id The LSselect ID
|
||||||
*
|
*
|
||||||
* @retval array|false Array of selectable object info with objects's DN as key
|
* @return array|false Array of selectable object info with objects's DN as key
|
||||||
* and array of object's info as value. Objects's info returned
|
* and array of object's info as value. Objects's info returned
|
||||||
* currently contains only the object type (object_type). if
|
* currently contains only the object type (object_type). if
|
||||||
* LSselect specified doesn't exists, this method return false.
|
* LSselect specified doesn't exists, this method return false.
|
||||||
|
@ -212,17 +212,17 @@ class LSselect extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Set selectable objects info
|
* Set selectable objects info
|
||||||
*
|
*
|
||||||
* @param[in] $id string The LSselect ID
|
* @param string $id The LSselect ID
|
||||||
* @param[in] $selected_objects array Array of selectable object info with objects's DN
|
* @param array $selected_objects Array of selectable object info with objects's DN
|
||||||
* as key and array of object's info as value. Objects's
|
* as key and array of object's info as value. Objects's
|
||||||
* info currently contains only the object type (key=object_type).
|
* info currently contains only the object type (key=object_type).
|
||||||
*
|
*
|
||||||
* @retval array|false Array of selectable object info with objects's DN as key
|
* @return array|false Array of selectable object info with objects's DN as key
|
||||||
* and array of object's info as value. Objects's info returned
|
* and array of object's info as value. Objects's info returned
|
||||||
* currently contains only the object type (object_type). if
|
* currently contains only the object type (object_type). if
|
||||||
* LSselect specified doesn't exists, this method return false.
|
* LSselect specified doesn't exists, this method return false.
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function setSelectedObjects($id, $selected_objects) {
|
public static function setSelectedObjects($id, $selected_objects) {
|
||||||
if (!self :: exists($id))
|
if (!self :: exists($id))
|
||||||
|
@ -247,11 +247,11 @@ class LSselect extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check if an object is selectable
|
* Check if an object is selectable
|
||||||
*
|
*
|
||||||
* @param[in] $id string The LSselect ID
|
* @param string $id The LSselect ID
|
||||||
* @param[in] $object_type string The object type
|
* @param string $object_type The object type
|
||||||
* @param[in] $object_dn string The object DN
|
* @param string $object_dn The object DN
|
||||||
*
|
*
|
||||||
* @retval boolean True if object is selectable, false otherwise
|
* @return boolean True if object is selectable, false otherwise
|
||||||
*/
|
*/
|
||||||
public static function checkObjectIsSelectable($id, $object_type, $object_dn) {
|
public static function checkObjectIsSelectable($id, $object_type, $object_dn) {
|
||||||
if (!self :: exists($id)) {
|
if (!self :: exists($id)) {
|
||||||
|
@ -303,9 +303,9 @@ class LSselect extends LSlog_staticLoggerClass {
|
||||||
* Data in answer:
|
* Data in answer:
|
||||||
* - success: True if object added to selection, false otherwise
|
* - success: True if object added to selection, false otherwise
|
||||||
*
|
*
|
||||||
* @param[in] &$data Reference to returned data array
|
* @param array &$data Reference to returned data array
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function ajax_addSelectedObject(&$data) {
|
public static function ajax_addSelectedObject(&$data) {
|
||||||
$data['success'] = false;
|
$data['success'] = false;
|
||||||
|
@ -350,9 +350,9 @@ class LSselect extends LSlog_staticLoggerClass {
|
||||||
* Data in answer:
|
* Data in answer:
|
||||||
* - success: True if object added to selection, false otherwise
|
* - success: True if object added to selection, false otherwise
|
||||||
*
|
*
|
||||||
* @param[in] &$data Reference to returned data array
|
* @param array &$data Reference to returned data array
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function ajax_dropSelectedObject(&$data) {
|
public static function ajax_dropSelectedObject(&$data) {
|
||||||
$data['success'] = false;
|
$data['success'] = false;
|
||||||
|
@ -388,9 +388,9 @@ class LSselect extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* Data in answer: any
|
* Data in answer: any
|
||||||
*
|
*
|
||||||
* @param[in] &$data Reference to returned data array
|
* @param array &$data Reference to returned data array
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function ajax_updateSelectedObjects(&$data) {
|
public static function ajax_updateSelectedObjects(&$data) {
|
||||||
if (isset($_REQUEST['LSselect_id']) && isset($_REQUEST['selected_objects']) ) {
|
if (isset($_REQUEST['LSselect_id']) && isset($_REQUEST['selected_objects']) ) {
|
||||||
|
@ -419,9 +419,9 @@ class LSselect extends LSlog_staticLoggerClass {
|
||||||
* Data in answer:
|
* Data in answer:
|
||||||
* - objects: The selected objects info (see getSelectedObjects for format)
|
* - objects: The selected objects info (see getSelectedObjects for format)
|
||||||
*
|
*
|
||||||
* @param[in] &$data Reference to returned data array
|
* @param array &$data Reference to returned data array
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function ajax_getSelectedObjects(&$data) {
|
public static function ajax_getSelectedObjects(&$data) {
|
||||||
if (isset($_REQUEST['LSselect_id'])) {
|
if (isset($_REQUEST['LSselect_id'])) {
|
||||||
|
@ -441,10 +441,10 @@ class LSselect extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* LSsearchEntry selectable customInfos method : check if object is selectable
|
* LSsearchEntry selectable customInfos method : check if object is selectable
|
||||||
*
|
*
|
||||||
* @param[in] $obj LSsearchEntry The LSsearchEntry object
|
* @param LSsearchEntry $obj The LSsearchEntry object
|
||||||
* @param[in] $id string The LSselect ID
|
* @param string $id The LSselect ID
|
||||||
*
|
*
|
||||||
* @retval boolean True if object is selectable, False otherwise
|
* @return boolean True if object is selectable, False otherwise
|
||||||
*/
|
*/
|
||||||
public static function selectable($obj, $id) {
|
public static function selectable($obj, $id) {
|
||||||
$editableAttr = self :: getConfig($id, "LSobjects.".$obj->type.".editableAttr");
|
$editableAttr = self :: getConfig($id, "LSobjects.".$obj->type.".editableAttr");
|
||||||
|
@ -459,10 +459,10 @@ class LSselect extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* LSsearchEntry selected customInfos method : check if object is selected
|
* LSsearchEntry selected customInfos method : check if object is selected
|
||||||
*
|
*
|
||||||
* @param[in] $obj LSsearchEntry The LSsearchEntry object
|
* @param LSsearchEntry $obj The LSsearchEntry object
|
||||||
* @param[in] $id string The LSselect ID
|
* @param string $id The LSselect ID
|
||||||
*
|
*
|
||||||
* @retval boolean True if object is selected, False otherwise
|
* @return boolean True if object is selected, False otherwise
|
||||||
*/
|
*/
|
||||||
public static function selected($obj, $id) {
|
public static function selected($obj, $id) {
|
||||||
if (self :: exists($id) &&
|
if (self :: exists($id) &&
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -25,7 +25,7 @@ class LSsmoothbox {
|
||||||
/*
|
/*
|
||||||
* Méthode chargeant les dépendances d'affichage
|
* Méthode chargeant les dépendances d'affichage
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function loadDependenciesDisplay() {
|
public static function loadDependenciesDisplay() {
|
||||||
if (LSsession :: loadLSclass('LSconfirmBox')) {
|
if (LSsession :: loadLSclass('LSconfirmBox')) {
|
||||||
|
|
|
@ -99,9 +99,9 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
* Set configuration from parameter $config and initialize
|
* Set configuration from parameter $config and initialize
|
||||||
* Smarty object.
|
* Smarty object.
|
||||||
*
|
*
|
||||||
* @param[in] $config array LStemplate configuration
|
* @param array $config LStemplate configuration
|
||||||
*
|
*
|
||||||
* @retval boolean True on success, False instead
|
* @return boolean True on success, False instead
|
||||||
**/
|
**/
|
||||||
public static function start($config) {
|
public static function start($config) {
|
||||||
// Trigger starting event
|
// Trigger starting event
|
||||||
|
@ -179,7 +179,7 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
*
|
*
|
||||||
* Return LS_THEME contanst value or 'default' if not defined
|
* Return LS_THEME contanst value or 'default' if not defined
|
||||||
*
|
*
|
||||||
* @retval string The default directory path of files
|
* @return string The default directory path of files
|
||||||
**/
|
**/
|
||||||
public static function getDefaultDir() {
|
public static function getDefaultDir() {
|
||||||
if (defined('LS_THEME'))
|
if (defined('LS_THEME'))
|
||||||
|
@ -191,12 +191,12 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return the path of the file to use
|
* Return the path of the file to use
|
||||||
*
|
*
|
||||||
* @param[in] string $name The file name (eg: mail.png)
|
* @param string $name The file name (eg: mail.png)
|
||||||
* @param[in] string $root_dir The root directory (eg: images)
|
* @param string $name The root directory (eg: images)
|
||||||
* @param[in] string $default_dir The default directory (eg: default)
|
* @param string $name The default directory (eg: default)
|
||||||
* @param[in] bool $with_nocache If true, include nocache URL param (default: false)
|
* @param string $name If true, include nocache URL param (default: false)
|
||||||
*
|
*
|
||||||
* @retval string The path of the file
|
* @return string The path of the file
|
||||||
**/
|
**/
|
||||||
public static function getFilePath($file, $root_dir, $default_dir=null, $with_nocache=false) {
|
public static function getFilePath($file, $root_dir, $default_dir=null, $with_nocache=false) {
|
||||||
if ($default_dir === null)
|
if ($default_dir === null)
|
||||||
|
@ -234,10 +234,10 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return the path of the image file to use
|
* Return the path of the image file to use
|
||||||
*
|
*
|
||||||
* @param[in] string $image The image name (eg: mail)
|
* @param string $name The image name (eg: mail)
|
||||||
* @param[in] bool $with_nocache If true, include nocache URL param (default: false)
|
* @param string $name If true, include nocache URL param (default: false)
|
||||||
*
|
*
|
||||||
* @retval string The path of the image file
|
* @return string The path of the image file
|
||||||
**/
|
**/
|
||||||
public static function getImagePath($image, $with_nocache=false) {
|
public static function getImagePath($image, $with_nocache=false) {
|
||||||
$exts=array('svg', 'png', 'gif', 'jpg');
|
$exts=array('svg', 'png', 'gif', 'jpg');
|
||||||
|
@ -251,10 +251,10 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return the path of the CSS file to use
|
* Return the path of the CSS file to use
|
||||||
*
|
*
|
||||||
* @param[in] string $css The CSS name (eg: main.css)
|
* @param string $name The CSS name (eg: main.css)
|
||||||
* @param[in] bool $with_nocache If true, include nocache URL param (default: false)
|
* @param string $name If true, include nocache URL param (default: false)
|
||||||
*
|
*
|
||||||
* @retval string The path of the CSS file
|
* @return string The path of the CSS file
|
||||||
**/
|
**/
|
||||||
public static function getCSSPath($css, $with_nocache=false) {
|
public static function getCSSPath($css, $with_nocache=false) {
|
||||||
return self :: getFilePath($css, self :: $config['css_dir'], Null, $with_nocache);
|
return self :: getFilePath($css, self :: $config['css_dir'], Null, $with_nocache);
|
||||||
|
@ -263,10 +263,10 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return the path of the JS file to use
|
* Return the path of the JS file to use
|
||||||
*
|
*
|
||||||
* @param[in] string $js The JS name (eg: LSdefaults.js)
|
* @param string $name The JS name (eg: LSdefaults.js)
|
||||||
* @param[in] bool $with_nocache If true, include nocache URL param (default: false)
|
* @param string $name If true, include nocache URL param (default: false)
|
||||||
*
|
*
|
||||||
* @retval string The path of the CSS file
|
* @return string The path of the CSS file
|
||||||
**/
|
**/
|
||||||
public static function getJSPath($js, $with_nocache=false) {
|
public static function getJSPath($js, $with_nocache=false) {
|
||||||
return self :: getFilePath($js, self :: $config['js_dir'], Null, $with_nocache);
|
return self :: getFilePath($js, self :: $config['js_dir'], Null, $with_nocache);
|
||||||
|
@ -275,10 +275,10 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return the path of the libary file to use
|
* Return the path of the libary file to use
|
||||||
*
|
*
|
||||||
* @param[in] string $file_path The lib file path (eg: arian-mootools-datepicker/Picker.js)
|
* @param string $name The lib file path (eg: arian-mootools-datepicker/Picker.js)
|
||||||
* @param[in] bool $with_nocache If true, include nocache URL param (default: false)
|
* @param string $name If true, include nocache URL param (default: false)
|
||||||
*
|
*
|
||||||
* @retval string The path of the Lib file
|
* @return string The path of the Lib file
|
||||||
**/
|
**/
|
||||||
public static function getLibFilePath($file_path, $with_nocache=false) {
|
public static function getLibFilePath($file_path, $with_nocache=false) {
|
||||||
return self :: getFilePath($file_path, self :: $config['libs_dir'], Null, $with_nocache);
|
return self :: getFilePath($file_path, self :: $config['libs_dir'], Null, $with_nocache);
|
||||||
|
@ -287,10 +287,10 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return the path of the Smarty template file to use
|
* Return the path of the Smarty template file to use
|
||||||
*
|
*
|
||||||
* @param[in] string $template The template name (eg: base.tpl)
|
* @param string $name The template name (eg: base.tpl)
|
||||||
* @param[in] bool $with_nocache If true, include nocache URL param (default: false)
|
* @param string $name If true, include nocache URL param (default: false)
|
||||||
*
|
*
|
||||||
* @retval string The path of the Smarty template file
|
* @return string The path of the Smarty template file
|
||||||
**/
|
**/
|
||||||
public static function getTemplatePath($template, $with_nocache=false) {
|
public static function getTemplatePath($template, $with_nocache=false) {
|
||||||
if (in_array($template, self :: $deprecated_template_files))
|
if (in_array($template, self :: $deprecated_template_files))
|
||||||
|
@ -306,9 +306,9 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return the nocache value of the specify file
|
* Return the nocache value of the specify file
|
||||||
*
|
*
|
||||||
* @param[in] string $file The file path
|
* @param string $name The file path
|
||||||
*
|
*
|
||||||
* @retval string The specified file's nocache value
|
* @return string The specified file's nocache value
|
||||||
**/
|
**/
|
||||||
public static function getNoCacheFileValue($file) {
|
public static function getNoCacheFileValue($file) {
|
||||||
$stat = @stat($file);
|
$stat = @stat($file);
|
||||||
|
@ -320,9 +320,9 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Return the content of a Smarty template file.
|
* Return the content of a Smarty template file.
|
||||||
*
|
*
|
||||||
* @param[in] string $template The template name (eg: base.tpl)
|
* @param string $name The template name (eg: base.tpl)
|
||||||
*
|
*
|
||||||
* @retval string The content of the Smarty template file
|
* @return string The content of the Smarty template file
|
||||||
**/
|
**/
|
||||||
public static function getTemplateSource($template) {
|
public static function getTemplateSource($template) {
|
||||||
$tpl_path=self :: getTemplatePath($template);
|
$tpl_path=self :: getTemplatePath($template);
|
||||||
|
@ -342,9 +342,9 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
* Return the timestamp of the last change of a Smarty
|
* Return the timestamp of the last change of a Smarty
|
||||||
* template file.
|
* template file.
|
||||||
*
|
*
|
||||||
* @param[in] string $template The template name (eg: base.tpl)
|
* @param string $name The template name (eg: base.tpl)
|
||||||
*
|
*
|
||||||
* @retval string The timestamp of the last change of the Smarty template file
|
* @return string The timestamp of the last change of the Smarty template file
|
||||||
**/
|
**/
|
||||||
public static function getTemplateTimestamp($template) {
|
public static function getTemplateTimestamp($template) {
|
||||||
$tpl_path=self :: getTemplatePath($template);
|
$tpl_path=self :: getTemplatePath($template);
|
||||||
|
@ -359,10 +359,10 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Assign template variable
|
* Assign template variable
|
||||||
*
|
*
|
||||||
* @param[in] string $name The variable name
|
* @param string $name The variable name
|
||||||
* @param[in] mixed $value The variable value
|
* @param string $name The variable value
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function assign($name,$value) {
|
public static function assign($name,$value) {
|
||||||
return self :: $_smarty -> assign($name,$value);
|
return self :: $_smarty -> assign($name,$value);
|
||||||
|
@ -371,7 +371,7 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Assign common template variables
|
* Assign common template variables
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function assignCommonVars() {
|
public static function assignCommonVars() {
|
||||||
// JS config
|
// JS config
|
||||||
|
@ -414,9 +414,9 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Display a template
|
* Display a template
|
||||||
*
|
*
|
||||||
* @param[in] string $template The template name (eg: base_connected.tpl)
|
* @param string $name The template name (eg: base_connected.tpl)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function display($template) {
|
public static function display($template) {
|
||||||
// Trigger displaying event
|
// Trigger displaying event
|
||||||
|
@ -445,9 +445,9 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Fetch a template
|
* Fetch a template
|
||||||
*
|
*
|
||||||
* @param[in] string $template The template name (eg: base_connected.tpl)
|
* @param string $name The template name (eg: base_connected.tpl)
|
||||||
*
|
*
|
||||||
* @retval string The template compiled
|
* @return string The template compiled
|
||||||
**/
|
**/
|
||||||
public static function fetch($template) {
|
public static function fetch($template) {
|
||||||
try {
|
try {
|
||||||
|
@ -461,9 +461,9 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Handle fatal error
|
* Handle fatal error
|
||||||
*
|
*
|
||||||
* @param[in] $error string|null Error message (optional)
|
* @param string|null $error Error message (optional)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function fatal_error($error=null) {
|
public static function fatal_error($error=null) {
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
|
@ -493,10 +493,10 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Register a template function
|
* Register a template function
|
||||||
*
|
*
|
||||||
* @param[in] string $name The function name in template
|
* @param string $name The function name in template
|
||||||
* @param[in] string $function_name The function name in PHP
|
* @param string $name The function name in PHP
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function registerFunction($name,$function_name) {
|
public static function registerFunction($name,$function_name) {
|
||||||
LStemplate_register_function($name,$function_name);
|
LStemplate_register_function($name,$function_name);
|
||||||
|
@ -505,11 +505,11 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Registered an action on a specific event
|
* Registered an action on a specific event
|
||||||
*
|
*
|
||||||
* @param[in] $event string The event name
|
* @param array $config The event name
|
||||||
* @param[in] $callable callable The callable to run on event
|
* @param callable $callable The callable to run on event
|
||||||
* @param[in] $param mixed Paremeters that will be pass to the callable
|
* @param array $config Paremeters that will be pass to the callable
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function addEvent($event,$callable,$param=NULL) {
|
public static function addEvent($event,$callable,$param=NULL) {
|
||||||
self :: $_events[$event][] = array(
|
self :: $_events[$event][] = array(
|
||||||
|
@ -521,9 +521,9 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Run triggered actions on specific event
|
* Run triggered actions on specific event
|
||||||
*
|
*
|
||||||
* @param[in] $event string Event name
|
* @param array $config Event name
|
||||||
*
|
*
|
||||||
* @retval boolean True if all triggered actions succefully runned, false otherwise
|
* @return boolean True if all triggered actions succefully runned, false otherwise
|
||||||
*/
|
*/
|
||||||
public static function fireEvent($event) {
|
public static function fireEvent($event) {
|
||||||
$return = true;
|
$return = true;
|
||||||
|
@ -536,12 +536,12 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
call_user_func_array($e['callable'],array(&$e['param']));
|
call_user_func_array($e['callable'],array(&$e['param']));
|
||||||
}
|
}
|
||||||
catch(Exception $er) {
|
catch(Exception $er) {
|
||||||
LSerror :: addErrorCode('LStemplate_03',array('callable' => getCallableName($e['callable']),'event' => $event));
|
LSerror :: addErrorCode('LStemplate_03',array('callable' => format_callable($e['callable']),'event' => $event));
|
||||||
$return = false;
|
$return = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LSerror :: addErrorCode('LStemplate_02',array('callable' => getCallableName($e['callable']),'event' => $event));
|
LSerror :: addErrorCode('LStemplate_02',array('callable' => format_callable($e['callable']),'event' => $event));
|
||||||
$return = false;
|
$return = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -558,12 +558,12 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Add a JS script to load on page
|
* Add a JS script to load on page
|
||||||
*
|
*
|
||||||
* @param[in] $file string The JS filename
|
* @param array $config The JS filename
|
||||||
*
|
*
|
||||||
* Note: about old $path of the LStemplate :: addJSscript() method, corresponding to
|
* Note: about old $path of the LStemplate :: addJSscript() method, corresponding to
|
||||||
* the sub-directory path that contain the file, you could just prefix the file name.
|
* the sub-directory path that contain the file, you could just prefix the file name.
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function addJSscript($file) {
|
public static function addJSscript($file) {
|
||||||
if (!in_array($file, self :: $JSscripts))
|
if (!in_array($file, self :: $JSscripts))
|
||||||
|
@ -573,9 +573,9 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Add a library JS file to load on page
|
* Add a library JS file to load on page
|
||||||
*
|
*
|
||||||
* @param[in] $file string The JS filename
|
* @param array $config The JS filename
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function addLibJSscript($file) {
|
public static function addLibJSscript($file) {
|
||||||
if (!in_array($file, self :: $LibsJSscripts))
|
if (!in_array($file, self :: $LibsJSscripts))
|
||||||
|
@ -585,10 +585,10 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Add Javascript configuration parameter
|
* Add Javascript configuration parameter
|
||||||
*
|
*
|
||||||
* @param[in] $name string Name of the configuration parameter
|
* @param array $config Name of the configuration parameter
|
||||||
* @param[in] $val mixed Value of the configuration parameter
|
* @param array $config Value of the configuration parameter
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function addJSconfigParam($name,$val) {
|
public static function addJSconfigParam($name,$val) {
|
||||||
self :: $JSconfigParams[$name]=$val;
|
self :: $JSconfigParams[$name]=$val;
|
||||||
|
@ -597,7 +597,7 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Get Javascript configuration parameters
|
* Get Javascript configuration parameters
|
||||||
*
|
*
|
||||||
* @retval array Javascript configuration parameters
|
* @return array Javascript configuration parameters
|
||||||
*/
|
*/
|
||||||
public static function getJSconfigParam() {
|
public static function getJSconfigParam() {
|
||||||
return self :: $JSconfigParams;
|
return self :: $JSconfigParams;
|
||||||
|
@ -606,10 +606,10 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Add help info
|
* Add help info
|
||||||
*
|
*
|
||||||
* @param[in] $group string The group name of this information
|
* @param array $config The group name of this information
|
||||||
* @param[in] $info array Array of the information to add (name => value)
|
* @param array $config Array of the information to add (name => value)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function addHelpInfo($group, $info) {
|
public static function addHelpInfo($group, $info) {
|
||||||
if (is_array($info)) {
|
if (is_array($info)) {
|
||||||
|
@ -625,12 +625,12 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Add a CSS file to load on page
|
* Add a CSS file to load on page
|
||||||
*
|
*
|
||||||
* @param[in] $file string The CSS filename
|
* @param array $config The CSS filename
|
||||||
*
|
*
|
||||||
* Note: about old $path of the LStemplate :: addCssFile() method, corresponding to
|
* Note: about old $path of the LStemplate :: addCssFile() method, corresponding to
|
||||||
* the sub-directory path that contain the file, you could just prefix the file name.
|
* the sub-directory path that contain the file, you could just prefix the file name.
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function addCssFile($file) {
|
public static function addCssFile($file) {
|
||||||
if (!in_array($file, self :: $CssFiles))
|
if (!in_array($file, self :: $CssFiles))
|
||||||
|
@ -640,9 +640,9 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Add a library CSS file to load on page
|
* Add a library CSS file to load on page
|
||||||
*
|
*
|
||||||
* @param[in] $file string The CSS filename
|
* @param array $config The CSS filename
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function addLibCssFile($file) {
|
public static function addLibCssFile($file) {
|
||||||
if (!in_array($file, self :: $LibsCssFiles))
|
if (!in_array($file, self :: $LibsCssFiles))
|
||||||
|
|
|
@ -28,10 +28,10 @@
|
||||||
/**
|
/**
|
||||||
* Retrieve a resource
|
* Retrieve a resource
|
||||||
*
|
*
|
||||||
* @param[in] $tpl_name string The template name
|
* @param string $tpl_name The template name
|
||||||
* @param[in] $tpl_source string Variable passed by reference
|
* @param string $tpl_source Variable passed by reference
|
||||||
* where the result should be stored.
|
* where the result should be stored.
|
||||||
* @param[in] $smarty_obj object The Smarty object
|
* @param Smarty $smarty_obj object The Smarty object
|
||||||
*
|
*
|
||||||
* @return bool TRUE if it was able to successfully retrieve
|
* @return bool TRUE if it was able to successfully retrieve
|
||||||
* the resource and FALSE otherwise.
|
* the resource and FALSE otherwise.
|
||||||
|
@ -44,10 +44,10 @@ function LStemplate_smarty_get_template ($tpl_name, &$tpl_source, &$smarty_obj)
|
||||||
/**
|
/**
|
||||||
* Retrieve the last modification timestamp of a template
|
* Retrieve the last modification timestamp of a template
|
||||||
*
|
*
|
||||||
* @param[in] $tpl_name string The template name
|
* @param string $tpl_name The template name
|
||||||
* @param[in] $tpl_timestamp int Variable passed by reference
|
* @param int $tpl_timestamp Variable passed by reference
|
||||||
* where the result should be stored.
|
* where the result should be stored.
|
||||||
* @param[in] $smarty_obj object The Smarty object
|
* @param Smarty $smarty_obj object The Smarty object
|
||||||
*
|
*
|
||||||
* @return bool TRUE if the timestamp could be succesfully determined,
|
* @return bool TRUE if the timestamp could be succesfully determined,
|
||||||
* or FALSE otherwise
|
* or FALSE otherwise
|
||||||
|
@ -67,8 +67,8 @@ function LStemplate_smarty_get_timestamp($tpl_name, &$tpl_timestamp, &$smarty_ob
|
||||||
* This function is used only for template resources but should
|
* This function is used only for template resources but should
|
||||||
* still be defined.
|
* still be defined.
|
||||||
*
|
*
|
||||||
* @param[in] $tpl_name string The template name
|
* @param string $tpl_name The template name
|
||||||
* @param[in] $smarty_obj object The Smarty object
|
* @param Smarty $smarty_obj object The Smarty object
|
||||||
*
|
*
|
||||||
* @return bool TRUE if the template is secured, or FALSE otherwise
|
* @return bool TRUE if the template is secured, or FALSE otherwise
|
||||||
**/
|
**/
|
||||||
|
@ -84,8 +84,8 @@ function LStemplate_smarty_get_secure($tpl_name, &$smarty_obj) {
|
||||||
* src attribute. However, it should still be defined even
|
* src attribute. However, it should still be defined even
|
||||||
* for template resources.
|
* for template resources.
|
||||||
*
|
*
|
||||||
* @param[in] $tpl_name string The template name
|
* @param string $tpl_name The template name
|
||||||
* @param[in] $smarty_obj object The Smarty object
|
* @param Smarty $smarty_obj object The Smarty object
|
||||||
*
|
*
|
||||||
* @return bool TRUE if the template is trusted, or FALSE otherwise
|
* @return bool TRUE if the template is trusted, or FALSE otherwise
|
||||||
**/
|
**/
|
||||||
|
@ -104,10 +104,10 @@ LStemplate :: $_smarty -> register_resource('ls', array(
|
||||||
/**
|
/**
|
||||||
* Register a template function
|
* Register a template function
|
||||||
*
|
*
|
||||||
* @param[in] string $name The function name in template
|
* @param string $name The function name in template
|
||||||
* @param[in] string $function_name The function name in PHP
|
* @param string $function_name The function name in PHP
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function LStemplate_register_function($name,$function_name) {
|
function LStemplate_register_function($name,$function_name) {
|
||||||
LStemplate :: $_smarty -> register_function($name,$function_name);
|
LStemplate :: $_smarty -> register_function($name,$function_name);
|
||||||
|
|
|
@ -63,10 +63,10 @@ LStemplate :: $_smarty -> registerResource('ls', new Smarty_Resource_LdapSaisie(
|
||||||
/**
|
/**
|
||||||
* Register a template function
|
* Register a template function
|
||||||
*
|
*
|
||||||
* @param[in] string $name The function name in template
|
* @param string $name The function name in template
|
||||||
* @param[in] string $function_name The function name in PHP
|
* @param string $function_name The function name in PHP
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function LStemplate_register_function($name,$function_name) {
|
function LStemplate_register_function($name,$function_name) {
|
||||||
LStemplate :: $_smarty -> registerPlugin("function",$name,$function_name);
|
LStemplate :: $_smarty -> registerPlugin("function",$name,$function_name);
|
||||||
|
|
|
@ -59,12 +59,12 @@ class LSurl extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Add an URL pattern
|
* Add an URL pattern
|
||||||
*
|
*
|
||||||
* @param[in] $pattern string The URL pattern (required)
|
* @param string $pattern The URL pattern (required)
|
||||||
* @param[in] $handler callable The URL pattern handler (must be callable, required)
|
* @param callable $handler The URL pattern handler (must be callable, required)
|
||||||
* @param[in] $authenticated boolean Permit to define if this URL is accessible only for authenticated users (optional, default: true)
|
* @param boolean $authenticated Permit to define if this URL is accessible only for authenticated users (optional, default: true)
|
||||||
* @param[in] $override boolean Allow override if a command already exists with the same name (optional, default: false)
|
* @param boolean $authenticated Allow override if a command already exists with the same name (optional, default: false)
|
||||||
* @param[in] $api_mode boolean Enable API mode (optional, default: false)
|
* @param boolean $authenticated Enable API mode (optional, default: false)
|
||||||
* @param[in] $methods array|null HTTP method (optional, default: array('GET', 'POST'))
|
* @param array|null $methods HTTP method (optional, default: array('GET', 'POST'))
|
||||||
**/
|
**/
|
||||||
public static function add_handler($pattern, $handler=null, $authenticated=true, $override=true, $api_mode=false, $methods=null) {
|
public static function add_handler($pattern, $handler=null, $authenticated=true, $override=true, $api_mode=false, $methods=null) {
|
||||||
if (is_null($methods))
|
if (is_null($methods))
|
||||||
|
@ -106,10 +106,10 @@ class LSurl extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Interprets the requested URL and return the corresponding LSurlRequest object
|
* Interprets the requested URL and return the corresponding LSurlRequest object
|
||||||
*
|
*
|
||||||
* @param[in] $default_url string|null The default URL if current one does not
|
* @param array|null $methods The default URL if current one does not
|
||||||
* match with any configured pattern.
|
* match with any configured pattern.
|
||||||
*
|
*
|
||||||
* @retval LSurlRequest The LSurlRequest object corresponding to the the requested URL.
|
* @return LSurlRequest The LSurlRequest object corresponding to the the requested URL.
|
||||||
**/
|
**/
|
||||||
private static function get_request($default_url=null) {
|
private static function get_request($default_url=null) {
|
||||||
$current_url = self :: get_current_url();
|
$current_url = self :: get_current_url();
|
||||||
|
@ -156,11 +156,11 @@ class LSurl extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check if the current requested URL match with a specific pattern
|
* Check if the current requested URL match with a specific pattern
|
||||||
*
|
*
|
||||||
* @param[in] $pattern string The URL pattern
|
* @param string $pattern The URL pattern
|
||||||
* @param[in] $current_url string|false The current URL (optional)
|
* @param array|null $methods The current URL (optional)
|
||||||
* @param[in] $methods array|null HTTP method (optional, default: no check)
|
* @param array|null $methods HTTP method (optional, default: no check)
|
||||||
*
|
*
|
||||||
* @retval array|false The URL info if pattern matched, false otherwise.
|
* @return array|false The URL info if pattern matched, false otherwise.
|
||||||
**/
|
**/
|
||||||
private static function url_match($pattern, $current_url=false, $methods=null) {
|
private static function url_match($pattern, $current_url=false, $methods=null) {
|
||||||
if ($methods && !in_array($_SERVER['REQUEST_METHOD'], $methods))
|
if ($methods && !in_array($_SERVER['REQUEST_METHOD'], $methods))
|
||||||
|
@ -179,9 +179,9 @@ class LSurl extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Get the public absolute URL
|
* Get the public absolute URL
|
||||||
*
|
*
|
||||||
* @param[in] $relative_url string|null Relative URL to convert (Default: current URL)
|
* @param array|null $methods Relative URL to convert (Default: current URL)
|
||||||
*
|
*
|
||||||
* @retval string The public absolute URL
|
* @return string The public absolute URL
|
||||||
**/
|
**/
|
||||||
public static function get_public_absolute_url($relative_url=null) {
|
public static function get_public_absolute_url($relative_url=null) {
|
||||||
if (!is_string($relative_url))
|
if (!is_string($relative_url))
|
||||||
|
@ -203,9 +203,9 @@ class LSurl extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Trigger redirect to specified URL (or homepage if omited)
|
* Trigger redirect to specified URL (or homepage if omited)
|
||||||
*
|
*
|
||||||
* @param[in] $go string|false The destination URL
|
* @param array|null $methods The destination URL
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function redirect($go=false) {
|
public static function redirect($go=false) {
|
||||||
$public_root_url = LSconfig :: get('public_root_url', '/', 'string');
|
$public_root_url = LSconfig :: get('public_root_url', '/', 'string');
|
||||||
|
@ -241,9 +241,9 @@ class LSurl extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Error 404 handler
|
* Error 404 handler
|
||||||
*
|
*
|
||||||
* @param[in] $request LSurlRequest|null The request (optional, default: null)
|
* @param LSurlRequest|null $request The request (optional, default: null)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function error_404($request=null) {
|
public static function error_404($request=null) {
|
||||||
http_response_code(404);
|
http_response_code(404);
|
||||||
|
@ -262,10 +262,10 @@ class LSurl extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Handle the current requested URL
|
* Handle the current requested URL
|
||||||
*
|
*
|
||||||
* @param[in] $default_url string|null The default URL if current one does not
|
* @param array|null $methods The default URL if current one does not
|
||||||
* match with any configured pattern.
|
* match with any configured pattern.
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
public static function handle_request($default_url=null) {
|
public static function handle_request($default_url=null) {
|
||||||
self :: $request = self :: get_request($default_url);
|
self :: $request = self :: get_request($default_url);
|
||||||
|
@ -299,7 +299,7 @@ class LSurl extends LSlog_staticLoggerClass {
|
||||||
catch (Exception $e) {
|
catch (Exception $e) {
|
||||||
self :: log_exception(
|
self :: log_exception(
|
||||||
$e, "An exception occured running URL handler function ".
|
$e, "An exception occured running URL handler function ".
|
||||||
getCallableName(self :: $request -> handler)
|
format_callable(self :: $request -> handler)
|
||||||
);
|
);
|
||||||
self :: log_fatal(_("This request could not be processed correctly."));
|
self :: log_fatal(_("This request could not be processed correctly."));
|
||||||
}
|
}
|
||||||
|
@ -312,7 +312,7 @@ class LSurl extends LSlog_staticLoggerClass {
|
||||||
/*
|
/*
|
||||||
* Try to detect current requested URL and return it
|
* Try to detect current requested URL and return it
|
||||||
*
|
*
|
||||||
* @retval string|false The current request URL or false if detection fail
|
* @return string|false The current request URL or false if detection fail
|
||||||
**/
|
**/
|
||||||
private static function get_current_url() {
|
private static function get_current_url() {
|
||||||
self :: log_debug("URL : request URI = '".$_SERVER['REQUEST_URI']."'");
|
self :: log_debug("URL : request URI = '".$_SERVER['REQUEST_URI']."'");
|
||||||
|
@ -348,7 +348,7 @@ class LSurl extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Try to detect rewrite base from public root URL
|
* Try to detect rewrite base from public root URL
|
||||||
*
|
*
|
||||||
* @retval string The detected rewrite base
|
* @return string The detected rewrite base
|
||||||
**/
|
**/
|
||||||
private static function get_rewrite_base() {
|
private static function get_rewrite_base() {
|
||||||
$public_root_url = LSconfig :: get('public_root_url', '/', 'string');
|
$public_root_url = LSconfig :: get('public_root_url', '/', 'string');
|
||||||
|
@ -365,9 +365,9 @@ class LSurl extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Remove trailing slash in specified URL
|
* Remove trailing slash in specified URL
|
||||||
*
|
*
|
||||||
* @param[in] $url string The URL
|
* @param string $pattern The URL
|
||||||
*
|
*
|
||||||
* @retval string The specified URL without trailing slash
|
* @return string The specified URL without trailing slash
|
||||||
**/
|
**/
|
||||||
private static function remove_trailing_slash($url) {
|
private static function remove_trailing_slash($url) {
|
||||||
if ($url == '/')
|
if ($url == '/')
|
||||||
|
|
|
@ -54,9 +54,9 @@ class LSurlRequest extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Get request info
|
* Get request info
|
||||||
*
|
*
|
||||||
* @param[in] $key string The name of the info
|
* @param string $key The name of the info
|
||||||
*
|
*
|
||||||
* @retval mixed The value
|
* @return mixed The value
|
||||||
**/
|
**/
|
||||||
public function __get($key) {
|
public function __get($key) {
|
||||||
if ($key == 'current_url')
|
if ($key == 'current_url')
|
||||||
|
@ -83,9 +83,9 @@ class LSurlRequest extends LSlog_staticLoggerClass {
|
||||||
/**
|
/**
|
||||||
* Check is request info is set
|
* Check is request info is set
|
||||||
*
|
*
|
||||||
* @param[in] $key string The name of the info
|
* @param string $key The name of the info
|
||||||
*
|
*
|
||||||
* @retval boolval True is info is set, False otherwise
|
* @return boolval True is info is set, False otherwise
|
||||||
**/
|
**/
|
||||||
public function __isset($key) {
|
public function __isset($key) {
|
||||||
if (in_array($key, array('current_url', 'handler', 'authenticated')))
|
if (in_array($key, array('current_url', 'handler', 'authenticated')))
|
||||||
|
@ -96,7 +96,7 @@ class LSurlRequest extends LSlog_staticLoggerClass {
|
||||||
/*
|
/*
|
||||||
* Get request referer (if known)
|
* Get request referer (if known)
|
||||||
*
|
*
|
||||||
* @retval string|null The request referer URL if known, null otherwise
|
* @return string|null The request referer URL if known, null otherwise
|
||||||
*/
|
*/
|
||||||
public function get_referer() {
|
public function get_referer() {
|
||||||
if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'])
|
if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'])
|
||||||
|
|
|
@ -28,14 +28,14 @@
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $format string Format de la chaine
|
* @param string $format Format de la chaine
|
||||||
* @param[in] $data mixed Les données pour composés la chaine
|
* @param string $format Les données pour composés la chaine
|
||||||
* Ce paramètre peut être un tableau de string, une string,
|
* Ce paramètre peut être un tableau de string, une string,
|
||||||
* une tableau d'objet ou un objet.
|
* une tableau d'objet ou un objet.
|
||||||
* @param[in] $meth string Le nom de la methode de/des objet(s) à appeler pour
|
* @param string $format Le nom de la methode de/des objet(s) à appeler pour
|
||||||
* obtenir la valeur de remplacement dans la chaine formatée.
|
* obtenir la valeur de remplacement dans la chaine formatée.
|
||||||
*
|
*
|
||||||
* @retval string La chaine formatée
|
* @return string La chaine formatée
|
||||||
*/
|
*/
|
||||||
function getFData($format,$data,$meth=NULL) {
|
function getFData($format,$data,$meth=NULL) {
|
||||||
$unique=false;
|
$unique=false;
|
||||||
|
@ -329,12 +329,12 @@ function LSdebugDefined() {
|
||||||
*
|
*
|
||||||
* Vérifie que les DNs sont dans la même branche de l'annuaire.
|
* Vérifie que les DNs sont dans la même branche de l'annuaire.
|
||||||
*
|
*
|
||||||
* @param[in] $dn Un premier DN.
|
* @param string $dn1 Un premier DN.
|
||||||
* @param[in] $dn Un deuxième DN.
|
* @param string $dn2 Un deuxième DN.
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval boolean true si les DN sont compatibles, false sinon.
|
* @return boolean true si les DN sont compatibles, false sinon.
|
||||||
*/
|
*/
|
||||||
function isCompatibleDNs($dn1,$dn2) {
|
function isCompatibleDNs($dn1,$dn2) {
|
||||||
$infos1=ldap_explode_dn($dn1,0);
|
$infos1=ldap_explode_dn($dn1,0);
|
||||||
|
@ -365,12 +365,12 @@ function isCompatibleDNs($dn1,$dn2) {
|
||||||
* Retourne un DN qui correspond au point de séparation des DN si les DN
|
* Retourne un DN qui correspond au point de séparation des DN si les DN
|
||||||
* ne sont pas dans la meme dans la meme branche ou le dn le plus long sinon.
|
* ne sont pas dans la meme dans la meme branche ou le dn le plus long sinon.
|
||||||
*
|
*
|
||||||
* @param[in] $dn Un premier DN.
|
* @param string $dn1 Un premier DN.
|
||||||
* @param[in] $dn Un deuxième DN.
|
* @param string $dn2 Un deuxième DN.
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @retval string Un DN (ou false si les DN ne sont pas valide)
|
* @return string Un DN (ou false si les DN ne sont pas valide)
|
||||||
*/
|
*/
|
||||||
function sumDn($dn1,$dn2) {
|
function sumDn($dn1,$dn2) {
|
||||||
$infos1=ldap_explode_dn($dn1,0);
|
$infos1=ldap_explode_dn($dn1,0);
|
||||||
|
@ -509,9 +509,9 @@ function compareDn($a,$b) {
|
||||||
/**
|
/**
|
||||||
* Translate message by using LSlang or Gettext methods
|
* Translate message by using LSlang or Gettext methods
|
||||||
*
|
*
|
||||||
* @param[in] @msg string The message
|
* @param string $msg The message
|
||||||
*
|
*
|
||||||
* @retval string The translated message if translation available, the original message otherwise
|
* @return string The translated message if translation available, the original message otherwise
|
||||||
**/
|
**/
|
||||||
function __($msg) {
|
function __($msg) {
|
||||||
if (empty($msg)) return $msg;
|
if (empty($msg)) return $msg;
|
||||||
|
@ -527,9 +527,9 @@ function __($msg) {
|
||||||
* Just-return the input message. This function permit the detection of message
|
* Just-return the input message. This function permit the detection of message
|
||||||
* that will be translated only at display time and not at declare time.
|
* that will be translated only at display time and not at declare time.
|
||||||
*
|
*
|
||||||
* @param[in] @msg string The message
|
* @param string $msg The message
|
||||||
*
|
*
|
||||||
* @retval string The message (unchanged)
|
* @return string The message (unchanged)
|
||||||
**/
|
**/
|
||||||
function ___($msg) {
|
function ___($msg) {
|
||||||
return $msg;
|
return $msg;
|
||||||
|
@ -547,9 +547,9 @@ if (!function_exists('unidecode') && function_exists('mb_ord')) {
|
||||||
/**
|
/**
|
||||||
* Supprime les accents d'une chaine
|
* Supprime les accents d'une chaine
|
||||||
*
|
*
|
||||||
* @param[in] $string La chaine originale
|
* @param string $string La chaine originale
|
||||||
*
|
*
|
||||||
* @retval string La chaine sans les accents
|
* @return string La chaine sans les accents
|
||||||
*/
|
*/
|
||||||
function withoutAccents($string){
|
function withoutAccents($string){
|
||||||
// Use unidecode lib if available
|
// Use unidecode lib if available
|
||||||
|
@ -575,10 +575,10 @@ function withoutAccents($string){
|
||||||
/**
|
/**
|
||||||
* Supprime les espaces d'une chaine en les remplacant par un motif ou non
|
* Supprime les espaces d'une chaine en les remplacant par un motif ou non
|
||||||
*
|
*
|
||||||
* @param[in] $str La chaine originale
|
* @param string $str La chaine originale
|
||||||
* @param[in] $to Le motif de remplacement. S'il n'est pas spécifié, les espaces seront simplement supprimés
|
* @param string $to Le motif de remplacement. S'il n'est pas spécifié, les espaces seront simplement supprimés
|
||||||
*
|
*
|
||||||
* @retval string La chaine sans les espaces
|
* @return string La chaine sans les espaces
|
||||||
**/
|
**/
|
||||||
function replaceSpaces($str,$to='') {
|
function replaceSpaces($str,$to='') {
|
||||||
return strtr($str,array (
|
return strtr($str,array (
|
||||||
|
@ -591,10 +591,10 @@ function withoutAccents($string){
|
||||||
/**
|
/**
|
||||||
* List files in a directory corresponding to a regex
|
* List files in a directory corresponding to a regex
|
||||||
*
|
*
|
||||||
* @param[in] $dir The path of the directory
|
* @param string $dir The path of the directory
|
||||||
* @param[in] $regex The regex apply on filename
|
* @param string $regex The regex apply on filename
|
||||||
*
|
*
|
||||||
* @retval array() List of file name
|
* @return array() List of file name
|
||||||
**/
|
**/
|
||||||
function listFiles($dir,$regex) {
|
function listFiles($dir,$regex) {
|
||||||
$retval=array();
|
$retval=array();
|
||||||
|
@ -614,43 +614,20 @@ function withoutAccents($string){
|
||||||
/**
|
/**
|
||||||
* Return current date in LDAP format
|
* Return current date in LDAP format
|
||||||
*
|
*
|
||||||
* @param[in] $mixed Anything (to permit using as generated function)
|
* @param mixed $mixed Anything (to permit using as generated function)
|
||||||
*
|
*
|
||||||
* @retval string The current date in LDAP format (YYYYMMDDHHMMSSZ)
|
* @return string The current date in LDAP format (YYYYMMDDHHMMSSZ)
|
||||||
**/
|
**/
|
||||||
function now($mixed=Null) {
|
function now($mixed=Null) {
|
||||||
return date ('YmdHis').'Z';
|
return date ('YmdHis').'Z';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Format callable name
|
|
||||||
*
|
|
||||||
* @param[in] $callable The callable
|
|
||||||
*
|
|
||||||
* @retval string The formated callable name
|
|
||||||
**/
|
|
||||||
function getCallableName($callable) {
|
|
||||||
if (is_string($callable)) {
|
|
||||||
return $callable.'()';
|
|
||||||
}
|
|
||||||
elseif(is_array($callable) && count($callable)==2) {
|
|
||||||
if (is_string($callable[0])) {
|
|
||||||
return $callable[0].'::'.$callable[1].'()';
|
|
||||||
}
|
|
||||||
elseif(is_object($callable[0])) {
|
|
||||||
return "object ".get_class($callable[0])."->".$callable[1].'()';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "unknown : ".(string)$callable;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a path is absolute
|
* Check if a path is absolute
|
||||||
*
|
*
|
||||||
* @param[in] $path string The path
|
* @param string $path The path
|
||||||
*
|
*
|
||||||
* @retval boolean True if path is absolute, False otherwise
|
* @return boolean True if path is absolute, False otherwise
|
||||||
*/
|
*/
|
||||||
function isAbsolutePath($path) {
|
function isAbsolutePath($path) {
|
||||||
return strStartWith($path, '/') || strStartWith($path, './') || strStartWith($path, '../');
|
return strStartWith($path, '/') || strStartWith($path, './') || strStartWith($path, '../');
|
||||||
|
@ -659,10 +636,10 @@ function isAbsolutePath($path) {
|
||||||
/**
|
/**
|
||||||
* Check if a string start with another specified string
|
* Check if a string start with another specified string
|
||||||
*
|
*
|
||||||
* @param[in] $string string The string to search in
|
* @param string $string The string to search in
|
||||||
* @param[in] $start_string string The starting string to check
|
* @param string $start_string The starting string to check
|
||||||
*
|
*
|
||||||
* @retval boolean True if string start by specified one, False otherwise
|
* @return boolean True if string start by specified one, False otherwise
|
||||||
*/
|
*/
|
||||||
function strStartWith($string, $start_string) {
|
function strStartWith($string, $start_string) {
|
||||||
if (strlen($start_string) > strlen($string))
|
if (strlen($start_string) > strlen($string))
|
||||||
|
@ -673,14 +650,14 @@ function strStartWith($string, $start_string) {
|
||||||
/**
|
/**
|
||||||
* Dump file content
|
* Dump file content
|
||||||
*
|
*
|
||||||
* @param[in] $file_path string The file path to dump
|
* @param string $file_path The file path to dump
|
||||||
* @param[in] $mime_type string|null The MIME type return as Content-type (optional, default: auto-detected)
|
* @param string|null $mime_type The MIME type return as Content-type (optional, default: auto-detected)
|
||||||
* @param[in] $max_age integer The cache max_age value, as return in Cache-Control HTTP header
|
* @param int $max_age The cache max_age value, as return in Cache-Control HTTP header
|
||||||
* (optional, default: 3600)
|
* (optional, default: 3600)
|
||||||
* @param[in] $force_download boolean Set to true to force download (optional, default: false)
|
* @param boolean $force_download Set to true to force download (optional, default: false)
|
||||||
* @param[in] $filename string Specific filename in case of force download (optional, default: orignal filename)
|
* @param string|null $filename Specific filename in case of force download (optional, default: orignal filename)
|
||||||
*
|
*
|
||||||
* @retval void
|
* @return void
|
||||||
**/
|
**/
|
||||||
function dumpFile($file_path, $mime_type=null, $max_age=3600, $force_download=false, $filename=null) {
|
function dumpFile($file_path, $mime_type=null, $max_age=3600, $force_download=false, $filename=null) {
|
||||||
if (is_file($file_path)) {
|
if (is_file($file_path)) {
|
||||||
|
@ -730,15 +707,16 @@ function dumpFile($file_path, $mime_type=null, $max_age=3600, $force_download=fa
|
||||||
* @return string The callable object string representation
|
* @return string The callable object string representation
|
||||||
*/
|
*/
|
||||||
function format_callable($callable) {
|
function format_callable($callable) {
|
||||||
if (is_array($callable))
|
if (is_string($callable))
|
||||||
|
return $callable."()";
|
||||||
|
if (is_array($callable) && count($callable)==2)
|
||||||
if (is_string($callable[0]))
|
if (is_string($callable[0]))
|
||||||
return $callable[0]."::".$callable[1]."()";
|
return $callable[0]."::".$callable[1]."()";
|
||||||
elseif (is_object($callable[0]))
|
elseif (is_object($callable[0]))
|
||||||
return get_class($callable[0])."->".$callable[1]."()";
|
return get_class($callable[0])."->".$callable[1]."()";
|
||||||
else
|
else
|
||||||
return "Unkown->".$callable[1]."()";
|
return "Unkown->".$callable[1]."()";
|
||||||
else
|
return varDump($callable);
|
||||||
return $callable."()";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_empty($val) {
|
function is_empty($val) {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue