mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 01:49:08 +01:00
LSaddon::posix: Add deleteHomeDirectoryByFTP function
This commit is contained in:
parent
5e8d625a34
commit
5998983315
1 changed files with 33 additions and 3 deletions
|
@ -24,16 +24,22 @@
|
|||
|
||||
// Support
|
||||
LSerror :: defineError('POSIX_SUPPORT_01',
|
||||
___("POSIX Support : The constant %{const} is not defined.")
|
||||
___("POSIX Support: The constant %{const} is not defined.")
|
||||
);
|
||||
|
||||
LSerror :: defineError('POSIX_SUPPORT_02',
|
||||
___("POSIX Support : Unable to load LSaddon::FTP.")
|
||||
___("POSIX support: Unable to load LSaddon::FTP.")
|
||||
);
|
||||
|
||||
// Autres erreurs
|
||||
LSerror :: defineError('POSIX_01',
|
||||
___("POSIX : The attribute %{dependency} is missing. Unable to forge the attribute %{attr}.")
|
||||
___("POSIX: The attribute %{dependency} is missing. Unable to forge the attribute %{attr}.")
|
||||
);
|
||||
LSerror :: defineError('POSIX_02',
|
||||
___("POSIX: Fail to create user home directory.")
|
||||
);
|
||||
LSerror :: defineError('POSIX_03',
|
||||
___("POSIX: Fail to delete user home directory.")
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -189,6 +195,30 @@ function createHomeDirectoryByFTP($ldapObject) {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete home directory by FTP
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*
|
||||
* @param LSldapObject $ldapObject L'objet ldap
|
||||
*
|
||||
* @return bool True on success, false otherwise
|
||||
*/
|
||||
function deleteHomeDirectoryByFTP($ldapObject) {
|
||||
$dir = getFData(LS_POSIX_HOMEDIRECTORY_FTP_PATH, $ldapObject, 'getValue');
|
||||
if (
|
||||
!removeDirsByFTP(
|
||||
LS_POSIX_HOMEDIRECTORY_FTP_HOST, LS_POSIX_HOMEDIRECTORY_FTP_PORT,
|
||||
LS_POSIX_HOMEDIRECTORY_FTP_USER, LS_POSIX_HOMEDIRECTORY_FTP_PWD,
|
||||
$dir
|
||||
)
|
||||
) {
|
||||
LSerror :: addErrorCode('POSIX_03');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate member attribute value from memberUid
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue