mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-18 14:33:49 +01:00
- LSldapObject :
-> Ajout d'une méthode getObjectKeyValueInRelation() et d'un paramètre 'getkeyvalue' pour LSrelation car jusqu'a présent le cas de renomage des objet en relation basé sur autre chose que le dn n'était pas géré - Rectification d'une erreur dans la css (LSform) du thème par défaut - LSsmoothobox : Rectification d'une erreur dans l'affichage de l'image de chargement - LSdefault : Rectification d'une erreur dans l'affichage des images de chargement
This commit is contained in:
parent
92701517d7
commit
0e84f7d284
6 changed files with 59 additions and 13 deletions
|
@ -50,6 +50,7 @@ $GLOBALS['LSobjects']['LSeepeople'] = array (
|
||||||
'emptyText' => _("N'appartient à aucun groupe."),
|
'emptyText' => _("N'appartient à aucun groupe."),
|
||||||
'LSobject' => 'LSeegroup',
|
'LSobject' => 'LSeegroup',
|
||||||
'list_function' => 'listUserGroups',
|
'list_function' => 'listUserGroups',
|
||||||
|
'getkeyvalue_function' => 'getMemberKeyValue',
|
||||||
'update_function' => 'updateUserGroups',
|
'update_function' => 'updateUserGroups',
|
||||||
'remove_function' => 'deleteOneMember',
|
'remove_function' => 'deleteOneMember',
|
||||||
'rename_function' => 'renameOneMember',
|
'rename_function' => 'renameOneMember',
|
||||||
|
|
|
@ -43,7 +43,7 @@ ul.LSform li {
|
||||||
* Champs du formulaire
|
* Champs du formulaire
|
||||||
*/
|
*/
|
||||||
.LSform input[type=text], .LSform input[type=file], .LSform input[type=submit], .LSform input[type=password], .LSform select, .LSform textarea {
|
.LSform input[type=text], .LSform input[type=file], .LSform input[type=submit], .LSform input[type=password], .LSform select, .LSform textarea {
|
||||||
border: 1px solid #84ff6a;
|
border: 1px solid #ccc;
|
||||||
width: 300px;
|
width: 300px;
|
||||||
background-color: #b5e4f6;
|
background-color: #b5e4f6;
|
||||||
}
|
}
|
||||||
|
|
|
@ -529,6 +529,7 @@ class LSldapObject {
|
||||||
if (!$GLOBALS['LSldap'] -> move($oldDn,$newDn)) {
|
if (!$GLOBALS['LSldap'] -> move($oldDn,$newDn)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$this -> dn = $newDn;
|
||||||
if (!$this -> afterRename($oldDn,$newDn)) {
|
if (!$this -> afterRename($oldDn,$newDn)) {
|
||||||
$GLOBALS['LSerror'] -> addErrorCode(37);
|
$GLOBALS['LSerror'] -> addErrorCode(37);
|
||||||
return;
|
return;
|
||||||
|
@ -1039,10 +1040,16 @@ class LSldapObject {
|
||||||
if ( isset($relation_conf['list_function']) ) {
|
if ( isset($relation_conf['list_function']) ) {
|
||||||
if ($GLOBALS['LSsession'] -> loadLSobject($relation_conf['LSobject'])) {
|
if ($GLOBALS['LSsession'] -> loadLSobject($relation_conf['LSobject'])) {
|
||||||
$obj = new $relation_conf['LSobject']();
|
$obj = new $relation_conf['LSobject']();
|
||||||
if (method_exists($obj,$relation_conf['list_function'])) {
|
if ((method_exists($obj,$relation_conf['list_function']))&&(method_exists($obj,$relation_conf['getkeyvalue_function']))) {
|
||||||
$list = $obj -> $relation_conf['list_function']($this);
|
$list = $obj -> $relation_conf['list_function']($this);
|
||||||
if (is_array($list)) {
|
if (is_array($list)) {
|
||||||
$this -> _relationsCache[$relation_name] = $list;
|
// Key Value
|
||||||
|
$key = $obj -> $relation_conf['getkeyvalue_function']($this);
|
||||||
|
|
||||||
|
$this -> _relationsCache[$relation_name] = array(
|
||||||
|
'list' => $list,
|
||||||
|
'keyvalue' => $key
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return;
|
return;
|
||||||
|
@ -1092,12 +1099,12 @@ class LSldapObject {
|
||||||
$GLOBALS['LSsession'] -> changeAuthUser($this);
|
$GLOBALS['LSsession'] -> changeAuthUser($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($this -> _relationsCache as $relation_name => $objList) {
|
foreach($this -> _relationsCache as $relation_name => $objInfos) {
|
||||||
if (isset($this->config['relations'][$relation_name]['rename_function'])) {
|
if ((isset($this->config['relations'][$relation_name]['rename_function']))&&(is_array($objInfos['list']))) {
|
||||||
foreach($objList as $obj) {
|
foreach($objInfos['list'] as $obj) {
|
||||||
$meth = $this->config['relations'][$relation_name]['rename_function'];
|
$meth = $this->config['relations'][$relation_name]['rename_function'];
|
||||||
if (method_exists($obj,$meth)) {
|
if (method_exists($obj,$meth)) {
|
||||||
if (!($obj -> $meth($this,$oldDn))) {
|
if (!($obj -> $meth($this,$objInfos['keyvalue']))) {
|
||||||
$error=1;
|
$error=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1134,9 +1141,9 @@ class LSldapObject {
|
||||||
*/
|
*/
|
||||||
function afterDelete() {
|
function afterDelete() {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
foreach($this -> _relationsCache as $relation_name => $objList) {
|
foreach($this -> _relationsCache as $relation_name => $objInfos) {
|
||||||
if (isset($this->config['relations'][$relation_name]['remove_function'])) {
|
if ((isset($this->config['relations'][$relation_name]['remove_function']))&&(is_array($objInfos['list']))) {
|
||||||
foreach($objList as $obj) {
|
foreach($objInfos['list'] as $obj) {
|
||||||
$meth = $this->config['relations'][$relation_name]['remove_function'];
|
$meth = $this->config['relations'][$relation_name]['remove_function'];
|
||||||
if (method_exists($obj,$meth)) {
|
if (method_exists($obj,$meth)) {
|
||||||
if (!($obj -> $meth($this))) {
|
if (!($obj -> $meth($this))) {
|
||||||
|
@ -1236,6 +1243,33 @@ class LSldapObject {
|
||||||
return !$error;
|
return !$error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retourne la valeur clef d'un objet en relation
|
||||||
|
*
|
||||||
|
* @param[in] $object Un object de type $objectType
|
||||||
|
* @param[in] $attr L'attribut dans lequel l'objet doit apparaitre
|
||||||
|
* @param[in] $objectType Le type d'objet en relation
|
||||||
|
* @param[in] $value La valeur que doit avoir l'attribut :
|
||||||
|
* - soit le dn (par defaut)
|
||||||
|
* - soit la valeur [0] d'un attribut
|
||||||
|
*
|
||||||
|
* @retval Mixed La valeur clef d'un objet en relation
|
||||||
|
**/
|
||||||
|
function getObjectKeyValueInRelation($object,$attr,$objectType,$attrValue='dn') {
|
||||||
|
if ((!$attr)||(!$objectType)) {
|
||||||
|
$GLOBALS['LSerror'] -> addErrorCode(1021,'getObjectKeyValueInRelation');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ($attrValue=='dn') {
|
||||||
|
$val = $object -> getDn();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$val = $object -> getValue($attrValue);
|
||||||
|
$val = $val[0];
|
||||||
|
}
|
||||||
|
return $val;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retourne la liste des relations pour l'objet en fonction de sa présence
|
* Retourne la liste des relations pour l'objet en fonction de sa présence
|
||||||
* dans un des attributs
|
* dans un des attributs
|
||||||
|
|
|
@ -48,6 +48,17 @@ class LSeegroup extends LSldapObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========== Members ========== */
|
/* ========== Members ========== */
|
||||||
|
/**
|
||||||
|
* Retourne la valeur clef d'un membre
|
||||||
|
*
|
||||||
|
* @param[in] $object Un object utilisateur
|
||||||
|
*
|
||||||
|
* @retval Mixed La valeur clef d'un membre
|
||||||
|
**/
|
||||||
|
function getMemberKeyValue($object) {
|
||||||
|
return $this -> getObjectKeyValueInRelation($object,$this -> memberAttr,$this -> userObjectType);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retourne la liste des groupes pour utilisateur
|
* Retourne la liste des groupes pour utilisateur
|
||||||
*
|
*
|
||||||
|
|
|
@ -119,10 +119,10 @@ var LSdefault = new Class({
|
||||||
this.loading_img_id++;
|
this.loading_img_id++;
|
||||||
this.loading_img[this.loading_img_id] = new Element('img');
|
this.loading_img[this.loading_img_id] = new Element('img');
|
||||||
if (size=='big') {
|
if (size=='big') {
|
||||||
var src = 'templates/images/loading.gif';
|
var src = this.imagePath('loading.gif');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var src = 'templates/images/ajax-loader.gif';
|
var src = this.imagePath('ajax-loader.gif');
|
||||||
}
|
}
|
||||||
this.loading_img[this.loading_img_id].src=src;
|
this.loading_img[this.loading_img_id].src=src;
|
||||||
if (position=='inside') {
|
if (position=='inside') {
|
||||||
|
|
|
@ -288,7 +288,7 @@ var LSsmoothbox = new Class({
|
||||||
load: function() {
|
load: function() {
|
||||||
this.frame.empty();
|
this.frame.empty();
|
||||||
this.loadingImage = new Element('img');
|
this.loadingImage = new Element('img');
|
||||||
this.loadingImage.setProperty('src','templates/images/loading.gif');
|
this.loadingImage.setProperty('src',varLSdefault.imagePath('loading.gif'));
|
||||||
this.loadingImage.setProperty('id','loadingImage-LSsmoothbox');
|
this.loadingImage.setProperty('id','loadingImage-LSsmoothbox');
|
||||||
this.openOptions.width = 120;
|
this.openOptions.width = 120;
|
||||||
this.openOptions.height = 120;
|
this.openOptions.height = 120;
|
||||||
|
|
Loading…
Reference in a new issue