mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 18:09:06 +01:00
- LSaddons :: Samba :
-> Renomage de la méthode generate_sambaSID en generate_sambaUserSID -> Ajout de la méthode generate_sambaGroupSID
This commit is contained in:
parent
ca48658a32
commit
6529d0b3bf
1 changed files with 28 additions and 2 deletions
|
@ -121,7 +121,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* Generation de sambaSID
|
||||
* Generation de sambaSID d'un utilisateur
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*
|
||||
|
@ -132,7 +132,7 @@
|
|||
*
|
||||
* @retval string SambaSID ou false si il y a un problème durant la génération
|
||||
*/
|
||||
function generate_sambaSID($ldapObject) {
|
||||
function generate_sambaUserSID($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ LS_SAMBA_UIDNUMBER_ATTR ]) != 'LSattribute' ) {
|
||||
$GLOBALS['LSerror'] -> addErrorCode('SAMBA_01',array('dependency' => LS_SAMBA_UIDNUMBER_ATTR, 'attr' => 'sambaSID'));
|
||||
return;
|
||||
|
@ -145,6 +145,32 @@
|
|||
|
||||
return ($sambaSID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generation de sambaSID d'un groupe
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*
|
||||
* Number = LS_SAMBA_GIDNUMBER_ATTR * 2 + LS_SAMBA_SID_BASE_GROUP
|
||||
* sambaSID = LS_SAMBA_DOMAIN_SID-Number
|
||||
*
|
||||
* @param[in] $ldapObject L'objet ldap
|
||||
*
|
||||
* @retval string SambaSID ou false si il y a un problème durant la génération
|
||||
*/
|
||||
function generate_sambaGroupSID($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ LS_SAMBA_GIDNUMBER_ATTR ]) != 'LSattribute' ) {
|
||||
$GLOBALS['LSerror'] -> addErrorCode('SAMBA_01',array('dependency' => LS_SAMBA_GIDNUMBER_ATTR, 'attr' => 'sambaSID'));
|
||||
return;
|
||||
}
|
||||
|
||||
$gidnumber_attr_val = $ldapObject -> attrs[ LS_SAMBA_GIDNUMBER_ATTR ] -> getValue();
|
||||
$gidnumber_attr_val = $gidnumber_attr_val[0];
|
||||
$gidNumber = $gidnumber_attr_val * 2 + LS_SAMBA_SID_BASE_GROUP;
|
||||
$sambaSID = LS_SAMBA_DOMAIN_SID . '-' . $gidNumber;
|
||||
|
||||
return ($sambaSID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generation de sambaPrimaryGroupSID
|
||||
|
|
Loading…
Reference in a new issue