mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 18:09:06 +01:00
3e823a2b22
-> view/select => change to use it (php+template+js) -> LSattr_html_select_object/LSattr_html_select_list => change to use it -> LSldapObject : -> change listObjectsName() / searchObject() / getSelectArray() / listObjects() -> comment search() function -> Add triggers to clean cache -> LSpeople : Update search config -> LSsession : Change function to use it : - getSubDnLdapServer() - loadLSprofiles() - LSrelation : Deplace error codes declaration from LSsession in class file - LSldapObject : -> change getObjectFilter() / getLabel() / getSubDnValue() / getSubDnName() for can call then staticaly -> Add afterModify() function and trigger -> Change getObjectFilter() / listObjectsInRelation() to use Net_LDAP2_Filter -> Add __get() function -> Move one LSerror code for LSrelation function from LSsession class file -> Add a global variable to save cached data ($cache) -> Change subDn and subDnName access methods - LSauth : Move LSsession auth procedure in a dedicated class -> LSsession : Change startLSsession() to use it - LSsession : -> Add getRootDn() function -> Fix getTopDn() to return root DN if no topDn is currently defined -> Create dedicated functions to support recoveryPassword mecanism : - recoverPasswd() - recoverPasswdSendMail() - recoverPasswdFirstStep() - recoverPasswdSecondStep -> Customize LSdebug return and display (php+js) -> Clean unused error codes -> Move LSrelation error codes -> Comment ajax method
173 lines
5.9 KiB
PHP
173 lines
5.9 KiB
PHP
<?php
|
|
/*******************************************************************************
|
|
* Copyright (C) 2007 Easter-eggs
|
|
* http://ldapsaisie.labs.libre-entreprise.org
|
|
*
|
|
* Author: See AUTHORS file in top-level directory.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License version 2
|
|
* as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
******************************************************************************/
|
|
|
|
require_once 'core.php';
|
|
|
|
if(LSsession :: startLSsession()) {
|
|
if (isset($_REQUEST['LSobject'])) {
|
|
$LSobject = $_REQUEST['LSobject'];
|
|
$dn = $_REQUEST['dn'];
|
|
|
|
if (LSsession :: in_menu($LSobject)) {
|
|
|
|
if ( $LSobject == 'SELF' ) {
|
|
$LSobject = LSsession :: getLSuserObject() -> getType();
|
|
$dn = LSsession :: getLSuserObjectDn();
|
|
}
|
|
|
|
if ( LSsession :: loadLSobject($LSobject) ) {
|
|
// Affichage d'un objet
|
|
if ( $dn!='' ) {
|
|
if (LSsession :: canAccess($LSobject,$dn)) {
|
|
if ( LSsession :: canEdit($LSobject,$dn) ) {
|
|
$LSview_actions[] = array(
|
|
'label' => _('Modify'),
|
|
'url' =>'modify.php?LSobject='.$LSobject.'&dn='.$dn,
|
|
'action' => 'modify'
|
|
);
|
|
}
|
|
|
|
if (LSsession :: canCreate($LSobject)) {
|
|
$LSview_actions[] = array(
|
|
'label' => _('Copy'),
|
|
'url' =>'create.php?LSobject='.$LSobject.'&load='.$dn,
|
|
'action' => 'copy'
|
|
);
|
|
}
|
|
|
|
if (LSsession :: canRemove($LSobject,$dn)) {
|
|
$LSview_actions[] = array(
|
|
'label' => _('Delete'),
|
|
'url' => 'remove.php?LSobject='.$LSobject.'&dn='.$dn,
|
|
'action' => 'delete'
|
|
);
|
|
}
|
|
|
|
if (LSsession :: getLSuserObjectDn() != $dn) {
|
|
$object = new $LSobject();
|
|
$object -> loadData($dn);
|
|
$GLOBALS['Smarty'] -> assign('pagetitle',$object -> getDisplayName());
|
|
}
|
|
else {
|
|
$object = LSsession :: getLSuserObject();
|
|
$GLOBALS['Smarty'] -> assign('pagetitle',_('My account'));
|
|
}
|
|
|
|
$view = $object -> getView();
|
|
$view -> displayView();
|
|
|
|
// LSrelations
|
|
if (LSsession :: loadLSclass('LSrelation')) {
|
|
LSrelation :: displayInLSview($object);
|
|
}
|
|
|
|
$GLOBALS['Smarty'] -> assign('LSview_actions',$LSview_actions);
|
|
LSsession :: setTemplate('view.tpl');
|
|
}
|
|
else {
|
|
LSerror :: addErrorCode('LSsession_11');
|
|
}
|
|
}
|
|
// Affichage d'une liste d'un type d'objet
|
|
elseif (LSsession :: loadLSclass('LSsearch')) {
|
|
$object = new $LSobject();
|
|
$GLOBALS['Smarty']->assign('pagetitle',$object -> getLabel());
|
|
|
|
$LSsearch = new LSsearch($LSobject,'LSview');
|
|
$LSsearch -> setParamsFormPostData();
|
|
|
|
$searchForm = array (
|
|
'action' => $_SERVER['PHP_SELF'],
|
|
'recursive' => (! LSsession :: isSubDnLSobject($LSobject) ),
|
|
'labels' => array (
|
|
'submit' => _('Search'),
|
|
'approx' => _('Approximative search'),
|
|
'recursive' => _('Recursive search')
|
|
),
|
|
'values' => array (
|
|
'pattern' => $LSsearch->getParam('pattern'),
|
|
'approx' => $LSsearch->getParam('approx'),
|
|
'recursive' => $LSsearch->getParam('recursive')
|
|
),
|
|
'names' => array (
|
|
'submit' => 'LSsearch_submit'
|
|
),
|
|
'hiddenFields' => $LSsearch -> getHiddenFieldForm()
|
|
);
|
|
$GLOBALS['Smarty']->assign('searchForm',$searchForm);
|
|
|
|
$LSview_actions=array();
|
|
if(LSsession :: canCreate($LSobject)) {
|
|
$LSview_actions['create'] = array (
|
|
'label' => 'New',
|
|
'url' => 'create.php?LSobject='.$LSobject,
|
|
'action' => 'create'
|
|
);
|
|
}
|
|
$LSview_actions['refresh'] = array (
|
|
'label' => 'Refresh',
|
|
'url' => 'view.php?LSobject='.$LSobject.'&refresh',
|
|
'action' => 'refresh'
|
|
);
|
|
/*$LSview_actions['purge'] = array (
|
|
'label' => 'Purge the cache',
|
|
'url' => 'view.php?LSobject='.$LSobject.'&LSsearchPurgeSession',
|
|
'action' => 'delete'
|
|
);*/
|
|
$GLOBALS['Smarty']->assign('LSview_actions',$LSview_actions);
|
|
|
|
$LSsearch -> run();
|
|
$page=(int)$_REQUEST['page'];
|
|
$page = $LSsearch -> getPage($page);
|
|
$GLOBALS['Smarty']->assign('page',$page);
|
|
$GLOBALS['Smarty']->assign('LSsearch',$LSsearch);
|
|
|
|
if (LSsession :: loadLSclass('LSform')) {
|
|
LSform :: loadDependenciesDisplayView();
|
|
}
|
|
|
|
LSsession :: setTemplate('viewSearch.tpl');
|
|
}
|
|
else {
|
|
LSsession :: addErrorCode('LSsession_05','LSsearch');
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
LSerror :: addErrorCode('LSsession_11');
|
|
}
|
|
}
|
|
else {
|
|
LSerror :: addErrorCode('LSsession_12');
|
|
}
|
|
}
|
|
else {
|
|
LSsession :: setTemplate('login.tpl');
|
|
}
|
|
// Affichage des retours d'erreurs
|
|
LSsession :: displayTemplate();
|
|
|
|
if (isset($LSsearch)) {
|
|
$LSsearch->afterUsingResult();
|
|
}
|
|
|
|
?>
|