mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 09:59:06 +01:00
- LSsession : Tranformation de la classe pour la rendre "statique".
-> Tout les appels on été revus.
This commit is contained in:
parent
6a7a135d3c
commit
03c375d827
55 changed files with 992 additions and 898 deletions
|
@ -22,9 +22,7 @@
|
|||
|
||||
require_once 'includes/class/class.LSsession.php';
|
||||
|
||||
$GLOBALS['LSsession'] = new LSsession();
|
||||
|
||||
if($LSsession -> startLSsession()) {
|
||||
if(LSsession :: startLSsession()) {
|
||||
|
||||
if (isset($_POST['LSform_objecttype'])) {
|
||||
$LSobject = $_POST['LSform_objecttype'];
|
||||
|
@ -35,8 +33,8 @@ if($LSsession -> startLSsession()) {
|
|||
|
||||
if (isset($LSobject)) {
|
||||
// Création d'un LSobject
|
||||
if ($GLOBALS['LSsession'] -> loadLSobject($LSobject)) {
|
||||
if ( $GLOBALS['LSsession'] -> canCreate($LSobject) ) {
|
||||
if (LSsession ::loadLSobject($LSobject)) {
|
||||
if ( LSsession :: canCreate($LSobject) ) {
|
||||
$object = new $LSobject();
|
||||
|
||||
if ($_GET['load']!='') {
|
||||
|
@ -49,10 +47,10 @@ if($LSsession -> startLSsession()) {
|
|||
// MàJ des données de l'objet LDAP
|
||||
if ($object -> updateData('create')) {
|
||||
if (!LSerror::errorsDefined()) {
|
||||
$GLOBALS['LSsession'] -> addInfo(_("L'objet a bien été ajouté."));
|
||||
LSsession :: addInfo(_("L'objet a bien été ajouté."));
|
||||
}
|
||||
if (isset($_REQUEST['ajax'])) {
|
||||
$GLOBALS['LSsession'] -> displayAjaxReturn (
|
||||
LSsession :: displayAjaxReturn (
|
||||
array(
|
||||
'LSredirect' => 'view.php?LSobject='.$LSobject.'&dn='.$object -> getDn()
|
||||
)
|
||||
|
@ -61,12 +59,12 @@ if($LSsession -> startLSsession()) {
|
|||
}
|
||||
else {
|
||||
if (!LSdebugDefined()) {
|
||||
$GLOBALS['LSsession'] -> redirect('view.php?LSobject='.$LSobject.'&dn='.$object -> getDn());
|
||||
LSsession :: redirect('view.php?LSobject='.$LSobject.'&dn='.$object -> getDn());
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$GLOBALS['LSsession'] -> displayAjaxReturn (
|
||||
LSsession :: displayAjaxReturn (
|
||||
array(
|
||||
'LSformErrors' => $form -> getErrors()
|
||||
)
|
||||
|
@ -75,7 +73,7 @@ if($LSsession -> startLSsession()) {
|
|||
}
|
||||
}
|
||||
else if (isset($_REQUEST['ajax']) && $form -> definedError()) {
|
||||
$GLOBALS['LSsession'] -> displayAjaxReturn (
|
||||
LSsession :: displayAjaxReturn (
|
||||
array(
|
||||
'LSformErrors' => $form -> getErrors()
|
||||
)
|
||||
|
@ -84,25 +82,25 @@ if($LSsession -> startLSsession()) {
|
|||
}
|
||||
// Définition du Titre de la page
|
||||
$GLOBALS['Smarty'] -> assign('pagetitle',_('Nouveau').' : '.$object -> getLabel());
|
||||
$GLOBALS['LSsession'] -> setTemplate('create.tpl');
|
||||
LSsession :: setTemplate('create.tpl');
|
||||
$form -> display();
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_11');
|
||||
LSerror :: addErrorCode('LSsession_11');
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSldapObject_01');
|
||||
LSerror :: addErrorCode('LSldapObject_01');
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_12');
|
||||
LSerror :: addErrorCode('LSsession_12');
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
$GLOBALS['LSsession'] -> setTemplate('login.tpl');
|
||||
LSsession :: setTemplate('login.tpl');
|
||||
}
|
||||
$GLOBALS['LSsession'] -> displayTemplate();
|
||||
LSsession :: displayTemplate();
|
||||
|
||||
?>
|
||||
|
|
|
@ -74,10 +74,10 @@ $GLOBALS['LSerror_code']['FTP_05']= array (
|
|||
// Dependance de librairie
|
||||
if (!class_exists('Net_FTP')) {
|
||||
if (!defined('NET_FTP')) {
|
||||
LSerror::addErrorCode('FTP_SUPPORT_02','NET_FTP');
|
||||
LSerror :: addErrorCode('FTP_SUPPORT_02','NET_FTP');
|
||||
$retval=false;
|
||||
} else if(!LSsession::includeFile(NET_FTP)) {
|
||||
LSerror::addErrorCode('FTP_SUPPORT_01');
|
||||
LSerror :: addErrorCode('FTP_SUPPORT_01');
|
||||
$retval=false;
|
||||
}
|
||||
}
|
||||
|
@ -108,14 +108,14 @@ $GLOBALS['LSerror_code']['FTP_05']= array (
|
|||
return $cnx;
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('FTP_01',"2");
|
||||
LSerror::addErrorCode('FTP_00',$do -> getMessage());
|
||||
LSerror :: addErrorCode('FTP_01',"2");
|
||||
LSerror :: addErrorCode('FTP_00',$do -> getMessage());
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('FTP_01',"1");
|
||||
LSerror::addErrorCode('FTP_00',$do -> getMessage());
|
||||
LSerror :: addErrorCode('FTP_01',"1");
|
||||
LSerror :: addErrorCode('FTP_00',$do -> getMessage());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -144,15 +144,15 @@ $GLOBALS['LSerror_code']['FTP_05']= array (
|
|||
foreach($dirs as $dir) {
|
||||
$do = $cnx -> mkdir($dir,true);
|
||||
if ($do instanceof PEAR_Error) {
|
||||
LSerror::addErrorCode('FTP_02',$dir);
|
||||
LSerror::addErrorCode('FTP_00',$do -> getMessage());
|
||||
LSerror :: addErrorCode('FTP_02',$dir);
|
||||
LSerror :: addErrorCode('FTP_00',$do -> getMessage());
|
||||
return;
|
||||
}
|
||||
if ($chmod) {
|
||||
$do = $cnx -> chmod($dir,$chmod);
|
||||
if ($do instanceof PEAR_Error) {
|
||||
LSerror::addErrorCode('FTP_04',$dir);
|
||||
LSerror::addErrorCode('FTP_00',$do -> getMessage());
|
||||
LSerror :: addErrorCode('FTP_04',$dir);
|
||||
LSerror :: addErrorCode('FTP_00',$do -> getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -194,8 +194,8 @@ $GLOBALS['LSerror_code']['FTP_05']= array (
|
|||
}
|
||||
$do = $cnx -> rm($dir,true);
|
||||
if ($do instanceof PEAR_Error) {
|
||||
LSerror::addErrorCode('FTP_03',$dir);
|
||||
LSerror::addErrorCode('FTP_00',$do -> getMessage());
|
||||
LSerror :: addErrorCode('FTP_03',$dir);
|
||||
LSerror :: addErrorCode('FTP_00',$do -> getMessage());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -223,8 +223,8 @@ $GLOBALS['LSerror_code']['FTP_05']= array (
|
|||
}
|
||||
$do = $cnx -> rename($old,$new);
|
||||
if ($do instanceof PEAR_Error) {
|
||||
LSerror::addErrorCode('FTP_05',array('old' => $old,'new' => $new));
|
||||
LSerror::addErrorCode('FTP_00',$do -> getMessage());
|
||||
LSerror :: addErrorCode('FTP_05',array('old' => $old,'new' => $new));
|
||||
LSerror :: addErrorCode('FTP_00',$do -> getMessage());
|
||||
return;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -52,7 +52,7 @@ $GLOBALS['LSerror_code']['MAIL_01']= array (
|
|||
// Dependance de librairie
|
||||
if (!class_exists('Mail')) {
|
||||
if(!LSsession::includeFile(PEAR_MAIL)) {
|
||||
LSerror::addErrorCode('MAIL_SUPPORT_01');
|
||||
LSerror :: addErrorCode('MAIL_SUPPORT_01');
|
||||
$retval=false;
|
||||
}
|
||||
}
|
||||
|
@ -76,21 +76,18 @@ $GLOBALS['LSerror_code']['MAIL_01']= array (
|
|||
if ($subject) {
|
||||
$headers["Subject"] = $subject;
|
||||
}
|
||||
if (!isset($headers['From']) && ($GLOBALS['LSsession'] -> getEmailSender() != "")) {
|
||||
$headers['From'] = $GLOBALS['LSsession'] -> getEmailSender();
|
||||
if (!isset($headers['From']) && (LSsession :: getEmailSender() != "")) {
|
||||
$headers['From'] = LSsession :: getEmailSender();
|
||||
}
|
||||
$headers["To"] = $to;
|
||||
|
||||
$ret = $mail_obj -> send($to,$headers,$msg);
|
||||
|
||||
if ($ret instanceof PEAR_Error) {
|
||||
LSerror::addErrorCode('MAIL_01');
|
||||
LSerror::addErrorCode('MAIL_00',$ret -> getMessage());
|
||||
LSerror :: addErrorCode('MAIL_01');
|
||||
LSerror :: addErrorCode('MAIL_00',$ret -> getMessage());
|
||||
return;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
|
|
@ -56,8 +56,8 @@ $retval=true;
|
|||
|
||||
// Dependance de librairie
|
||||
if (!function_exists('createDirsByFTP')) {
|
||||
if(!$GLOBALS['LSsession'] -> loadLSaddon('ftp')) {
|
||||
LSerror::addErrorCode('MAILDIR_SUPPORT_01');
|
||||
if(!LSsession :: loadLSaddon('ftp')) {
|
||||
LSerror :: addErrorCode('MAILDIR_SUPPORT_01');
|
||||
$retval=false;
|
||||
}
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ $retval=true;
|
|||
|
||||
foreach($MUST_DEFINE_CONST as $const) {
|
||||
if ( (!defined($const)) || (constant($const) == "")) {
|
||||
LSerror::addErrorCode('MAILDIR_SUPPORT_02',$const);
|
||||
LSerror :: addErrorCode('MAILDIR_SUPPORT_02',$const);
|
||||
$retval=false;
|
||||
}
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ $retval=true;
|
|||
$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)) {
|
||||
LSerror::addErrorCode('MAILDIR_01');
|
||||
LSerror :: addErrorCode('MAILDIR_01');
|
||||
return;
|
||||
}
|
||||
return true;
|
||||
|
@ -127,7 +127,7 @@ $retval=true;
|
|||
}
|
||||
}
|
||||
if (!removeDirsByFTP(LS_MAILDIR_FTP_HOST,LS_MAILDIR_FTP_PORT,LS_MAILDIR_FTP_USER,LS_MAILDIR_FTP_PWD,$dir)) {
|
||||
LSerror::addErrorCode('MAILDIR_02');
|
||||
LSerror :: addErrorCode('MAILDIR_02');
|
||||
return;
|
||||
}
|
||||
return true;
|
||||
|
@ -155,7 +155,7 @@ $retval=true;
|
|||
}
|
||||
|
||||
if ($dir=="") {
|
||||
LSerror::addErrorCode('MAILDIR_04');
|
||||
LSerror :: addErrorCode('MAILDIR_04');
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -174,7 +174,7 @@ $retval=true;
|
|||
*/
|
||||
function renameMaildirByFTP($old,$new) {
|
||||
if (!renameDirByFTP(LS_MAILDIR_FTP_HOST,LS_MAILDIR_FTP_PORT,LS_MAILDIR_FTP_USER,LS_MAILDIR_FTP_PWD,$old,$new)) {
|
||||
LSerror::addErrorCode('MAILDIR_03');
|
||||
LSerror :: addErrorCode('MAILDIR_03');
|
||||
return;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -52,8 +52,8 @@ $GLOBALS['LSerror_code']['POSIX_01']= array (
|
|||
|
||||
// Dependance de librairie
|
||||
if (!function_exists('createDirsByFTP')) {
|
||||
if(!$GLOBALS['LSsession'] -> loadLSaddon('ftp')) {
|
||||
LSerror::addErrorCode('POSIX_SUPPORT_02');
|
||||
if(!LSsession :: loadLSaddon('ftp')) {
|
||||
LSerror :: addErrorCode('POSIX_SUPPORT_02');
|
||||
$retval=false;
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ $GLOBALS['LSerror_code']['POSIX_01']= array (
|
|||
|
||||
foreach($MUST_DEFINE_CONST as $const) {
|
||||
if ( (!defined($const)) || (constant($const) == "")) {
|
||||
LSerror::addErrorCode('POSIX_SUPPORT_O1',$const);
|
||||
LSerror :: addErrorCode('POSIX_SUPPORT_O1',$const);
|
||||
$retval=false;
|
||||
}
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ $GLOBALS['LSerror_code']['POSIX_01']= array (
|
|||
*/
|
||||
function generate_homeDirectory($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ LS_POSIX_UID_ATTR ]) != 'LSattribute' ) {
|
||||
LSerror::addErrorCode('POSIX_01',array('dependency' => 'uid', 'attr' => 'homeDirectory'));
|
||||
LSerror :: addErrorCode('POSIX_01',array('dependency' => 'uid', 'attr' => 'homeDirectory'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -169,7 +169,7 @@ $GLOBALS['LSerror_code']['POSIX_01']= array (
|
|||
function createHomeDirectoryByFTP($ldapObject) {
|
||||
$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)) {
|
||||
LSerror::addErrorCode('POSIX_02');
|
||||
LSerror :: addErrorCode('POSIX_02');
|
||||
return;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -57,7 +57,7 @@ $GLOBALS['LSerror_code']['SAMBA_01']= array (
|
|||
// Dependance de librairie
|
||||
if ( !class_exists('smbHash') ) {
|
||||
if ( !LSsession::includeFile(LS_LIB_DIR . 'class.smbHash.php') ) {
|
||||
LSerror::addErrorCode('SAMBA_SUPPORT_01');
|
||||
LSerror :: addErrorCode('SAMBA_SUPPORT_01');
|
||||
$retval=false;
|
||||
}
|
||||
}
|
||||
|
@ -74,14 +74,14 @@ $GLOBALS['LSerror_code']['SAMBA_01']= array (
|
|||
|
||||
foreach($MUST_DEFINE_CONST as $const) {
|
||||
if ( (!defined($const)) || (constant($const) == "")) {
|
||||
LSerror::addErrorCode('SAMBA_SUPPORT_02',$const);
|
||||
LSerror :: addErrorCode('SAMBA_SUPPORT_02',$const);
|
||||
$retval=false;
|
||||
}
|
||||
}
|
||||
|
||||
// Pour l'intégrité des SID
|
||||
if ( (LS_SAMBA_SID_BASE_USER % 2) == (LS_SAMBA_SID_BASE_GROUP % 2) ) {
|
||||
LSerror::addErrorCode('SAMBA_SUPPORT_03');
|
||||
LSerror :: addErrorCode('SAMBA_SUPPORT_03');
|
||||
$retval=false;
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ $GLOBALS['LSerror_code']['SAMBA_01']= array (
|
|||
*/
|
||||
function generate_sambaUserSID($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ LS_SAMBA_UIDNUMBER_ATTR ]) != 'LSattribute' ) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ $GLOBALS['LSerror_code']['SAMBA_01']= array (
|
|||
*/
|
||||
function generate_sambaGroupSID($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ LS_SAMBA_GIDNUMBER_ATTR ]) != 'LSattribute' ) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -154,7 +154,7 @@ $GLOBALS['LSerror_code']['SAMBA_01']= array (
|
|||
*/
|
||||
function generate_sambaPrimaryGroupSID($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ LS_SAMBA_GIDNUMBER_ATTR ]) != 'LSattribute' ) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -176,7 +176,7 @@ $GLOBALS['LSerror_code']['SAMBA_01']= array (
|
|||
*/
|
||||
function generate_sambaNTPassword($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ LS_SAMBA_USERPASSWORD_ATTR ]) != 'LSattribute' ) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -201,7 +201,7 @@ $GLOBALS['LSerror_code']['SAMBA_01']= array (
|
|||
*/
|
||||
function generate_sambaLMPassword($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ LS_SAMBA_USERPASSWORD_ATTR ]) != 'LSattribute' ) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ $GLOBALS['LSerror_code']['SUPANN_01']= array (
|
|||
|
||||
foreach($MUST_DEFINE_CONST as $const) {
|
||||
if ( (!defined($const)) || (constant($const) == "")) {
|
||||
LSerror::addErrorCode('SUPANN_SUPPORT_01',$const);
|
||||
LSerror :: addErrorCode('SUPANN_SUPPORT_01',$const);
|
||||
$retval=false;
|
||||
}
|
||||
}
|
||||
|
@ -70,11 +70,11 @@ $GLOBALS['LSerror_code']['SUPANN_01']= array (
|
|||
*/
|
||||
function generate_displayName($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ LS_SUPANN_LASTNAME_ATTR ]) != 'LSattribute' ) {
|
||||
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;
|
||||
}
|
||||
if ( get_class($ldapObject -> attrs[ LS_SUPANN_FIRSTNAME_ATTR ]) != 'LSattribute' ) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -95,11 +95,11 @@ $GLOBALS['LSerror_code']['SUPANN_01']= array (
|
|||
*/
|
||||
function generate_cn($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ LS_SUPANN_LASTNAME_ATTR ]) != 'LSattribute' ) {
|
||||
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;
|
||||
}
|
||||
if ( get_class($ldapObject -> attrs[ LS_SUPANN_FIRSTNAME_ATTR ]) != 'LSattribute' ) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -80,12 +80,12 @@ class LSattr_html {
|
|||
*/
|
||||
function addToForm (&$form,$idForm,$data=NULL) {
|
||||
if (!$this -> LSformElement_type) {
|
||||
LSerror::addErrorCode('LSattr_html_01',$this -> name);
|
||||
LSerror :: addErrorCode('LSattr_html_01',$this -> name);
|
||||
return;
|
||||
}
|
||||
$element=$form -> addElement($this -> LSformElement_type, $this -> name, $this -> config['label'],$this -> config, $this);
|
||||
if(!$element) {
|
||||
LSerror::addErrorCode('LSform_06',$this -> name);
|
||||
LSerror :: addErrorCode('LSform_06',$this -> name);
|
||||
return;
|
||||
}
|
||||
if ($data) {
|
||||
|
|
|
@ -39,12 +39,12 @@ class LSattr_html_image extends LSattr_html {
|
|||
function addToForm (&$form,$idForm,$data=NULL) {
|
||||
$element=$form -> addElement('image', $this -> name, $this -> config['label'],$this -> config, $this);
|
||||
if(!$element) {
|
||||
LSerror::addErrorCode('LSform_06',$this -> name);
|
||||
LSerror :: addErrorCode('LSform_06',$this -> name);
|
||||
return;
|
||||
}
|
||||
|
||||
if (count($data)>1) {
|
||||
LSerror::addErrorCode('LSattr_html_03','password');
|
||||
LSerror :: addErrorCode('LSattr_html_03','password');
|
||||
}
|
||||
|
||||
if ($data) {
|
||||
|
|
|
@ -39,12 +39,12 @@ class LSattr_html_password extends LSattr_html {
|
|||
function addToForm (&$form,$idForm,$data=NULL) {
|
||||
$element=$form -> addElement('password', $this -> name, $this -> config['label'], $this -> config, $this);
|
||||
if(!$element) {
|
||||
LSerror::addErrorCode('LSform_06',$this -> name);
|
||||
LSerror :: addErrorCode('LSform_06',$this -> name);
|
||||
return;
|
||||
}
|
||||
|
||||
if (count($data)>1) {
|
||||
LSerror::addErrorCode('LSattr_html_03','password');
|
||||
LSerror :: addErrorCode('LSattr_html_03','password');
|
||||
}
|
||||
|
||||
if ($data) {
|
||||
|
|
|
@ -41,7 +41,7 @@ class LSattr_html_select_list extends LSattr_html{
|
|||
$this -> config['text_possible_values'] = $possible_values;
|
||||
$element=$form -> addElement('select', $this -> name, $this -> config['label'],$this -> config, $this);
|
||||
if(!$element) {
|
||||
LSerror::addErrorCode('LSform_06',$this -> name);
|
||||
LSerror :: addErrorCode('LSform_06',$this -> name);
|
||||
return;
|
||||
}
|
||||
if ($data) {
|
||||
|
@ -76,10 +76,10 @@ class LSattr_html_select_list extends LSattr_html{
|
|||
foreach($this -> config['possible_values'] as $val_name => $val) {
|
||||
if($val_name=='OTHER_OBJECT') {
|
||||
if ((!isset($val['object_type'])) || (!isset($val['value_attribute']))) {
|
||||
LSerror::addErrorCode('LSattr_html_select_list_01',$this -> name);
|
||||
LSerror :: addErrorCode('LSattr_html_select_list_01',$this -> name);
|
||||
break;
|
||||
}
|
||||
if (!$GLOBALS['LSsession'] -> loadLSobject($val['object_type'])) {
|
||||
if (!LSsession :: loadLSobject($val['object_type'])) {
|
||||
return;
|
||||
}
|
||||
$obj = new $val['object_type']();
|
||||
|
|
|
@ -40,7 +40,7 @@ class LSattr_html_select_object extends LSattr_html{
|
|||
$this -> config['attrObject'] = $this;
|
||||
$element=$form -> addElement('select_object', $this -> name, $this -> config['label'],$this -> config,$this);
|
||||
if(!$element) {
|
||||
LSerror::addErrorCode('LSform_06',$this -> name);
|
||||
LSerror :: addErrorCode('LSform_06',$this -> name);
|
||||
return;
|
||||
}
|
||||
if ($data) {
|
||||
|
@ -81,11 +81,11 @@ class LSattr_html_select_object extends LSattr_html{
|
|||
if (isset($this -> config['selectable_object'])) {
|
||||
$conf=$this -> config['selectable_object'];
|
||||
if (!isset($conf['object_type'])) {
|
||||
LSerror::addErrorCode('LSattr_html_select_object_01',$this -> name);
|
||||
LSerror :: addErrorCode('LSattr_html_select_object_01',$this -> name);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$GLOBALS['LSsession'] -> loadLSobject($conf['object_type'])) {
|
||||
if (!LSsession :: loadLSobject($conf['object_type'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -129,11 +129,11 @@ class LSattr_html_select_object extends LSattr_html{
|
|||
if (isset($this -> config['selectable_object'])) {
|
||||
$conf=$this -> config['selectable_object'];
|
||||
if (!isset($conf['object_type'])) {
|
||||
LSerror::addErrorCode('LSattr_html_select_object_01',$this -> name);
|
||||
LSerror :: addErrorCode('LSattr_html_select_object_01',$this -> name);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$GLOBALS['LSsession'] -> loadLSobject($conf['object_type'])) {
|
||||
if (!LSsession :: loadLSobject($conf['object_type'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ class LSattr_ldap_password extends LSattr_ldap {
|
|||
break;
|
||||
case 'ext_des':
|
||||
if ( ! defined( 'CRYPT_EXT_DES' ) || CRYPT_EXT_DES == 0 ) {
|
||||
LSerror::addErrorCode(1023,'ext_des');
|
||||
LSerror :: addErrorCode(1023,'ext_des');
|
||||
}
|
||||
else {
|
||||
return '{CRYPT}' . crypt( $this -> clearPassword, '_' . $this -> getSalt(8) );
|
||||
|
@ -73,7 +73,7 @@ class LSattr_ldap_password extends LSattr_ldap {
|
|||
break;
|
||||
case 'blowfish':
|
||||
if( ! defined( 'CRYPT_BLOWFISH' ) || CRYPT_BLOWFISH == 0 ) {
|
||||
LSerror::addErrorCode(1023,'blowfish');
|
||||
LSerror :: addErrorCode(1023,'blowfish');
|
||||
}
|
||||
else {
|
||||
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' ) ) {
|
||||
return '{SHA}' . base64_encode( mhash( MHASH_SHA1, $this -> clearPassword ) );
|
||||
} else {
|
||||
LSerror::addErrorCode(1023,'sha');
|
||||
LSerror :: addErrorCode(1023,'sha');
|
||||
}
|
||||
break;
|
||||
case 'ssha':
|
||||
|
@ -96,7 +96,7 @@ class LSattr_ldap_password extends LSattr_ldap {
|
|||
return "{SSHA}".base64_encode( mhash( MHASH_SHA1, $this -> clearPassword.$salt ).$salt );
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode(1023,'ssha');
|
||||
LSerror :: addErrorCode(1023,'ssha');
|
||||
}
|
||||
break;
|
||||
case 'smd5':
|
||||
|
@ -106,7 +106,7 @@ class LSattr_ldap_password extends LSattr_ldap {
|
|||
return "{SMD5}".base64_encode( mhash( MHASH_MD5, $password_clear.$salt ).$salt );
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode(1023,'smd5');
|
||||
LSerror :: addErrorCode(1023,'smd5');
|
||||
}
|
||||
break;
|
||||
case 'md5':
|
||||
|
@ -114,7 +114,7 @@ class LSattr_ldap_password extends LSattr_ldap {
|
|||
break;
|
||||
case 'md5crypt':
|
||||
if( ! defined( 'CRYPT_MD5' ) || CRYPT_MD5 == 0 ) {
|
||||
LSerror::addErrorCode(1023,'md5crypt');
|
||||
LSerror :: addErrorCode(1023,'md5crypt');
|
||||
}
|
||||
else {
|
||||
return '{CRYPT}'.crypt($this -> clearPassword,'$1$'.$this -> getSalt().'$');
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
$GLOBALS['LSsession'] -> loadLSclass('LSattr_ldap');
|
||||
$GLOBALS['LSsession'] -> loadLSclass('LSattr_html');
|
||||
LSsession :: loadLSclass('LSattr_ldap');
|
||||
LSsession :: loadLSclass('LSattr_html');
|
||||
|
||||
/**
|
||||
* Attribut Ldap
|
||||
|
@ -66,14 +66,14 @@ class LSattribute {
|
|||
$this -> ldapObject = $ldapObject;
|
||||
$html_type = "LSattr_html_".$config['html_type'];
|
||||
$ldap_type = "LSattr_ldap_".$config['ldap_type'];
|
||||
$GLOBALS['LSsession'] -> loadLSclass($html_type);
|
||||
$GLOBALS['LSsession'] -> loadLSclass($ldap_type);
|
||||
LSsession :: loadLSclass($html_type);
|
||||
LSsession :: loadLSclass($ldap_type);
|
||||
if((class_exists($html_type))&&(class_exists($ldap_type))) {
|
||||
$this -> html = new $html_type($name,$config,$this);
|
||||
$this -> ldap = new $ldap_type($name,$config,$this);
|
||||
}
|
||||
else {
|
||||
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 true;
|
||||
|
@ -92,7 +92,7 @@ class LSattribute {
|
|||
|
||||
function getLabel() {
|
||||
if (!$this -> html) {
|
||||
LSerror::addErrorCode('LSattribute_09',array('type' => 'html','name' => $this -> name));
|
||||
LSerror :: addErrorCode('LSattribute_09',array('type' => 'html','name' => $this -> name));
|
||||
return;
|
||||
}
|
||||
return $this -> html -> getLabel();
|
||||
|
@ -158,7 +158,7 @@ class LSattribute {
|
|||
*/
|
||||
function getDisplayValue() {
|
||||
if (!$this -> ldap) {
|
||||
LSerror::addErrorCode('LSattribute_09',array('type' => 'ldap','name' => $this -> name));
|
||||
LSerror :: addErrorCode('LSattribute_09',array('type' => 'ldap','name' => $this -> name));
|
||||
return;
|
||||
}
|
||||
$data = $this -> ldap -> getDisplayValue($this -> data);
|
||||
|
@ -170,7 +170,7 @@ class LSattribute {
|
|||
$result=$func($result);
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSattribute_02',array('attr' => $this->name,'func' => $func));
|
||||
LSerror :: addErrorCode('LSattribute_02',array('attr' => $this->name,'func' => $func));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ class LSattribute {
|
|||
return $this -> config['onDisplay']($data);
|
||||
}
|
||||
else {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -207,7 +207,7 @@ class LSattribute {
|
|||
function addToForm(&$form,$idForm,&$obj=NULL,$value=NULL) {
|
||||
if(isset($this -> config['form'][$idForm])) {
|
||||
if (!$this -> html) {
|
||||
LSerror::addErrorCode('LSattribute_09',array('type' => 'html','name' => $this -> name));
|
||||
LSerror :: addErrorCode('LSattribute_09',array('type' => 'html','name' => $this -> name));
|
||||
return;
|
||||
}
|
||||
if($this -> myRights() == 'n') {
|
||||
|
@ -225,7 +225,7 @@ class LSattribute {
|
|||
|
||||
$element = $this -> html -> addToForm($form,$idForm,$data);
|
||||
if(!$element) {
|
||||
LSerror::addErrorCode('LSform_06',$this -> name);
|
||||
LSerror :: addErrorCode('LSform_06',$this -> name);
|
||||
}
|
||||
|
||||
if($this -> config['required']==1) {
|
||||
|
@ -240,7 +240,7 @@ class LSattribute {
|
|||
if(is_array($this -> config['check_data'])) {
|
||||
foreach ($this -> config['check_data'] as $rule => $rule_infos) {
|
||||
if((!$form -> isRuleRegistered($rule))&&($rule!='')) {
|
||||
LSerror::addErrorCode('LSattribute_03',array('attr' => $this->name,'rule' => $rule));
|
||||
LSerror :: addErrorCode('LSattribute_03',array('attr' => $this->name,'rule' => $rule));
|
||||
return;
|
||||
}
|
||||
if(!isset($rule_infos['msg']))
|
||||
|
@ -251,7 +251,7 @@ class LSattribute {
|
|||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSattribute_04',$this->name);
|
||||
LSerror :: addErrorCode('LSattribute_04',$this->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -314,7 +314,7 @@ class LSattribute {
|
|||
function addToView(&$form) {
|
||||
if((isset($this -> config['view'])) && ($this -> myRights() != 'n') ) {
|
||||
if (!$this -> html) {
|
||||
LSerror::addErrorCode('LSattribute_09',array('type' => 'html','name' => $this -> name));
|
||||
LSerror :: addErrorCode('LSattribute_09',array('type' => 'html','name' => $this -> name));
|
||||
return;
|
||||
}
|
||||
if($this -> data !='') {
|
||||
|
@ -325,7 +325,7 @@ class LSattribute {
|
|||
}
|
||||
$element = $this -> html -> addToForm($form,'view',$data);
|
||||
if(!$element instanceof LSformElement) {
|
||||
LSerror::addErrorCode('LSform_06',$this -> name);
|
||||
LSerror :: addErrorCode('LSform_06',$this -> name);
|
||||
return;
|
||||
}
|
||||
$element -> freeze();
|
||||
|
@ -347,7 +347,7 @@ class LSattribute {
|
|||
function refreshForm(&$form,$idForm) {
|
||||
if(isset($this -> config['form'][$idForm])&&($this -> myRights()!='n')) {
|
||||
if (!$this -> html) {
|
||||
LSerror::addErrorCode('LSattribute_09',array('type' => 'html','name' => $this -> name));
|
||||
LSerror :: addErrorCode('LSattribute_09',array('type' => 'html','name' => $this -> name));
|
||||
return;
|
||||
}
|
||||
$form_element = $form -> getElement($this -> name);
|
||||
|
@ -504,7 +504,7 @@ class LSattribute {
|
|||
$result=$func($result);
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSattribute_05',array('attr' => $this->name,'func' => $func));
|
||||
LSerror :: addErrorCode('LSattribute_05',array('attr' => $this->name,'func' => $func));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -514,14 +514,14 @@ class LSattribute {
|
|||
$result = $this -> config['onSave']($data);
|
||||
}
|
||||
else {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!$this -> ldap) {
|
||||
LSerror::addErrorCode('LSattribute_09',array('type' => 'ldap','name' => $this -> name));
|
||||
LSerror :: addErrorCode('LSattribute_09',array('type' => 'ldap','name' => $this -> name));
|
||||
return;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -61,7 +61,7 @@ class LSform {
|
|||
$this -> idForm = $idForm;
|
||||
$this -> submit = $submit;
|
||||
$this -> ldapObject = $ldapObject;
|
||||
$GLOBALS['LSsession'] -> loadLSclass('LSformElement');
|
||||
LSsession :: loadLSclass('LSformElement');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -73,16 +73,16 @@ class LSform {
|
|||
*/
|
||||
function display(){
|
||||
if ($this -> idForm == 'view') {
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSview.js');
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSform.js');
|
||||
LSsession :: addJSscript('LSview.js');
|
||||
LSsession :: addJSscript('LSform.js');
|
||||
}
|
||||
else {
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSformElement_field.js');
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSformElement.js');
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSform.js');
|
||||
LSsession :: addJSscript('LSformElement_field.js');
|
||||
LSsession :: addJSscript('LSformElement.js');
|
||||
LSsession :: addJSscript('LSform.js');
|
||||
}
|
||||
|
||||
$GLOBALS['LSsession'] -> addHelpInfos(
|
||||
LSsession :: addHelpInfos(
|
||||
'LSform',
|
||||
array(
|
||||
'addFieldBtn' => _('Ajouter un champ pour saisir une autre valeur.'),
|
||||
|
@ -90,7 +90,7 @@ class LSform {
|
|||
)
|
||||
);
|
||||
|
||||
$GLOBALS['LSsession'] -> addCssFile('LSform.css');
|
||||
LSsession :: addCssFile('LSform.css');
|
||||
$GLOBALS['Smarty'] -> assign('LSform_action',$_SERVER['PHP_SELF']);
|
||||
$LSform_header = "\t<input type='hidden' name='validate' value='LSform'/>\n
|
||||
\t<input type='hidden' name='idForm' id='LSform_idform' value='".$this -> idForm."'/>\n
|
||||
|
@ -138,8 +138,8 @@ class LSform {
|
|||
* @retval void
|
||||
*/
|
||||
function displayView(){
|
||||
$GLOBALS['LSsession'] -> addCssFile('LSform.css');
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSform.js');
|
||||
LSsession :: addCssFile('LSform.css');
|
||||
LSsession :: addJSscript('LSform.js');
|
||||
$LSform_object = array(
|
||||
'type' => $this -> ldapObject -> getType(),
|
||||
'dn' => $this -> ldapObject -> getDn()
|
||||
|
@ -219,7 +219,7 @@ class LSform {
|
|||
return;
|
||||
if ($this -> isSubmit()) {
|
||||
if (!$this -> getPostData()) {
|
||||
LSerror::addErrorCode('LSform_01');
|
||||
LSerror :: addErrorCode('LSform_01');
|
||||
return;
|
||||
}
|
||||
$this -> setValuesFromPostData();
|
||||
|
@ -260,10 +260,10 @@ class LSform {
|
|||
}
|
||||
if (!is_array($this -> _rules[$element]))
|
||||
continue;
|
||||
$GLOBALS['LSsession'] -> loadLSclass('LSformRule');
|
||||
LSsession :: loadLSclass('LSformRule');
|
||||
foreach($this -> _rules[$element] as $rule) {
|
||||
$ruleType="LSformRule_".$rule['name'];
|
||||
$GLOBALS['LSsession'] -> loadLSclass($ruleType);
|
||||
LSsession :: loadLSclass($ruleType);
|
||||
if (! call_user_func(array( $ruleType,'validate') , $value, $rule['options'], $this -> getElement($element))) {
|
||||
$retval=false;
|
||||
$this -> setElementError($this -> elements[$element],$rule['options']['msg']);
|
||||
|
@ -343,7 +343,7 @@ class LSform {
|
|||
function getPostData() {
|
||||
foreach($this -> elements as $element_name => $element) {
|
||||
if( !($element -> getPostData($this -> _postData)) ) {
|
||||
LSerror::addErrorCode('LSform_02',$element_name);
|
||||
LSerror :: addErrorCode('LSform_02',$element_name);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -364,9 +364,9 @@ class LSform {
|
|||
*/
|
||||
function addElement($type,$name,$label,$params=array(),&$attr_html) {
|
||||
$elementType='LSformElement_'.$type;
|
||||
$GLOBALS['LSsession'] -> loadLSclass($elementType);
|
||||
LSsession :: loadLSclass($elementType);
|
||||
if (!class_exists($elementType)) {
|
||||
LSerror::addErrorCode('LSform_05',array('type' => $type));
|
||||
LSerror :: addErrorCode('LSform_05',array('type' => $type));
|
||||
return;
|
||||
}
|
||||
$element=$this -> elements[$name] = new $elementType($this,$name,$label,$params,$attr_html);
|
||||
|
@ -375,7 +375,7 @@ class LSform {
|
|||
}
|
||||
else {
|
||||
unset ($this -> elements[$name]);
|
||||
LSerror::addErrorCode('LSform_06',array('element' => $name));
|
||||
LSerror :: addErrorCode('LSform_06',array('element' => $name));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -401,12 +401,12 @@ class LSform {
|
|||
return true;
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSattribute_03',array('attr' => $element,'rule'=>$rule));
|
||||
LSerror :: addErrorCode('LSattribute_03',array('attr' => $element,'rule'=>$rule));
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSform_04',array('element' => $element));
|
||||
LSerror :: addErrorCode('LSform_04',array('element' => $element));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -440,8 +440,8 @@ class LSform {
|
|||
* @param[in] $element string Le nom de l'élément conserné
|
||||
*/
|
||||
function isRuleRegistered($rule) {
|
||||
$GLOBALS['LSsession'] -> loadLSclass('LSformRule');
|
||||
$GLOBALS['LSsession'] -> loadLSclass('LSformRule_'.$rule);
|
||||
LSsession :: loadLSclass('LSformRule');
|
||||
LSsession :: loadLSclass('LSformRule_'.$rule);
|
||||
return class_exists('LSformRule_'.$rule);
|
||||
}
|
||||
|
||||
|
|
|
@ -267,7 +267,7 @@ class LSformElement {
|
|||
if (!$template) {
|
||||
$template = $this -> template;
|
||||
}
|
||||
return $GLOBALS['LSsession'] -> fetchTemplate(
|
||||
return LSsession :: fetchTemplate(
|
||||
$template,
|
||||
array_merge_recursive(
|
||||
$variables,
|
||||
|
|
|
@ -46,13 +46,13 @@ class LSformElement_boolean extends LSformElement {
|
|||
$return = $this -> getLabelInfos();
|
||||
if (!$this -> isFreeze()) {
|
||||
// Help Infos
|
||||
$GLOBALS['LSsession'] -> addHelpInfos(
|
||||
LSsession :: addHelpInfos(
|
||||
'LSformElement_boolean',
|
||||
array(
|
||||
'clear' => _('Effacer le choix.')
|
||||
)
|
||||
);
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSformElement_boolean.js');
|
||||
LSsession :: addJSscript('LSformElement_boolean.js');
|
||||
}
|
||||
$return['html'] = $this -> fetchTemplate(
|
||||
NULL,
|
||||
|
|
|
@ -135,7 +135,7 @@ class LSformElement_date extends LSformElement {
|
|||
// value
|
||||
if (!$this -> isFreeze()) {
|
||||
// Help Infos
|
||||
$GLOBALS['LSsession'] -> addHelpInfos(
|
||||
LSsession :: addHelpInfos(
|
||||
'LSformElement_date',
|
||||
array(
|
||||
'calendar' => _('Sélectionner dans un calendrier.')
|
||||
|
@ -146,15 +146,15 @@ class LSformElement_date extends LSformElement {
|
|||
'format' => $this -> php2js_format($this -> getFormat()),
|
||||
'firstDayOfWeek' => $this -> getFirstDayOfWeek()
|
||||
);
|
||||
$GLOBALS['LSsession'] -> addJSconfigParam($this -> name,$params);
|
||||
LSsession :: addJSconfigParam($this -> name,$params);
|
||||
|
||||
$GLOBALS['LSsession'] -> addCssFile('theme.css',LS_LIB_DIR.'jscalendar/skins/aqua/');
|
||||
$GLOBALS['LSsession'] -> addJSscript('calendar.js',LS_LIB_DIR.'jscalendar/');
|
||||
$GLOBALS['LSsession'] -> addJSscript('calendar-en.js',LS_LIB_DIR.'jscalendar/lang/');
|
||||
LSsession :: addCssFile('theme.css',LS_LIB_DIR.'jscalendar/skins/aqua/');
|
||||
LSsession :: addJSscript('calendar.js',LS_LIB_DIR.'jscalendar/');
|
||||
LSsession :: addJSscript('calendar-en.js',LS_LIB_DIR.'jscalendar/lang/');
|
||||
$codeLang = strtolower($GLOBALS['LSconfig']['lang'][0].$GLOBALS['LSconfig']['lang'][1]);
|
||||
$GLOBALS['LSsession'] -> addJSscript('calendar-'.$codeLang.'.js',LS_LIB_DIR.'jscalendar/lang/');
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSformElement_date_field.js');
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSformElement_date.js');
|
||||
LSsession :: addJSscript('calendar-'.$codeLang.'.js',LS_LIB_DIR.'jscalendar/lang/');
|
||||
LSsession :: addJSscript('LSformElement_date_field.js');
|
||||
LSsession :: addJSscript('LSformElement_date.js');
|
||||
}
|
||||
$return['html'] = $this -> fetchTemplate();
|
||||
return $return;
|
||||
|
|
|
@ -44,10 +44,10 @@ class LSformElement_image extends LSformElement {
|
|||
* @retval array
|
||||
*/
|
||||
function getDisplay(){
|
||||
$GLOBALS['LSsession'] -> addCssFile('LSformElement_image.css');
|
||||
LSsession :: addCssFile('LSformElement_image.css');
|
||||
$return = true;
|
||||
if (!$this -> isFreeze()) {
|
||||
$GLOBALS['LSsession'] -> addHelpInfos(
|
||||
LSsession :: addHelpInfos(
|
||||
'LSformElement_date',
|
||||
array(
|
||||
'zoom' => _('Cliquer pour agrandir.'),
|
||||
|
@ -61,7 +61,7 @@ class LSformElement_image extends LSformElement {
|
|||
}
|
||||
|
||||
if (!empty($this -> values[0])) {
|
||||
$img_path = $GLOBALS['LSsession'] -> getTmpFile($this -> values[0]);
|
||||
$img_path = LSsession :: getTmpFile($this -> values[0]);
|
||||
$GLOBALS['Smarty'] -> assign('LSformElement_image',array(
|
||||
'img' => $img_path,
|
||||
'id' => $id,
|
||||
|
@ -73,7 +73,7 @@ class LSformElement_image extends LSformElement {
|
|||
if ($this -> form -> definedError($this -> name)) {
|
||||
$GLOBALS['Smarty'] -> assign('LSformElement_image_errors',true);
|
||||
}
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSformElement_image.js');
|
||||
LSsession :: addJSscript('LSformElement_image.js');
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ class LSformElement_image extends LSformElement {
|
|||
fclose($fp);
|
||||
$tmp_file = LS_TMP_DIR.$this -> name.'_'.rand().'.tmp';
|
||||
if (move_uploaded_file($_FILES[$this -> name]['tmp_name'],$tmp_file)) {
|
||||
$GLOBALS['LSsession'] -> addTmpFile($buf,$tmp_file);
|
||||
LSsession :: addTmpFile($buf,$tmp_file);
|
||||
}
|
||||
$return[$this -> name][0] = $buf;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
$GLOBALS['LSsession'] -> loadLSclass('LSformElement_text');
|
||||
LSsession :: loadLSclass('LSformElement_text');
|
||||
|
||||
/**
|
||||
* Element mail d'un formulaire pour LdapSaisie
|
||||
|
@ -52,7 +52,7 @@ class LSformElement_mail extends LSformElement_text {
|
|||
var $fieldTemplate = 'LSformElement_uri_field.tpl';
|
||||
|
||||
function getDisplay() {
|
||||
$GLOBALS['LSsession'] -> addHelpInfos (
|
||||
LSsession :: addHelpInfos (
|
||||
'LSformElement_mail',
|
||||
array(
|
||||
'mail' => _("Envoyer un mail depuis l'interface.")
|
||||
|
|
|
@ -82,7 +82,7 @@ class LSformElement_mailQuota extends LSformElement {
|
|||
}
|
||||
}
|
||||
|
||||
$GLOBALS['LSsession'] -> addCssFile('LSformElement_mailQuota.css');
|
||||
LSsession :: addCssFile('LSformElement_mailQuota.css');
|
||||
|
||||
$return['html'] = $this -> fetchTemplate(
|
||||
NULL,
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
$GLOBALS['LSsession'] -> loadLSclass('LSformElement_text');
|
||||
$GLOBALS['LSsession'] -> loadLSaddon('maildir');
|
||||
LSsession :: loadLSclass('LSformElement_text');
|
||||
LSsession :: loadLSaddon('maildir');
|
||||
|
||||
/**
|
||||
* Element maildir d'un formulaire pour LdapSaisie
|
||||
|
@ -63,7 +63,7 @@ class LSformElement_maildir extends LSformElement_text {
|
|||
var $fieldTemplate = 'LSformElement_maildir_field.tpl';
|
||||
|
||||
function getDisplay() {
|
||||
$GLOBALS['LSsession'] -> addHelpInfos (
|
||||
LSsession :: addHelpInfos (
|
||||
'LSformElement_maildir',
|
||||
array(
|
||||
'do' => _("La création ou modification de la maildir en même temps que l'utilisateur est activée. Cliquer sur ce bouton pour la désactiver."),
|
||||
|
@ -140,7 +140,7 @@ class LSformElement_maildir extends LSformElement_text {
|
|||
$newname=getFData($this -> params['html_options']['archiveNameFormat'],$this -> _toDo['old']);
|
||||
if ($newname) {
|
||||
if (renameMaildirByFTP($this -> _toDo['old'],$newname)) {
|
||||
$GLOBALS['LSsession'] -> addInfo("La boîte mail a été archivée.");
|
||||
LSsession :: addInfo("La boîte mail a été archivée.");
|
||||
return true;
|
||||
}
|
||||
return;
|
||||
|
@ -150,7 +150,7 @@ class LSformElement_maildir extends LSformElement_text {
|
|||
}
|
||||
else {
|
||||
if (removeMaildirByFTP(null,$this -> _toDo['old'])) {
|
||||
$GLOBALS['LSsession'] -> addInfo("La boîte mail a été supprimée.");
|
||||
LSsession :: addInfo("La boîte mail a été supprimée.");
|
||||
return true;
|
||||
}
|
||||
return;
|
||||
|
@ -158,14 +158,14 @@ class LSformElement_maildir extends LSformElement_text {
|
|||
break;
|
||||
case 'modify':
|
||||
if (renameMaildirByFTP($this -> _toDo['old'],$this -> _toDo['new'])) {
|
||||
$GLOBALS['LSsession'] -> addInfo("La boîte mail a été déplacée.");
|
||||
LSsession :: addInfo("La boîte mail a été déplacée.");
|
||||
return true;
|
||||
}
|
||||
return;
|
||||
break;
|
||||
case 'create':
|
||||
if (createMaildirByFTP(null,$this -> _toDo['new'])) {
|
||||
$GLOBALS['LSsession'] -> addInfo("La boîte mail a été créée.");
|
||||
LSsession :: addInfo("La boîte mail a été créée.");
|
||||
return true;
|
||||
}
|
||||
return;
|
||||
|
|
|
@ -70,7 +70,7 @@ class LSformElement_password extends LSformElement {
|
|||
$this -> sendMail = true;
|
||||
LSdebug ('send by config');
|
||||
}
|
||||
if ($this -> sendMail && $GLOBALS['LSsession'] -> loadLSaddon('mail')) {
|
||||
if ($this -> sendMail && LSsession :: loadLSaddon('mail')) {
|
||||
$msg = getFData($this -> params['html_options']['mail']['msg'],$return[$this -> name][0]);
|
||||
$subject = $this -> params['html_options']['mail']['subject'];
|
||||
if (isset($_POST['LSformElement_password_'.$this -> name.'_msg'])) {
|
||||
|
@ -104,13 +104,13 @@ class LSformElement_password extends LSformElement {
|
|||
* @retval array
|
||||
*/
|
||||
function getDisplay(){
|
||||
$GLOBALS['LSsession'] -> addCssFile('LSformElement_password.css');
|
||||
LSsession :: addCssFile('LSformElement_password.css');
|
||||
$return = $this -> getLabelInfos();
|
||||
$pwd = "";
|
||||
if (!$this -> isFreeze()) {
|
||||
|
||||
// Help Infos
|
||||
$GLOBALS['LSsession'] -> addHelpInfos(
|
||||
LSsession :: addHelpInfos(
|
||||
'LSformElement_password',
|
||||
array(
|
||||
'generate' => _('Générer un mot de passe.'),
|
||||
|
@ -134,10 +134,10 @@ class LSformElement_password extends LSformElement {
|
|||
if (isset($this -> params['html_options']['mail'])) {
|
||||
$params['mail'] = $this -> params['html_options']['mail'];
|
||||
}
|
||||
$GLOBALS['LSsession'] -> addJSconfigParam($this -> name,$params);
|
||||
LSsession :: addJSconfigParam($this -> name,$params);
|
||||
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSformElement_password_field.js');
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSformElement_password.js');
|
||||
LSsession :: addJSscript('LSformElement_password_field.js');
|
||||
LSsession :: addJSscript('LSformElement_password.js');
|
||||
}
|
||||
$return['html'] = $this -> fetchTemplate(NULL,array('pwd' => $pwd));
|
||||
return $return;
|
||||
|
@ -151,7 +151,7 @@ class LSformElement_password extends LSformElement {
|
|||
if ($this -> attr_html -> attribute -> ldapObject -> isNew()) {
|
||||
return false;
|
||||
}
|
||||
return $GLOBALS['LSsession'] -> checkUserPwd($this -> attr_html -> attribute -> ldapObject,$pwd);
|
||||
return LSsession :: checkUserPwd($this -> attr_html -> attribute -> ldapObject,$pwd);
|
||||
}
|
||||
|
||||
function send($params) {
|
||||
|
@ -176,7 +176,7 @@ class LSformElement_password extends LSformElement {
|
|||
$this -> sendMail['subject'],
|
||||
$this -> sendMail['msg']
|
||||
)) {
|
||||
$GLOBALS['LSsession'] -> addInfo(_('Mail de changement de mot de passe envoyé.'));
|
||||
LSsession :: addInfo(_('Mail de changement de mot de passe envoyé.'));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
$GLOBALS['LSsession'] -> loadLSclass('LSformElement_text');
|
||||
LSsession :: loadLSclass('LSformElement_text');
|
||||
|
||||
/**
|
||||
* Element RSS d'un formulaire pour LdapSaisie
|
||||
|
@ -43,7 +43,7 @@ class LSformElement_rss extends LSformElement_text {
|
|||
var $fieldTemplate = 'LSformElement_uri_field.tpl';
|
||||
|
||||
function getDisplay() {
|
||||
$GLOBALS['LSsession'] -> addHelpInfos (
|
||||
LSsession :: addHelpInfos (
|
||||
'LSformElement_rss',
|
||||
array(
|
||||
'display' => _("Afficher la file RSS.")
|
||||
|
|
|
@ -46,13 +46,13 @@ class LSformElement_select extends LSformElement {
|
|||
$return = $this -> getLabelInfos();
|
||||
$params = array();
|
||||
if (!$this -> isFreeze()) {
|
||||
$GLOBALS['LSsession'] -> addHelpInfos (
|
||||
LSsession :: addHelpInfos (
|
||||
'LSformElement_select',
|
||||
array(
|
||||
'clear' => _("Effacer la sélection.")
|
||||
)
|
||||
);
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSformElement_select.js');
|
||||
LSsession :: addJSscript('LSformElement_select.js');
|
||||
}
|
||||
$params['possible_values'] = $this -> params['text_possible_values'];
|
||||
$return['html'] = $this -> fetchTemplate(NULL,$params);
|
||||
|
|
|
@ -43,14 +43,14 @@ class LSformElement_select_object extends LSformElement {
|
|||
* @retval array
|
||||
*/
|
||||
function getDisplay($refresh=NULL){
|
||||
$GLOBALS['LSsession'] -> addCssFile('LSformElement_select_object.css');
|
||||
LSsession :: addCssFile('LSformElement_select_object.css');
|
||||
if ($refresh) {
|
||||
$this -> values = $this -> getValuesFromSession();
|
||||
}
|
||||
$return = $this -> getLabelInfos();
|
||||
|
||||
if (!$this -> isFreeze()) {
|
||||
$GLOBALS['LSsession'] -> addJSconfigParam(
|
||||
LSsession :: addJSconfigParam(
|
||||
$this -> name,
|
||||
array(
|
||||
'object_type' => $this -> selectableObject,
|
||||
|
@ -62,7 +62,7 @@ class LSformElement_select_object extends LSformElement {
|
|||
)
|
||||
);
|
||||
|
||||
$GLOBALS['LSsession'] -> addHelpInfos (
|
||||
LSsession :: addHelpInfos (
|
||||
'LSformElement_select_object',
|
||||
array(
|
||||
'searchAdd' => _("Ajout rapide"),
|
||||
|
@ -71,15 +71,15 @@ class LSformElement_select_object extends LSformElement {
|
|||
)
|
||||
);
|
||||
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSformElement_select_object_field.js');
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSformElement_select_object.js');
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSform.js');
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSselect.js');
|
||||
$GLOBALS['LSsession'] -> addCssFile('LSselect.css');
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSsmoothbox.js');
|
||||
$GLOBALS['LSsession'] -> addCssFile('LSsmoothbox.css');
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSconfirmBox.js');
|
||||
$GLOBALS['LSsession'] -> addCssFile('LSconfirmBox.css');
|
||||
LSsession :: addJSscript('LSformElement_select_object_field.js');
|
||||
LSsession :: addJSscript('LSformElement_select_object.js');
|
||||
LSsession :: addJSscript('LSform.js');
|
||||
LSsession :: addJSscript('LSselect.js');
|
||||
LSsession :: addCssFile('LSselect.css');
|
||||
LSsession :: addJSscript('LSsmoothbox.js');
|
||||
LSsession :: addCssFile('LSsmoothbox.css');
|
||||
LSsession :: addJSscript('LSconfirmBox.js');
|
||||
LSsession :: addCssFile('LSconfirmBox.css');
|
||||
|
||||
}
|
||||
$return['html'] = $this -> fetchTemplate(NULL,array('selectableObject' => $this -> selectableObject));
|
||||
|
@ -142,7 +142,7 @@ class LSformElement_select_object extends LSformElement {
|
|||
*/
|
||||
function searchAdd ($pattern) {
|
||||
if (is_array($this -> params['selectable_object'])) {
|
||||
if ($GLOBALS['LSsession'] -> loadLSobject($this -> params['selectable_object']['object_type'])) {
|
||||
if (LSsession :: loadLSobject($this -> params['selectable_object']['object_type'])) {
|
||||
$obj = new $this -> params['selectable_object']['object_type']();
|
||||
$ret = $obj -> getSelectArray($pattern,NULL,$this -> params['selectable_object']['display_attribute']);
|
||||
if (is_array($ret)) {
|
||||
|
|
|
@ -43,15 +43,15 @@ class LSformElement_ssh_key extends LSformElement {
|
|||
* @retval array
|
||||
*/
|
||||
function getDisplay(){
|
||||
$GLOBALS['LSsession'] -> addCssFile('LSformElement_ssh_key.css');
|
||||
LSsession :: addCssFile('LSformElement_ssh_key.css');
|
||||
$return = $this -> getLabelInfos();
|
||||
$params = array();
|
||||
if (!$this -> isFreeze()) {
|
||||
$params['values_txt'] = $this -> values;
|
||||
}
|
||||
else {
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSformElement_ssh_key.js');
|
||||
$GLOBALS['LSsession'] -> addHelpInfos (
|
||||
LSsession :: addJSscript('LSformElement_ssh_key.js');
|
||||
LSsession :: addHelpInfos (
|
||||
'LSformElement_ssh_key',
|
||||
array(
|
||||
'display' => _("Afficher la clef complète.")
|
||||
|
|
|
@ -48,22 +48,22 @@ class LSformElement_text extends LSformElement {
|
|||
// value
|
||||
if (!$this -> isFreeze()) {
|
||||
if (isset($this -> params['html_options'])) {
|
||||
$GLOBALS['LSsession'] -> addJSconfigParam($this -> name,$this -> params['html_options']);
|
||||
LSsession :: addJSconfigParam($this -> name,$this -> params['html_options']);
|
||||
}
|
||||
$GLOBALS['LSsession'] -> addHelpInfos(
|
||||
LSsession :: addHelpInfos(
|
||||
'LSformElement_text',
|
||||
array(
|
||||
'generate' => _('Générer la valeur')
|
||||
)
|
||||
);
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSformElement_text_field.js');
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSformElement_text.js');
|
||||
LSsession :: addJSscript('LSformElement_text_field.js');
|
||||
LSsession :: addJSscript('LSformElement_text.js');
|
||||
}
|
||||
foreach ($this -> JSscripts as $js) {
|
||||
$GLOBALS['LSsession'] -> addJSscript($js);
|
||||
LSsession :: addJSscript($js);
|
||||
}
|
||||
foreach ($this -> CSSfiles as $css) {
|
||||
$GLOBALS['LSsession'] -> addCssFile($css);
|
||||
LSsession :: addCssFile($css);
|
||||
}
|
||||
$return['html'] = $this -> fetchTemplate();
|
||||
return $return;
|
||||
|
|
|
@ -44,13 +44,13 @@ class LSformElement_textarea extends LSformElement {
|
|||
function getDisplay(){
|
||||
$return = $this -> getLabelInfos();
|
||||
if (!$this -> isFreeze()) {
|
||||
$GLOBALS['LSsession'] -> addHelpInfos(
|
||||
LSsession :: addHelpInfos(
|
||||
'LSformElement_textarea',
|
||||
array(
|
||||
'clear' => _('Effacer')
|
||||
)
|
||||
);
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSformElement_textarea.js');
|
||||
LSsession :: addJSscript('LSformElement_textarea.js');
|
||||
}
|
||||
$return['html'] = $this -> fetchTemplate();
|
||||
return $return;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
$GLOBALS['LSsession'] -> loadLSclass('LSformElement_text');
|
||||
LSsession :: loadLSclass('LSformElement_text');
|
||||
|
||||
/**
|
||||
* Element texte d'un formulaire pour LdapSaisie
|
||||
|
@ -44,7 +44,7 @@ class LSformElement_url extends LSformElement_text {
|
|||
var $fieldTemplate = 'LSformElement_uri_field.tpl';
|
||||
|
||||
function getDisplay() {
|
||||
$GLOBALS['LSsession'] -> addHelpInfos (
|
||||
LSsession :: addHelpInfos (
|
||||
'LSformElement_url',
|
||||
array(
|
||||
'go' => _("Afficher ce site."),
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
$GLOBALS['LSsession'] -> loadLSclass('LSformElement_text');
|
||||
LSsession :: loadLSclass('LSformElement_text');
|
||||
|
||||
/**
|
||||
* Element xmpp d'un formulaire pour LdapSaisie
|
||||
|
@ -44,7 +44,7 @@ class LSformElement_xmpp extends LSformElement_text {
|
|||
var $fieldTemplate = 'LSformElement_uri_field.tpl';
|
||||
|
||||
function getDisplay() {
|
||||
$GLOBALS['LSsession'] -> addHelpInfos (
|
||||
LSsession :: addHelpInfos (
|
||||
'LSformElement_xmpp',
|
||||
array(
|
||||
'chat' => _("Dialoguer avec cette personne.")
|
||||
|
|
|
@ -38,7 +38,7 @@ class LSformRule_alphanumeric extends LSformRule {
|
|||
*/
|
||||
function validate ($value,$options=array(),$formElement) {
|
||||
$regex = '/^[a-zA-Z0-9]+$/';
|
||||
$GLOBALS['LSsession'] -> loadLSclass('LSformRule_regex');
|
||||
LSsession :: loadLSclass('LSformRule_regex');
|
||||
return LSformRule_regex :: validate($value,$regex,$formElement);
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ class LSformRule_compare extends LSformRule {
|
|||
*/
|
||||
function validate ($values,$options=array(),$formElement) {
|
||||
if (!isset($options['params']['operator'])) {
|
||||
LSerror::addErrorCode('LSformRule_01',array('type' => 'compare', 'param' => 'operator');
|
||||
LSerror :: addErrorCode('LSformRule_01',array('type' => 'compare', 'param' => 'operator');
|
||||
return;
|
||||
}
|
||||
$operator = LSformRule_compare :: _findOperator($options['params']['operator']);
|
||||
|
|
|
@ -39,7 +39,7 @@ class LSformRule_imagefile extends LSformRule {
|
|||
* @return boolean true si la valeur est valide, false sinon
|
||||
*/
|
||||
function validate ($value,$options,$formElement) {
|
||||
$file = $GLOBALS['LSsession'] -> getTmpFile($value);
|
||||
$file = LSsession :: getTmpFile($value);
|
||||
|
||||
$mimetype = mime_content_type($file);
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ class LSformRule_imagefilesize extends LSformRule {
|
|||
* @return boolean true si la valeur est valide, false sinon
|
||||
*/
|
||||
function validate ($value,$options,$formElement) {
|
||||
$file = $GLOBALS['LSsession'] -> getTmpFile($value);
|
||||
$file = LSsession :: getTmpFile($value);
|
||||
|
||||
$size = filesize($file);
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ class LSformRule_imagesize extends LSformRule {
|
|||
* @return boolean true si la valeur est valide, false sinon
|
||||
*/
|
||||
function validate ($value,$options,$formElement) {
|
||||
$file = $GLOBALS['LSsession'] -> getTmpFile($value);
|
||||
$file = LSsession :: getTmpFile($value);
|
||||
list($width, $height, $type, $attr) = getimagesize($file);
|
||||
|
||||
if (is_int($options['params']['maxWidth'])) {
|
||||
|
|
|
@ -38,7 +38,7 @@ class LSformRule_lettersonly extends LSformRule {
|
|||
*/
|
||||
function validate ($value,$options=array(),$formElement) {
|
||||
$regex = '/^[a-zA-Z]+$/';
|
||||
$GLOBALS['LSsession'] -> loadLSclass('LSformRule_regex');
|
||||
LSsession :: loadLSclass('LSformRule_regex');
|
||||
return LSformRule_regex :: validate($value,$regex,$formElement);
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ class LSformRule_maxlength extends LSformRule {
|
|||
*/
|
||||
function validate ($value,$options,$formElement) {
|
||||
if(!isset($options['params']['limit'])) {
|
||||
LSerror::addErrorCode('LSformRule_01',array('type' => 'maxlength', 'param' => 'limit'));
|
||||
LSerror :: addErrorCode('LSformRule_01',array('type' => 'maxlength', 'param' => 'limit'));
|
||||
return;
|
||||
}
|
||||
return (strlen($value)<=$options['params']['limit']);
|
||||
|
|
|
@ -39,7 +39,7 @@ class LSformRule_minlength extends LSformRule {
|
|||
*/
|
||||
function validate ($value,$options,$formElement) {
|
||||
if(!isset($options['params']['limit'])) {
|
||||
LSerror::addErrorCode('LSformRule_01',array('type' => 'minlength', 'param' => 'limit');
|
||||
LSerror :: addErrorCode('LSformRule_01',array('type' => 'minlength', 'param' => 'limit');
|
||||
return;
|
||||
}
|
||||
return (strlen($value)>=$options['params']['limit']);
|
||||
|
|
|
@ -38,7 +38,7 @@ class LSformRule_nonzero extends LSformRule {
|
|||
*/
|
||||
function validate ($value,$options,$formElement) {
|
||||
$regex = '/^-?[1-9][0-9]*/';
|
||||
$GLOBALS['LSsession'] -> loadLSclass('LSformRule_regex');
|
||||
LSsession :: loadLSclass('LSformRule_regex');
|
||||
return LSformRule_regex :: validate($value,$regex,$formElement);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ class LSformRule_nopunctuation extends LSformRule {
|
|||
*/
|
||||
function validate ($value,$options=array(),$formElement) {
|
||||
$regex = '/^[^().\/\*\^\?#!@$%+=,\"\'><~\[\]{}]+$/';
|
||||
$GLOBALS['LSsession'] -> loadLSclass('LSformRule_regex');
|
||||
LSsession :: loadLSclass('LSformRule_regex');
|
||||
return LSformRule_regex :: validate($value,$regex,$formElement);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ class LSformRule_numeric extends LSformRule{
|
|||
*/
|
||||
function validate ($value,$options=array(),$formElement) {
|
||||
$regex = '/(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/';
|
||||
$GLOBALS['LSsession'] -> loadLSclass('LSformRule_regex');
|
||||
LSsession :: loadLSclass('LSformRule_regex');
|
||||
return LSformRule_regex :: validate($value,$regex,$formElement);
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ class LSformRule_rangelength extends LSformRule {
|
|||
*/
|
||||
function validate ($value,$options=array(),$formElement) {
|
||||
if(!isset($options['params']['limits'])) {
|
||||
LSerror::addErrorCode('LSformRule_01',array('type' => 'rangelength', 'param' => 'limit');
|
||||
LSerror :: addErrorCode('LSformRule_01',array('type' => 'rangelength', 'param' => 'limit');
|
||||
return;
|
||||
}
|
||||
$len=strlen($value);
|
||||
|
|
|
@ -43,7 +43,7 @@ class LSformRule_regex extends LSformRule {
|
|||
$regex=$option['params']['regex'];
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSformRule_regex_01');
|
||||
LSerror :: addErrorCode('LSformRule_regex_01');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ class LSformRule_telephonenumber extends LSformRule {
|
|||
*/
|
||||
function validate($value,$option=array(),$formElement) {
|
||||
$regex = '/^(01|02|03|04|05|06|08|09)[0-9]{8}$/';
|
||||
$GLOBALS['LSsession'] -> loadLSclass('LSformRule_regex');
|
||||
LSsession :: loadLSclass('LSformRule_regex');
|
||||
return LSformRule_regex :: validate($value,$regex,$formElement);
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ class LSldap {
|
|||
function connect() {
|
||||
$this -> cnx = Net_LDAP2::connect($this -> config);
|
||||
if (Net_LDAP2::isError($this -> cnx)) {
|
||||
LSerror::addErrorCode('LSldap_01',$this -> cnx -> getMessage());
|
||||
LSerror :: addErrorCode('LSldap_01',$this -> cnx -> getMessage());
|
||||
$this -> cnx = NULL;
|
||||
return;
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ class LSldap {
|
|||
function search ($filter,$basedn=NULL,$params = array()) {
|
||||
$ret = $this -> cnx -> search($basedn,$filter,$params);
|
||||
if (Net_LDAP2::isError($ret)) {
|
||||
LSerror::addErrorCode('LSldap_02',$ret -> getMessage());
|
||||
LSerror :: addErrorCode('LSldap_02',$ret -> getMessage());
|
||||
return;
|
||||
}
|
||||
$retInfos=array();
|
||||
|
@ -136,7 +136,7 @@ class LSldap {
|
|||
$filter=NULL;
|
||||
$ret = $this -> cnx -> search($basedn,$filter,$params);
|
||||
if (Net_LDAP2::isError($ret)) {
|
||||
LSerror::addErrorCode('LSldap_02',$ret -> getMessage());
|
||||
LSerror :: addErrorCode('LSldap_02',$ret -> getMessage());
|
||||
return;
|
||||
}
|
||||
return $ret -> count();
|
||||
|
@ -212,7 +212,7 @@ class LSldap {
|
|||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSldap_03');
|
||||
LSerror :: addErrorCode('LSldap_03');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -299,8 +299,8 @@ class LSldap {
|
|||
}
|
||||
|
||||
if (Net_LDAP2::isError($ret)) {
|
||||
LSerror::addErrorCode('LSldap_05',$dn);
|
||||
LSerror::addErrorCode(0,'NetLdap-Error : '.$ret->getMessage());
|
||||
LSerror :: addErrorCode('LSldap_05',$dn);
|
||||
LSerror :: addErrorCode(0,'NetLdap-Error : '.$ret->getMessage());
|
||||
}
|
||||
else {
|
||||
if (!empty($dropAttr)) {
|
||||
|
@ -316,15 +316,15 @@ class LSldap {
|
|||
}
|
||||
$ret = $entry -> update();
|
||||
if (Net_LDAP2::isError($ret)) {
|
||||
LSerror::addErrorCode('LSldap_06');
|
||||
LSerror::addErrorCode(0,'NetLdap-Error : '.$ret->getMessage());
|
||||
LSerror :: addErrorCode('LSldap_06');
|
||||
LSerror :: addErrorCode(0,'NetLdap-Error : '.$ret->getMessage());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSldap_04');
|
||||
LSerror :: addErrorCode('LSldap_04');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -369,7 +369,7 @@ class LSldap {
|
|||
function remove($dn) {
|
||||
$ret = $this -> cnx -> delete($dn,array('recursive' => true));
|
||||
if (Net_LDAP2::isError($ret)) {
|
||||
LSerror::addErrorCode(0,'NetLdap-Error : '.$ret->getMessage());
|
||||
LSerror :: addErrorCode(0,'NetLdap-Error : '.$ret->getMessage());
|
||||
return;
|
||||
}
|
||||
return true;
|
||||
|
@ -386,8 +386,8 @@ class LSldap {
|
|||
function move($old,$new) {
|
||||
$ret = $this -> cnx -> move($old,$new);
|
||||
if (Net_LDAP2::isError($ret)) {
|
||||
LSerror::addErrorCode('LSldap_07');
|
||||
LSerror::addErrorCode(0,'NetLdap-Error : '.$ret->getMessage());
|
||||
LSerror :: addErrorCode('LSldap_07');
|
||||
LSerror :: addErrorCode(0,'NetLdap-Error : '.$ret->getMessage());
|
||||
return;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
$GLOBALS['LSsession'] -> loadLSclass('LSattribute');
|
||||
LSsession :: loadLSclass('LSattribute');
|
||||
|
||||
/**
|
||||
* Base d'un objet ldap
|
||||
|
@ -64,7 +64,7 @@ class LSldapObject {
|
|||
$this -> config = $GLOBALS['LSobjects'][$type_name];
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSldapObject_01');
|
||||
LSerror :: addErrorCode('LSldapObject_01');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ class LSldapObject {
|
|||
$spe = $this -> getDisplayNameFormat();
|
||||
}
|
||||
$val = $this -> getFData($spe,&$this -> attrs,'getDisplayValue');
|
||||
if ($GLOBALS['LSsession'] -> haveSubDn() && $full) {
|
||||
if (LSsession :: haveSubDn() && $full) {
|
||||
$val.=' ('.$this -> getSubDnName().')';
|
||||
}
|
||||
return $val;
|
||||
|
@ -184,7 +184,7 @@ class LSldapObject {
|
|||
* @retval LSform Le formulaire crée
|
||||
*/
|
||||
function getForm($idForm,$load=NULL) {
|
||||
$GLOBALS['LSsession'] -> loadLSclass('LSform');
|
||||
LSsession :: loadLSclass('LSform');
|
||||
$LSform = new LSform($this,$idForm);
|
||||
$this -> forms[$idForm] = array($LSform,$load);
|
||||
|
||||
|
@ -227,7 +227,7 @@ class LSldapObject {
|
|||
* @retval LSform Le formulaire crée
|
||||
*/
|
||||
function getView() {
|
||||
$GLOBALS['LSsession'] -> loadLSclass('LSform');
|
||||
LSsession :: loadLSclass('LSform');
|
||||
$this -> view = new LSform($this,'view');
|
||||
foreach($this -> attrs as $attr_name => $attr) {
|
||||
$this -> attrs[$attr_name] -> addToView($this -> view);
|
||||
|
@ -276,7 +276,7 @@ class LSldapObject {
|
|||
if(isset($this -> forms[$idForm]))
|
||||
$LSform = $this -> forms[$idForm][0];
|
||||
else {
|
||||
LSerror::addErrorCode('LSldapObject_02',$this -> getType());
|
||||
LSerror :: addErrorCode('LSldapObject_02',$this -> getType());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -289,7 +289,7 @@ class LSldapObject {
|
|||
$LSform = $LSform[0];
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSldapObject_03',$this -> getType());
|
||||
LSerror :: addErrorCode('LSldapObject_03',$this -> getType());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -307,12 +307,12 @@ class LSldapObject {
|
|||
if(isset($this -> config['before_modify'])) {
|
||||
if(function_exists($this -> config['before_modify'])) {
|
||||
if(!$this -> config['before_modify']($this)) {
|
||||
LSerror::addErrorCode('LSldapObject_08',$this -> config['before_modify']);
|
||||
LSerror :: addErrorCode('LSldapObject_08',$this -> config['before_modify']);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSldapObject_07',$this -> config['before_modify']);
|
||||
LSerror :: addErrorCode('LSldapObject_07',$this -> config['before_modify']);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -335,11 +335,11 @@ class LSldapObject {
|
|||
if((isset($this -> config['after_modify']))&&(!$this -> submitError)) {
|
||||
if(function_exists($this -> config['after_modify'])) {
|
||||
if(!$this -> config['after_modify']($this)) {
|
||||
LSerror::addErrorCode('LSldapObject_10',$this -> config['after_modify']);
|
||||
LSerror :: addErrorCode('LSldapObject_10',$this -> config['after_modify']);
|
||||
}
|
||||
}
|
||||
else {
|
||||
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 -> generateValue()) {
|
||||
if (!$this -> validateAttrData($LSform, $attr)) {
|
||||
LSerror::addErrorCode('LSattribute_08',$attr -> getLabel());
|
||||
LSerror :: addErrorCode('LSattribute_08',$attr -> getLabel());
|
||||
$retval = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSattribute_07',$attr -> getLabel());
|
||||
LSerror :: addErrorCode('LSattribute_07',$attr -> getLabel());
|
||||
$retval = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSattribute_06',$attr -> getLabel());
|
||||
LSerror :: addErrorCode('LSattribute_06',$attr -> getLabel());
|
||||
$retval = false;
|
||||
}
|
||||
}
|
||||
|
@ -422,7 +422,7 @@ class LSldapObject {
|
|||
foreach($vconfig as $test) {
|
||||
// Définition du basedn par défaut
|
||||
if (!isset($test['basedn'])) {
|
||||
$test['basedn']=$GLOBALS['LSsession']->topDn;
|
||||
$test['basedn']=LSsession :: getTopDn();
|
||||
}
|
||||
|
||||
// Définition du message d'erreur
|
||||
|
@ -476,12 +476,12 @@ class LSldapObject {
|
|||
}
|
||||
}
|
||||
else {
|
||||
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;
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSldapObject_05',array('attr' => $attr->name,'obj' => $this->getType()));
|
||||
LSerror :: addErrorCode('LSldapObject_05',array('attr' => $attr->name,'obj' => $this->getType()));
|
||||
$retval = false;
|
||||
}
|
||||
}
|
||||
|
@ -492,17 +492,17 @@ class LSldapObject {
|
|||
if (!empty($dependsAttrs)) {
|
||||
foreach($dependsAttrs as $dependAttr) {
|
||||
if(!isset($this -> attrs[$dependAttr])){
|
||||
LSerror::addErrorCode('LSldapObject_14',array('attr_depend' => $dependAttr, 'attr' => $attr -> getLabel()));
|
||||
LSerror :: addErrorCode('LSldapObject_14',array('attr_depend' => $dependAttr, 'attr' => $attr -> getLabel()));
|
||||
continue;
|
||||
}
|
||||
if($this -> attrs[$dependAttr] -> canBeGenerated()) {
|
||||
if (!$this -> attrs[$dependAttr] -> generateValue()) {
|
||||
LSerror::addErrorCode('LSattribute_07',$this -> attrs[$dependAttr] -> getLabel());
|
||||
LSerror :: addErrorCode('LSattribute_07',$this -> attrs[$dependAttr] -> getLabel());
|
||||
$retval = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSattribute_06',$this -> attrs[$dependAttr] -> getLabel());
|
||||
LSerror :: addErrorCode('LSattribute_06',$this -> attrs[$dependAttr] -> getLabel());
|
||||
$retval = false;
|
||||
}
|
||||
}
|
||||
|
@ -531,7 +531,7 @@ class LSldapObject {
|
|||
$new = true;
|
||||
LSdebug('Rename');
|
||||
if (!$this -> beforeRename()) {
|
||||
LSerror::addErrorCode('LSldapObject_16');
|
||||
LSerror :: addErrorCode('LSldapObject_16');
|
||||
return;
|
||||
}
|
||||
$oldDn = $this -> getDn();
|
||||
|
@ -543,7 +543,7 @@ class LSldapObject {
|
|||
}
|
||||
$this -> dn = $newDn;
|
||||
if (!$this -> afterRename($oldDn,$newDn)) {
|
||||
LSerror::addErrorCode('LSldapObject_17');
|
||||
LSerror :: addErrorCode('LSldapObject_17');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -566,14 +566,14 @@ class LSldapObject {
|
|||
}
|
||||
if ($new) {
|
||||
if (!$this -> afterCreate()) {
|
||||
LSerror::addErrorCode('LSldapObject_21');
|
||||
LSerror :: addErrorCode('LSldapObject_21');
|
||||
return;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSldapObject_13');
|
||||
LSerror :: addErrorCode('LSldapObject_13');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -997,18 +997,19 @@ class LSldapObject {
|
|||
}
|
||||
else {
|
||||
$rdn_attr=$this -> config['rdn'];
|
||||
if( (isset($this -> config['rdn'])) && (isset($this -> attrs[$rdn_attr])) && (isset($this -> config['container_dn'])) && (isset($GLOBALS['LSsession']->topDn)) ) {
|
||||
$topDn = LSsession :: getTopDn();
|
||||
if( (isset($this -> config['rdn'])) && (isset($this -> attrs[$rdn_attr])) && (isset($this -> config['container_dn'])) && ($topDn) ) {
|
||||
$rdn_val=$this -> attrs[$rdn_attr] -> getUpdateData();
|
||||
if (!empty($rdn_val)) {
|
||||
return $rdn_attr.'='.$rdn_val[0].','.$this -> config['container_dn'].','.$GLOBALS['LSsession']->topDn;
|
||||
return $rdn_attr.'='.$rdn_val[0].','.$this -> config['container_dn'].','.$topDn;
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSldapObject_12',$this -> config['rdn']);
|
||||
LSerror :: addErrorCode('LSldapObject_12',$this -> config['rdn']);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSldapObject_11',$this -> getType());
|
||||
LSerror :: addErrorCode('LSldapObject_11',$this -> getType());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1034,7 +1035,7 @@ class LSldapObject {
|
|||
*/
|
||||
function whoami() {
|
||||
if (!$this -> _whoami)
|
||||
$this -> _whoami = $GLOBALS['LSsession'] -> whoami($this -> dn);
|
||||
$this -> _whoami = LSsession :: whoami($this -> dn);
|
||||
return $this -> _whoami;
|
||||
}
|
||||
|
||||
|
@ -1063,11 +1064,11 @@ class LSldapObject {
|
|||
if ($this -> afterDelete()) {
|
||||
return true;
|
||||
}
|
||||
LSerror::addErrorCode('LSldapObject_19');
|
||||
LSerror :: addErrorCode('LSldapObject_19');
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSldapObject_18');
|
||||
LSerror :: addErrorCode('LSldapObject_18');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -1098,7 +1099,7 @@ class LSldapObject {
|
|||
return $this -> _subDn_value[$dn];
|
||||
}
|
||||
$subDn_value='';
|
||||
$subDnLdapServer = $GLOBALS['LSsession'] -> getSortSubDnLdapServer();
|
||||
$subDnLdapServer = LSsession :: getSortSubDnLdapServer();
|
||||
foreach ($subDnLdapServer as $subDn => $subDn_name) {
|
||||
if (isCompatibleDNs($subDn,$dn)&&($subDn!=$dn)) {
|
||||
$subDn_value=$subDn;
|
||||
|
@ -1117,7 +1118,7 @@ class LSldapObject {
|
|||
* @return string Le nom du subDn de l'object
|
||||
*/
|
||||
function getSubDnName($dn=NULL) {
|
||||
$subDnLdapServer = $GLOBALS['LSsession'] -> getSortSubDnLdapServer();
|
||||
$subDnLdapServer = LSsession :: getSortSubDnLdapServer();
|
||||
return $subDnLdapServer[$this -> getSubDnValue($dn)];
|
||||
}
|
||||
|
||||
|
@ -1135,7 +1136,7 @@ class LSldapObject {
|
|||
$me -> loadData($this -> getDn());
|
||||
foreach($this->config['LSrelation'] as $relation_name => $relation_conf) {
|
||||
if ( isset($relation_conf['list_function']) ) {
|
||||
if ($GLOBALS['LSsession'] -> loadLSobject($relation_conf['LSobject'])) {
|
||||
if (LSsession :: loadLSobject($relation_conf['LSobject'])) {
|
||||
$obj = new $relation_conf['LSobject']();
|
||||
if ((method_exists($obj,$relation_conf['list_function']))&&(method_exists($obj,$relation_conf['getkeyvalue_function']))) {
|
||||
$list = $obj -> $relation_conf['list_function']($me);
|
||||
|
@ -1194,8 +1195,8 @@ class LSldapObject {
|
|||
*/
|
||||
function afterRename($oldDn,$newDn) {
|
||||
$error = 0;
|
||||
if($GLOBALS['LSsession'] -> dn == $oldDn) {
|
||||
$GLOBALS['LSsession'] -> changeAuthUser($this);
|
||||
if(LSsession :: getLSuserObjectDn() == $oldDn) {
|
||||
LSsession :: changeAuthUser($this);
|
||||
}
|
||||
|
||||
foreach($this -> _LSrelationsCache as $relation_name => $objInfos) {
|
||||
|
@ -1274,12 +1275,12 @@ class LSldapObject {
|
|||
foreach($config as $action) {
|
||||
if(function_exists($action)) {
|
||||
if(!$action($this)) {
|
||||
LSerror::addErrorCode('LSldapObject_25',$action);
|
||||
LSerror :: addErrorCode('LSldapObject_25',$action);
|
||||
$error=true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSldapObject_24',$action);
|
||||
LSerror :: addErrorCode('LSldapObject_24',$action);
|
||||
$error=true;
|
||||
}
|
||||
}
|
||||
|
@ -1306,10 +1307,10 @@ class LSldapObject {
|
|||
function afterCreate() {
|
||||
LSdebug('after');
|
||||
$error = 0;
|
||||
if ($GLOBALS['LSsession'] -> isSubDnLSobject($this -> getType())) {
|
||||
if (is_array($GLOBALS['LSsession'] -> ldapServer['subDn']['LSobject'][$this -> getType()]['LSobjects'])) {
|
||||
foreach($GLOBALS['LSsession'] -> ldapServer['subDn']['LSobject'][$this -> getType()]['LSobjects'] as $type) {
|
||||
if ($GLOBALS['LSsession'] -> loadLSobject($type)) {
|
||||
if (LSsession :: isSubDnLSobject($this -> getType())) {
|
||||
if (is_array(LSsession :: $ldapServer['subDn']['LSobject'][$this -> getType()]['LSobjects'])) {
|
||||
foreach(LSsession :: $ldapServer['subDn']['LSobject'][$this -> getType()]['LSobjects'] as $type) {
|
||||
if (LSsession :: loadLSobject($type)) {
|
||||
if (isset($GLOBALS['LSobjects'][$type]['container_auto_create'])&&isset($GLOBALS['LSobjects'][$type]['container_dn'])) {
|
||||
$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)) {
|
||||
|
@ -1341,12 +1342,12 @@ class LSldapObject {
|
|||
foreach($config as $action) {
|
||||
if(function_exists($action)) {
|
||||
if(!$action($this)) {
|
||||
LSerror::addErrorCode('LSldapObject_23',$action);
|
||||
LSerror :: addErrorCode('LSldapObject_23',$action);
|
||||
$error=true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSldapObject_22',$action);
|
||||
LSerror :: addErrorCode('LSldapObject_22',$action);
|
||||
$error=true;
|
||||
}
|
||||
}
|
||||
|
@ -1369,7 +1370,7 @@ class LSldapObject {
|
|||
**/
|
||||
function getObjectKeyValueInRelation($object,$attr,$objectType,$attrValue='dn') {
|
||||
if ((!$attr)||(!$objectType)) {
|
||||
LSerror::addErrorCode('LSrelations_05','getObjectKeyValueInRelation');
|
||||
LSerror :: addErrorCode('LSrelations_05','getObjectKeyValueInRelation');
|
||||
return;
|
||||
}
|
||||
if ($attrValue=='dn') {
|
||||
|
@ -1402,7 +1403,7 @@ class LSldapObject {
|
|||
**/
|
||||
function listObjectsInRelation($object,$attr,$objectType,$attrValue='dn') {
|
||||
if ((!$attr)||(!$objectType)) {
|
||||
LSerror::addErrorCode('LSrelations_05','listObjectsInRelation');
|
||||
LSerror :: addErrorCode('LSrelations_05','listObjectsInRelation');
|
||||
return;
|
||||
}
|
||||
if ($attrValue=='dn') {
|
||||
|
@ -1415,7 +1416,7 @@ class LSldapObject {
|
|||
if ($val) {
|
||||
$filter = $this -> getObjectFilter();
|
||||
$filter = '(&'.$filter.'('.$attr.'='.$val.'))';
|
||||
return $this -> listObjects($filter,$GLOBALS['LSsession'] -> ldapServer['ldap_config']['basedn'],array('scope' => 'sub'));
|
||||
return $this -> listObjects($filter,LSsession :: $ldapServer['ldap_config']['basedn'],array('scope' => 'sub'));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -1434,7 +1435,7 @@ class LSldapObject {
|
|||
**/
|
||||
function addOneObjectInRelation($object,$attr,$objectType,$attrValue='dn') {
|
||||
if ((!$attr)||(!$objectType)) {
|
||||
LSerror::addErrorCode('LSrelations_05','addOneObjectInRelation');
|
||||
LSerror :: addErrorCode('LSrelations_05','addOneObjectInRelation');
|
||||
return;
|
||||
}
|
||||
if ($object instanceof $objectType) {
|
||||
|
@ -1484,7 +1485,7 @@ class LSldapObject {
|
|||
**/
|
||||
function deleteOneObjectInRelation($object,$attr,$objectType,$attrValue='dn') {
|
||||
if ((!$attr)||(!$objectType)) {
|
||||
LSerror::addErrorCode('LSrelations_05','deleteOneObjectInRelation');
|
||||
LSerror :: addErrorCode('LSrelations_05','deleteOneObjectInRelation');
|
||||
return;
|
||||
}
|
||||
if ($object instanceof $objectType) {
|
||||
|
@ -1529,7 +1530,7 @@ class LSldapObject {
|
|||
*/
|
||||
function renameOneObjectInRelation($object,$oldValue,$attr,$objectType,$attrValue='dn') {
|
||||
if ((!$attr)||(!$objectType)) {
|
||||
LSerror::addErrorCode('LSrelations_05','renameOneObjectInRelation');
|
||||
LSerror :: addErrorCode('LSrelations_05','renameOneObjectInRelation');
|
||||
return;
|
||||
}
|
||||
if ($object instanceof $objectType) {
|
||||
|
@ -1579,7 +1580,7 @@ class LSldapObject {
|
|||
**/
|
||||
function updateObjectsInRelation($object,$listDns,$attr,$objectType,$attrValue='dn') {
|
||||
if ((!$attr)||(!$objectType)) {
|
||||
LSerror::addErrorCode('LSrelations_05','updateObjectsInRelation');
|
||||
LSerror :: addErrorCode('LSrelations_05','updateObjectsInRelation');
|
||||
return;
|
||||
}
|
||||
$currentObjects = $this -> listObjectsInRelation($object,$attr,$objectType,$attrValue);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -89,7 +89,7 @@ function getFData($format,$data,$meth=NULL) {
|
|||
$format[$i]=ereg_replace($ch[0],$value,$format[$i]);
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('fct_getFData_01',array('meth' => $meth,'obj' => $ch[1]));
|
||||
LSerror :: addErrorCode('fct_getFData_01',array('meth' => $meth,'obj' => $ch[1]));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ function getFData($format,$data,$meth=NULL) {
|
|||
$format[$i]=ereg_replace($ch[0],$value,$format[$i]);
|
||||
}
|
||||
else {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,17 +22,15 @@
|
|||
|
||||
require_once 'includes/class/class.LSsession.php';
|
||||
|
||||
$GLOBALS['LSsession'] = new LSsession();
|
||||
|
||||
if($LSsession -> startLSsession()) {
|
||||
if(LSsession :: startLSsession()) {
|
||||
|
||||
// Définition du Titre de la page
|
||||
$GLOBALS['Smarty'] -> assign('pagetitle',_('Accueil'));
|
||||
|
||||
// Template
|
||||
$GLOBALS['LSsession'] -> setTemplate('accueil.tpl');
|
||||
LSsession :: setTemplate('accueil.tpl');
|
||||
}
|
||||
|
||||
// Affichage des retours d'erreurs
|
||||
$GLOBALS['LSsession'] -> displayTemplate();
|
||||
LSsession :: displayTemplate();
|
||||
?>
|
||||
|
|
|
@ -2,14 +2,16 @@
|
|||
|
||||
require_once 'includes/class/class.LSsession.php';
|
||||
|
||||
$GLOBALS['LSsession'] = new LSsession();
|
||||
|
||||
if (($_REQUEST['template'] != 'login')&&($_REQUEST['template'] != 'recoverPassword')) {
|
||||
if ( !$GLOBALS['LSsession'] -> startLSsession() ) {
|
||||
LSerror::addErrorCode('LSsession_22');
|
||||
if ( !LSsession :: startLSsession() ) {
|
||||
LSerror :: addErrorCode('LSsession_22');
|
||||
$_ERRORS = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSsession :: initialize() or die('Error during initialization.');
|
||||
}
|
||||
|
||||
$data=NULL;
|
||||
if (!isset($_ERRORS)) {
|
||||
switch($_REQUEST['template']) {
|
||||
|
@ -17,9 +19,9 @@ if (!isset($_ERRORS)) {
|
|||
switch($_REQUEST['action']) {
|
||||
case 'onLdapServerChanged':
|
||||
if ( isset($_REQUEST['server']) ) {
|
||||
$GLOBALS['LSsession'] -> setLdapServer($_REQUEST['server']);
|
||||
LSsession :: setLdapServer($_REQUEST['server']);
|
||||
$data = array();
|
||||
if ( $GLOBALS['LSsession'] -> LSldapConnect() ) {
|
||||
if ( LSsession :: LSldapConnect() ) {
|
||||
session_start();
|
||||
if (isset($_SESSION['LSsession_topDn'])) {
|
||||
$sel = $_SESSION['LSsession_topDn'];
|
||||
|
@ -27,13 +29,13 @@ if (!isset($_ERRORS)) {
|
|||
else {
|
||||
$sel = NULL;
|
||||
}
|
||||
$list = $GLOBALS['LSsession'] -> getSubDnLdapServerOptions($sel);
|
||||
$list = LSsession :: getSubDnLdapServerOptions($sel);
|
||||
if (is_string($list)) {
|
||||
$data['list_topDn'] = "<select name='LSsession_topDn' id='LSsession_topDn'>".$list."</select>";
|
||||
$data['subDnLabel'] = $GLOBALS['LSsession'] -> getSubDnLabel();
|
||||
$data['subDnLabel'] = LSsession :: getSubDnLabel();
|
||||
}
|
||||
}
|
||||
$data['recoverPassword'] = isset($GLOBALS['LSsession'] -> ldapServer['recoverPassword']);
|
||||
$data['recoverPassword'] = isset(LSsession::$ldapServer['recoverPassword']);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -42,8 +44,8 @@ if (!isset($_ERRORS)) {
|
|||
switch($_REQUEST['action']) {
|
||||
case 'onLdapServerChanged':
|
||||
if ( isset($_REQUEST['server']) ) {
|
||||
$GLOBALS['LSsession'] -> setLdapServer($_REQUEST['server']);
|
||||
$data=array('recoverPassword' => isset($GLOBALS['LSsession'] -> ldapServer['recoverPassword']));
|
||||
LSsession :: setLdapServer($_REQUEST['server']);
|
||||
$data=array('recoverPassword' => isset(LSsession::$ldapServer['recoverPassword']));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -52,7 +54,7 @@ if (!isset($_ERRORS)) {
|
|||
switch($_REQUEST['action']) {
|
||||
case 'onAddFieldBtnClick':
|
||||
if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['objectdn'])) && (isset($_REQUEST['idform'])) && (isset($_REQUEST['fieldId'])) ) {
|
||||
if ($GLOBALS['LSsession'] -> loadLSobject($_REQUEST['objecttype'])) {
|
||||
if (LSsession ::loadLSobject($_REQUEST['objecttype'])) {
|
||||
$object = new $_REQUEST['objecttype']();
|
||||
$object -> loadData($_REQUEST['objectdn']);
|
||||
$form = $object -> getForm($_REQUEST['idform']);
|
||||
|
@ -69,7 +71,7 @@ if (!isset($_ERRORS)) {
|
|||
break;
|
||||
case 'LSformElement_select_object_refresh':
|
||||
if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['objectdn'])) && (isset($_REQUEST['idform'])) ) {
|
||||
if ($GLOBALS['LSsession'] -> loadLSobject($_REQUEST['objecttype'])) {
|
||||
if (LSsession ::loadLSobject($_REQUEST['objecttype'])) {
|
||||
$object = new $_REQUEST['objecttype']();
|
||||
$form = $object -> getForm($_REQUEST['idform']);
|
||||
$field=$form -> getElement($_REQUEST['attribute']);
|
||||
|
@ -84,7 +86,7 @@ if (!isset($_ERRORS)) {
|
|||
break;
|
||||
case 'LSformElement_select_object_searchAdd':
|
||||
if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['pattern'])) && (isset($_REQUEST['idform'])) ) {
|
||||
if ($GLOBALS['LSsession'] -> loadLSobject($_REQUEST['objecttype'])) {
|
||||
if (LSsession ::loadLSobject($_REQUEST['objecttype'])) {
|
||||
$object = new $_REQUEST['objecttype']();
|
||||
$form = $object -> getForm($_REQUEST['idform']);
|
||||
$field=$form -> getElement($_REQUEST['attribute']);
|
||||
|
@ -94,7 +96,7 @@ if (!isset($_ERRORS)) {
|
|||
break;
|
||||
case 'generatePassword':
|
||||
if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['objectdn'])) && (isset($_REQUEST['idform'])) ) {
|
||||
if ($GLOBALS['LSsession'] -> loadLSobject($_REQUEST['objecttype'])) {
|
||||
if (LSsession ::loadLSobject($_REQUEST['objecttype'])) {
|
||||
$object = new $_REQUEST['objecttype']();
|
||||
if ($object) {
|
||||
$form = $object -> getForm($_REQUEST['idform']);
|
||||
|
@ -115,7 +117,7 @@ if (!isset($_ERRORS)) {
|
|||
break;
|
||||
case 'verifyPassword':
|
||||
if ((isset($_REQUEST['attribute'])) && (isset($_REQUEST['objecttype'])) && (isset($_REQUEST['fieldValue'])) && (isset($_REQUEST['idform'])) && (isset($_REQUEST['objectdn'])) ) {
|
||||
if ($GLOBALS['LSsession'] -> loadLSobject($_REQUEST['objecttype'])) {
|
||||
if (LSsession ::loadLSobject($_REQUEST['objecttype'])) {
|
||||
$object = new $_REQUEST['objecttype']();
|
||||
$form = $object -> getForm($_REQUEST['idform']);
|
||||
$object -> loadData($_REQUEST['objectdn']);
|
||||
|
@ -135,12 +137,12 @@ if (!isset($_ERRORS)) {
|
|||
if ((isset($_REQUEST['id'])) && (isset($_REQUEST['href'])) ) {
|
||||
if (isset($_SESSION['LSrelation'][$_REQUEST['id']])) {
|
||||
$conf = $_SESSION['LSrelation'][$_REQUEST['id']];
|
||||
if ($GLOBALS['LSsession']->loadLSobject($conf['objectType'])) {
|
||||
if (LSsession ::loadLSobject($conf['objectType'])) {
|
||||
$object = new $conf['objectType']();
|
||||
if (($object -> loadData($conf['objectDn'])) && (isset($object->config['LSrelation'][$conf['relationName']]))) {
|
||||
$relationConf = $object->config['LSrelation'][$conf['relationName']];
|
||||
if ($GLOBALS['LSsession'] -> loadLSobject($relationConf['LSobject'])) {
|
||||
if ($GLOBALS['LSsession'] -> relationCanEdit($object -> getValue('dn'),$object -> getType(),$conf['relationName'])) {
|
||||
if (LSsession ::loadLSobject($relationConf['LSobject'])) {
|
||||
if (LSsession :: relationCanEdit($object -> getValue('dn'),$object -> getType(),$conf['relationName'])) {
|
||||
if (method_exists($relationConf['LSobject'],$relationConf['list_function'])) {
|
||||
$objRel = new $relationConf['LSobject']();
|
||||
$list = $objRel -> $relationConf['list_function']($object);
|
||||
|
@ -156,24 +158,24 @@ if (!isset($_ERRORS)) {
|
|||
);
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSrelations_01',$relationName);
|
||||
LSerror :: addErrorCode('LSrelations_01',$relationName);
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_11');
|
||||
LSerror :: addErrorCode('LSsession_11');
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_12');
|
||||
LSerror :: addErrorCode('LSsession_12');
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_12');
|
||||
LSerror :: addErrorCode('LSsession_12');
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_12');
|
||||
LSerror :: addErrorCode('LSsession_12');
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -181,12 +183,12 @@ if (!isset($_ERRORS)) {
|
|||
if (isset($_REQUEST['id'])) {
|
||||
if (isset($_SESSION['LSrelation'][$_REQUEST['id']])) {
|
||||
$conf = $_SESSION['LSrelation'][$_REQUEST['id']];
|
||||
if ($GLOBALS['LSsession']->loadLSobject($conf['objectType'])) {
|
||||
if (LSsession ::loadLSobject($conf['objectType'])) {
|
||||
$object = new $conf['objectType']();
|
||||
if (($object -> loadData($conf['objectDn'])) && (isset($object->config['LSrelation'][$conf['relationName']]))) {
|
||||
$relationConf = $object->config['LSrelation'][$conf['relationName']];
|
||||
if ($GLOBALS['LSsession'] -> loadLSobject($relationConf['LSobject'])) {
|
||||
if ($GLOBALS['LSsession'] -> relationCanEdit($object -> getValue('dn'),$object -> getType(),$conf['relationName'])) {
|
||||
if (LSsession ::loadLSobject($relationConf['LSobject'])) {
|
||||
if (LSsession :: relationCanEdit($object -> getValue('dn'),$object -> getType(),$conf['relationName'])) {
|
||||
if (is_array($_SESSION['LSselect'][$relationConf['LSobject']])) {
|
||||
if (method_exists($relationConf['LSobject'],$relationConf['update_function'])) {
|
||||
$objRel = new $relationConf['LSobject']();
|
||||
|
@ -209,33 +211,33 @@ if (!isset($_ERRORS)) {
|
|||
$data['id'] = $_REQUEST['id'];
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSrelations_01',$relationName);
|
||||
LSerror :: addErrorCode('LSrelations_01',$relationName);
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSrelations_03',$relationName);
|
||||
LSerror :: addErrorCode('LSrelations_03',$relationName);
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSrelations_02',$relationName);
|
||||
LSerror :: addErrorCode('LSrelations_02',$relationName);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_11');
|
||||
LSerror :: addErrorCode('LSsession_11');
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_12');
|
||||
LSerror :: addErrorCode('LSsession_12');
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_12');
|
||||
LSerror :: addErrorCode('LSsession_12');
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_12');
|
||||
LSerror :: addErrorCode('LSsession_12');
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -243,12 +245,12 @@ if (!isset($_ERRORS)) {
|
|||
if ((isset($_REQUEST['id'])) && (isset($_REQUEST['dn']))) {
|
||||
if (isset($_SESSION['LSrelation'][$_REQUEST['id']])) {
|
||||
$conf = $_SESSION['LSrelation'][$_REQUEST['id']];
|
||||
if ($GLOBALS['LSsession']->loadLSobject($conf['objectType'])) {
|
||||
if (LSsession ::loadLSobject($conf['objectType'])) {
|
||||
$object = new $conf['objectType']();
|
||||
if (($object -> loadData($conf['objectDn'])) && (isset($object->config['LSrelation'][$conf['relationName']]))) {
|
||||
$relationConf = $object->config['LSrelation'][$conf['relationName']];
|
||||
if ($GLOBALS['LSsession'] -> loadLSobject($relationConf['LSobject'])) {
|
||||
if ($GLOBALS['LSsession'] -> relationCanEdit($object -> getValue('dn'),$object -> getType(),$conf['relationName'])) {
|
||||
if (LSsession ::loadLSobject($relationConf['LSobject'])) {
|
||||
if (LSsession :: relationCanEdit($object -> getValue('dn'),$object -> getType(),$conf['relationName'])) {
|
||||
if (method_exists($relationConf['LSobject'],$relationConf['list_function'])) {
|
||||
$objRel = new $relationConf['LSobject']();
|
||||
$list = $objRel -> $relationConf['list_function']($object);
|
||||
|
@ -257,7 +259,7 @@ if (!isset($_ERRORS)) {
|
|||
foreach($list as $o) {
|
||||
if($o -> getDn() == $_REQUEST['dn']) {
|
||||
if (!$o -> $relationConf['remove_function']($object)) {
|
||||
LSerror::addErrorCode('LSrelations_03',$conf['relationName']);
|
||||
LSerror :: addErrorCode('LSrelations_03',$conf['relationName']);
|
||||
}
|
||||
else {
|
||||
$ok = true;
|
||||
|
@ -266,7 +268,7 @@ if (!isset($_ERRORS)) {
|
|||
}
|
||||
if (!$ok) {
|
||||
LSdebug($_REQUEST['value']." introuvé parmi la liste");
|
||||
LSerror::addErrorCode('LSrelations_03',$conf['relationName']);
|
||||
LSerror :: addErrorCode('LSrelations_03',$conf['relationName']);
|
||||
}
|
||||
else {
|
||||
$data=array(
|
||||
|
@ -275,28 +277,28 @@ if (!isset($_ERRORS)) {
|
|||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSrelations_03',$conf['relationName']);
|
||||
LSerror :: addErrorCode('LSrelations_03',$conf['relationName']);
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSrelations_01',$conf['relationName']);
|
||||
LSerror :: addErrorCode('LSrelations_01',$conf['relationName']);
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_11');
|
||||
LSerror :: addErrorCode('LSsession_11');
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_12');
|
||||
LSerror :: addErrorCode('LSsession_12');
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_12');
|
||||
LSerror :: addErrorCode('LSsession_12');
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_12');
|
||||
LSerror :: addErrorCode('LSsession_12');
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -346,7 +348,7 @@ if (!isset($_ERRORS)) {
|
|||
);
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_12');
|
||||
LSerror :: addErrorCode('LSsession_12');
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -355,7 +357,7 @@ if (!isset($_ERRORS)) {
|
|||
switch($_REQUEST['action']) {
|
||||
case 'display':
|
||||
if (isset($_REQUEST['object']['type']) && isset($_REQUEST['object']['dn'])) {
|
||||
if ($GLOBALS['LSsession']->loadLSobject($_REQUEST['object']['type'])) {
|
||||
if (LSsession ::loadLSobject($_REQUEST['object']['type'])) {
|
||||
$obj = new $_REQUEST['object']['type']();
|
||||
$obj -> loadData($_REQUEST['object']['dn']);
|
||||
$msg = $obj -> getFData($_REQUEST['msg']);
|
||||
|
@ -385,7 +387,7 @@ if (!isset($_ERRORS)) {
|
|||
break;
|
||||
case 'send':
|
||||
if (isset($_REQUEST['infos'])) {
|
||||
if ($GLOBALS['LSsession'] -> loadLSaddon('mail')) {
|
||||
if (LSsession ::loadLSaddon('mail')) {
|
||||
if(sendMail($_REQUEST['infos']['mail'],$_REQUEST['infos']['subject'],$_REQUEST['infos']['msg'])) {
|
||||
$data = array(
|
||||
'msgok' => _("Votre message a bien été envoyé.")
|
||||
|
@ -394,13 +396,13 @@ if (!isset($_ERRORS)) {
|
|||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_12');
|
||||
LSerror :: addErrorCode('LSsession_12');
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$GLOBALS['LSsession'] -> displayAjaxReturn($data);
|
||||
LSsession :: displayAjaxReturn($data);
|
||||
|
||||
?>
|
||||
|
|
|
@ -22,9 +22,7 @@
|
|||
|
||||
require_once 'includes/class/class.LSsession.php';
|
||||
|
||||
$GLOBALS['LSsession'] = new LSsession();
|
||||
|
||||
if($LSsession -> startLSsession()) {
|
||||
if(LSsession :: startLSsession()) {
|
||||
|
||||
if (isset($_POST['LSform_objecttype'])) {
|
||||
$LSobject = $_POST['LSform_objecttype'];
|
||||
|
@ -42,8 +40,8 @@ if($LSsession -> startLSsession()) {
|
|||
|
||||
if ((isset($dn)) && (isset($LSobject)) ) {
|
||||
// Création d'un LSobject
|
||||
if ($GLOBALS['LSsession'] -> loadLSobject($LSobject)) {
|
||||
if ( $GLOBALS['LSsession'] -> canEdit($LSobject,$dn) ) {
|
||||
if (LSsession :: loadLSobject($LSobject)) {
|
||||
if ( LSsession :: canEdit($LSobject,$dn) ) {
|
||||
$object = new $LSobject();
|
||||
if ($object -> loadData($dn)) {
|
||||
// Définition du Titre de la page
|
||||
|
@ -53,13 +51,13 @@ if($LSsession -> startLSsession()) {
|
|||
// MàJ des données de l'objet LDAP
|
||||
if ($object -> updateData('modify')) {
|
||||
if (LSerror::errorsDefined()) {
|
||||
$GLOBALS['LSsession'] -> addInfo(_("L'objet a été modifié partiellement."));
|
||||
LSsession :: addInfo(_("L'objet a été modifié partiellement."));
|
||||
}
|
||||
else {
|
||||
$GLOBALS['LSsession'] -> addInfo(_("L'objet a bien été modifié."));
|
||||
LSsession :: addInfo(_("L'objet a bien été modifié."));
|
||||
}
|
||||
if (isset($_REQUEST['ajax'])) {
|
||||
$GLOBALS['LSsession'] -> displayAjaxReturn (
|
||||
LSsession :: displayAjaxReturn (
|
||||
array(
|
||||
'LSredirect' => 'view.php?LSobject='.$LSobject.'&dn='.$object -> getDn()
|
||||
)
|
||||
|
@ -68,15 +66,15 @@ if($LSsession -> startLSsession()) {
|
|||
}
|
||||
else {
|
||||
if (!LSdebugDefined()) {
|
||||
$GLOBALS['LSsession'] -> redirect('view.php?LSobject='.$LSobject.'&dn='.$object -> getDn());
|
||||
LSsession :: redirect('view.php?LSobject='.$LSobject.'&dn='.$object -> getDn());
|
||||
}
|
||||
else {
|
||||
$GLOBALS['LSsession'] -> displayTemplate();
|
||||
LSsession :: displayTemplate();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$GLOBALS['LSsession'] -> displayAjaxReturn (
|
||||
LSsession :: displayAjaxReturn (
|
||||
array(
|
||||
'LSformErrors' => $form -> getErrors()
|
||||
)
|
||||
|
@ -84,7 +82,7 @@ if($LSsession -> startLSsession()) {
|
|||
}
|
||||
}
|
||||
else if (isset($_REQUEST['ajax']) && $form -> definedError()) {
|
||||
$GLOBALS['LSsession'] -> displayAjaxReturn (
|
||||
LSsession :: displayAjaxReturn (
|
||||
array(
|
||||
'LSformErrors' => $form -> getErrors()
|
||||
)
|
||||
|
@ -97,7 +95,7 @@ if($LSsession -> startLSsession()) {
|
|||
'action' => 'view'
|
||||
);
|
||||
|
||||
if ($GLOBALS['LSsession'] -> canRemove($LSobject,$object -> getDn())) {
|
||||
if (LSsession :: canRemove($LSobject,$object -> getDn())) {
|
||||
$LSview_actions[] = array(
|
||||
'label' => _('Supprimer'),
|
||||
'url' => 'remove.php?LSobject='.$LSobject.'&dn='.$object -> getDn(),
|
||||
|
@ -105,31 +103,31 @@ if($LSsession -> startLSsession()) {
|
|||
);
|
||||
}
|
||||
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSsmoothbox.js');
|
||||
$GLOBALS['LSsession'] -> addCssFile('LSsmoothbox.css');
|
||||
LSsession :: addJSscript('LSsmoothbox.js');
|
||||
LSsession :: addCssFile('LSsmoothbox.css');
|
||||
$GLOBALS['Smarty'] -> assign('LSview_actions',$LSview_actions);
|
||||
$GLOBALS['LSsession'] -> setTemplate('modify.tpl');
|
||||
LSsession :: setTemplate('modify.tpl');
|
||||
$form -> display();
|
||||
$GLOBALS['LSsession'] -> displayTemplate();
|
||||
LSsession :: displayTemplate();
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_11');
|
||||
LSerror :: addErrorCode('LSsession_11');
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_11');
|
||||
LSerror :: addErrorCode('LSsession_11');
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_12');
|
||||
LSerror :: addErrorCode('LSsession_12');
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
$GLOBALS['LSsession'] -> setTemplate('login.tpl');
|
||||
$GLOBALS['LSsession'] -> displayTemplate();
|
||||
LSsession :: setTemplate('login.tpl');
|
||||
LSsession :: displayTemplate();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -22,25 +22,23 @@
|
|||
|
||||
require_once 'includes/class/class.LSsession.php';
|
||||
|
||||
$GLOBALS['LSsession'] = new LSsession();
|
||||
|
||||
if($LSsession -> startLSsession()) {
|
||||
if(LSsession :: startLSsession()) {
|
||||
|
||||
if ((isset($_GET['LSobject'])) && (isset($_GET['dn']))) {
|
||||
|
||||
if ($GLOBALS['LSsession'] -> loadLSobject($_GET['LSobject'])) {
|
||||
if ( $GLOBALS['LSsession'] -> canRemove($_GET['LSobject'],$_GET['dn']) ) {
|
||||
if (LSsession ::loadLSobject($_GET['LSobject'])) {
|
||||
if ( LSsession :: canRemove($_GET['LSobject'],$_GET['dn']) ) {
|
||||
$object = new $_GET['LSobject']();
|
||||
if ($object -> loadData($_GET['dn'])) {
|
||||
if (isset($_GET['valid'])) {
|
||||
$objectname=$object -> getDisplayName();
|
||||
$GLOBALS['Smarty'] -> assign('pagetitle',_('Suppression').' : '.$objectname);
|
||||
if ($object -> remove()) {
|
||||
$GLOBALS['LSsession'] -> addInfo($objectname.' '._('a bien été supprimé').'.');
|
||||
$GLOBALS['LSsession'] -> redirect('view.php?LSobject='.$_GET['LSobject'].'&refresh');
|
||||
LSsession :: addInfo($objectname.' '._('a bien été supprimé').'.');
|
||||
LSsession :: redirect('view.php?LSobject='.$_GET['LSobject'].'&refresh');
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSldapObject_15',$objectname);
|
||||
LSerror :: addErrorCode('LSldapObject_15',$objectname);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -50,29 +48,29 @@ if($LSsession -> startLSsession()) {
|
|||
$GLOBALS['Smarty'] -> assign('validation_url','remove.php?LSobject='.$_GET['LSobject'].'&dn='.$_GET['dn'].'&valid');
|
||||
$GLOBALS['Smarty'] -> assign('validation_txt',_('Valider'));
|
||||
}
|
||||
$GLOBALS['LSsession'] -> setTemplate('question.tpl');
|
||||
LSsession :: setTemplate('question.tpl');
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_12');
|
||||
LSerror :: addErrorCode('LSsession_12');
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_11');
|
||||
LSerror :: addErrorCode('LSsession_11');
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSldapObject_01');
|
||||
LSerror :: addErrorCode('LSldapObject_01');
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_12');
|
||||
LSerror :: addErrorCode('LSsession_12');
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
$GLOBALS['LSsession'] -> setTemplate('login.tpl');
|
||||
LSsession :: setTemplate('login.tpl');
|
||||
}
|
||||
|
||||
// Affichage des retours d'erreurs
|
||||
$GLOBALS['LSsession'] -> displayTemplate();
|
||||
LSsession :: displayTemplate();
|
||||
?>
|
||||
|
|
|
@ -22,13 +22,11 @@
|
|||
|
||||
require_once 'includes/class/class.LSsession.php';
|
||||
|
||||
$GLOBALS['LSsession'] = new LSsession();
|
||||
|
||||
if($LSsession -> startLSsession()) {
|
||||
if(LSsession :: startLSsession()) {
|
||||
if (isset($_REQUEST['LSobject'])) {
|
||||
$LSobject = $_REQUEST['LSobject'];
|
||||
|
||||
if ( $GLOBALS['LSsession'] -> loadLSobject($LSobject) ) {
|
||||
if ( LSsession ::loadLSobject($LSobject) ) {
|
||||
$objectList=array();
|
||||
$object = new $LSobject();
|
||||
|
||||
|
@ -37,18 +35,18 @@ if($LSsession -> startLSsession()) {
|
|||
|
||||
if (isset($_SESSION['LSsession']['LSsearch'][$LSobject])) {
|
||||
$filter = $_SESSION['LSsession']['LSsearch'][$LSobject]['filter'];
|
||||
if (isCompatibleDNs($_SESSION['LSsession']['LSsearch'][$LSobject]['topDn'],$GLOBALS['LSsession'] -> topDn)) {
|
||||
if (isCompatibleDNs($_SESSION['LSsession']['LSsearch'][$LSobject]['topDn'],LSsession :: getTopDn())) {
|
||||
$topDn = $_SESSION['LSsession']['LSsearch'][$LSobject]['topDn'];
|
||||
if (isset($_SESSION['LSsession']['LSsearch'][$LSobject]['selectedTopDn'])) {
|
||||
$selectedTopDn = $_SESSION['LSsession']['LSsearch'][$LSobject]['selectedTopDn'];
|
||||
}
|
||||
else {
|
||||
$selectedTopDn = $GLOBALS['LSsession'] -> topDn;
|
||||
$selectedTopDn = LSsession :: getTopDn();
|
||||
}
|
||||
}
|
||||
else {
|
||||
$selectedTopDn = $GLOBALS['LSsession'] -> topDn;
|
||||
$topDn = $object -> config['container_dn'].','.$GLOBALS['LSsession'] -> topDn;
|
||||
$selectedTopDn = LSsession :: getTopDn();
|
||||
$topDn = $object -> config['container_dn'].','.LSsession :: getTopDn();
|
||||
}
|
||||
$params = $_SESSION['LSsession']['LSsearch'][$LSobject]['params'];
|
||||
$pattern = $_SESSION['LSsession']['LSsearch'][$LSobject]['pattern'];
|
||||
|
@ -60,17 +58,17 @@ if($LSsession -> startLSsession()) {
|
|||
}
|
||||
else {
|
||||
$filter = NULL;
|
||||
$topDn = $object -> config['container_dn'].','.$GLOBALS['LSsession'] -> topDn;
|
||||
$topDn = $object -> config['container_dn'].','.LSsession :: getTopDn();
|
||||
$params = array('scope' => 'one');
|
||||
$pattern = false;
|
||||
$recur = false;
|
||||
$approx = false;
|
||||
$selectedTopDn = $GLOBALS['LSsession'] -> topDn;
|
||||
$selectedTopDn = LSsession :: getTopDn();
|
||||
$orderby = false;
|
||||
$_REQUEST['orderby']=$GLOBALS['LSobjects'][$LSobject]['orderby'];
|
||||
$ordersense = 'ASC';
|
||||
$subDnLdapServer = $GLOBALS['LSsession'] -> getSubDnLdapServer();
|
||||
$doSubDn = (($subDnLdapServer)&&(!$GLOBALS['LSsession']->isSubDnLSobject($LSobject)));
|
||||
$subDnLdapServer = LSsession :: getSubDnLdapServer();
|
||||
$doSubDn = (($subDnLdapServer)&&(!LSsession :: isSubDnLSobject($LSobject)));
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['LSview_search_submit'])) {
|
||||
|
@ -101,25 +99,25 @@ if($LSsession -> startLSsession()) {
|
|||
if (isset($_REQUEST['LSview_recur'])) {
|
||||
$recur = true;
|
||||
$params['scope'] = 'sub';
|
||||
if ($GLOBALS['LSsession'] -> validSubDnLdapServer($_REQUEST['LSselect_topDn'])) {
|
||||
if (LSsession :: validSubDnLdapServer($_REQUEST['LSselect_topDn'])) {
|
||||
$topDn = $_REQUEST['LSselect_topDn'];
|
||||
$selectedTopDn = $topDn;
|
||||
}
|
||||
else {
|
||||
$topDn = $GLOBALS['LSsession'] -> topDn;
|
||||
$topDn = LSsession :: getTopDn();
|
||||
$selectedTopDn = $topDn;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$recur = false;
|
||||
$params['scope'] = 'one';
|
||||
if ($GLOBALS['LSsession'] -> validSubDnLdapServer($_REQUEST['LSselect_topDn'])) {
|
||||
if (LSsession :: validSubDnLdapServer($_REQUEST['LSselect_topDn'])) {
|
||||
$topDn = $object -> config['container_dn'].','.$_REQUEST['LSselect_topDn'];
|
||||
$selectedTopDn = $_REQUEST['LSselect_topDn'];
|
||||
}
|
||||
else {
|
||||
$topDn = $object -> config['container_dn'].','.$GLOBALS['LSsession'] -> topDn;
|
||||
$selectedTopDn = $GLOBALS['LSsession'] -> topDn;
|
||||
$topDn = $object -> config['container_dn'].','.LSsession :: getTopDn();
|
||||
$selectedTopDn = LSsession :: getTopDn();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -188,7 +186,7 @@ if($LSsession -> startLSsession()) {
|
|||
)
|
||||
);
|
||||
|
||||
if (($GLOBALS['LSsession'] -> cacheSearch()) && isset($_SESSION['LSsession']['LSsearch'][$hash]) && (!isset($_REQUEST['refresh']))) {
|
||||
if ((LSsession :: cacheSearch()) && isset($_SESSION['LSsession']['LSsearch'][$hash]) && (!isset($_REQUEST['refresh']))) {
|
||||
// On affiche à partir du cache
|
||||
$searchData=$_SESSION['LSsession']['LSsearch'][$hash];
|
||||
LSdebug('From cache');
|
||||
|
@ -208,7 +206,7 @@ if($LSsession -> startLSsession()) {
|
|||
$c=0;
|
||||
|
||||
foreach($list as $objDn => $objName) {
|
||||
if ($GLOBALS['LSsession'] -> canAccess($LSobject,$objDn)) {
|
||||
if (LSsession :: canAccess($LSobject,$objDn)) {
|
||||
|
||||
$c++;
|
||||
unset($actions);
|
||||
|
@ -230,7 +228,7 @@ if($LSsession -> startLSsession()) {
|
|||
}
|
||||
$searchData['objectList']=$objectList;
|
||||
$searchData['LSview_actions'] = $LSview_actions;
|
||||
if ($GLOBALS['LSsession'] -> cacheSearch()) {
|
||||
if (LSsession :: cacheSearch()) {
|
||||
$_SESSION['LSsession']['LSsearch'][$hash]=$searchData;
|
||||
}
|
||||
if ($orderby) {
|
||||
|
@ -298,7 +296,7 @@ if($LSsession -> startLSsession()) {
|
|||
$searchData['objectList'][$i]['select']=$select;
|
||||
}
|
||||
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSview.js');
|
||||
LSsession :: addJSscript('LSview.js');
|
||||
|
||||
$GLOBALS['Smarty']->assign('LSview_search',array(
|
||||
'action' => $_SERVER['PHP_SELF'],
|
||||
|
@ -315,22 +313,22 @@ if($LSsession -> startLSsession()) {
|
|||
$GLOBALS['Smarty'] -> assign('LSview_actions',$searchData['LSview_actions']);
|
||||
$GLOBALS['Smarty'] -> assign('LSselect_multiple',$multiple);
|
||||
if (isset($_REQUEST['ajax'])) {
|
||||
$GLOBALS['LSsession'] -> setTemplate('select_table.tpl');
|
||||
LSsession :: setTemplate('select_table.tpl');
|
||||
}
|
||||
else {
|
||||
$GLOBALS['LSsession'] -> setTemplate('select.tpl');
|
||||
LSsession :: setTemplate('select.tpl');
|
||||
}
|
||||
$GLOBALS['LSsession'] -> ajaxDisplay = true;
|
||||
LSsession :: setAjaxDisplay();
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_12');
|
||||
LSerror :: addErrorCode('LSsession_12');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$GLOBALS['LSsession'] -> setTemplate('login.tpl');
|
||||
LSsession :: setTemplate('login.tpl');
|
||||
}
|
||||
|
||||
// Affichage des retours d'erreurs
|
||||
$GLOBALS['LSsession'] -> displayTemplate();
|
||||
LSsession :: displayTemplate();
|
||||
?>
|
||||
|
|
110
trunk/view.php
110
trunk/view.php
|
@ -22,25 +22,23 @@
|
|||
|
||||
require_once 'includes/class/class.LSsession.php';
|
||||
|
||||
$GLOBALS['LSsession'] = new LSsession();
|
||||
|
||||
if($LSsession -> startLSsession()) {
|
||||
if(LSsession :: startLSsession()) {
|
||||
if (isset($_REQUEST['LSobject'])) {
|
||||
$LSobject = $_REQUEST['LSobject'];
|
||||
$dn = $_REQUEST['dn'];
|
||||
|
||||
if ($GLOBALS['LSsession'] -> in_menu($LSobject)) {
|
||||
if (LSsession :: in_menu($LSobject)) {
|
||||
|
||||
if ( $LSobject == 'SELF' ) {
|
||||
$LSobject = $GLOBALS['LSsession']-> LSuserObject -> getType();
|
||||
$dn = $GLOBALS['LSsession']-> LSuserObject -> getValue('dn');
|
||||
$LSobject = LSsession :: getLSuserObject() -> getType();
|
||||
$dn = LSsession :: getLSuserObjectDn();
|
||||
}
|
||||
|
||||
if ( $GLOBALS['LSsession'] -> loadLSobject($LSobject) ) {
|
||||
if ( LSsession :: loadLSobject($LSobject) ) {
|
||||
// Affichage d'un objet
|
||||
if ( $dn!='' ) {
|
||||
if ($GLOBALS['LSsession'] -> canAccess($LSobject,$dn)) {
|
||||
if ( $GLOBALS['LSsession'] -> canEdit($LSobject,$dn) ) {
|
||||
if (LSsession :: canAccess($LSobject,$dn)) {
|
||||
if ( LSsession :: canEdit($LSobject,$dn) ) {
|
||||
$LSview_actions[] = array(
|
||||
'label' => _('Modifier'),
|
||||
'url' =>'modify.php?LSobject='.$LSobject.'&dn='.$dn,
|
||||
|
@ -48,7 +46,7 @@ if($LSsession -> startLSsession()) {
|
|||
);
|
||||
}
|
||||
|
||||
if ($GLOBALS['LSsession'] -> canCreate($LSobject)) {
|
||||
if (LSsession :: canCreate($LSobject)) {
|
||||
$LSview_actions[] = array(
|
||||
'label' => _('Copier'),
|
||||
'url' =>'create.php?LSobject='.$LSobject.'&load='.$dn,
|
||||
|
@ -56,7 +54,7 @@ if($LSsession -> startLSsession()) {
|
|||
);
|
||||
}
|
||||
|
||||
if ($GLOBALS['LSsession'] -> canRemove($LSobject,$dn)) {
|
||||
if (LSsession :: canRemove($LSobject,$dn)) {
|
||||
$LSview_actions[] = array(
|
||||
'label' => _('Supprimer'),
|
||||
'url' => 'remove.php?LSobject='.$LSobject.'&dn='.$dn,
|
||||
|
@ -64,13 +62,13 @@ if($LSsession -> startLSsession()) {
|
|||
);
|
||||
}
|
||||
|
||||
if ($GLOBALS['LSsession']-> LSuserObject -> getValue('dn') != $dn) {
|
||||
if (LSsession :: getLSuserObjectDn() != $dn) {
|
||||
$object = new $LSobject();
|
||||
$object -> loadData($dn);
|
||||
$GLOBALS['Smarty'] -> assign('pagetitle',$object -> getDisplayName());
|
||||
}
|
||||
else {
|
||||
$object = &$GLOBALS['LSsession']-> LSuserObject;
|
||||
$object = LSsession :: getLSuserObject();
|
||||
$GLOBALS['Smarty'] -> assign('pagetitle',_('Mon compte'));
|
||||
}
|
||||
|
||||
|
@ -82,7 +80,7 @@ if($LSsession -> startLSsession()) {
|
|||
$LSrelations=array();
|
||||
$LSrelations_JSparams=array();
|
||||
foreach($object -> config['LSrelation'] as $relationName => $relationConf) {
|
||||
if ($GLOBALS['LSsession'] -> relationCanAccess($object -> getValue('dn'),$LSobject,$relationName)) {
|
||||
if (LSsession :: relationCanAccess($object -> getValue('dn'),$LSobject,$relationName)) {
|
||||
$return=array(
|
||||
'label' => $relationConf['label'],
|
||||
'LSobject' => $relationConf['LSobject']
|
||||
|
@ -105,7 +103,7 @@ if($LSsession -> startLSsession()) {
|
|||
'objectType' => $object -> getType(),
|
||||
'objectDn' => $object -> getDn(),
|
||||
);
|
||||
if ($GLOBALS['LSsession'] -> relationCanEdit($object -> getValue('dn'),$LSobject,$relationName)) {
|
||||
if (LSsession :: relationCanEdit($object -> getValue('dn'),$LSobject,$relationName)) {
|
||||
$return['actions'][] = array(
|
||||
'label' => _('Modifier'),
|
||||
'url' => 'select.php?LSobject='.$relationConf['LSobject'].'&multiple=1',
|
||||
|
@ -113,17 +111,17 @@ if($LSsession -> startLSsession()) {
|
|||
);
|
||||
}
|
||||
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSselect.js');
|
||||
$GLOBALS['LSsession'] -> addCssFile('LSselect.css');
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSsmoothbox.js');
|
||||
$GLOBALS['LSsession'] -> addCssFile('LSsmoothbox.css');
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSrelation.js');
|
||||
$GLOBALS['LSsession'] -> addCssFile('LSrelation.css');
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSconfirmBox.js');
|
||||
$GLOBALS['LSsession'] -> addCssFile('LSconfirmBox.css');
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSview.js');
|
||||
LSsession :: addJSscript('LSselect.js');
|
||||
LSsession :: addCssFile('LSselect.css');
|
||||
LSsession :: addJSscript('LSsmoothbox.js');
|
||||
LSsession :: addCssFile('LSsmoothbox.css');
|
||||
LSsession :: addJSscript('LSrelation.js');
|
||||
LSsession :: addCssFile('LSrelation.css');
|
||||
LSsession :: addJSscript('LSconfirmBox.js');
|
||||
LSsession :: addCssFile('LSconfirmBox.css');
|
||||
LSsession :: addJSscript('LSview.js');
|
||||
|
||||
if($GLOBALS['LSsession'] -> loadLSobject($relationConf['LSobject'])) {
|
||||
if(LSsession :: loadLSobject($relationConf['LSobject'])) {
|
||||
if (method_exists($relationConf['LSobject'],$relationConf['list_function'])) {
|
||||
$objRel = new $relationConf['LSobject']();
|
||||
$list = $objRel -> $relationConf['list_function']($object);
|
||||
|
@ -141,29 +139,29 @@ if($LSsession -> startLSsession()) {
|
|||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSrelations_01',$relationName);
|
||||
LSerror :: addErrorCode('LSrelations_01',$relationName);
|
||||
}
|
||||
$LSrelations[]=$return;
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSrelations_04',array('relation' => $relationName,'LSobject' => $relationConf['LSobject']));
|
||||
LSerror :: addErrorCode('LSrelations_04',array('relation' => $relationName,'LSobject' => $relationConf['LSobject']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSconfirmBox.js');
|
||||
$GLOBALS['LSsession'] -> addCssFile('LSconfirmBox.css');
|
||||
LSsession :: addJSscript('LSconfirmBox.js');
|
||||
LSsession :: addCssFile('LSconfirmBox.css');
|
||||
$GLOBALS['Smarty'] -> assign('LSrelations',$LSrelations);
|
||||
$GLOBALS['LSsession'] -> addJSconfigParam('LSrelations',$LSrelations_JSparams);
|
||||
LSsession :: addJSconfigParam('LSrelations',$LSrelations_JSparams);
|
||||
}
|
||||
|
||||
$GLOBALS['Smarty'] -> assign('LSview_actions',$LSview_actions);
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSsmoothbox.js');
|
||||
$GLOBALS['LSsession'] -> addCssFile('LSsmoothbox.css');
|
||||
$GLOBALS['LSsession'] -> setTemplate('view.tpl');
|
||||
LSsession :: addJSscript('LSsmoothbox.js');
|
||||
LSsession :: addCssFile('LSsmoothbox.css');
|
||||
LSsession :: setTemplate('view.tpl');
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_11');
|
||||
LSerror :: addErrorCode('LSsession_11');
|
||||
}
|
||||
}
|
||||
// Affichage d'une liste d'un type d'objet
|
||||
|
@ -180,10 +178,10 @@ if($LSsession -> startLSsession()) {
|
|||
$pattern = $_SESSION['LSsession']['LSsearch'][$LSobject]['pattern'];
|
||||
$recur = $_SESSION['LSsession']['LSsearch'][$LSobject]['recur'];
|
||||
if ($recur) {
|
||||
$topDn = $GLOBALS['LSsession'] -> topDn;
|
||||
$topDn = LSsession :: getTopDn();
|
||||
}
|
||||
else {
|
||||
$topDn = $object -> config['container_dn'].','.$GLOBALS['LSsession'] -> topDn;
|
||||
$topDn = $object -> config['container_dn'].','.LSsession :: getTopDn();
|
||||
}
|
||||
$approx = $_SESSION['LSsession']['LSsearch'][$LSobject]['approx'];
|
||||
$orderby = $_SESSION['LSsession']['LSsearch'][$LSobject]['orderby'];
|
||||
|
@ -192,7 +190,7 @@ if($LSsession -> startLSsession()) {
|
|||
}
|
||||
else {
|
||||
$filter = NULL;
|
||||
$topDn = $object -> config['container_dn'].','.$GLOBALS['LSsession'] -> topDn;
|
||||
$topDn = $object -> config['container_dn'].','.LSsession :: getTopDn();
|
||||
$params = array('scope' => 'one');
|
||||
$pattern = false;
|
||||
$recur = false;
|
||||
|
@ -200,8 +198,8 @@ if($LSsession -> startLSsession()) {
|
|||
$orderby = false;
|
||||
$_REQUEST['orderby']=$GLOBALS['LSobjects'][$LSobject]['orderby'];
|
||||
$ordersense = 'ASC';
|
||||
$subDnLdapServer = $GLOBALS['LSsession'] -> getSubDnLdapServer();
|
||||
$doSubDn = (($subDnLdapServer)&&(!$GLOBALS['LSsession']->isSubDnLSobject($LSobject)));
|
||||
$subDnLdapServer = LSsession :: getSubDnLdapServer();
|
||||
$doSubDn = (($subDnLdapServer)&&(!LSsession :: isSubDnLSobject($LSobject)));
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['LSview_search_submit'])) {
|
||||
|
@ -232,12 +230,12 @@ if($LSsession -> startLSsession()) {
|
|||
if (isset($_REQUEST['LSview_recur'])) {
|
||||
$recur = true;
|
||||
$params['scope'] = 'sub';
|
||||
$topDn = $GLOBALS['LSsession'] -> topDn;
|
||||
$topDn = LSsession :: getTopDn();
|
||||
}
|
||||
else {
|
||||
$recur = false;
|
||||
$params['scope'] = 'one';
|
||||
$topDn = $object -> config['container_dn'].','.$GLOBALS['LSsession'] -> topDn;
|
||||
$topDn = $object -> config['container_dn'].','.LSsession :: getTopDn();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -299,13 +297,13 @@ if($LSsession -> startLSsession()) {
|
|||
)
|
||||
);
|
||||
|
||||
if (($GLOBALS['LSsession'] -> cacheSearch()) && isset($_SESSION['LSsession']['LSsearch'][$hash]) && (!isset($_REQUEST['refresh']))) {
|
||||
if ((LSsession :: cacheSearch()) && isset($_SESSION['LSsession']['LSsearch'][$hash]) && (!isset($_REQUEST['refresh']))) {
|
||||
// On affiche à partir du cache
|
||||
$searchData=$_SESSION['LSsession']['LSsearch'][$hash];
|
||||
LSdebug('Recherche : From cache');
|
||||
if(!isset($searchData['LSview_actions']['create'])) {
|
||||
LSdebug('Recherche : Check Create()');
|
||||
if ($GLOBALS['LSsession'] -> canCreate($LSobject)) {
|
||||
if (LSsession :: canCreate($LSobject)) {
|
||||
$searchData['LSview_actions']['create'] = array (
|
||||
'label' => _('Nouveau'),
|
||||
'url' => 'create.php?LSobject='.$LSobject,
|
||||
|
@ -320,7 +318,7 @@ if($LSsession -> startLSsession()) {
|
|||
}
|
||||
else { // Load
|
||||
LSdebug('Recherche : Load');
|
||||
if ($GLOBALS['LSsession'] -> canCreate($LSobject)) {
|
||||
if (LSsession :: canCreate($LSobject)) {
|
||||
$LSview_actions['create'] = array (
|
||||
'label' => _('Nouveau'),
|
||||
'url' => 'create.php?LSobject='.$LSobject,
|
||||
|
@ -341,7 +339,7 @@ if($LSsession -> startLSsession()) {
|
|||
|
||||
$nbObjects=0;
|
||||
foreach($list as $objDn => $objName) {
|
||||
if ($GLOBALS['LSsession'] -> canAccess($LSobject,$objDn)) {
|
||||
if (LSsession :: canAccess($LSobject,$objDn)) {
|
||||
$subDn_name=false;
|
||||
if ($doSubDn) {
|
||||
$subDn_name = $object -> getSubDnName($objDn);
|
||||
|
@ -377,7 +375,7 @@ if($LSsession -> startLSsession()) {
|
|||
'action' => 'view'
|
||||
);
|
||||
|
||||
if ($GLOBALS['LSsession'] -> canEdit($LSobject,$searchData['objectList'][$i]['dn'])) {
|
||||
if (LSsession :: canEdit($LSobject,$searchData['objectList'][$i]['dn'])) {
|
||||
$actions[]=array(
|
||||
'label' => _('Modifier'),
|
||||
'url' => 'modify.php?LSobject='.$LSobject.'&dn='.$searchData['objectList'][$i]['dn'],
|
||||
|
@ -393,7 +391,7 @@ if($LSsession -> startLSsession()) {
|
|||
);
|
||||
}
|
||||
|
||||
if ($GLOBALS['LSsession'] -> canRemove($LSobject,$searchData['objectList'][$i]['dn'])) {
|
||||
if (LSsession :: canRemove($LSobject,$searchData['objectList'][$i]['dn'])) {
|
||||
$actions[] = array (
|
||||
'label' => _('Supprimer'),
|
||||
'url' => 'remove.php?LSobject='.$LSobject.'&dn='.$searchData['objectList'][$i]['dn'],
|
||||
|
@ -434,7 +432,7 @@ if($LSsession -> startLSsession()) {
|
|||
$GLOBALS['Smarty']->assign('LSobject_list_ordersense',$ordersense);
|
||||
|
||||
// Mise en cache
|
||||
if ($GLOBALS['LSsession'] -> cacheSearch()) {
|
||||
if (LSsession :: cacheSearch()) {
|
||||
$_SESSION['LSsession']['LSsearch'][$hash]=$searchData;
|
||||
}
|
||||
|
||||
|
@ -453,9 +451,9 @@ if($LSsession -> startLSsession()) {
|
|||
$GLOBALS['Smarty']->assign('LSobject_list_nbpage',$searchData['LSobject_list_nbpage']);
|
||||
} // Fin Pagination
|
||||
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSconfirmBox.js');
|
||||
$GLOBALS['LSsession'] -> addCssFile('LSconfirmBox.css');
|
||||
$GLOBALS['LSsession'] -> addJSscript('LSview.js');
|
||||
LSsession :: addJSscript('LSconfirmBox.js');
|
||||
LSsession :: addCssFile('LSconfirmBox.css');
|
||||
LSsession :: addJSscript('LSview.js');
|
||||
|
||||
$GLOBALS['Smarty']->assign('LSview_search',array(
|
||||
'action' => $_SERVER['PHP_SELF'],
|
||||
|
@ -472,22 +470,22 @@ if($LSsession -> startLSsession()) {
|
|||
$GLOBALS['Smarty']->assign('LSobject_list',$searchData['objectList']);
|
||||
$GLOBALS['Smarty']->assign('LSobject_list_objecttype',$LSobject);
|
||||
$GLOBALS['Smarty'] -> assign('LSview_actions',$searchData['LSview_actions']);
|
||||
$GLOBALS['LSsession'] -> setTemplate('viewList.tpl');
|
||||
LSsession :: setTemplate('viewList.tpl');
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_11');
|
||||
LSerror :: addErrorCode('LSsession_11');
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror::addErrorCode('LSsession_12');
|
||||
LSerror :: addErrorCode('LSsession_12');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$GLOBALS['LSsession'] -> setTemplate('login.tpl');
|
||||
LSsession :: setTemplate('login.tpl');
|
||||
}
|
||||
|
||||
// Affichage des retours d'erreurs
|
||||
$GLOBALS['LSsession'] -> displayTemplate();
|
||||
LSsession :: displayTemplate();
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue