mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 18:09: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,7 +82,7 @@ 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 {
|
||||
|
@ -101,8 +99,8 @@ if($LSsession -> startLSsession()) {
|
|||
|
||||
}
|
||||
else {
|
||||
$GLOBALS['LSsession'] -> setTemplate('login.tpl');
|
||||
LSsession :: setTemplate('login.tpl');
|
||||
}
|
||||
$GLOBALS['LSsession'] -> displayTemplate();
|
||||
LSsession :: displayTemplate();
|
||||
|
||||
?>
|
||||
|
|
|
@ -76,8 +76,8 @@ $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;
|
||||
|
||||
|
@ -90,7 +90,4 @@ $GLOBALS['LSerror_code']['MAIL_01']= array (
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
|
|
@ -56,7 +56,7 @@ $retval=true;
|
|||
|
||||
// Dependance de librairie
|
||||
if (!function_exists('createDirsByFTP')) {
|
||||
if(!$GLOBALS['LSsession'] -> loadLSaddon('ftp')) {
|
||||
if(!LSsession :: loadLSaddon('ftp')) {
|
||||
LSerror :: addErrorCode('MAILDIR_SUPPORT_01');
|
||||
$retval=false;
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ $GLOBALS['LSerror_code']['POSIX_01']= array (
|
|||
|
||||
// Dependance de librairie
|
||||
if (!function_exists('createDirsByFTP')) {
|
||||
if(!$GLOBALS['LSsession'] -> loadLSaddon('ftp')) {
|
||||
if(!LSsession :: loadLSaddon('ftp')) {
|
||||
LSerror :: addErrorCode('POSIX_SUPPORT_02');
|
||||
$retval=false;
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ class LSattr_html_select_list extends LSattr_html{
|
|||
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']();
|
||||
|
|
|
@ -85,7 +85,7 @@ class LSattr_html_select_object extends LSattr_html{
|
|||
return;
|
||||
}
|
||||
|
||||
if (!$GLOBALS['LSsession'] -> loadLSobject($conf['object_type'])) {
|
||||
if (!LSsession :: loadLSobject($conf['object_type'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ class LSattr_html_select_object extends LSattr_html{
|
|||
return;
|
||||
}
|
||||
|
||||
if (!$GLOBALS['LSsession'] -> loadLSobject($conf['object_type'])) {
|
||||
if (!LSsession :: loadLSobject($conf['object_type'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -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,8 +66,8 @@ 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);
|
||||
|
|
|
@ -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()
|
||||
|
@ -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']);
|
||||
|
@ -364,7 +364,7 @@ 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));
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
$GLOBALS['LSsession'] -> loadLSclass('LSattribute');
|
||||
LSsession :: loadLSclass('LSattribute');
|
||||
|
||||
/**
|
||||
* Base d'un objet ldap
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -997,10 +997,11 @@ 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']);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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)) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -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() ) {
|
||||
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);
|
||||
|
@ -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']();
|
||||
|
@ -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);
|
||||
|
@ -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é.")
|
||||
|
@ -401,6 +403,6 @@ if (!isset($_ERRORS)) {
|
|||
}
|
||||
}
|
||||
|
||||
$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,12 +103,12 @@ 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 {
|
||||
|
@ -128,8 +126,8 @@ if($LSsession -> startLSsession()) {
|
|||
|
||||
}
|
||||
else {
|
||||
$GLOBALS['LSsession'] -> setTemplate('login.tpl');
|
||||
$GLOBALS['LSsession'] -> displayTemplate();
|
||||
LSsession :: setTemplate('login.tpl');
|
||||
LSsession :: displayTemplate();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -22,22 +22,20 @@
|
|||
|
||||
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);
|
||||
|
@ -50,7 +48,7 @@ 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');
|
||||
|
@ -70,9 +68,9 @@ if($LSsession -> startLSsession()) {
|
|||
|
||||
}
|
||||
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,12 +313,12 @@ 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 {
|
||||
|
@ -328,9 +326,9 @@ if($LSsession -> startLSsession()) {
|
|||
}
|
||||
}
|
||||
else {
|
||||
$GLOBALS['LSsession'] -> setTemplate('login.tpl');
|
||||
LSsession :: setTemplate('login.tpl');
|
||||
}
|
||||
|
||||
// Affichage des retours d'erreurs
|
||||
$GLOBALS['LSsession'] -> displayTemplate();
|
||||
LSsession :: displayTemplate();
|
||||
?>
|
||||
|
|
100
trunk/view.php
100
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);
|
||||
|
@ -151,16 +149,16 @@ if($LSsession -> startLSsession()) {
|
|||
}
|
||||
}
|
||||
|
||||
$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');
|
||||
|
@ -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,7 +470,7 @@ 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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -485,9 +483,9 @@ if($LSsession -> startLSsession()) {
|
|||
}
|
||||
}
|
||||
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