mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-26 11:52:59 +01:00
- LStips : Ajout de bulles d'aide
-> help_info ajouté dans la configuration des attributs - LSeepeople : Ajout d'une bulle d'aide pour loginshell - LSdebug : Renomage des fonctions attachées : - debug() -> LSdebug() - debug_pring() -> LSdebug_print() -> Nétoyage des debug dans le code et renomage quand nécessaire. -> Ajout d'une fonctionnalité de dump de variable à LSdebug() - LSsession : Correction d'un problème de chemin pour les scripts JS
This commit is contained in:
parent
1f51f7601b
commit
b88fca55cb
20 changed files with 80 additions and 52 deletions
|
@ -222,6 +222,7 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
),
|
),
|
||||||
'loginShell' => array (
|
'loginShell' => array (
|
||||||
'label' => _('Interpreteur de commande'),
|
'label' => _('Interpreteur de commande'),
|
||||||
|
'help_info' => _("Permet ou non a l'utilisateur de se connecter à un système POSIX."),
|
||||||
'ldap_type' => 'boolean',
|
'ldap_type' => 'boolean',
|
||||||
'html_type' => 'boolean',
|
'html_type' => 'boolean',
|
||||||
'required' => 1,
|
'required' => 1,
|
||||||
|
|
|
@ -187,7 +187,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
$password = $ldapObject -> attrs[ LS_SAMBA_USERPASSWORD_ATTR ] -> ldap -> getClearPassword();
|
$password = $ldapObject -> attrs[ LS_SAMBA_USERPASSWORD_ATTR ] -> ldap -> getClearPassword();
|
||||||
debug('pwd : '.$password);
|
|
||||||
$sambapassword = new smbHash;
|
$sambapassword = new smbHash;
|
||||||
$sambaNTPassword = $sambapassword -> nthash($password);
|
$sambaNTPassword = $sambapassword -> nthash($password);
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,6 @@ class LSattr_html_select_list extends LSattr_html{
|
||||||
$regex_check_data.='|^'.preg_quote($val,'/').'$';
|
$regex_check_data.='|^'.preg_quote($val,'/').'$';
|
||||||
}
|
}
|
||||||
$regex_check_data.='/';
|
$regex_check_data.='/';
|
||||||
debug($this -> name.' : < '.$regex_check_data." ><br/>",$GLOBALS['debug_stat']);
|
|
||||||
$form -> addRule($this -> name, 'regex', array('msg'=> 'Valeur incorrect','params' => array('regex' => $regex_check_data)) );
|
$form -> addRule($this -> name, 'regex', array('msg'=> 'Valeur incorrect','params' => array('regex' => $regex_check_data)) );
|
||||||
// On retourne un pointeur vers l'element ajouter
|
// On retourne un pointeur vers l'element ajouter
|
||||||
return $element;
|
return $element;
|
||||||
|
|
|
@ -102,7 +102,6 @@ class LSattr_html_select_object extends LSattr_html{
|
||||||
$filter.='('.$conf['value_attribute'].'='.$val.')';
|
$filter.='('.$conf['value_attribute'].'='.$val.')';
|
||||||
}
|
}
|
||||||
$filter.=')';
|
$filter.=')';
|
||||||
debug($filter);
|
|
||||||
$obj = new $conf['object_type']();
|
$obj = new $conf['object_type']();
|
||||||
$list = $obj -> listObjects($filter);
|
$list = $obj -> listObjects($filter);
|
||||||
}
|
}
|
||||||
|
@ -122,7 +121,6 @@ class LSattr_html_select_object extends LSattr_html{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
debug($values);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$_SESSION['LSselect'][$conf['object_type']]=$DNs;
|
$_SESSION['LSselect'][$conf['object_type']]=$DNs;
|
||||||
|
|
|
@ -189,7 +189,7 @@ class LSform {
|
||||||
if (!$this -> checkData()) {
|
if (!$this -> checkData()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
debug("les données sont checkées");
|
LSdebug("les données sont checkées");
|
||||||
$this -> _isValidate = true;
|
$this -> _isValidate = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,6 +204,9 @@ class LSformElement {
|
||||||
$return['required']=true;
|
$return['required']=true;
|
||||||
}
|
}
|
||||||
$return['label'] = $this -> getLabel();
|
$return['label'] = $this -> getLabel();
|
||||||
|
if (isset($this -> params['help_info'])) {
|
||||||
|
$return['help_info']=$this -> params['help_info'];
|
||||||
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,6 @@ class LSformElement_image extends LSformElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_uploaded_file($_FILES[$this -> name]['tmp_name'])) {
|
if (is_uploaded_file($_FILES[$this -> name]['tmp_name'])) {
|
||||||
debug($_FILES[$this -> name]['tmp_name']);
|
|
||||||
$fp = fopen($_FILES[$this -> name]['tmp_name'], "r");
|
$fp = fopen($_FILES[$this -> name]['tmp_name'], "r");
|
||||||
$buf = fread($fp, filesize($_FILES[$this -> name]['tmp_name']));
|
$buf = fread($fp, filesize($_FILES[$this -> name]['tmp_name']));
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
|
@ -42,7 +42,6 @@ class LSformRule_imagesize extends LSformRule {
|
||||||
*/
|
*/
|
||||||
function validate ($value,$options,$formElement) {
|
function validate ($value,$options,$formElement) {
|
||||||
$file = $GLOBALS['LSsession'] -> getTmpFile($value);
|
$file = $GLOBALS['LSsession'] -> getTmpFile($value);
|
||||||
debug('Verify : '.$file.' - Options : '.print_r($options,true));
|
|
||||||
list($width, $height, $type, $attr) = getimagesize($file);
|
list($width, $height, $type, $attr) = getimagesize($file);
|
||||||
|
|
||||||
if (is_int($options['param']['maxWidth'])) {
|
if (is_int($options['param']['maxWidth'])) {
|
||||||
|
|
|
@ -253,7 +253,7 @@ class LSldap {
|
||||||
* @retval boolean true si l'objet a bien été mis à jour, false sinon
|
* @retval boolean true si l'objet a bien été mis à jour, false sinon
|
||||||
*/
|
*/
|
||||||
function update($object_type,$dn,$change) {
|
function update($object_type,$dn,$change) {
|
||||||
debug($change);
|
LSdebug($change);
|
||||||
$dropAttr=array();
|
$dropAttr=array();
|
||||||
$entry=$this -> getEntry($object_type,$dn);
|
$entry=$this -> getEntry($object_type,$dn);
|
||||||
if (is_array($entry)) {
|
if (is_array($entry)) {
|
||||||
|
@ -286,8 +286,8 @@ class LSldap {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$entry -> replace($changeData);
|
$entry -> replace($changeData);
|
||||||
debug('change : <pre>'.print_r($changeData,true).'</pre>');
|
LSdebug('change : <pre>'.print_r($changeData,true).'</pre>');
|
||||||
debug('drop : <pre>'.print_r($dropAttr,true).'</pre>');
|
LSdebug('drop : <pre>'.print_r($dropAttr,true).'</pre>');
|
||||||
|
|
||||||
if ($new) {
|
if ($new) {
|
||||||
$ret = $this -> cnx -> add($entry);
|
$ret = $this -> cnx -> add($entry);
|
||||||
|
|
|
@ -303,7 +303,7 @@ class LSldapObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($this -> validateAttrsData($idForm)) {
|
if($this -> validateAttrsData($idForm)) {
|
||||||
debug("les données sont validées");
|
LSdebug("les données sont validées");
|
||||||
if(isset($this -> config['before_modify'])) {
|
if(isset($this -> config['before_modify'])) {
|
||||||
if(function_exists($this -> config['before_modify'])) {
|
if(function_exists($this -> config['before_modify'])) {
|
||||||
if(!$this -> config['before_modify']($this)) {
|
if(!$this -> config['before_modify']($this)) {
|
||||||
|
@ -317,7 +317,7 @@ class LSldapObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($this -> submitChange($idForm)) {
|
if ($this -> submitChange($idForm)) {
|
||||||
debug('Les modifications sont submitées');
|
LSdebug('Les modifications sont submitées');
|
||||||
$this -> submitError = false;
|
$this -> submitError = false;
|
||||||
$this -> reloadData();
|
$this -> reloadData();
|
||||||
$this -> refreshForm($idForm);
|
$this -> refreshForm($idForm);
|
||||||
|
@ -517,7 +517,7 @@ class LSldapObject {
|
||||||
if(($attr -> isUpdate())&&($attr -> isValidate())) {
|
if(($attr -> isUpdate())&&($attr -> isValidate())) {
|
||||||
if(($attr -> name == $this -> config['rdn'])&&(!$new)) {
|
if(($attr -> name == $this -> config['rdn'])&&(!$new)) {
|
||||||
$new = true;
|
$new = true;
|
||||||
debug('Rename');
|
LSdebug('Rename');
|
||||||
if (!$this -> beforeRename()) {
|
if (!$this -> beforeRename()) {
|
||||||
$GLOBALS['LSerror'] -> addErrorCode(36);
|
$GLOBALS['LSerror'] -> addErrorCode(36);
|
||||||
return;
|
return;
|
||||||
|
@ -547,7 +547,7 @@ class LSldapObject {
|
||||||
$dn=$this -> getDn();
|
$dn=$this -> getDn();
|
||||||
if($dn) {
|
if($dn) {
|
||||||
$this -> dn=$dn;
|
$this -> dn=$dn;
|
||||||
debug($submitData);
|
LSdebug($submitData);
|
||||||
if (!$GLOBALS['LSldap'] -> update($this -> getType(),$dn, $submitData)) {
|
if (!$GLOBALS['LSldap'] -> update($this -> getType(),$dn, $submitData)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1184,7 +1184,7 @@ class LSldapObject {
|
||||||
* @retval True en cas de cas ce succès, False sinon.
|
* @retval True en cas de cas ce succès, False sinon.
|
||||||
*/
|
*/
|
||||||
function afterCreate() {
|
function afterCreate() {
|
||||||
debug('after');
|
LSdebug('after');
|
||||||
$error = 0;
|
$error = 0;
|
||||||
if ($GLOBALS['LSsession'] -> isSubDnLSobject($this -> getType())) {
|
if ($GLOBALS['LSsession'] -> isSubDnLSobject($this -> getType())) {
|
||||||
if (is_array($GLOBALS['LSsession'] -> ldapServer['subDn']['LSobject'][$this -> getType()]['LSobjects'])) {
|
if (is_array($GLOBALS['LSsession'] -> ldapServer['subDn']['LSobject'][$this -> getType()]['LSobjects'])) {
|
||||||
|
@ -1193,7 +1193,7 @@ class LSldapObject {
|
||||||
if (isset($GLOBALS['LSobjects'][$type]['container_auto_create'])&&isset($GLOBALS['LSobjects'][$type]['container_dn'])) {
|
if (isset($GLOBALS['LSobjects'][$type]['container_auto_create'])&&isset($GLOBALS['LSobjects'][$type]['container_dn'])) {
|
||||||
$dn = $GLOBALS['LSobjects'][$type]['container_dn'].','.$this -> getDn();
|
$dn = $GLOBALS['LSobjects'][$type]['container_dn'].','.$this -> getDn();
|
||||||
if(!$GLOBALS['LSldap'] -> getNewEntry($dn,$GLOBALS['LSobjects'][$type]['container_auto_create']['objectclass'],$GLOBALS['LSobjects'][$type]['container_auto_create']['attrs'],true)) {
|
if(!$GLOBALS['LSldap'] -> getNewEntry($dn,$GLOBALS['LSobjects'][$type]['container_auto_create']['objectclass'],$GLOBALS['LSobjects'][$type]['container_auto_create']['attrs'],true)) {
|
||||||
debug("Impossible de créer l'entrée fille : ".print_r(
|
LSdebug("Impossible de créer l'entrée fille : ".print_r(
|
||||||
array(
|
array(
|
||||||
'dn' => $dn,
|
'dn' => $dn,
|
||||||
'objectClass' => $GLOBALS['LSobjects'][$type]['container_auto_create']['objectclass'],
|
'objectClass' => $GLOBALS['LSobjects'][$type]['container_auto_create']['objectclass'],
|
||||||
|
|
|
@ -311,7 +311,7 @@ class LSsession {
|
||||||
}
|
}
|
||||||
if ($nbresult==0) {
|
if ($nbresult==0) {
|
||||||
// identifiant incorrect
|
// identifiant incorrect
|
||||||
debug('identifiant incorrect');
|
LSdebug('identifiant incorrect');
|
||||||
$GLOBALS['LSerror'] -> addErrorCode(1006);
|
$GLOBALS['LSerror'] -> addErrorCode(1006);
|
||||||
}
|
}
|
||||||
else if ($nbresult>1) {
|
else if ($nbresult>1) {
|
||||||
|
@ -320,9 +320,9 @@ class LSsession {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (isset($_GET['LSsession_recoverPassword'])) {
|
if (isset($_GET['LSsession_recoverPassword'])) {
|
||||||
debug('Recover : Id trouvé');
|
LSdebug('Recover : Id trouvé');
|
||||||
if ($this -> ldapServer['recoverPassword']) {
|
if ($this -> ldapServer['recoverPassword']) {
|
||||||
debug('Récupération active');
|
LSdebug('Récupération active');
|
||||||
$user=$result[0];
|
$user=$result[0];
|
||||||
$emailAddress = $user -> getValue($this -> ldapServer['recoverPassword']['mailAttr']);
|
$emailAddress = $user -> getValue($this -> ldapServer['recoverPassword']['mailAttr']);
|
||||||
$emailAddress = $emailAddress[0];
|
$emailAddress = $emailAddress[0];
|
||||||
|
@ -337,7 +337,7 @@ class LSsession {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (checkEmail($emailAddress)) {
|
if (checkEmail($emailAddress)) {
|
||||||
debug('Email : '.$emailAddress);
|
LSdebug('Email : '.$emailAddress);
|
||||||
$this -> dn = $user -> getDn();
|
$this -> dn = $user -> getDn();
|
||||||
// 1ère étape : envoie du recoveryHash
|
// 1ère étape : envoie du recoveryHash
|
||||||
if (!isset($_GET['recoveryHash'])) {
|
if (!isset($_GET['recoveryHash'])) {
|
||||||
|
@ -378,19 +378,19 @@ class LSsession {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Problème durant l'envoie du mail
|
// Problème durant l'envoie du mail
|
||||||
debug("Problème durant l'envoie du mail");
|
LSdebug("Problème durant l'envoie du mail");
|
||||||
$GLOBALS['LSerror'] -> addErrorCode(1020);
|
$GLOBALS['LSerror'] -> addErrorCode(1020);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Erreur durant la mise à jour de l'objet
|
// Erreur durant la mise à jour de l'objet
|
||||||
debug("Erreur durant la mise à jour de l'objet");
|
LSdebug("Erreur durant la mise à jour de l'objet");
|
||||||
$GLOBALS['LSerror'] -> addErrorCode(1020);
|
$GLOBALS['LSerror'] -> addErrorCode(1020);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Erreur durant la validation du formulaire de modification de perte de password
|
// Erreur durant la validation du formulaire de modification de perte de password
|
||||||
debug("Erreur durant la validation du formulaire de modification de perte de password");
|
LSdebug("Erreur durant la validation du formulaire de modification de perte de password");
|
||||||
$GLOBALS['LSerror'] -> addErrorCode(1020);
|
$GLOBALS['LSerror'] -> addErrorCode(1020);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -399,7 +399,7 @@ class LSsession {
|
||||||
$attr=$user -> attrs[$this -> ldapServer['authobject_pwdattr']];
|
$attr=$user -> attrs[$this -> ldapServer['authobject_pwdattr']];
|
||||||
if ($attr instanceof LSattribute) {
|
if ($attr instanceof LSattribute) {
|
||||||
$mdp = generatePassword($attr -> config['html_options']['chars'],$attr -> config['html_options']['lenght']);
|
$mdp = generatePassword($attr -> config['html_options']['chars'],$attr -> config['html_options']['lenght']);
|
||||||
debug('Nvx mpd : '.$mdp);
|
LSdebug('Nvx mpd : '.$mdp);
|
||||||
$lostPasswdForm = $user -> getForm('lostPassword');
|
$lostPasswdForm = $user -> getForm('lostPassword');
|
||||||
$lostPasswdForm -> setPostData(
|
$lostPasswdForm -> setPostData(
|
||||||
array(
|
array(
|
||||||
|
@ -423,25 +423,25 @@ class LSsession {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Problème durant l'envoie du mail
|
// Problème durant l'envoie du mail
|
||||||
debug("Problème durant l'envoie du mail");
|
LSdebug("Problème durant l'envoie du mail");
|
||||||
$GLOBALS['LSerror'] -> addErrorCode(1020);
|
$GLOBALS['LSerror'] -> addErrorCode(1020);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Erreur durant la mise à jour de l'objet
|
// Erreur durant la mise à jour de l'objet
|
||||||
debug("Erreur durant la mise à jour de l'objet");
|
LSdebug("Erreur durant la mise à jour de l'objet");
|
||||||
$GLOBALS['LSerror'] -> addErrorCode(1020);
|
$GLOBALS['LSerror'] -> addErrorCode(1020);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Erreur durant la validation du formulaire de modification de perte de password
|
// Erreur durant la validation du formulaire de modification de perte de password
|
||||||
debug("Erreur durant la validation du formulaire de modification de perte de password");
|
LSdebug("Erreur durant la validation du formulaire de modification de perte de password");
|
||||||
$GLOBALS['LSerror'] -> addErrorCode(1020);
|
$GLOBALS['LSerror'] -> addErrorCode(1020);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// l'attribut password n'existe pas
|
// l'attribut password n'existe pas
|
||||||
debug("L'attribut password n'existe pas");
|
LSdebug("L'attribut password n'existe pas");
|
||||||
$GLOBALS['LSerror'] -> addErrorCode(1020);
|
$GLOBALS['LSerror'] -> addErrorCode(1020);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -468,7 +468,7 @@ class LSsession {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$GLOBALS['LSerror'] -> addErrorCode(1006);
|
$GLOBALS['LSerror'] -> addErrorCode(1006);
|
||||||
debug('mdp incorrect');
|
LSdebug('mdp incorrect');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -870,7 +870,10 @@ class LSsession {
|
||||||
if (!$script['path']) {
|
if (!$script['path']) {
|
||||||
$script['path']=LS_JS_DIR;
|
$script['path']=LS_JS_DIR;
|
||||||
}
|
}
|
||||||
$JSscript_txt.="<script src='".$script['path'].'/'.$script['file']."' type='text/javascript'></script>\n";
|
else {
|
||||||
|
$script['path'].='/';
|
||||||
|
}
|
||||||
|
$JSscript_txt.="<script src='".$script['path'].$script['file']."' type='text/javascript'></script>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$GLOBALS['Smarty'] -> assign('LSjsConfig',json_encode($this -> _JSconfigParams));
|
$GLOBALS['Smarty'] -> assign('LSjsConfig',json_encode($this -> _JSconfigParams));
|
||||||
|
@ -927,11 +930,11 @@ class LSsession {
|
||||||
|
|
||||||
if ($this -> ajaxDisplay) {
|
if ($this -> ajaxDisplay) {
|
||||||
$GLOBALS['Smarty'] -> assign('LSerror_txt',$GLOBALS['LSerror']->getErrors());
|
$GLOBALS['Smarty'] -> assign('LSerror_txt',$GLOBALS['LSerror']->getErrors());
|
||||||
$GLOBALS['Smarty'] -> assign('LSdebug_txt',debug_print(true));
|
$GLOBALS['Smarty'] -> assign('LSdebug_txt',LSdebug_print(true));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$GLOBALS['LSerror'] -> display();
|
$GLOBALS['LSerror'] -> display();
|
||||||
debug_print();
|
LSdebug_print();
|
||||||
}
|
}
|
||||||
if (!$this -> template)
|
if (!$this -> template)
|
||||||
$this -> setTemplate('empty.tpl');
|
$this -> setTemplate('empty.tpl');
|
||||||
|
@ -960,11 +963,11 @@ class LSsession {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
debug('Impossible de chargé le dn : '.$dn);
|
LSdebug('Impossible de chargé le dn : '.$dn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
debug('Impossible de créer l\'objet de type : '.$conf['LSobject']);
|
LSdebug('Impossible de créer l\'objet de type : '.$conf['LSobject']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -110,7 +110,7 @@ function loadDir($dir,$regexpr='^.*\.php$') {
|
||||||
|
|
||||||
|
|
||||||
function valid($obj) {
|
function valid($obj) {
|
||||||
debug('Validation : ok');
|
LSdebug('Validation : ok');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,8 +118,14 @@ function return_data($data) {
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
function debug($data,$get=true) {
|
function LSdebug($data,$dump=false) {
|
||||||
if ($get) {
|
if ($dump) {
|
||||||
|
ob_start();
|
||||||
|
var_dump($data);
|
||||||
|
$GLOBALS['LSdebug']['fields'][]=ob_get_contents();
|
||||||
|
ob_end_clean();
|
||||||
|
}
|
||||||
|
else {
|
||||||
if (is_array($data)||is_object($data)) {
|
if (is_array($data)||is_object($data)) {
|
||||||
$GLOBALS['LSdebug']['fields'][]=$data;
|
$GLOBALS['LSdebug']['fields'][]=$data;
|
||||||
}
|
}
|
||||||
|
@ -130,7 +136,7 @@ function debug($data,$get=true) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function debug_print($return=false) {
|
function LSdebug_print($return=false) {
|
||||||
if (( $GLOBALS['LSdebug']['fields'] ) && ( $GLOBALS['LSdebug']['active'] )) {
|
if (( $GLOBALS['LSdebug']['fields'] ) && ( $GLOBALS['LSdebug']['active'] )) {
|
||||||
$txt='<ul>';
|
$txt='<ul>';
|
||||||
foreach($GLOBALS['LSdebug']['fields'] as $debug) {
|
foreach($GLOBALS['LSdebug']['fields'] as $debug) {
|
||||||
|
@ -236,14 +242,14 @@ function debug_print($return=false) {
|
||||||
$regex = '/^((\"[^\"\f\n\r\t\v\b]+\")|([\w\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}]+(\.[\w\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}]+)*))@((\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9\-])+\.)+[A-Za-z\-]+))$/';
|
$regex = '/^((\"[^\"\f\n\r\t\v\b]+\")|([\w\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}]+(\.[\w\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}]+)*))@((\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9\-])+\.)+[A-Za-z\-]+))$/';
|
||||||
|
|
||||||
if (!preg_match($regex, $value)) {
|
if (!preg_match($regex, $value)) {
|
||||||
debug('checkEmail : regex fail');
|
LSdebug('checkEmail : regex fail');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($checkDns && function_exists('checkdnsrr')) {
|
if ($checkDns && function_exists('checkdnsrr')) {
|
||||||
$tokens = explode('@', $value);
|
$tokens = explode('@', $value);
|
||||||
if (!(checkdnsrr($tokens[1], 'MX') || checkdnsrr($tokens[1], 'A'))) {
|
if (!(checkdnsrr($tokens[1], 'MX') || checkdnsrr($tokens[1], 'A'))) {
|
||||||
debug('checkEmail : DNS fail');
|
LSdebug('checkEmail : DNS fail');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ var LSform = new Class({
|
||||||
initialize: function(){
|
initialize: function(){
|
||||||
this._modules=[];
|
this._modules=[];
|
||||||
this.initializeLSform_AddAndRemoveBtns();
|
this.initializeLSform_AddAndRemoveBtns();
|
||||||
|
this.LStips = new Tips('.LStips');
|
||||||
},
|
},
|
||||||
|
|
||||||
initializeLSform_AddAndRemoveBtns: function(el) {
|
initializeLSform_AddAndRemoveBtns: function(el) {
|
||||||
|
|
|
@ -250,7 +250,7 @@ if (!isset($_ERRORS)) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$ok) {
|
if (!$ok) {
|
||||||
debug($_REQUEST['value']." introuvé parmi la liste");
|
LSdebug($_REQUEST['value']." introuvé parmi la liste");
|
||||||
$GLOBALS['LSerror'] -> addErrorCode(1015,$conf['relationName']);
|
$GLOBALS['LSerror'] -> addErrorCode(1015,$conf['relationName']);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -403,7 +403,7 @@ if (isset($_REQUEST['imgload'])) {
|
||||||
$data['imgload'] = $_REQUEST['imgload'];
|
$data['imgload'] = $_REQUEST['imgload'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$debug_txt = debug_print(true);
|
$debug_txt = LSdebug_print(true);
|
||||||
if ($debug_txt != "") {
|
if ($debug_txt != "") {
|
||||||
$data['LSdebug'] = $debug_txt;
|
$data['LSdebug'] = $debug_txt;
|
||||||
}
|
}
|
||||||
|
|
|
@ -188,10 +188,10 @@ if($LSsession -> startLSsession()) {
|
||||||
if (($GLOBALS['LSsession'] -> cacheSearch()) && isset($_SESSION['LSsession']['LSsearch'][$hash]) && (!isset($_REQUEST['refresh']))) {
|
if (($GLOBALS['LSsession'] -> cacheSearch()) && isset($_SESSION['LSsession']['LSsearch'][$hash]) && (!isset($_REQUEST['refresh']))) {
|
||||||
// On affiche à partir du cache
|
// On affiche à partir du cache
|
||||||
$searchData=$_SESSION['LSsession']['LSsearch'][$hash];
|
$searchData=$_SESSION['LSsession']['LSsearch'][$hash];
|
||||||
debug('From cache');
|
LSdebug('From cache');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
debug('Load');
|
LSdebug('Load');
|
||||||
$LSview_actions[] = array (
|
$LSview_actions[] = array (
|
||||||
'label' => _('Rafraîchir'),
|
'label' => _('Rafraîchir'),
|
||||||
'url' => 'view.php?LSobject='.$LSobject.'&refresh',
|
'url' => 'view.php?LSobject='.$LSobject.'&refresh',
|
||||||
|
@ -222,7 +222,7 @@ if($LSsession -> startLSsession()) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
debug($thisObject->getValue('dn'));
|
LSdebug($thisObject->getValue('dn'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$searchData['objectList']=$objectList;
|
$searchData['objectList']=$objectList;
|
||||||
|
@ -257,7 +257,7 @@ if($LSsession -> startLSsession()) {
|
||||||
return -1*$sense;
|
return -1*$sense;
|
||||||
}
|
}
|
||||||
if (!uasort($searchData['objectList'],'sortBy')) {
|
if (!uasort($searchData['objectList'],'sortBy')) {
|
||||||
debug('Erreur durant le trie.');
|
LSdebug('Erreur durant le trie.');
|
||||||
}
|
}
|
||||||
$_SESSION['LSsession']['LSsearch'][$hash]=$searchData;
|
$_SESSION['LSsession']['LSsearch'][$hash]=$searchData;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
{$LSform_header}
|
{$LSform_header}
|
||||||
<dl class='LSform'>
|
<dl class='LSform'>
|
||||||
{foreach from=$LSform_fields item=field}
|
{foreach from=$LSform_fields item=field}
|
||||||
<dt class='LSform'>{$field.label}</dt>
|
<dt class='LSform'>{$field.label}{if $field.help_info!=""} <img class='LStips' src="templates/images/help.png" alt='?' title="{$field.help_info}"/>{/if}</dt>
|
||||||
<dd class='LSform'>{$field.html}{if $field.add != ''} <span class='LSform-addfield'>+ Ajouter un champ</span>{/if}</dd>
|
<dd class='LSform'>{$field.html}{if $field.add != ''} <span class='LSform-addfield'>+ Ajouter un champ</span>{/if}</dd>
|
||||||
{if $field.errors != ''}
|
{if $field.errors != ''}
|
||||||
{foreach from=$field.errors item=error}
|
{foreach from=$field.errors item=error}
|
||||||
|
|
|
@ -64,3 +64,23 @@ input[type='submit'].LSform {
|
||||||
img.LSform-add-field-btn, img.LSform-remove-field-btn {
|
img.LSform-add-field-btn, img.LSform-remove-field-btn {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Tips */
|
||||||
|
.tip-top {
|
||||||
|
color: #fff;
|
||||||
|
width: 139px;
|
||||||
|
z-index: 13000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tip-title {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 11px;
|
||||||
|
margin: 0;
|
||||||
|
color: #b5e4f6;
|
||||||
|
padding: 2px;
|
||||||
|
background: #333;
|
||||||
|
opacity: 0.8;
|
||||||
|
-moz-border-radius: 2px;
|
||||||
|
width: 200px;
|
||||||
|
text-align: justify;
|
||||||
|
}
|
||||||
|
|
BIN
trunk/templates/images/help.png
Normal file
BIN
trunk/templates/images/help.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 786 B |
|
@ -26,7 +26,7 @@
|
||||||
{$LSform_header}
|
{$LSform_header}
|
||||||
<dl class='LSform'>
|
<dl class='LSform'>
|
||||||
{foreach from=$LSform_fields item=field}
|
{foreach from=$LSform_fields item=field}
|
||||||
<dt class='LSform'>{$field.label}</dt>
|
<dt class='LSform'>{$field.label}{if $field.help_info!=""} <img class='LStips' src="templates/images/help.png" alt='?' title="{$field.help_info}"/>{/if}</dt>
|
||||||
<dd class='LSform'>{$field.html}{if $field.add != ''} <span class='LSform-addfield'>+ Ajouter un champ</span>{/if}</dd>
|
<dd class='LSform'>{$field.html}{if $field.add != ''} <span class='LSform-addfield'>+ Ajouter un champ</span>{/if}</dd>
|
||||||
{if $field.errors != ''}
|
{if $field.errors != ''}
|
||||||
{foreach from=$field.errors item=error}
|
{foreach from=$field.errors item=error}
|
||||||
|
|
|
@ -286,10 +286,10 @@ if($LSsession -> startLSsession()) {
|
||||||
if (($GLOBALS['LSsession'] -> cacheSearch()) && isset($_SESSION['LSsession']['LSsearch'][$hash]) && (!isset($_REQUEST['refresh']))) {
|
if (($GLOBALS['LSsession'] -> cacheSearch()) && isset($_SESSION['LSsession']['LSsearch'][$hash]) && (!isset($_REQUEST['refresh']))) {
|
||||||
// On affiche à partir du cache
|
// On affiche à partir du cache
|
||||||
$searchData=$_SESSION['LSsession']['LSsearch'][$hash];
|
$searchData=$_SESSION['LSsession']['LSsearch'][$hash];
|
||||||
debug('Recherche : From cache');
|
LSdebug('Recherche : From cache');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
debug('Recherche : Load');
|
LSdebug('Recherche : Load');
|
||||||
if ($GLOBALS['LSsession'] -> canCreate($LSobject)) {
|
if ($GLOBALS['LSsession'] -> canCreate($LSobject)) {
|
||||||
$LSview_actions[] = array (
|
$LSview_actions[] = array (
|
||||||
'label' => _('Nouveau'),
|
'label' => _('Nouveau'),
|
||||||
|
@ -335,7 +335,7 @@ if($LSsession -> startLSsession()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!isset($searchData['objectList'][0]['actions']))&&(!empty($searchData['objectList']))) {
|
if ((!isset($searchData['objectList'][0]['actions']))&&(!empty($searchData['objectList']))) {
|
||||||
debug('Load actions');
|
LSdebug('Load actions');
|
||||||
for($i=0;$i<$searchData['LSobject_list_nbresult'];$i++) {
|
for($i=0;$i<$searchData['LSobject_list_nbresult'];$i++) {
|
||||||
$actions=array();
|
$actions=array();
|
||||||
|
|
||||||
|
@ -395,7 +395,7 @@ if($LSsession -> startLSsession()) {
|
||||||
return -1*$sense;
|
return -1*$sense;
|
||||||
}
|
}
|
||||||
if (!uasort($searchData['objectList'],'sortBy')) {
|
if (!uasort($searchData['objectList'],'sortBy')) {
|
||||||
debug('Erreur durant le trie.');
|
LSdebug('Erreur durant le trie.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$GLOBALS['Smarty']->assign('LSobject_list_orderby',$orderby);
|
$GLOBALS['Smarty']->assign('LSobject_list_orderby',$orderby);
|
||||||
|
|
Loading…
Reference in a new issue