- Remplacement des appels à LSerror via la variable globale par des appels

statiques.
This commit is contained in:
Benjamin Renard 2009-01-21 17:37:02 +00:00
parent 2a86edcae4
commit 7df8ed984d
29 changed files with 196 additions and 197 deletions

View file

@ -48,7 +48,7 @@ if($LSsession -> startLSsession()) {
if ($form->validate()) { if ($form->validate()) {
// MàJ des données de l'objet LDAP // MàJ des données de l'objet LDAP
if ($object -> updateData('create')) { if ($object -> updateData('create')) {
if (!$GLOBALS['LSerror']->errorsDefined()) { if (!LSerror::errorsDefined()) {
$GLOBALS['LSsession'] -> addInfo(_("L'objet a bien été ajouté.")); $GLOBALS['LSsession'] -> addInfo(_("L'objet a bien été ajouté."));
} }
if (isset($_REQUEST['ajax'])) { if (isset($_REQUEST['ajax'])) {
@ -88,15 +88,15 @@ if($LSsession -> startLSsession()) {
$form -> display(); $form -> display();
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_11'); LSerror::addErrorCode('LSsession_11');
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_01'); LSerror::addErrorCode('LSldapObject_01');
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); LSerror::addErrorCode('LSsession_12');
} }
} }

View file

@ -74,10 +74,10 @@ $GLOBALS['LSerror_code']['FTP_05']= array (
// Dependance de librairie // Dependance de librairie
if (!class_exists('Net_FTP')) { if (!class_exists('Net_FTP')) {
if (!defined('NET_FTP')) { if (!defined('NET_FTP')) {
$GLOBALS['LSerror'] -> addErrorCode('FTP_SUPPORT_02','NET_FTP'); LSerror::addErrorCode('FTP_SUPPORT_02','NET_FTP');
$retval=false; $retval=false;
} else if(!LSsession::includeFile(NET_FTP)) { } else if(!LSsession::includeFile(NET_FTP)) {
$GLOBALS['LSerror'] -> addErrorCode('FTP_SUPPORT_01'); LSerror::addErrorCode('FTP_SUPPORT_01');
$retval=false; $retval=false;
} }
} }
@ -108,14 +108,14 @@ $GLOBALS['LSerror_code']['FTP_05']= array (
return $cnx; return $cnx;
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('FTP_01',"2"); LSerror::addErrorCode('FTP_01',"2");
$GLOBALS['LSerror'] -> addErrorCode('FTP_00',$do -> getMessage()); LSerror::addErrorCode('FTP_00',$do -> getMessage());
return; return;
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('FTP_01',"1"); LSerror::addErrorCode('FTP_01',"1");
$GLOBALS['LSerror'] -> addErrorCode('FTP_00',$do -> getMessage()); LSerror::addErrorCode('FTP_00',$do -> getMessage());
return; return;
} }
} }
@ -144,15 +144,15 @@ $GLOBALS['LSerror_code']['FTP_05']= array (
foreach($dirs as $dir) { foreach($dirs as $dir) {
$do = $cnx -> mkdir($dir,true); $do = $cnx -> mkdir($dir,true);
if ($do instanceof PEAR_Error) { if ($do instanceof PEAR_Error) {
$GLOBALS['LSerror'] -> addErrorCode('FTP_02',$dir); LSerror::addErrorCode('FTP_02',$dir);
$GLOBALS['LSerror'] -> addErrorCode('FTP_00',$do -> getMessage()); LSerror::addErrorCode('FTP_00',$do -> getMessage());
return; return;
} }
if ($chmod) { if ($chmod) {
$do = $cnx -> chmod($dir,$chmod); $do = $cnx -> chmod($dir,$chmod);
if ($do instanceof PEAR_Error) { if ($do instanceof PEAR_Error) {
$GLOBALS['LSerror'] -> addErrorCode('FTP_04',$dir); LSerror::addErrorCode('FTP_04',$dir);
$GLOBALS['LSerror'] -> addErrorCode('FTP_00',$do -> getMessage()); LSerror::addErrorCode('FTP_00',$do -> getMessage());
} }
} }
} }
@ -194,8 +194,8 @@ $GLOBALS['LSerror_code']['FTP_05']= array (
} }
$do = $cnx -> rm($dir,true); $do = $cnx -> rm($dir,true);
if ($do instanceof PEAR_Error) { if ($do instanceof PEAR_Error) {
$GLOBALS['LSerror'] -> addErrorCode('FTP_03',$dir); LSerror::addErrorCode('FTP_03',$dir);
$GLOBALS['LSerror'] -> addErrorCode('FTP_00',$do -> getMessage()); LSerror::addErrorCode('FTP_00',$do -> getMessage());
return; return;
} }
} }
@ -223,8 +223,8 @@ $GLOBALS['LSerror_code']['FTP_05']= array (
} }
$do = $cnx -> rename($old,$new); $do = $cnx -> rename($old,$new);
if ($do instanceof PEAR_Error) { if ($do instanceof PEAR_Error) {
$GLOBALS['LSerror'] -> addErrorCode('FTP_05',array('old' => $old,'new' => $new)); LSerror::addErrorCode('FTP_05',array('old' => $old,'new' => $new));
$GLOBALS['LSerror'] -> addErrorCode('FTP_00',$do -> getMessage()); LSerror::addErrorCode('FTP_00',$do -> getMessage());
return; return;
} }
return true; return true;

View file

@ -52,7 +52,7 @@ $GLOBALS['LSerror_code']['MAIL_01']= array (
// Dependance de librairie // Dependance de librairie
if (!class_exists('Mail')) { if (!class_exists('Mail')) {
if(!LSsession::includeFile(PEAR_MAIL)) { if(!LSsession::includeFile(PEAR_MAIL)) {
$GLOBALS['LSerror'] -> addErrorCode('MAIL_SUPPORT_01'); LSerror::addErrorCode('MAIL_SUPPORT_01');
$retval=false; $retval=false;
} }
} }
@ -84,8 +84,8 @@ $GLOBALS['LSerror_code']['MAIL_01']= array (
$ret = $mail_obj -> send($to,$headers,$msg); $ret = $mail_obj -> send($to,$headers,$msg);
if ($ret instanceof PEAR_Error) { if ($ret instanceof PEAR_Error) {
$GLOBALS['LSerror'] -> addErrorCode('MAIL_01'); LSerror::addErrorCode('MAIL_01');
$GLOBALS['LSerror'] -> addErrorCode('MAIL_00',$ret -> getMessage()); LSerror::addErrorCode('MAIL_00',$ret -> getMessage());
return; return;
} }
return true; return true;

View file

@ -54,7 +54,7 @@ $retval=true;
// Dependance de librairie // Dependance de librairie
if (!function_exists('createDirsByFTP')) { if (!function_exists('createDirsByFTP')) {
if(!$GLOBALS['LSsession'] -> loadLSaddon('ftp')) { if(!$GLOBALS['LSsession'] -> loadLSaddon('ftp')) {
$GLOBALS['LSerror'] -> addErrorCode('MAILDIR_SUPPORT_01'); LSerror::addErrorCode('MAILDIR_SUPPORT_01');
$retval=false; $retval=false;
} }
} }
@ -67,7 +67,7 @@ $retval=true;
foreach($MUST_DEFINE_CONST as $const) { foreach($MUST_DEFINE_CONST as $const) {
if ( (!defined($const)) || (constant($const) == "")) { if ( (!defined($const)) || (constant($const) == "")) {
$GLOBALS['LSerror'] -> addErrorCode('MAILDIR_SUPPORT_02',$const); LSerror::addErrorCode('MAILDIR_SUPPORT_02',$const);
$retval=false; $retval=false;
} }
} }
@ -95,7 +95,7 @@ $retval=true;
$dir.'/tmp' $dir.'/tmp'
); );
if (!createDirsByFTP(LS_MAILDIR_FTP_HOST,LS_MAILDIR_FTP_PORT,LS_MAILDIR_FTP_USER,LS_MAILDIR_FTP_PWD,$dirs,LS_MAILDIR_FTP_MAILDIR_CHMOD)) { if (!createDirsByFTP(LS_MAILDIR_FTP_HOST,LS_MAILDIR_FTP_PORT,LS_MAILDIR_FTP_USER,LS_MAILDIR_FTP_PWD,$dirs,LS_MAILDIR_FTP_MAILDIR_CHMOD)) {
$GLOBALS['LSerror'] -> addErrorCode('MAILDIR_01'); LSerror::addErrorCode('MAILDIR_01');
return; return;
} }
return true; return true;
@ -117,7 +117,7 @@ $retval=true;
$dir = getFData(LS_MAILDIR_FTP_MAILDIR_PATH,$ldapObject,'getValue'); $dir = getFData(LS_MAILDIR_FTP_MAILDIR_PATH,$ldapObject,'getValue');
} }
if (!removeDirsByFTP(LS_MAILDIR_FTP_HOST,LS_MAILDIR_FTP_PORT,LS_MAILDIR_FTP_USER,LS_MAILDIR_FTP_PWD,$dir)) { if (!removeDirsByFTP(LS_MAILDIR_FTP_HOST,LS_MAILDIR_FTP_PORT,LS_MAILDIR_FTP_USER,LS_MAILDIR_FTP_PWD,$dir)) {
$GLOBALS['LSerror'] -> addErrorCode('MAILDIR_02'); LSerror::addErrorCode('MAILDIR_02');
return; return;
} }
return true; return true;
@ -135,7 +135,7 @@ $retval=true;
*/ */
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)) {
$GLOBALS['LSerror'] -> addErrorCode('MAILDIR_03'); LSerror::addErrorCode('MAILDIR_03');
return; return;
} }
return true; return true;

View file

@ -53,7 +53,7 @@ $GLOBALS['LSerror_code']['POSIX_01']= array (
// Dependance de librairie // Dependance de librairie
if (!function_exists('createDirsByFTP')) { if (!function_exists('createDirsByFTP')) {
if(!$GLOBALS['LSsession'] -> loadLSaddon('ftp')) { if(!$GLOBALS['LSsession'] -> loadLSaddon('ftp')) {
$GLOBALS['LSerror'] -> addErrorCode('POSIX_SUPPORT_02'); LSerror::addErrorCode('POSIX_SUPPORT_02');
$retval=false; $retval=false;
} }
} }
@ -74,7 +74,7 @@ $GLOBALS['LSerror_code']['POSIX_01']= array (
foreach($MUST_DEFINE_CONST as $const) { foreach($MUST_DEFINE_CONST as $const) {
if ( (!defined($const)) || (constant($const) == "")) { if ( (!defined($const)) || (constant($const) == "")) {
$GLOBALS['LSerror'] -> addErrorCode('POSIX_SUPPORT_O1',$const); LSerror::addErrorCode('POSIX_SUPPORT_O1',$const);
$retval=false; $retval=false;
} }
} }
@ -147,7 +147,7 @@ $GLOBALS['LSerror_code']['POSIX_01']= array (
*/ */
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' ) {
$GLOBALS['LSerror'] -> addErrorCode('POSIX_01',array('dependency' => 'uid', 'attr' => 'homeDirectory')); LSerror::addErrorCode('POSIX_01',array('dependency' => 'uid', 'attr' => 'homeDirectory'));
return; return;
} }
@ -169,7 +169,7 @@ $GLOBALS['LSerror_code']['POSIX_01']= array (
function createHomeDirectoryByFTP($ldapObject) { function createHomeDirectoryByFTP($ldapObject) {
$dir = getFData(LS_POSIX_HOMEDIRECTORY_FTP_PATH,$ldapObject,'getValue'); $dir = getFData(LS_POSIX_HOMEDIRECTORY_FTP_PATH,$ldapObject,'getValue');
if (!createDirsByFTP(LS_POSIX_HOMEDIRECTORY_FTP_HOST,LS_POSIX_HOMEDIRECTORY_FTP_PORT,LS_POSIX_HOMEDIRECTORY_FTP_USER,LS_POSIX_HOMEDIRECTORY_FTP_PWD,$dir)) { if (!createDirsByFTP(LS_POSIX_HOMEDIRECTORY_FTP_HOST,LS_POSIX_HOMEDIRECTORY_FTP_PORT,LS_POSIX_HOMEDIRECTORY_FTP_USER,LS_POSIX_HOMEDIRECTORY_FTP_PWD,$dir)) {
$GLOBALS['LSerror'] -> addErrorCode('POSIX_02'); LSerror::addErrorCode('POSIX_02');
return; return;
} }
return true; return true;

View file

@ -57,7 +57,7 @@ $GLOBALS['LSerror_code']['SAMBA_01']= array (
// Dependance de librairie // Dependance de librairie
if ( !class_exists('smbHash') ) { if ( !class_exists('smbHash') ) {
if ( !LSsession::includeFile(LS_LIB_DIR . 'class.smbHash.php') ) { if ( !LSsession::includeFile(LS_LIB_DIR . 'class.smbHash.php') ) {
$GLOBALS['LSerror'] -> addErrorCode('SAMBA_SUPPORT_01'); LSerror::addErrorCode('SAMBA_SUPPORT_01');
$retval=false; $retval=false;
} }
} }
@ -74,14 +74,14 @@ $GLOBALS['LSerror_code']['SAMBA_01']= array (
foreach($MUST_DEFINE_CONST as $const) { foreach($MUST_DEFINE_CONST as $const) {
if ( (!defined($const)) || (constant($const) == "")) { if ( (!defined($const)) || (constant($const) == "")) {
$GLOBALS['LSerror'] -> addErrorCode('SAMBA_SUPPORT_02',$const); LSerror::addErrorCode('SAMBA_SUPPORT_02',$const);
$retval=false; $retval=false;
} }
} }
// Pour l'intégrité des SID // Pour l'intégrité des SID
if ( (LS_SAMBA_SID_BASE_USER % 2) == (LS_SAMBA_SID_BASE_GROUP % 2) ) { if ( (LS_SAMBA_SID_BASE_USER % 2) == (LS_SAMBA_SID_BASE_GROUP % 2) ) {
$GLOBALS['LSerror'] -> addErrorCode('SAMBA_SUPPORT_03'); LSerror::addErrorCode('SAMBA_SUPPORT_03');
$retval=false; $retval=false;
} }
@ -102,7 +102,7 @@ $GLOBALS['LSerror_code']['SAMBA_01']= array (
*/ */
function generate_sambaUserSID($ldapObject) { function generate_sambaUserSID($ldapObject) {
if ( get_class($ldapObject -> attrs[ LS_SAMBA_UIDNUMBER_ATTR ]) != 'LSattribute' ) { if ( get_class($ldapObject -> attrs[ LS_SAMBA_UIDNUMBER_ATTR ]) != 'LSattribute' ) {
$GLOBALS['LSerror'] -> addErrorCode('SAMBA_01',array('dependency' => LS_SAMBA_UIDNUMBER_ATTR, 'attr' => 'sambaSID')); LSerror::addErrorCode('SAMBA_01',array('dependency' => LS_SAMBA_UIDNUMBER_ATTR, 'attr' => 'sambaSID'));
return; return;
} }
@ -128,7 +128,7 @@ $GLOBALS['LSerror_code']['SAMBA_01']= array (
*/ */
function generate_sambaGroupSID($ldapObject) { function generate_sambaGroupSID($ldapObject) {
if ( get_class($ldapObject -> attrs[ LS_SAMBA_GIDNUMBER_ATTR ]) != 'LSattribute' ) { if ( get_class($ldapObject -> attrs[ LS_SAMBA_GIDNUMBER_ATTR ]) != 'LSattribute' ) {
$GLOBALS['LSerror'] -> addErrorCode('SAMBA_01',array('dependency' => LS_SAMBA_GIDNUMBER_ATTR, 'attr' => 'sambaSID')); LSerror::addErrorCode('SAMBA_01',array('dependency' => LS_SAMBA_GIDNUMBER_ATTR, 'attr' => 'sambaSID'));
return; return;
} }
@ -154,7 +154,7 @@ $GLOBALS['LSerror_code']['SAMBA_01']= array (
*/ */
function generate_sambaPrimaryGroupSID($ldapObject) { function generate_sambaPrimaryGroupSID($ldapObject) {
if ( get_class($ldapObject -> attrs[ LS_SAMBA_GIDNUMBER_ATTR ]) != 'LSattribute' ) { if ( get_class($ldapObject -> attrs[ LS_SAMBA_GIDNUMBER_ATTR ]) != 'LSattribute' ) {
$GLOBALS['LSerror'] -> addErrorCode('SAMBA_02',array('dependency' => LS_SAMBA_GIDNUMBER_ATTR, 'attr' => 'sambaPrimaryGroupSID')); LSerror::addErrorCode('SAMBA_02',array('dependency' => LS_SAMBA_GIDNUMBER_ATTR, 'attr' => 'sambaPrimaryGroupSID'));
return; return;
} }
@ -176,7 +176,7 @@ $GLOBALS['LSerror_code']['SAMBA_01']= array (
*/ */
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' ) {
$GLOBALS['LSerror'] -> addErrorCode('SAMBA_03',array('dependency' => LS_SAMBA_USERPASSWORD_ATTR, 'attr' => 'sambaNTPassword')); LSerror::addErrorCode('SAMBA_03',array('dependency' => LS_SAMBA_USERPASSWORD_ATTR, 'attr' => 'sambaNTPassword'));
return; return;
} }
@ -201,7 +201,7 @@ $GLOBALS['LSerror_code']['SAMBA_01']= array (
*/ */
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' ) {
$GLOBALS['LSerror'] -> addErrorCode('SAMBA_04',array('dependency' => LS_SAMBA_USERPASSWORD_ATTR, 'attr' => 'sambaLMPassword')); LSerror::addErrorCode('SAMBA_04',array('dependency' => LS_SAMBA_USERPASSWORD_ATTR, 'attr' => 'sambaLMPassword'));
return; return;
} }

View file

@ -51,7 +51,7 @@ $GLOBALS['LSerror_code']['SUPANN_01']= array (
foreach($MUST_DEFINE_CONST as $const) { foreach($MUST_DEFINE_CONST as $const) {
if ( (!defined($const)) || (constant($const) == "")) { if ( (!defined($const)) || (constant($const) == "")) {
$GLOBALS['LSerror'] -> addErrorCode('SUPANN_SUPPORT_01',$const); LSerror::addErrorCode('SUPANN_SUPPORT_01',$const);
$retval=false; $retval=false;
} }
} }
@ -70,11 +70,11 @@ $GLOBALS['LSerror_code']['SUPANN_01']= array (
*/ */
function generate_displayName($ldapObject) { function generate_displayName($ldapObject) {
if ( get_class($ldapObject -> attrs[ LS_SUPANN_LASTNAME_ATTR ]) != 'LSattribute' ) { if ( get_class($ldapObject -> attrs[ LS_SUPANN_LASTNAME_ATTR ]) != 'LSattribute' ) {
$GLOBALS['LSerror'] -> addErrorCode('SUPANN_01',array('dependency' => LS_SUPANN_LASTNAME_ATTR, 'attr' => 'cn')); LSerror::addErrorCode('SUPANN_01',array('dependency' => LS_SUPANN_LASTNAME_ATTR, 'attr' => 'cn'));
return; return;
} }
if ( get_class($ldapObject -> attrs[ LS_SUPANN_FIRSTNAME_ATTR ]) != 'LSattribute' ) { if ( get_class($ldapObject -> attrs[ LS_SUPANN_FIRSTNAME_ATTR ]) != 'LSattribute' ) {
$GLOBALS['LSerror'] -> addErrorCode('SUPANN_01',array('dependency' => LS_SUPANN_FIRSTNAME_ATTR, 'attr' => 'cn')); LSerror::addErrorCode('SUPANN_01',array('dependency' => LS_SUPANN_FIRSTNAME_ATTR, 'attr' => 'cn'));
return; return;
} }
@ -95,11 +95,11 @@ $GLOBALS['LSerror_code']['SUPANN_01']= array (
*/ */
function generate_cn($ldapObject) { function generate_cn($ldapObject) {
if ( get_class($ldapObject -> attrs[ LS_SUPANN_LASTNAME_ATTR ]) != 'LSattribute' ) { if ( get_class($ldapObject -> attrs[ LS_SUPANN_LASTNAME_ATTR ]) != 'LSattribute' ) {
$GLOBALS['LSerror'] -> addErrorCode('SUPANN_01',array('dependency' => LS_SUPANN_LASTNAME_ATTR, 'attr' => 'cn')); LSerror::addErrorCode('SUPANN_01',array('dependency' => LS_SUPANN_LASTNAME_ATTR, 'attr' => 'cn'));
return; return;
} }
if ( get_class($ldapObject -> attrs[ LS_SUPANN_FIRSTNAME_ATTR ]) != 'LSattribute' ) { if ( get_class($ldapObject -> attrs[ LS_SUPANN_FIRSTNAME_ATTR ]) != 'LSattribute' ) {
$GLOBALS['LSerror'] -> addErrorCode('SUPANN_01',array('dependency' => LS_SUPANN_FIRSTNAME_ATTR, 'attr' => 'cn')); LSerror::addErrorCode('SUPANN_01',array('dependency' => LS_SUPANN_FIRSTNAME_ATTR, 'attr' => 'cn'));
return; return;
} }

View file

@ -80,12 +80,12 @@ class LSattr_html {
*/ */
function addToForm (&$form,$idForm,$data=NULL) { function addToForm (&$form,$idForm,$data=NULL) {
if (!$this -> LSformElement_type) { if (!$this -> LSformElement_type) {
$GLOBALS['LSerror'] -> addErrorCode('LSattr_html_01',$this -> name); LSerror::addErrorCode('LSattr_html_01',$this -> name);
return; return;
} }
$element=$form -> addElement($this -> LSformElement_type, $this -> name, $this -> config['label'],$this -> config, $this); $element=$form -> addElement($this -> LSformElement_type, $this -> name, $this -> config['label'],$this -> config, $this);
if(!$element) { if(!$element) {
$GLOBALS['LSerror'] -> addErrorCode('LSform_06',$this -> name); LSerror::addErrorCode('LSform_06',$this -> name);
return; return;
} }
if ($data) { if ($data) {

View file

@ -39,12 +39,12 @@ class LSattr_html_image extends LSattr_html {
function addToForm (&$form,$idForm,$data=NULL) { function addToForm (&$form,$idForm,$data=NULL) {
$element=$form -> addElement('image', $this -> name, $this -> config['label'],$this -> config, $this); $element=$form -> addElement('image', $this -> name, $this -> config['label'],$this -> config, $this);
if(!$element) { if(!$element) {
$GLOBALS['LSerror'] -> addErrorCode('LSform_06',$this -> name); LSerror::addErrorCode('LSform_06',$this -> name);
return; return;
} }
if (count($data)>1) { if (count($data)>1) {
$GLOBALS['LSerror'] -> addErrorCode('LSattr_html_03','password'); LSerror::addErrorCode('LSattr_html_03','password');
} }
if ($data) { if ($data) {

View file

@ -39,12 +39,12 @@ class LSattr_html_password extends LSattr_html {
function addToForm (&$form,$idForm,$data=NULL) { function addToForm (&$form,$idForm,$data=NULL) {
$element=$form -> addElement('password', $this -> name, $this -> config['label'], $this -> config, $this); $element=$form -> addElement('password', $this -> name, $this -> config['label'], $this -> config, $this);
if(!$element) { if(!$element) {
$GLOBALS['LSerror'] -> addErrorCode('LSform_06',$this -> name); LSerror::addErrorCode('LSform_06',$this -> name);
return; return;
} }
if (count($data)>1) { if (count($data)>1) {
$GLOBALS['LSerror'] -> addErrorCode('LSattr_html_03','password'); LSerror::addErrorCode('LSattr_html_03','password');
} }
if ($data) { if ($data) {

View file

@ -41,7 +41,7 @@ class LSattr_html_select_list extends LSattr_html{
$this -> config['text_possible_values'] = $possible_values; $this -> config['text_possible_values'] = $possible_values;
$element=$form -> addElement('select', $this -> name, $this -> config['label'],$this -> config, $this); $element=$form -> addElement('select', $this -> name, $this -> config['label'],$this -> config, $this);
if(!$element) { if(!$element) {
$GLOBALS['LSerror'] -> addErrorCode('LSform_06',$this -> name); LSerror::addErrorCode('LSform_06',$this -> name);
return; return;
} }
if ($data) { if ($data) {
@ -76,7 +76,7 @@ class LSattr_html_select_list extends LSattr_html{
foreach($this -> config['possible_values'] as $val_name => $val) { foreach($this -> config['possible_values'] as $val_name => $val) {
if($val_name=='OTHER_OBJECT') { if($val_name=='OTHER_OBJECT') {
if ((!isset($val['object_type'])) || (!isset($val['value_attribute']))) { if ((!isset($val['object_type'])) || (!isset($val['value_attribute']))) {
$GLOBALS['LSerror'] -> addErrorCode('LSattr_html_select_list_01',$this -> name); LSerror::addErrorCode('LSattr_html_select_list_01',$this -> name);
break; break;
} }
if (!$GLOBALS['LSsession'] -> loadLSobject($val['object_type'])) { if (!$GLOBALS['LSsession'] -> loadLSobject($val['object_type'])) {

View file

@ -40,7 +40,7 @@ class LSattr_html_select_object extends LSattr_html{
$this -> config['attrObject'] = $this; $this -> config['attrObject'] = $this;
$element=$form -> addElement('select_object', $this -> name, $this -> config['label'],$this -> config,$this); $element=$form -> addElement('select_object', $this -> name, $this -> config['label'],$this -> config,$this);
if(!$element) { if(!$element) {
$GLOBALS['LSerror'] -> addErrorCode('LSform_06',$this -> name); LSerror::addErrorCode('LSform_06',$this -> name);
return; return;
} }
if ($data) { if ($data) {
@ -81,7 +81,7 @@ class LSattr_html_select_object extends LSattr_html{
if (isset($this -> config['selectable_object'])) { if (isset($this -> config['selectable_object'])) {
$conf=$this -> config['selectable_object']; $conf=$this -> config['selectable_object'];
if (!isset($conf['object_type'])) { if (!isset($conf['object_type'])) {
$GLOBALS['LSerror'] -> addErrorCode('LSattr_html_select_object_01',$this -> name); LSerror::addErrorCode('LSattr_html_select_object_01',$this -> name);
return; return;
} }
@ -129,7 +129,7 @@ class LSattr_html_select_object extends LSattr_html{
if (isset($this -> config['selectable_object'])) { if (isset($this -> config['selectable_object'])) {
$conf=$this -> config['selectable_object']; $conf=$this -> config['selectable_object'];
if (!isset($conf['object_type'])) { if (!isset($conf['object_type'])) {
$GLOBALS['LSerror'] -> addErrorCode('LSattr_html_select_object_01',$this -> name); LSerror::addErrorCode('LSattr_html_select_object_01',$this -> name);
return; return;
} }

View file

@ -65,7 +65,7 @@ class LSattr_ldap_password extends LSattr_ldap {
break; break;
case 'ext_des': case 'ext_des':
if ( ! defined( 'CRYPT_EXT_DES' ) || CRYPT_EXT_DES == 0 ) { if ( ! defined( 'CRYPT_EXT_DES' ) || CRYPT_EXT_DES == 0 ) {
$GLOBALS['LSerror'] -> addErrorCode(1023,'ext_des'); LSerror::addErrorCode(1023,'ext_des');
} }
else { else {
return '{CRYPT}' . crypt( $this -> clearPassword, '_' . $this -> getSalt(8) ); return '{CRYPT}' . crypt( $this -> clearPassword, '_' . $this -> getSalt(8) );
@ -73,7 +73,7 @@ class LSattr_ldap_password extends LSattr_ldap {
break; break;
case 'blowfish': case 'blowfish':
if( ! defined( 'CRYPT_BLOWFISH' ) || CRYPT_BLOWFISH == 0 ) { if( ! defined( 'CRYPT_BLOWFISH' ) || CRYPT_BLOWFISH == 0 ) {
$GLOBALS['LSerror'] -> addErrorCode(1023,'blowfish'); LSerror::addErrorCode(1023,'blowfish');
} }
else { else {
return '{CRYPT}' . crypt( $this -> clearPassword, '$2a$12$' . $this -> getSalt(13) ); return '{CRYPT}' . crypt( $this -> clearPassword, '$2a$12$' . $this -> getSalt(13) );
@ -86,7 +86,7 @@ class LSattr_ldap_password extends LSattr_ldap {
elseif( function_exists( 'mhash' ) ) { elseif( function_exists( 'mhash' ) ) {
return '{SHA}' . base64_encode( mhash( MHASH_SHA1, $this -> clearPassword ) ); return '{SHA}' . base64_encode( mhash( MHASH_SHA1, $this -> clearPassword ) );
} else { } else {
$GLOBALS['LSerror'] -> addErrorCode(1023,'sha'); LSerror::addErrorCode(1023,'sha');
} }
break; break;
case 'ssha': case 'ssha':
@ -96,7 +96,7 @@ class LSattr_ldap_password extends LSattr_ldap {
return "{SSHA}".base64_encode( mhash( MHASH_SHA1, $this -> clearPassword.$salt ).$salt ); return "{SSHA}".base64_encode( mhash( MHASH_SHA1, $this -> clearPassword.$salt ).$salt );
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode(1023,'ssha'); LSerror::addErrorCode(1023,'ssha');
} }
break; break;
case 'smd5': case 'smd5':
@ -106,7 +106,7 @@ class LSattr_ldap_password extends LSattr_ldap {
return "{SMD5}".base64_encode( mhash( MHASH_MD5, $password_clear.$salt ).$salt ); return "{SMD5}".base64_encode( mhash( MHASH_MD5, $password_clear.$salt ).$salt );
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode(1023,'smd5'); LSerror::addErrorCode(1023,'smd5');
} }
break; break;
case 'md5': case 'md5':
@ -114,7 +114,7 @@ class LSattr_ldap_password extends LSattr_ldap {
break; break;
case 'md5crypt': case 'md5crypt':
if( ! defined( 'CRYPT_MD5' ) || CRYPT_MD5 == 0 ) { if( ! defined( 'CRYPT_MD5' ) || CRYPT_MD5 == 0 ) {
$GLOBALS['LSerror'] -> addErrorCode(1023,'md5crypt'); LSerror::addErrorCode(1023,'md5crypt');
} }
else { else {
return '{CRYPT}'.crypt($this -> clearPassword,'$1$'.$this -> getSalt().'$'); return '{CRYPT}'.crypt($this -> clearPassword,'$1$'.$this -> getSalt().'$');

View file

@ -73,7 +73,7 @@ class LSattribute {
$this -> ldap = new $ldap_type($name,$config,$this); $this -> ldap = new $ldap_type($name,$config,$this);
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSattribute_01',array('attr' => $name,'html'=>$config['html_type'],'ldap'=>$config['ldap_type'])); LSerror::addErrorCode('LSattribute_01',array('attr' => $name,'html'=>$config['html_type'],'ldap'=>$config['ldap_type']));
return; return;
} }
return true; return true;
@ -92,7 +92,7 @@ class LSattribute {
function getLabel() { function getLabel() {
if (!$this -> html) { if (!$this -> html) {
$GLOBALS['LSerror'] -> addErrorCode('LSattribute_09',array('type' => 'html','name' => $this -> name)); LSerror::addErrorCode('LSattribute_09',array('type' => 'html','name' => $this -> name));
return; return;
} }
return $this -> html -> getLabel(); return $this -> html -> getLabel();
@ -158,7 +158,7 @@ class LSattribute {
*/ */
function getDisplayValue() { function getDisplayValue() {
if (!$this -> ldap) { if (!$this -> ldap) {
$GLOBALS['LSerror'] -> addErrorCode('LSattribute_09',array('type' => 'ldap','name' => $this -> name)); LSerror::addErrorCode('LSattribute_09',array('type' => 'ldap','name' => $this -> name));
return; return;
} }
$data = $this -> ldap -> getDisplayValue($this -> data); $data = $this -> ldap -> getDisplayValue($this -> data);
@ -170,7 +170,7 @@ class LSattribute {
$result=$func($result); $result=$func($result);
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSattribute_02',array('attr' => $this->name,'func' => $func)); LSerror::addErrorCode('LSattribute_02',array('attr' => $this->name,'func' => $func));
return; return;
} }
} }
@ -181,7 +181,7 @@ class LSattribute {
return $this -> config['onDisplay']($data); return $this -> config['onDisplay']($data);
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSattribute_02',array('attr' => $this->name,'func' => $this -> config['onDisplay'])); LSerror::addErrorCode('LSattribute_02',array('attr' => $this->name,'func' => $this -> config['onDisplay']));
return; return;
} }
} }
@ -207,7 +207,7 @@ class LSattribute {
function addToForm(&$form,$idForm,&$obj=NULL,$value=NULL) { function addToForm(&$form,$idForm,&$obj=NULL,$value=NULL) {
if(isset($this -> config['form'][$idForm])) { if(isset($this -> config['form'][$idForm])) {
if (!$this -> html) { if (!$this -> html) {
$GLOBALS['LSerror'] -> addErrorCode('LSattribute_09',array('type' => 'html','name' => $this -> name)); LSerror::addErrorCode('LSattribute_09',array('type' => 'html','name' => $this -> name));
return; return;
} }
if($this -> myRights() == 'n') { if($this -> myRights() == 'n') {
@ -225,7 +225,7 @@ class LSattribute {
$element = $this -> html -> addToForm($form,$idForm,$data); $element = $this -> html -> addToForm($form,$idForm,$data);
if(!$element) { if(!$element) {
$GLOBALS['LSerror'] -> addErrorCode('LSform_06',$this -> name); LSerror::addErrorCode('LSform_06',$this -> name);
} }
if($this -> config['required']==1) { if($this -> config['required']==1) {
@ -240,7 +240,7 @@ class LSattribute {
if(is_array($this -> config['check_data'])) { if(is_array($this -> config['check_data'])) {
foreach ($this -> config['check_data'] as $rule => $rule_infos) { foreach ($this -> config['check_data'] as $rule => $rule_infos) {
if((!$form -> isRuleRegistered($rule))&&($rule!='')) { if((!$form -> isRuleRegistered($rule))&&($rule!='')) {
$GLOBALS['LSerror'] -> addErrorCode('LSattribute_03',array('attr' => $this->name,'rule' => $rule)); LSerror::addErrorCode('LSattribute_03',array('attr' => $this->name,'rule' => $rule));
return; return;
} }
if(!isset($rule_infos['msg'])) if(!isset($rule_infos['msg']))
@ -251,7 +251,7 @@ class LSattribute {
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSattribute_04',$this->name); LSerror::addErrorCode('LSattribute_04',$this->name);
} }
} }
} }
@ -314,7 +314,7 @@ class LSattribute {
function addToView(&$form) { function addToView(&$form) {
if((isset($this -> config['view'])) && ($this -> myRights() != 'n') ) { if((isset($this -> config['view'])) && ($this -> myRights() != 'n') ) {
if (!$this -> html) { if (!$this -> html) {
$GLOBALS['LSerror'] -> addErrorCode('LSattribute_09',array('type' => 'html','name' => $this -> name)); LSerror::addErrorCode('LSattribute_09',array('type' => 'html','name' => $this -> name));
return; return;
} }
if($this -> data !='') { if($this -> data !='') {
@ -325,7 +325,7 @@ class LSattribute {
} }
$element = $this -> html -> addToForm($form,'view',$data); $element = $this -> html -> addToForm($form,'view',$data);
if(!$element instanceof LSformElement) { if(!$element instanceof LSformElement) {
$GLOBALS['LSerror'] -> addErrorCode('LSform_06',$this -> name); LSerror::addErrorCode('LSform_06',$this -> name);
return; return;
} }
$element -> freeze(); $element -> freeze();
@ -347,7 +347,7 @@ class LSattribute {
function refreshForm(&$form,$idForm) { function refreshForm(&$form,$idForm) {
if(isset($this -> config['form'][$idForm])&&($this -> myRights()!='n')) { if(isset($this -> config['form'][$idForm])&&($this -> myRights()!='n')) {
if (!$this -> html) { if (!$this -> html) {
$GLOBALS['LSerror'] -> addErrorCode('LSattribute_09',array('type' => 'html','name' => $this -> name)); LSerror::addErrorCode('LSattribute_09',array('type' => 'html','name' => $this -> name));
return; return;
} }
$form_element = $form -> getElement($this -> name); $form_element = $form -> getElement($this -> name);
@ -504,7 +504,7 @@ class LSattribute {
$result=$func($result); $result=$func($result);
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSattribute_05',array('attr' => $this->name,'func' => $func)); LSerror::addErrorCode('LSattribute_05',array('attr' => $this->name,'func' => $func));
return; return;
} }
} }
@ -514,14 +514,14 @@ class LSattribute {
$result = $this -> config['onSave']($data); $result = $this -> config['onSave']($data);
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSattribute_05',array('attr' => $this->name,'func' => $this -> config['onSave'])); LSerror::addErrorCode('LSattribute_05',array('attr' => $this->name,'func' => $this -> config['onSave']));
return; return;
} }
} }
} }
else { else {
if (!$this -> ldap) { if (!$this -> ldap) {
$GLOBALS['LSerror'] -> addErrorCode('LSattribute_09',array('type' => 'ldap','name' => $this -> name)); LSerror::addErrorCode('LSattribute_09',array('type' => 'ldap','name' => $this -> name));
return; return;
} }
else { else {

View file

@ -219,7 +219,7 @@ class LSform {
return; return;
if ($this -> isSubmit()) { if ($this -> isSubmit()) {
if (!$this -> getPostData()) { if (!$this -> getPostData()) {
$GLOBALS['LSerror'] -> addErrorCode('LSform_01'); LSerror::addErrorCode('LSform_01');
return; return;
} }
$this -> setValuesFromPostData(); $this -> setValuesFromPostData();
@ -343,7 +343,7 @@ class LSform {
function getPostData() { function getPostData() {
foreach($this -> elements as $element_name => $element) { foreach($this -> elements as $element_name => $element) {
if( !($element -> getPostData($this -> _postData)) ) { if( !($element -> getPostData($this -> _postData)) ) {
$GLOBALS['LSerror'] -> addErrorCode('LSform_02',$element_name); LSerror::addErrorCode('LSform_02',$element_name);
return; return;
} }
} }
@ -366,7 +366,7 @@ class LSform {
$elementType='LSformElement_'.$type; $elementType='LSformElement_'.$type;
$GLOBALS['LSsession'] -> loadLSclass($elementType); $GLOBALS['LSsession'] -> loadLSclass($elementType);
if (!class_exists($elementType)) { if (!class_exists($elementType)) {
$GLOBALS['LSerror'] -> addErrorCode('LSform_05',array('type' => $type)); LSerror::addErrorCode('LSform_05',array('type' => $type));
return; return;
} }
$element=$this -> elements[$name] = new $elementType($this,$name,$label,$params,$attr_html); $element=$this -> elements[$name] = new $elementType($this,$name,$label,$params,$attr_html);
@ -375,7 +375,7 @@ class LSform {
} }
else { else {
unset ($this -> elements[$name]); unset ($this -> elements[$name]);
$GLOBALS['LSerror'] -> addErrorCode('LSform_06',array('element' => $name)); LSerror::addErrorCode('LSform_06',array('element' => $name));
return; return;
} }
} }
@ -401,12 +401,12 @@ class LSform {
return true; return true;
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSattribute_03',array('attr' => $element,'rule'=>$rule)); LSerror::addErrorCode('LSattribute_03',array('attr' => $element,'rule'=>$rule));
return; return;
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSform_04',array('element' => $element)); LSerror::addErrorCode('LSform_04',array('element' => $element));
return; return;
} }
} }

View file

@ -69,7 +69,7 @@ class LSformRule_compare extends LSformRule {
*/ */
function validate ($values,$options=array(),$formElement) { function validate ($values,$options=array(),$formElement) {
if (!isset($options['params']['operator'])) { if (!isset($options['params']['operator'])) {
$GLOBALS['LSerror'] -> addErrorCode('LSformRule_01',array('type' => 'compare', 'param' => 'operator'); LSerror::addErrorCode('LSformRule_01',array('type' => 'compare', 'param' => 'operator');
return; return;
} }
$operator = LSformRule_compare :: _findOperator($options['params']['operator']); $operator = LSformRule_compare :: _findOperator($options['params']['operator']);

View file

@ -39,7 +39,7 @@ class LSformRule_maxlength extends LSformRule {
*/ */
function validate ($value,$options,$formElement) { function validate ($value,$options,$formElement) {
if(!isset($options['params']['limit'])) { if(!isset($options['params']['limit'])) {
$GLOBALS['LSerror'] -> addErrorCode('LSformRule_01',array('type' => 'maxlength', 'param' => 'limit')); LSerror::addErrorCode('LSformRule_01',array('type' => 'maxlength', 'param' => 'limit'));
return; return;
} }
return (strlen($value)<=$options['params']['limit']); return (strlen($value)<=$options['params']['limit']);

View file

@ -39,7 +39,7 @@ class LSformRule_minlength extends LSformRule {
*/ */
function validate ($value,$options,$formElement) { function validate ($value,$options,$formElement) {
if(!isset($options['params']['limit'])) { if(!isset($options['params']['limit'])) {
$GLOBALS['LSerror'] -> addErrorCode('LSformRule_01',array('type' => 'minlength', 'param' => 'limit'); LSerror::addErrorCode('LSformRule_01',array('type' => 'minlength', 'param' => 'limit');
return; return;
} }
return (strlen($value)>=$options['params']['limit']); return (strlen($value)>=$options['params']['limit']);

View file

@ -40,7 +40,7 @@ class LSformRule_rangelength extends LSformRule {
*/ */
function validate ($value,$options=array(),$formElement) { function validate ($value,$options=array(),$formElement) {
if(!isset($options['params']['limits'])) { if(!isset($options['params']['limits'])) {
$GLOBALS['LSerror'] -> addErrorCode('LSformRule_01',array('type' => 'rangelength', 'param' => 'limit'); LSerror::addErrorCode('LSformRule_01',array('type' => 'rangelength', 'param' => 'limit');
return; return;
} }
$len=strlen($value); $len=strlen($value);

View file

@ -43,7 +43,7 @@ class LSformRule_regex extends LSformRule {
$regex=$option['params']['regex']; $regex=$option['params']['regex'];
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSformRule_regex_01'); LSerror::addErrorCode('LSformRule_regex_01');
return; return;
} }
} }

View file

@ -63,7 +63,7 @@ class LSldap {
function connect() { function connect() {
$this -> cnx = Net_LDAP2::connect($this -> config); $this -> cnx = Net_LDAP2::connect($this -> config);
if (Net_LDAP2::isError($this -> cnx)) { if (Net_LDAP2::isError($this -> cnx)) {
$GLOBALS['LSerror'] -> addErrorCode('LSldap_01',$this -> cnx -> getMessage()); LSerror::addErrorCode('LSldap_01',$this -> cnx -> getMessage());
$this -> cnx = NULL; $this -> cnx = NULL;
return; return;
} }
@ -105,7 +105,7 @@ class LSldap {
function search ($filter,$basedn=NULL,$params = array()) { function search ($filter,$basedn=NULL,$params = array()) {
$ret = $this -> cnx -> search($basedn,$filter,$params); $ret = $this -> cnx -> search($basedn,$filter,$params);
if (Net_LDAP2::isError($ret)) { if (Net_LDAP2::isError($ret)) {
$GLOBALS['LSerror'] -> addErrorCode('LSldap_02',$ret -> getMessage()); LSerror::addErrorCode('LSldap_02',$ret -> getMessage());
return; return;
} }
$retInfos=array(); $retInfos=array();
@ -136,7 +136,7 @@ class LSldap {
$filter=NULL; $filter=NULL;
$ret = $this -> cnx -> search($basedn,$filter,$params); $ret = $this -> cnx -> search($basedn,$filter,$params);
if (Net_LDAP2::isError($ret)) { if (Net_LDAP2::isError($ret)) {
$GLOBALS['LSerror'] -> addErrorCode('LSldap_02',$ret -> getMessage()); LSerror::addErrorCode('LSldap_02',$ret -> getMessage());
return; return;
} }
return $ret -> count(); return $ret -> count();
@ -212,7 +212,7 @@ class LSldap {
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSldap_03'); LSerror::addErrorCode('LSldap_03');
return; return;
} }
} }
@ -299,8 +299,8 @@ class LSldap {
} }
if (Net_LDAP2::isError($ret)) { if (Net_LDAP2::isError($ret)) {
$GLOBALS['LSerror'] -> addErrorCode('LSldap_05',$dn); LSerror::addErrorCode('LSldap_05',$dn);
$GLOBALS['LSerror'] -> addErrorCode(0,'NetLdap-Error : '.$ret->getMessage()); LSerror::addErrorCode(0,'NetLdap-Error : '.$ret->getMessage());
} }
else { else {
if (!empty($dropAttr)) { if (!empty($dropAttr)) {
@ -316,15 +316,15 @@ class LSldap {
} }
$ret = $entry -> update(); $ret = $entry -> update();
if (Net_LDAP2::isError($ret)) { if (Net_LDAP2::isError($ret)) {
$GLOBALS['LSerror'] -> addErrorCode('LSldap_06'); LSerror::addErrorCode('LSldap_06');
$GLOBALS['LSerror'] -> addErrorCode(0,'NetLdap-Error : '.$ret->getMessage()); LSerror::addErrorCode(0,'NetLdap-Error : '.$ret->getMessage());
} }
} }
return true; return true;
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSldap_04'); LSerror::addErrorCode('LSldap_04');
return; return;
} }
} }
@ -369,7 +369,7 @@ class LSldap {
function remove($dn) { function remove($dn) {
$ret = $this -> cnx -> delete($dn,array('recursive' => true)); $ret = $this -> cnx -> delete($dn,array('recursive' => true));
if (Net_LDAP2::isError($ret)) { if (Net_LDAP2::isError($ret)) {
$GLOBALS['LSerror'] -> addErrorCode(0,'NetLdap-Error : '.$ret->getMessage()); LSerror::addErrorCode(0,'NetLdap-Error : '.$ret->getMessage());
return; return;
} }
return true; return true;
@ -386,8 +386,8 @@ class LSldap {
function move($old,$new) { function move($old,$new) {
$ret = $this -> cnx -> move($old,$new); $ret = $this -> cnx -> move($old,$new);
if (Net_LDAP2::isError($ret)) { if (Net_LDAP2::isError($ret)) {
$GLOBALS['LSerror'] -> addErrorCode('LSldap_07'); LSerror::addErrorCode('LSldap_07');
$GLOBALS['LSerror'] -> addErrorCode(0,'NetLdap-Error : '.$ret->getMessage()); LSerror::addErrorCode(0,'NetLdap-Error : '.$ret->getMessage());
return; return;
} }
return true; return true;

View file

@ -64,7 +64,7 @@ class LSldapObject {
$this -> config = $GLOBALS['LSobjects'][$type_name]; $this -> config = $GLOBALS['LSobjects'][$type_name];
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_01'); LSerror::addErrorCode('LSldapObject_01');
return; return;
} }
} }
@ -276,7 +276,7 @@ class LSldapObject {
if(isset($this -> forms[$idForm])) if(isset($this -> forms[$idForm]))
$LSform = $this -> forms[$idForm][0]; $LSform = $this -> forms[$idForm][0];
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_02',$this -> getType()); LSerror::addErrorCode('LSldapObject_02',$this -> getType());
return; return;
} }
} }
@ -289,7 +289,7 @@ class LSldapObject {
$LSform = $LSform[0]; $LSform = $LSform[0];
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_03',$this -> getType()); LSerror::addErrorCode('LSldapObject_03',$this -> getType());
return; return;
} }
} }
@ -307,12 +307,12 @@ class LSldapObject {
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)) {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_08',$this -> config['before_modify']); LSerror::addErrorCode('LSldapObject_08',$this -> config['before_modify']);
return; return;
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_07',$this -> config['before_modify']); LSerror::addErrorCode('LSldapObject_07',$this -> config['before_modify']);
return; return;
} }
} }
@ -335,11 +335,11 @@ class LSldapObject {
if((isset($this -> config['after_modify']))&&(!$this -> submitError)) { if((isset($this -> config['after_modify']))&&(!$this -> submitError)) {
if(function_exists($this -> config['after_modify'])) { if(function_exists($this -> config['after_modify'])) {
if(!$this -> config['after_modify']($this)) { if(!$this -> config['after_modify']($this)) {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_10',$this -> config['after_modify']); LSerror::addErrorCode('LSldapObject_10',$this -> config['after_modify']);
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_09',$this -> config['after_modify']); LSerror::addErrorCode('LSldapObject_09',$this -> config['after_modify']);
} }
} }
@ -378,17 +378,17 @@ class LSldapObject {
if ( $attr -> canBeGenerated()) { if ( $attr -> canBeGenerated()) {
if ($attr -> generateValue()) { if ($attr -> generateValue()) {
if (!$this -> validateAttrData($LSform, $attr)) { if (!$this -> validateAttrData($LSform, $attr)) {
$GLOBALS['LSerror'] -> addErrorCode('LSattribute_08',$attr -> getLabel()); LSerror::addErrorCode('LSattribute_08',$attr -> getLabel());
$retval = false; $retval = false;
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSattribute_07',$attr -> getLabel()); LSerror::addErrorCode('LSattribute_07',$attr -> getLabel());
$retval = false; $retval = false;
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSattribute_06',$attr -> getLabel()); LSerror::addErrorCode('LSattribute_06',$attr -> getLabel());
$retval = false; $retval = false;
} }
} }
@ -476,12 +476,12 @@ class LSldapObject {
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_04',array('attr' => $attr->name,'obj' => $this->getType(),'func' => $test['function'])); LSerror::addErrorCode('LSldapObject_04',array('attr' => $attr->name,'obj' => $this->getType(),'func' => $test['function']));
$retval = false; $retval = false;
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_05',array('attr' => $attr->name,'obj' => $this->getType())); LSerror::addErrorCode('LSldapObject_05',array('attr' => $attr->name,'obj' => $this->getType()));
$retval = false; $retval = false;
} }
} }
@ -492,17 +492,17 @@ class LSldapObject {
if (!empty($dependsAttrs)) { if (!empty($dependsAttrs)) {
foreach($dependsAttrs as $dependAttr) { foreach($dependsAttrs as $dependAttr) {
if(!isset($this -> attrs[$dependAttr])){ if(!isset($this -> attrs[$dependAttr])){
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_14',array('attr_depend' => $dependAttr, 'attr' => $attr -> getLabel())); LSerror::addErrorCode('LSldapObject_14',array('attr_depend' => $dependAttr, 'attr' => $attr -> getLabel()));
continue; continue;
} }
if($this -> attrs[$dependAttr] -> canBeGenerated()) { if($this -> attrs[$dependAttr] -> canBeGenerated()) {
if (!$this -> attrs[$dependAttr] -> generateValue()) { if (!$this -> attrs[$dependAttr] -> generateValue()) {
$GLOBALS['LSerror'] -> addErrorCode('LSattribute_07',$this -> attrs[$dependAttr] -> getLabel()); LSerror::addErrorCode('LSattribute_07',$this -> attrs[$dependAttr] -> getLabel());
$retval = false; $retval = false;
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSattribute_06',$this -> attrs[$dependAttr] -> getLabel()); LSerror::addErrorCode('LSattribute_06',$this -> attrs[$dependAttr] -> getLabel());
$retval = false; $retval = false;
} }
} }
@ -531,7 +531,7 @@ class LSldapObject {
$new = true; $new = true;
LSdebug('Rename'); LSdebug('Rename');
if (!$this -> beforeRename()) { if (!$this -> beforeRename()) {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_16'); LSerror::addErrorCode('LSldapObject_16');
return; return;
} }
$oldDn = $this -> getDn(); $oldDn = $this -> getDn();
@ -543,7 +543,7 @@ class LSldapObject {
} }
$this -> dn = $newDn; $this -> dn = $newDn;
if (!$this -> afterRename($oldDn,$newDn)) { if (!$this -> afterRename($oldDn,$newDn)) {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_17'); LSerror::addErrorCode('LSldapObject_17');
return; return;
} }
} }
@ -566,14 +566,14 @@ class LSldapObject {
} }
if ($new) { if ($new) {
if (!$this -> afterCreate()) { if (!$this -> afterCreate()) {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_21'); LSerror::addErrorCode('LSldapObject_21');
return; return;
} }
} }
return true; return true;
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_13'); LSerror::addErrorCode('LSldapObject_13');
return; return;
} }
} }
@ -1003,12 +1003,12 @@ class LSldapObject {
return $rdn_attr.'='.$rdn_val[0].','.$this -> config['container_dn'].','.$GLOBALS['LSsession']->topDn; return $rdn_attr.'='.$rdn_val[0].','.$this -> config['container_dn'].','.$GLOBALS['LSsession']->topDn;
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_12',$this -> config['rdn']); LSerror::addErrorCode('LSldapObject_12',$this -> config['rdn']);
return; return;
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_11',$this -> getType()); LSerror::addErrorCode('LSldapObject_11',$this -> getType());
return; return;
} }
} }
@ -1063,11 +1063,11 @@ class LSldapObject {
if ($this -> afterDelete()) { if ($this -> afterDelete()) {
return true; return true;
} }
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_19'); LSerror::addErrorCode('LSldapObject_19');
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_18'); LSerror::addErrorCode('LSldapObject_18');
} }
return; return;
} }
@ -1266,12 +1266,12 @@ class LSldapObject {
foreach($config as $action) { foreach($config as $action) {
if(function_exists($action)) { if(function_exists($action)) {
if(!$action($this)) { if(!$action($this)) {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_25',$action); LSerror::addErrorCode('LSldapObject_25',$action);
$error=true; $error=true;
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_24',$action); LSerror::addErrorCode('LSldapObject_24',$action);
$error=true; $error=true;
} }
} }
@ -1327,12 +1327,12 @@ class LSldapObject {
foreach($config as $action) { foreach($config as $action) {
if(function_exists($action)) { if(function_exists($action)) {
if(!$action($this)) { if(!$action($this)) {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_23',$action); LSerror::addErrorCode('LSldapObject_23',$action);
$error=true; $error=true;
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_22',$action); LSerror::addErrorCode('LSldapObject_22',$action);
$error=true; $error=true;
} }
} }
@ -1355,7 +1355,7 @@ class LSldapObject {
**/ **/
function getObjectKeyValueInRelation($object,$attr,$objectType,$attrValue='dn') { function getObjectKeyValueInRelation($object,$attr,$objectType,$attrValue='dn') {
if ((!$attr)||(!$objectType)) { if ((!$attr)||(!$objectType)) {
$GLOBALS['LSerror'] -> addErrorCode('LSrelations_05','getObjectKeyValueInRelation'); LSerror::addErrorCode('LSrelations_05','getObjectKeyValueInRelation');
return; return;
} }
if ($attrValue=='dn') { if ($attrValue=='dn') {
@ -1388,7 +1388,7 @@ class LSldapObject {
**/ **/
function listObjectsInRelation($object,$attr,$objectType,$attrValue='dn') { function listObjectsInRelation($object,$attr,$objectType,$attrValue='dn') {
if ((!$attr)||(!$objectType)) { if ((!$attr)||(!$objectType)) {
$GLOBALS['LSerror'] -> addErrorCode('LSrelations_05','listObjectsInRelation'); LSerror::addErrorCode('LSrelations_05','listObjectsInRelation');
return; return;
} }
if ($attrValue=='dn') { if ($attrValue=='dn') {
@ -1420,7 +1420,7 @@ class LSldapObject {
**/ **/
function addOneObjectInRelation($object,$attr,$objectType,$attrValue='dn') { function addOneObjectInRelation($object,$attr,$objectType,$attrValue='dn') {
if ((!$attr)||(!$objectType)) { if ((!$attr)||(!$objectType)) {
$GLOBALS['LSerror'] -> addErrorCode('LSrelations_05','addOneObjectInRelation'); LSerror::addErrorCode('LSrelations_05','addOneObjectInRelation');
return; return;
} }
if ($object instanceof $objectType) { if ($object instanceof $objectType) {
@ -1470,7 +1470,7 @@ class LSldapObject {
**/ **/
function deleteOneObjectInRelation($object,$attr,$objectType,$attrValue='dn') { function deleteOneObjectInRelation($object,$attr,$objectType,$attrValue='dn') {
if ((!$attr)||(!$objectType)) { if ((!$attr)||(!$objectType)) {
$GLOBALS['LSerror'] -> addErrorCode('LSrelations_05','deleteOneObjectInRelation'); LSerror::addErrorCode('LSrelations_05','deleteOneObjectInRelation');
return; return;
} }
if ($object instanceof $objectType) { if ($object instanceof $objectType) {
@ -1515,7 +1515,7 @@ class LSldapObject {
*/ */
function renameOneObjectInRelation($object,$oldValue,$attr,$objectType,$attrValue='dn') { function renameOneObjectInRelation($object,$oldValue,$attr,$objectType,$attrValue='dn') {
if ((!$attr)||(!$objectType)) { if ((!$attr)||(!$objectType)) {
$GLOBALS['LSerror'] -> addErrorCode('LSrelations_05','renameOneObjectInRelation'); LSerror::addErrorCode('LSrelations_05','renameOneObjectInRelation');
return; return;
} }
if ($object instanceof $objectType) { if ($object instanceof $objectType) {
@ -1565,7 +1565,7 @@ class LSldapObject {
**/ **/
function updateObjectsInRelation($object,$listDns,$attr,$objectType,$attrValue='dn') { function updateObjectsInRelation($object,$listDns,$attr,$objectType,$attrValue='dn') {
if ((!$attr)||(!$objectType)) { if ((!$attr)||(!$objectType)) {
$GLOBALS['LSerror'] -> addErrorCode('LSrelations_05','updateObjectsInRelation'); LSerror::addErrorCode('LSrelations_05','updateObjectsInRelation');
return; return;
} }
$currentObjects = $this -> listObjectsInRelation($object,$attr,$objectType,$attrValue); $currentObjects = $this -> listObjectsInRelation($object,$attr,$objectType,$attrValue);

View file

@ -133,7 +133,6 @@ class LSsession {
if(!$this -> loadLSclass('LSerror')) { if(!$this -> loadLSclass('LSerror')) {
return; return;
} }
$GLOBALS['LSerror'] = new LSerror();
return true; return true;
} }
@ -172,7 +171,7 @@ class LSsession {
$error = 1; $error = 1;
} }
if ($error) { if ($error) {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_04',$object); LSerror::addErrorCode('LSsession_04',$object);
return; return;
} }
return true; return true;
@ -191,7 +190,7 @@ class LSsession {
if(self::includeFile(LS_ADDONS_DIR .'LSaddons.'.$addon.'.php')) { if(self::includeFile(LS_ADDONS_DIR .'LSaddons.'.$addon.'.php')) {
self::includeFile(LS_CONF_DIR."LSaddons/config.LSaddons.".$addon.".php"); self::includeFile(LS_CONF_DIR."LSaddons/config.LSaddons.".$addon.".php");
if (!call_user_func('LSaddon_'. $addon .'_support')) { if (!call_user_func('LSaddon_'. $addon .'_support')) {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_02',$addon); LSerror::addErrorCode('LSsession_02',$addon);
return; return;
} }
return true; return true;
@ -209,7 +208,7 @@ class LSsession {
*/ */
function loadLSaddons() { function loadLSaddons() {
if(!is_array($GLOBALS['LSaddons']['loads'])) { if(!is_array($GLOBALS['LSaddons']['loads'])) {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_01',"LSaddons['loads']"); LSerror::addErrorCode('LSsession_01',"LSaddons['loads']");
return; return;
} }
@ -345,11 +344,11 @@ class LSsession {
if ($nbresult==0) { if ($nbresult==0) {
// identifiant incorrect // identifiant incorrect
LSdebug('identifiant incorrect'); LSdebug('identifiant incorrect');
$GLOBALS['LSerror'] -> addErrorCode('LSsession_06'); LSerror::addErrorCode('LSsession_06');
} }
else if ($nbresult>1) { else if ($nbresult>1) {
// duplication d'authentité // duplication d'authentité
$GLOBALS['LSerror'] -> addErrorCode('LSsession_07'); LSerror::addErrorCode('LSsession_07');
} }
else { else {
if (isset($_GET['LSsession_recoverPassword'])) { if (isset($_GET['LSsession_recoverPassword'])) {
@ -410,19 +409,19 @@ class LSsession {
else { else {
// Problème durant l'envoie du mail // Problème durant l'envoie du mail
LSdebug("Problème durant l'envoie du mail"); LSdebug("Problème durant l'envoie du mail");
$GLOBALS['LSerror'] -> addErrorCode('LSsession_20',7); LSerror::addErrorCode('LSsession_20',7);
} }
} }
else { else {
// Erreur durant la mise à jour de l'objet // Erreur durant la mise à jour de l'objet
LSdebug("Erreur durant la mise à jour de l'objet"); LSdebug("Erreur durant la mise à jour de l'objet");
$GLOBALS['LSerror'] -> addErrorCode('LSsession_20',6); LSerror::addErrorCode('LSsession_20',6);
} }
} }
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
LSdebug("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('LSsession_20',5); LSerror::addErrorCode('LSsession_20',5);
} }
} }
// 2nd étape : génération du mot de passe + envoie par mail // 2nd étape : génération du mot de passe + envoie par mail
@ -455,35 +454,35 @@ class LSsession {
else { else {
// Problème durant l'envoie du mail // Problème durant l'envoie du mail
LSdebug("Problème durant l'envoie du mail"); LSdebug("Problème durant l'envoie du mail");
$GLOBALS['LSerror'] -> addErrorCode('LSsession_20',4); LSerror::addErrorCode('LSsession_20',4);
} }
} }
else { else {
// Erreur durant la mise à jour de l'objet // Erreur durant la mise à jour de l'objet
LSdebug("Erreur durant la mise à jour de l'objet"); LSdebug("Erreur durant la mise à jour de l'objet");
$GLOBALS['LSerror'] -> addErrorCode('LSsession_20',3); LSerror::addErrorCode('LSsession_20',3);
} }
} }
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
LSdebug("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('LSsession_20',2); LSerror::addErrorCode('LSsession_20',2);
} }
} }
else { else {
// l'attribut password n'existe pas // l'attribut password n'existe pas
LSdebug("L'attribut password n'existe pas"); LSdebug("L'attribut password n'existe pas");
$GLOBALS['LSerror'] -> addErrorCode('LSsession_20',1); LSerror::addErrorCode('LSsession_20',1);
} }
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_19'); LSerror::addErrorCode('LSsession_19');
} }
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_18'); LSerror::addErrorCode('LSsession_18');
} }
} }
else { else {
@ -499,18 +498,18 @@ class LSsession {
return true; return true;
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_06'); LSerror::addErrorCode('LSsession_06');
LSdebug('mdp incorrect'); LSdebug('mdp incorrect');
} }
} }
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_10'); LSerror::addErrorCode('LSsession_10');
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_09'); LSerror::addErrorCode('LSsession_09');
} }
} }
if ($this -> ldapServerId) { if ($this -> ldapServerId) {
@ -596,7 +595,7 @@ class LSsession {
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_03'); LSerror::addErrorCode('LSsession_03');
return; return;
} }
} }
@ -640,17 +639,17 @@ class LSsession {
$return=array_merge($return,$tbl_return); $return=array_merge($return,$tbl_return);
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_17',3); LSerror::addErrorCode('LSsession_17',3);
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_17',2); LSerror::addErrorCode('LSsession_17',2);
} }
} }
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_17',1); LSerror::addErrorCode('LSsession_17',1);
} }
} }
else { else {
@ -968,11 +967,11 @@ class LSsession {
} }
if ($this -> ajaxDisplay) { if ($this -> ajaxDisplay) {
$GLOBALS['Smarty'] -> assign('LSerror_txt',$GLOBALS['LSerror']->getErrors()); $GLOBALS['Smarty'] -> assign('LSerror_txt',LSerror::getErrors());
$GLOBALS['Smarty'] -> assign('LSdebug_txt',LSdebug_print(true)); $GLOBALS['Smarty'] -> assign('LSdebug_txt',LSdebug_print(true));
} }
else { else {
$GLOBALS['LSerror'] -> display(); LSerror::display();
LSdebug_print(); LSdebug_print();
} }
if (!$this -> template) if (!$this -> template)
@ -1004,8 +1003,8 @@ class LSsession {
$_SESSION['LSsession_infos']=array(); $_SESSION['LSsession_infos']=array();
} }
if ($GLOBALS['LSerror']->errorsDefined()) { if (LSerror::errorsDefined()) {
$data['LSerror'] = $GLOBALS['LSerror']->getErrors(); $data['LSerror'] = LSerror::getErrors();
} }
if (isset($_REQUEST['imgload'])) { if (isset($_REQUEST['imgload'])) {

View file

@ -89,7 +89,7 @@ function getFData($format,$data,$meth=NULL) {
$format[$i]=ereg_replace($ch[0],$value,$format[$i]); $format[$i]=ereg_replace($ch[0],$value,$format[$i]);
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('fct_getFData_01',array('meth' => $meth,'obj' => $ch[1])); LSerror::addErrorCode('fct_getFData_01',array('meth' => $meth,'obj' => $ch[1]));
break; break;
} }
} }
@ -136,7 +136,7 @@ function getFData($format,$data,$meth=NULL) {
$format[$i]=ereg_replace($ch[0],$value,$format[$i]); $format[$i]=ereg_replace($ch[0],$value,$format[$i]);
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('fct_getFData_01',array('meth' => $meth,'obj' => get_class($data))); LSerror::addErrorCode('fct_getFData_01',array('meth' => $meth,'obj' => get_class($data)));
break; break;
} }
} }

View file

@ -6,7 +6,7 @@ $GLOBALS['LSsession'] = new LSsession();
if (($_REQUEST['template'] != 'login')&&($_REQUEST['template'] != 'recoverPassword')) { if (($_REQUEST['template'] != 'login')&&($_REQUEST['template'] != 'recoverPassword')) {
if ( !$GLOBALS['LSsession'] -> startLSsession() ) { if ( !$GLOBALS['LSsession'] -> startLSsession() ) {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_22'); LSerror::addErrorCode('LSsession_22');
$_ERRORS = true; $_ERRORS = true;
} }
} }
@ -156,24 +156,24 @@ if (!isset($_ERRORS)) {
); );
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSrelations_01',$relationName); LSerror::addErrorCode('LSrelations_01',$relationName);
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_11'); LSerror::addErrorCode('LSsession_11');
} }
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); LSerror::addErrorCode('LSsession_12');
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); LSerror::addErrorCode('LSsession_12');
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); LSerror::addErrorCode('LSsession_12');
} }
} }
break; break;
@ -209,33 +209,33 @@ if (!isset($_ERRORS)) {
$data['id'] = $_REQUEST['id']; $data['id'] = $_REQUEST['id'];
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSrelations_01',$relationName); LSerror::addErrorCode('LSrelations_01',$relationName);
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSrelations_03',$relationName); LSerror::addErrorCode('LSrelations_03',$relationName);
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSrelations_02',$relationName); LSerror::addErrorCode('LSrelations_02',$relationName);
} }
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_11'); LSerror::addErrorCode('LSsession_11');
} }
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); LSerror::addErrorCode('LSsession_12');
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); LSerror::addErrorCode('LSsession_12');
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); LSerror::addErrorCode('LSsession_12');
} }
} }
break; break;
@ -257,7 +257,7 @@ if (!isset($_ERRORS)) {
foreach($list as $o) { foreach($list as $o) {
if($o -> getDn() == $_REQUEST['dn']) { if($o -> getDn() == $_REQUEST['dn']) {
if (!$o -> $relationConf['remove_function']($object)) { if (!$o -> $relationConf['remove_function']($object)) {
$GLOBALS['LSerror'] -> addErrorCode('LSrelations_03',$conf['relationName']); LSerror::addErrorCode('LSrelations_03',$conf['relationName']);
} }
else { else {
$ok = true; $ok = true;
@ -266,7 +266,7 @@ if (!isset($_ERRORS)) {
} }
if (!$ok) { if (!$ok) {
LSdebug($_REQUEST['value']." introuvé parmi la liste"); LSdebug($_REQUEST['value']." introuvé parmi la liste");
$GLOBALS['LSerror'] -> addErrorCode('LSrelations_03',$conf['relationName']); LSerror::addErrorCode('LSrelations_03',$conf['relationName']);
} }
else { else {
$data=array( $data=array(
@ -275,28 +275,28 @@ if (!isset($_ERRORS)) {
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSrelations_03',$conf['relationName']); LSerror::addErrorCode('LSrelations_03',$conf['relationName']);
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSrelations_01',$conf['relationName']); LSerror::addErrorCode('LSrelations_01',$conf['relationName']);
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_11'); LSerror::addErrorCode('LSsession_11');
} }
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); LSerror::addErrorCode('LSsession_12');
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); LSerror::addErrorCode('LSsession_12');
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); LSerror::addErrorCode('LSsession_12');
} }
} }
break; break;
@ -346,7 +346,7 @@ if (!isset($_ERRORS)) {
); );
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); LSerror::addErrorCode('LSsession_12');
} }
break; break;
} }
@ -394,7 +394,7 @@ if (!isset($_ERRORS)) {
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); LSerror::addErrorCode('LSsession_12');
} }
} }
break; break;

View file

@ -52,7 +52,7 @@ if($LSsession -> startLSsession()) {
if ($form->validate()) { if ($form->validate()) {
// MàJ des données de l'objet LDAP // MàJ des données de l'objet LDAP
if ($object -> updateData('modify')) { if ($object -> updateData('modify')) {
if ($GLOBALS['LSerror']->errorsDefined()) { if (LSerror::errorsDefined()) {
$GLOBALS['LSsession'] -> addInfo(_("L'objet a été modifié partiellement.")); $GLOBALS['LSsession'] -> addInfo(_("L'objet a été modifié partiellement."));
} }
else { else {
@ -114,16 +114,16 @@ if($LSsession -> startLSsession()) {
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_11'); LSerror::addErrorCode('LSsession_11');
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_11'); LSerror::addErrorCode('LSsession_11');
} }
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); LSerror::addErrorCode('LSsession_12');
} }
} }

View file

@ -40,7 +40,7 @@ if($LSsession -> startLSsession()) {
$GLOBALS['LSsession'] -> redirect('view.php?LSobject='.$_GET['LSobject'].'&refresh'); $GLOBALS['LSsession'] -> redirect('view.php?LSobject='.$_GET['LSobject'].'&refresh');
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_15',$objectname); LSerror::addErrorCode('LSldapObject_15',$objectname);
} }
} }
else { else {
@ -53,19 +53,19 @@ if($LSsession -> startLSsession()) {
$GLOBALS['LSsession'] -> setTemplate('question.tpl'); $GLOBALS['LSsession'] -> setTemplate('question.tpl');
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); LSerror::addErrorCode('LSsession_12');
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_11'); LSerror::addErrorCode('LSsession_11');
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSldapObject_01'); LSerror::addErrorCode('LSldapObject_01');
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); LSerror::addErrorCode('LSsession_12');
} }
} }

View file

@ -324,7 +324,7 @@ if($LSsession -> startLSsession()) {
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); LSerror::addErrorCode('LSsession_12');
} }
} }
else { else {

View file

@ -141,12 +141,12 @@ if($LSsession -> startLSsession()) {
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSrelations_01',$relationName); LSerror::addErrorCode('LSrelations_01',$relationName);
} }
$LSrelations[]=$return; $LSrelations[]=$return;
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSrelations_04',array('relation' => $relationName,'LSobject' => $relationConf['LSobject'])); LSerror::addErrorCode('LSrelations_04',array('relation' => $relationName,'LSobject' => $relationConf['LSobject']));
} }
} }
} }
@ -163,7 +163,7 @@ if($LSsession -> startLSsession()) {
$GLOBALS['LSsession'] -> setTemplate('view.tpl'); $GLOBALS['LSsession'] -> setTemplate('view.tpl');
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_11'); LSerror::addErrorCode('LSsession_11');
} }
} }
// Affichage d'une liste d'un type d'objet // Affichage d'une liste d'un type d'objet
@ -477,11 +477,11 @@ if($LSsession -> startLSsession()) {
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_11'); LSerror::addErrorCode('LSsession_11');
} }
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); LSerror::addErrorCode('LSsession_12');
} }
} }
else { else {