mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 09:59:06 +01:00
LSaddons: Code cleaning
This commit is contained in:
parent
425df3da3a
commit
0eb0143921
8 changed files with 1093 additions and 1078 deletions
|
@ -39,14 +39,14 @@ LSerror :: defineError('ASTERISK_04',
|
|||
___("Asterisk: The LDAP attribute type of the attribute %{attr} is incorrect: its must be password.")
|
||||
);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Check support of Asterisk by LdapSaisie
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*
|
||||
* @return boolean true if Asterisk is totally supported, false in other case
|
||||
*/
|
||||
function LSaddon_asterisk_support() {
|
||||
function LSaddon_asterisk_support() {
|
||||
$retval=true;
|
||||
|
||||
$MUST_DEFINE_CONST= array(
|
||||
|
@ -62,11 +62,11 @@ LSerror :: defineError('ASTERISK_04',
|
|||
}
|
||||
|
||||
return $retval;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Make asterisk password hash
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
|
@ -80,7 +80,7 @@ LSerror :: defineError('ASTERISK_04',
|
|||
*
|
||||
* @return string|false The hashed password, or false
|
||||
*/
|
||||
function hashAsteriskPassword($ldapObject,$clearPassword) {
|
||||
function hashAsteriskPassword($ldapObject,$clearPassword) {
|
||||
if (!is_a($ldapObject,'LSldapObject')) {
|
||||
LSerror :: addErrorCode('ASTERISK_01',array('function' => 'hashAsteriskPassword', 'objectName' => 'LSldapObject'));
|
||||
return false;
|
||||
|
@ -90,9 +90,9 @@ LSerror :: defineError('ASTERISK_04',
|
|||
}
|
||||
$ldapObject -> registerOtherValue('clearPassword',$clearPassword);
|
||||
return md5($ldapObject->getFData(LS_ASTERISK_HASH_PWD_FORMAT));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Generate asterisk MD5 hashed password
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
|
@ -101,7 +101,7 @@ LSerror :: defineError('ASTERISK_04',
|
|||
*
|
||||
* @return string|false asterisk MD5 hashed password or False
|
||||
*/
|
||||
function generate_asteriskMD5HashedPassword($ldapObject) {
|
||||
function generate_asteriskMD5HashedPassword($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ LS_ASTERISK_USERPASSWORD_ATTR ]) != 'LSattribute' ) {
|
||||
LSerror :: addErrorCode('ASTERISK_02',array(LS_ASTERISK_USERPASSWORD_ATTR));
|
||||
return false;
|
||||
|
@ -123,4 +123,4 @@ LSerror :: defineError('ASTERISK_04',
|
|||
return false;
|
||||
}
|
||||
return hashAsteriskPassword($ldapObject,(string)$password);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,14 +45,14 @@ LSerror :: defineError('LS_EXPORTSEARCHRESULTASCSV_03',
|
|||
);
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Check support of exportSearchResultAsCSV
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*
|
||||
* @return boolean true if exportSearchResultAsCSV is fully supported, false in other case
|
||||
*/
|
||||
function LSaddon_exportSearchResultAsCSV_support() {
|
||||
function LSaddon_exportSearchResultAsCSV_support() {
|
||||
$retval=true;
|
||||
|
||||
// Check fputcsv function
|
||||
|
@ -74,9 +74,9 @@ LSerror :: defineError('LS_EXPORTSEARCHRESULTASCSV_03',
|
|||
}
|
||||
|
||||
return $retval;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Write LSsearch result as CSV and force download of it.
|
||||
*
|
||||
* @param LSsearch $LSsearch The LSsearch object
|
||||
|
@ -85,7 +85,7 @@ LSerror :: defineError('LS_EXPORTSEARCHRESULTASCSV_03',
|
|||
*
|
||||
* @return boolean Void if CSV file is successfully generated and upload, false in other case
|
||||
*/
|
||||
function exportSearchResultAsCSV($LSsearch) {
|
||||
function exportSearchResultAsCSV($LSsearch) {
|
||||
$csv = fopen('php://temp/maxmemory:'. (5*1024*1024), 'r+');
|
||||
|
||||
if ($csv === false) {
|
||||
|
@ -134,9 +134,9 @@ LSerror :: defineError('LS_EXPORTSEARCHRESULTASCSV_03',
|
|||
print stream_get_contents($csv);
|
||||
@fclose($csv);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Write CSV row in file
|
||||
*
|
||||
* @param resource &$csv The CSV file description reference
|
||||
|
@ -146,9 +146,9 @@ LSerror :: defineError('LS_EXPORTSEARCHRESULTASCSV_03',
|
|||
*
|
||||
* @return boolean True if CSV row is successfully writed, false in other case
|
||||
*/
|
||||
function writeRowInCSV(&$csv, &$row) {
|
||||
function writeRowInCSV(&$csv, &$row) {
|
||||
if (!defined('PHP_VERSION_ID') or PHP_VERSION_ID < 50504) {
|
||||
return (fputcsv($csv, $row, LS_EXPORTSEARCHRESULTASCSV_DELIMITER, LS_EXPORTSEARCHRESULTASCSV_ENCLOSURE) !== false);
|
||||
}
|
||||
return (fputcsv($csv, $row, LS_EXPORTSEARCHRESULTASCSV_DELIMITER, LS_EXPORTSEARCHRESULTASCSV_ENCLOSURE, LS_EXPORTSEARCHRESULTASCSV_ESCAPE_CHAR) !== false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,165 +53,170 @@ LSerror :: defineError('FTP_05',
|
|||
___("FTP Support : Unable to rename folder from %{old} to %{new} on the remote server.")
|
||||
);
|
||||
|
||||
/**
|
||||
* Verification du support FTP par ldapSaisie
|
||||
/**
|
||||
* Check support of FTP addon
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*
|
||||
* @return boolean true si FTP est pleinement supporté, false sinon
|
||||
* @return boolean true if FTP addon is fully supported, false in other case
|
||||
*/
|
||||
function LSaddon_ftp_support() {
|
||||
$retval=true;
|
||||
function LSaddon_ftp_support() {
|
||||
$retval = true;
|
||||
|
||||
// Dependance de librairie
|
||||
// Net_FTP lib dependency
|
||||
if (!class_exists('Net_FTP')) {
|
||||
if (!defined('NET_FTP')) {
|
||||
LSerror :: addErrorCode('FTP_SUPPORT_02','NET_FTP');
|
||||
$retval=false;
|
||||
LSerror :: addErrorCode('FTP_SUPPORT_02', 'NET_FTP');
|
||||
$retval = false;
|
||||
} else if(!LSsession::includeFile(NET_FTP, true)) {
|
||||
LSerror :: addErrorCode('FTP_SUPPORT_01');
|
||||
$retval=false;
|
||||
$retval = false;
|
||||
}
|
||||
}
|
||||
|
||||
return $retval;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Connexion a un serveur FTP
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*
|
||||
* @param string $host Le nom ou l'IP du serveur FTP
|
||||
* @param string $port Le port de connexion au serveur ftp
|
||||
* @param string $user Le nom d'utilidateur de connexion
|
||||
* @param string $pwd Le mot de passe de connexion
|
||||
*
|
||||
* @return Net_FTP|false Net_FTP object en cas de succès, false sinon
|
||||
*/
|
||||
function connectToFTP($host,$port,$user,$pwd) {
|
||||
/**
|
||||
* Connect to FTP server
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*
|
||||
* @param string $host FTP server FQDN or IP address
|
||||
* @param string $port The TCP port of the FTP server
|
||||
* @param string $user The username
|
||||
* @param string $pwd The password
|
||||
*
|
||||
* @return Net_FTP|false Net_FTP object in case of success, false otherwise
|
||||
*/
|
||||
function connectToFTP($host, $port, $user, $pwd) {
|
||||
$cnx = new Net_FTP();
|
||||
$do = $cnx -> connect($host,$port);
|
||||
if (! $do instanceof PEAR_Error){
|
||||
$do = $cnx -> login($user,$pwd);
|
||||
if (! $do instanceof PEAR_Error) {
|
||||
$do = $cnx -> connect($host, $port);
|
||||
if (!$do instanceof PEAR_Error){
|
||||
$do = $cnx -> login($user, $pwd);
|
||||
if (!$do instanceof PEAR_Error) {
|
||||
return $cnx;
|
||||
}
|
||||
else {
|
||||
LSerror :: addErrorCode('FTP_01',"2");
|
||||
LSerror :: addErrorCode('FTP_00',$do -> getMessage());
|
||||
LSerror :: addErrorCode('FTP_01', "2");
|
||||
LSerror :: addErrorCode('FTP_00', $do -> getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
LSerror :: addErrorCode('FTP_01',"1");
|
||||
LSerror :: addErrorCode('FTP_00',$do -> getMessage());
|
||||
LSerror :: addErrorCode('FTP_01', "1");
|
||||
LSerror :: addErrorCode('FTP_00', $do -> getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creation d'un ou plusieurs dossiers via FTP
|
||||
/**
|
||||
* Creation d'un ou plusieurs dossiers via FTP
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*
|
||||
* @param string $host Le nom ou l'IP du serveur FTP
|
||||
* @param string $port Le port de connexion au serveur ftp
|
||||
* @param string $user Le nom d'utilidateur de connexion
|
||||
* @param string $pwd Le mot de passe de connexion
|
||||
* @param array $dirs ou string Le(s) dossier(s) à ajouter
|
||||
*
|
||||
* @return bool True ou false si il y a un problème durant la création du/des dossier(s)
|
||||
|
||||
* Create one or more directories throught FTP
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*
|
||||
* @param string $host Le nom ou l'IP du serveur FTP
|
||||
* @param string $port Le port de connexion au serveur ftp
|
||||
* @param string $user Le nom d'utilidateur de connexion
|
||||
* @param string $pwd Le mot de passe de connexion
|
||||
* @param array $dirs ou string Le(s) dossier(s) à ajouter
|
||||
* @param string $host FTP server FQDN or IP address
|
||||
* @param string $port The TCP port of the FTP server
|
||||
* @param string $user The username
|
||||
* @param string $pwd The password
|
||||
* @param array|string $dirs The directory/ies to add
|
||||
* @param int $chmod The directory/ies mode as an octal number (do not forget leading zero,
|
||||
* example: 0755 or 02755, default : default umask on the SSH server)
|
||||
*
|
||||
* @return bool True ou false si il y a un problème durant la création du/des dossier(s)
|
||||
* @return boolean
|
||||
*/
|
||||
function createDirsByFTP($host,$port,$user,$pwd,$dirs,$chmod=NULL) {
|
||||
$cnx = connectToFTP($host,$port,$user,$pwd);
|
||||
function createDirsByFTP($host, $port, $user, $pwd, $dirs, $chmod=NULL) {
|
||||
$cnx = connectToFTP($host, $port, $user, $pwd);
|
||||
if (!$cnx) return false;
|
||||
if (!is_array($dirs)) {
|
||||
$dirs = array($dirs);
|
||||
}
|
||||
foreach($dirs as $dir) {
|
||||
$do = $cnx -> mkdir($dir,true);
|
||||
foreach(ensureIsArray($dirs) as $dir) {
|
||||
$do = $cnx -> mkdir($dir, true);
|
||||
if ($do instanceof PEAR_Error) {
|
||||
LSerror :: addErrorCode('FTP_02',$dir);
|
||||
LSerror :: addErrorCode('FTP_00',$do -> getMessage());
|
||||
LSerror :: addErrorCode('FTP_02', $dir);
|
||||
LSerror :: addErrorCode('FTP_00', $do -> getMessage());
|
||||
return false;
|
||||
}
|
||||
if ($chmod) {
|
||||
$do = $cnx -> chmod($dir,$chmod);
|
||||
$do = $cnx -> chmod($dir, $chmod);
|
||||
if ($do instanceof PEAR_Error) {
|
||||
LSerror :: addErrorCode('FTP_04',$dir);
|
||||
LSerror :: addErrorCode('FTP_00',$do -> getMessage());
|
||||
LSerror :: addErrorCode('FTP_04', $dir);
|
||||
LSerror :: addErrorCode('FTP_00', $do -> getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Suppression d'un ou plusieurs dossiers via FTP
|
||||
/**
|
||||
* Delete one or more directories throught FTP
|
||||
*
|
||||
* Note : Attention : suppression récursive. Cela veut dire que les sous-dossiers
|
||||
* lister par un LS FTP seront supprimé d'abord. Attention : Si votre serveur
|
||||
* FTP est configuré pour caché certains fichiers ou dossiers (dont le nom
|
||||
* commence par un '.' par exempl), ces fichiers ne seront pas supprimés et la
|
||||
* suppression du dossier parent échoura.
|
||||
*
|
||||
* Pour VsFTPd : Ajouter force_dot_files=1 dans la configuration.
|
||||
* Caution : recursive deletion ! The content of the directory will be listed and deleted before the
|
||||
* directory. If your FTP server is configured to mask some files or directories (for instance,
|
||||
* starting by '.'), they will not be listed and deleted and this may cause the deletion to fail.
|
||||
* With VsFTPd, you have to add force_dot_files=1 in configuration.
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*
|
||||
* @param string $host Le nom ou l'IP du serveur FTP
|
||||
* @param string $port Le port de connexion au serveur ftp
|
||||
* @param string $user Le nom d'utilidateur de connexion
|
||||
* @param string $pwd Le mot de passe de connexion
|
||||
* @param array $dirs ou string Le(s) dossier(s) à supprimer
|
||||
* @param string $host FTP server FQDN or IP address
|
||||
* @param string $port The TCP port of the FTP server
|
||||
* @param string $user The username
|
||||
* @param string $pwd The password
|
||||
* @param array|string $dirs The directory/ies to remove
|
||||
*
|
||||
* @return bool True ou false si il y a un problème durant la suppression du/des dossier(s)
|
||||
* @return boolean
|
||||
*/
|
||||
function removeDirsByFTP($host,$port,$user,$pwd,$dirs) {
|
||||
$cnx = connectToFTP($host,$port,$user,$pwd);
|
||||
function removeDirsByFTP($host, $port, $user, $pwd, $dirs) {
|
||||
$cnx = connectToFTP($host, $port, $user, $pwd);
|
||||
if (!$cnx) return false;
|
||||
if (!is_array($dirs)) {
|
||||
$dirs = array($dirs);
|
||||
}
|
||||
foreach($dirs as $dir) {
|
||||
if ($dir[strlen($dir)-1]!='/') {
|
||||
$dir.='/';
|
||||
foreach(ensureIsArray($dirs) as $dir) {
|
||||
if ($dir[strlen($dir)-1] != '/') {
|
||||
$dir .= '/';
|
||||
}
|
||||
$do = $cnx -> rm($dir,true);
|
||||
if ($do instanceof PEAR_Error) {
|
||||
LSerror :: addErrorCode('FTP_03',$dir);
|
||||
LSerror :: addErrorCode('FTP_00',$do -> getMessage());
|
||||
LSerror :: addErrorCode('FTP_03', $dir);
|
||||
LSerror :: addErrorCode('FTP_00', $do -> getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Renomage d'un dossier via FTP
|
||||
/**
|
||||
* Rename a directory throught FTP
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*
|
||||
* @param string $host Le nom ou l'IP du serveur FTP
|
||||
* @param string $port Le port de connexion au serveur ftp
|
||||
* @param string $user Le nom d'utilidateur de connexion
|
||||
* @param string $pwd Le mot de passe de connexion
|
||||
* @param string $old Le dossier à renomer
|
||||
* @param string $new Le nouveau nom du dossier à renomer
|
||||
* @param string $host FTP server FQDN or IP address
|
||||
* @param string $port The TCP port of the FTP server
|
||||
* @param string $user The username
|
||||
* @param string $pwd The password
|
||||
* @param string $old The actual directory path to rename
|
||||
* @param string $new The new directory path
|
||||
*
|
||||
* @return bool True ou false si il y a un problème durant le renomage du/des dossier(s)
|
||||
* @return boolean
|
||||
*/
|
||||
function renameDirByFTP($host,$port,$user,$pwd,$old,$new) {
|
||||
$cnx = connectToFTP($host,$port,$user,$pwd);
|
||||
function renameDirByFTP($host, $port, $user, $pwd, $old, $new) {
|
||||
$cnx = connectToFTP($host, $port, $user, $pwd);
|
||||
if (!$cnx) return false;
|
||||
$do = $cnx -> rename($old,$new);
|
||||
$do = $cnx -> rename($old, $new);
|
||||
if ($do instanceof PEAR_Error) {
|
||||
LSerror :: addErrorCode('FTP_05',array('old' => $old,'new' => $new));
|
||||
LSerror :: addErrorCode('FTP_00',$do -> getMessage());
|
||||
LSerror :: addErrorCode('FTP_05', array('old' => $old, 'new' => $new));
|
||||
LSerror :: addErrorCode('FTP_00', $do -> getMessage());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,14 +39,14 @@ LSerror :: defineError('MAIL_01',
|
|||
___("MAIL : Error sending your email")
|
||||
);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Check support of this LSaddon
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*
|
||||
* @return boolean true if this LSaddon is fully supported, false otherwise
|
||||
*/
|
||||
function LSaddon_mail_support() {
|
||||
function LSaddon_mail_support() {
|
||||
$retval=true;
|
||||
|
||||
// Lib dependencies (check/load)
|
||||
|
@ -80,9 +80,9 @@ LSerror :: defineError('MAIL_01',
|
|||
);
|
||||
|
||||
return $retval;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Send an email
|
||||
*
|
||||
* @param string|array<string> $to Email recipient(s)
|
||||
|
@ -99,7 +99,7 @@ LSerror :: defineError('MAIL_01',
|
|||
*
|
||||
* @return boolean true si MAIL est pleinement supporté, false sinon
|
||||
*/
|
||||
function sendMail($to, $subject, $msg, $headers=null, $attachments=null,
|
||||
function sendMail($to, $subject, $msg, $headers=null, $attachments=null,
|
||||
$eol=null, $encoding=null, $html=false) {
|
||||
global $MAIL_SEND_PARAMS, $MAIL_HEARDERS, $MAIL_CATCH_ALL;
|
||||
$mail_obj = Mail::factory(MAIL_SEND_METHOD, (isset($MAIL_SEND_PARAMS)?$MAIL_SEND_PARAMS:null));
|
||||
|
@ -203,7 +203,7 @@ LSerror :: defineError('MAIL_01',
|
|||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (php_sapi_name() != 'cli')
|
||||
|
|
|
@ -44,25 +44,25 @@ LSerror :: defineError('MAILDIR_04',
|
|||
___("MAILDIR : Error retrieving remote path of the maildir.")
|
||||
);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Verification du support Maildir par ldapSaisie
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*
|
||||
* @return boolean true si Maildir est pleinement supporté, false sinon
|
||||
*/
|
||||
function LSaddon_maildir_support() {
|
||||
$retval=true;
|
||||
function LSaddon_maildir_support() {
|
||||
$retval = true;
|
||||
|
||||
// Dependance de librairie
|
||||
if (!function_exists('createDirsByFTP')) {
|
||||
if(!LSsession :: loadLSaddon('ftp')) {
|
||||
LSerror :: addErrorCode('MAILDIR_SUPPORT_01');
|
||||
$retval=false;
|
||||
$retval = false;
|
||||
}
|
||||
}
|
||||
|
||||
$MUST_DEFINE_CONST= array(
|
||||
$MUST_DEFINE_CONST = array(
|
||||
'LS_MAILDIR_FTP_HOST',
|
||||
'LS_MAILDIR_FTP_USER',
|
||||
'LS_MAILDIR_FTP_MAILDIR_PATH',
|
||||
|
@ -71,14 +71,14 @@ LSerror :: defineError('MAILDIR_04',
|
|||
|
||||
foreach($MUST_DEFINE_CONST as $const) {
|
||||
if ( (!defined($const)) || (constant($const) == "")) {
|
||||
LSerror :: addErrorCode('MAILDIR_SUPPORT_02',$const);
|
||||
$retval=false;
|
||||
LSerror :: addErrorCode('MAILDIR_SUPPORT_02', $const);
|
||||
$retval = false;
|
||||
}
|
||||
}
|
||||
return $retval;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Creation d'une Maildir via FTP
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
|
@ -89,26 +89,31 @@ LSerror :: defineError('MAILDIR_04',
|
|||
*
|
||||
* @return bool True ou false si il y a un problème durant la création de la Maildir
|
||||
*/
|
||||
function createMaildirByFTP($ldapObject,$dir=null) {
|
||||
function createMaildirByFTP($ldapObject,$dir=null) {
|
||||
if (!$dir) {
|
||||
$dir = getMaildirPath($ldapObject);
|
||||
if (!$dir) {
|
||||
if (!$dir)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$dirs = array(
|
||||
$dir.'/cur',
|
||||
$dir.'/new',
|
||||
$dir.'/tmp'
|
||||
);
|
||||
if (!createDirsByFTP(LS_MAILDIR_FTP_HOST,LS_MAILDIR_FTP_PORT,LS_MAILDIR_FTP_USER,LS_MAILDIR_FTP_PWD,$dirs,LS_MAILDIR_FTP_MAILDIR_CHMOD)) {
|
||||
if (
|
||||
!createDirsByFTP(
|
||||
LS_MAILDIR_FTP_HOST, LS_MAILDIR_FTP_PORT,
|
||||
LS_MAILDIR_FTP_USER, LS_MAILDIR_FTP_PWD,
|
||||
$dirs, LS_MAILDIR_FTP_MAILDIR_CHMOD
|
||||
)
|
||||
) {
|
||||
LSerror :: addErrorCode('MAILDIR_01');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Suppression d'une Maildir via FTP
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
|
@ -119,21 +124,26 @@ LSerror :: defineError('MAILDIR_04',
|
|||
*
|
||||
* @return bool True ou false si il y a un problème durant la suppression de la Maildir
|
||||
*/
|
||||
function removeMaildirByFTP($ldapObject,$dir=null) {
|
||||
function removeMaildirByFTP($ldapObject,$dir=null) {
|
||||
if (!$dir) {
|
||||
$dir = getMaildirPath($ldapObject);
|
||||
if (!$dir) {
|
||||
if (!$dir)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!removeDirsByFTP(LS_MAILDIR_FTP_HOST,LS_MAILDIR_FTP_PORT,LS_MAILDIR_FTP_USER,LS_MAILDIR_FTP_PWD,$dir)) {
|
||||
if (
|
||||
!removeDirsByFTP(
|
||||
LS_MAILDIR_FTP_HOST, LS_MAILDIR_FTP_PORT,
|
||||
LS_MAILDIR_FTP_USER, LS_MAILDIR_FTP_PWD,
|
||||
$dir
|
||||
)
|
||||
) {
|
||||
LSerror :: addErrorCode('MAILDIR_02');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Retourne le chemin distant de la maildir
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
|
@ -142,27 +152,25 @@ LSerror :: defineError('MAILDIR_04',
|
|||
*
|
||||
* @return string|false Le chemin distant de la maildir ou false si il y a un problème
|
||||
*/
|
||||
function getMaildirPath($ldapObject) {
|
||||
$dir = getFData(LS_MAILDIR_FTP_MAILDIR_PATH,$ldapObject,'getValue');
|
||||
function getMaildirPath($ldapObject) {
|
||||
$dir = getFData(LS_MAILDIR_FTP_MAILDIR_PATH, $ldapObject, 'getValue');
|
||||
|
||||
if (LS_MAILDIR_FTP_MAILDIR_PATH_REGEX != "") {
|
||||
if (preg_match(LS_MAILDIR_FTP_MAILDIR_PATH_REGEX,$dir,$regs)) {
|
||||
$dir = $regs[1];
|
||||
}
|
||||
else {
|
||||
$dir = "";
|
||||
}
|
||||
if (constant("LS_MAILDIR_FTP_MAILDIR_PATH_REGEX")) {
|
||||
$dir = (
|
||||
preg_match(LS_MAILDIR_FTP_MAILDIR_PATH_REGEX, $dir, $regs)?
|
||||
$regs[1]:false
|
||||
);
|
||||
}
|
||||
|
||||
if ($dir=="") {
|
||||
if (!$dir) {
|
||||
LSerror :: addErrorCode('MAILDIR_04');
|
||||
return false;
|
||||
}
|
||||
|
||||
return $dir;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Rename Maildir via FTP
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
|
@ -172,10 +180,16 @@ LSerror :: defineError('MAILDIR_04',
|
|||
*
|
||||
* @return bool True ou false si il y a un problème durant le renomage de la Maildir
|
||||
*/
|
||||
function renameMaildirByFTP($old,$new) {
|
||||
if (!renameDirByFTP(LS_MAILDIR_FTP_HOST,LS_MAILDIR_FTP_PORT,LS_MAILDIR_FTP_USER,LS_MAILDIR_FTP_PWD,$old,$new)) {
|
||||
function renameMaildirByFTP($old, $new) {
|
||||
if (
|
||||
!renameDirByFTP(
|
||||
LS_MAILDIR_FTP_HOST, LS_MAILDIR_FTP_PORT,
|
||||
LS_MAILDIR_FTP_USER, LS_MAILDIR_FTP_PWD,
|
||||
$old, $new
|
||||
)
|
||||
) {
|
||||
LSerror :: addErrorCode('MAILDIR_03');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,26 +36,25 @@ LSerror :: defineError('POSIX_01',
|
|||
___("POSIX : The attribute %{dependency} is missing. Unable to forge the attribute %{attr}.")
|
||||
);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Verification du support POSIX par ldapSaisie
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*
|
||||
* @return boolean true si POSIX est pleinement supporté, false sinon
|
||||
*/
|
||||
function LSaddon_posix_support() {
|
||||
|
||||
$retval=true;
|
||||
function LSaddon_posix_support() {
|
||||
$retval = true;
|
||||
|
||||
// Dependance de librairie
|
||||
if (!function_exists('createDirsByFTP')) {
|
||||
if(!LSsession :: loadLSaddon('ftp')) {
|
||||
LSerror :: addErrorCode('POSIX_SUPPORT_02');
|
||||
$retval=false;
|
||||
$retval = false;
|
||||
}
|
||||
}
|
||||
|
||||
$MUST_DEFINE_CONST= array(
|
||||
$MUST_DEFINE_CONST = array(
|
||||
'LS_POSIX_UID_ATTR',
|
||||
'LS_POSIX_UIDNUMBER_ATTR',
|
||||
'LS_POSIX_GIDNUMBER_ATTR',
|
||||
|
@ -72,15 +71,15 @@ LSerror :: defineError('POSIX_01',
|
|||
|
||||
foreach($MUST_DEFINE_CONST as $const) {
|
||||
if ( (!defined($const)) || (constant($const) == "")) {
|
||||
LSerror :: addErrorCode('POSIX_SUPPORT_O1',$const);
|
||||
$retval=false;
|
||||
LSerror :: addErrorCode('POSIX_SUPPORT_O1', $const);
|
||||
$retval = false;
|
||||
}
|
||||
}
|
||||
|
||||
return $retval;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Generation de uidNumber
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
|
@ -89,8 +88,7 @@ LSerror :: defineError('POSIX_01',
|
|||
*
|
||||
* @return integer|false uidNumber ou false si il y a un problème durant la génération
|
||||
*/
|
||||
function generate_uidNumber($ldapObject) {
|
||||
|
||||
function generate_uidNumber($ldapObject) {
|
||||
$objects = LSldap :: search (
|
||||
LS_POSIX_UIDNUMBER_ATTR.'=*',
|
||||
NULL,
|
||||
|
@ -112,10 +110,9 @@ LSerror :: defineError('POSIX_01',
|
|||
|
||||
$uidNumber++;
|
||||
return $uidNumber;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Generation de gidNumber
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
|
@ -124,10 +121,9 @@ LSerror :: defineError('POSIX_01',
|
|||
*
|
||||
* @return integer|false gidNumber ou false si il y a un problème durant la génération
|
||||
*/
|
||||
function generate_gidNumber($ldapObject) {
|
||||
|
||||
function generate_gidNumber($ldapObject) {
|
||||
$objects = LSldap :: search (
|
||||
LS_POSIX_GIDNUMBER_ATTR.'=*',
|
||||
LS_POSIX_GIDNUMBER_ATTR . '=*',
|
||||
NULL,
|
||||
array(
|
||||
'attributes' => array(
|
||||
|
@ -147,10 +143,9 @@ LSerror :: defineError('POSIX_01',
|
|||
|
||||
$gidNumber++;
|
||||
return $gidNumber;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Generation de homeDirectory
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
|
@ -159,19 +154,18 @@ LSerror :: defineError('POSIX_01',
|
|||
*
|
||||
* @return string|false homeDirectory ou false si il y a un problème durant la génération
|
||||
*/
|
||||
function generate_homeDirectory($ldapObject) {
|
||||
function generate_homeDirectory($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ LS_POSIX_UID_ATTR ]) != 'LSattribute' ) {
|
||||
LSerror :: addErrorCode('POSIX_01',array('dependency' => 'uid', 'attr' => 'homeDirectory'));
|
||||
LSerror :: addErrorCode('POSIX_01', array('dependency' => 'uid', 'attr' => 'homeDirectory'));
|
||||
return false;
|
||||
}
|
||||
|
||||
$uid = $ldapObject -> attrs[ LS_POSIX_UID_ATTR ] -> getValue();
|
||||
$home = LS_POSIX_HOMEDIRECTORY . $uid[0];
|
||||
return $home;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Create home directory by FTP
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
|
@ -180,16 +174,22 @@ LSerror :: defineError('POSIX_01',
|
|||
*
|
||||
* @return bool True on success, false otherwise
|
||||
*/
|
||||
function createHomeDirectoryByFTP($ldapObject) {
|
||||
$dir = getFData(LS_POSIX_HOMEDIRECTORY_FTP_PATH,$ldapObject,'getValue');
|
||||
if (!createDirsByFTP(LS_POSIX_HOMEDIRECTORY_FTP_HOST,LS_POSIX_HOMEDIRECTORY_FTP_PORT,LS_POSIX_HOMEDIRECTORY_FTP_USER,LS_POSIX_HOMEDIRECTORY_FTP_PWD,$dir)) {
|
||||
function createHomeDirectoryByFTP($ldapObject) {
|
||||
$dir = getFData(LS_POSIX_HOMEDIRECTORY_FTP_PATH, $ldapObject, 'getValue');
|
||||
if (
|
||||
!createDirsByFTP(
|
||||
LS_POSIX_HOMEDIRECTORY_FTP_HOST, LS_POSIX_HOMEDIRECTORY_FTP_PORT,
|
||||
LS_POSIX_HOMEDIRECTORY_FTP_USER, LS_POSIX_HOMEDIRECTORY_FTP_PWD,
|
||||
$dir
|
||||
)
|
||||
) {
|
||||
LSerror :: addErrorCode('POSIX_02');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Generate member attribute value from memberUid
|
||||
*
|
||||
* IMPORTANT : The attribute memberUid must be define in configuration
|
||||
|
@ -201,18 +201,20 @@ LSerror :: defineError('POSIX_01',
|
|||
*
|
||||
* @return array|false array of member attribute values or false in case of error
|
||||
*/
|
||||
function generateMemberFromMemberUid($ldapObject) {
|
||||
function generateMemberFromMemberUid($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ 'memberUid' ]) != 'LSattribute' ) {
|
||||
LSerror :: addErrorCode('POSIX_01',array('dependency' => 'memberUid', 'attr' => 'member'));
|
||||
LSerror :: addErrorCode('POSIX_01', array('dependency' => 'memberUid', 'attr' => 'member'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( get_class($ldapObject -> attrs[ 'member' ]) != 'LSattribute' ) {
|
||||
LSerror :: addErrorCode('POSIX_01',array('dependency' => 'member', 'attr' => 'member'));
|
||||
LSerror :: addErrorCode('POSIX_01', array('dependency' => 'member', 'attr' => 'member'));
|
||||
return false;
|
||||
}
|
||||
|
||||
$obj_type=LSconfig::get('LSobjects.'.get_class($ldapObject).'.attrs.memberUid.html_options.selectable_object.object_type');
|
||||
$obj_type = LSconfig::get(
|
||||
'LSobjects.'.get_class($ldapObject).'.attrs.memberUid.html_options.selectable_object.object_type'
|
||||
);
|
||||
if (empty($obj_type))
|
||||
return false;
|
||||
|
||||
|
@ -220,14 +222,18 @@ LSerror :: defineError('POSIX_01',
|
|||
$member = array();
|
||||
if (is_array($uids)) {
|
||||
foreach ( $uids as $uid ) {
|
||||
$member[]='uid='.$uid.','.LSconfig::get('LSobjects.'.$obj_type.'.container_dn').','.LSsession::getTopDn();
|
||||
$member[] = sprintf(
|
||||
'uid=%s,%s,%s',
|
||||
$uid,
|
||||
LSconfig::get('LSobjects.'.$obj_type.'.container_dn'),
|
||||
LSsession::getTopDn()
|
||||
);
|
||||
}
|
||||
}
|
||||
return $member;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Generate memberUid attribute value from uniqueMember
|
||||
*
|
||||
* IMPORTANT : The attribute uniqueMember must be define in configuration
|
||||
|
@ -239,14 +245,14 @@ LSerror :: defineError('POSIX_01',
|
|||
*
|
||||
* @return array|false array of memberUid values or false in case of error
|
||||
*/
|
||||
function generate_memberUidFromUniqueMember($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ 'memberUid' ]) != 'LSattribute' ) {
|
||||
LSerror :: addErrorCode('POSIX_01',array('dependency' => 'memberUid', 'attr' => 'memberUid'));
|
||||
function generate_memberUidFromUniqueMember($ldapObject) {
|
||||
if (get_class($ldapObject -> attrs[ 'memberUid' ]) != 'LSattribute') {
|
||||
LSerror :: addErrorCode('POSIX_01', array('dependency' => 'memberUid', 'attr' => 'memberUid'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( get_class($ldapObject -> attrs[ 'uniqueMember' ]) != 'LSattribute' ) {
|
||||
LSerror :: addErrorCode('POSIX_01',array('dependency' => 'uniqueMember', 'attr' => 'memberUid'));
|
||||
if (get_class($ldapObject -> attrs[ 'uniqueMember' ]) != 'LSattribute') {
|
||||
LSerror :: addErrorCode('POSIX_01', array('dependency' => 'uniqueMember', 'attr' => 'memberUid'));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -254,14 +260,13 @@ LSerror :: defineError('POSIX_01',
|
|||
$uids = array();
|
||||
if (is_array($dns)) {
|
||||
foreach($dns as $dn) {
|
||||
if(preg_match(LS_POSIX_DN_TO_UID_PATTERN,$dn,$matches)) {
|
||||
$uids[]=$matches[1];
|
||||
if(preg_match(LS_POSIX_DN_TO_UID_PATTERN, $dn, $matches)) {
|
||||
$uids[] = $matches[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $uids;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate shadowLastChange attribute value
|
||||
|
|
|
@ -229,8 +229,7 @@ function generate_sambaPrimaryGroupSID($ldapObject) {
|
|||
return generate_sambaSID($ldapObject, LS_SAMBA_GIDNUMBER_ATTR, LS_SAMBA_SID_BASE_GROUP);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Generation de sambaNTPassword
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
|
@ -239,7 +238,7 @@ function generate_sambaPrimaryGroupSID($ldapObject) {
|
|||
*
|
||||
* @return string|false sambaNTPassword value on success, false otherwise
|
||||
*/
|
||||
function generate_sambaNTPassword($ldapObject) {
|
||||
function generate_sambaNTPassword($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ LS_SAMBA_USERPASSWORD_ATTR ]) != 'LSattribute' ) {
|
||||
LSerror :: addErrorCode('SAMBA_01',array('dependency' => LS_SAMBA_USERPASSWORD_ATTR, 'attr' => 'sambaNTPassword'));
|
||||
return false;
|
||||
|
@ -258,13 +257,10 @@ function generate_sambaPrimaryGroupSID($ldapObject) {
|
|||
$sambapassword = new smbHash;
|
||||
$sambaNTPassword = $sambapassword -> nthash($password);
|
||||
|
||||
if($sambaNTPassword == '') {
|
||||
return false;
|
||||
}
|
||||
return $sambaNTPassword;
|
||||
}
|
||||
return $sambaNTPassword?$sambaNTPassword:false;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Generation de sambaLMPassword
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
|
@ -273,7 +269,7 @@ function generate_sambaPrimaryGroupSID($ldapObject) {
|
|||
*
|
||||
* @return string|false sambaLMPassword value on success, false otherwise
|
||||
*/
|
||||
function generate_sambaLMPassword($ldapObject) {
|
||||
function generate_sambaLMPassword($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ LS_SAMBA_USERPASSWORD_ATTR ]) != 'LSattribute' ) {
|
||||
LSerror :: addErrorCode(
|
||||
'SAMBA_01',
|
||||
|
@ -296,11 +292,8 @@ function generate_sambaPrimaryGroupSID($ldapObject) {
|
|||
$sambapassword = new smbHash;
|
||||
$sambaLMPassword = $sambapassword -> lmhash($password);
|
||||
|
||||
if($sambaLMPassword == '') {
|
||||
return false;
|
||||
}
|
||||
return $sambaLMPassword;
|
||||
}
|
||||
return $sambaLMPassword?$sambaLMPassword:false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate UNIX ID value from sambaUnixIdPool object
|
||||
|
|
|
@ -59,14 +59,14 @@ LSerror :: defineError('SSH_07',
|
|||
___("SSH : Unable to rename folder from %{old} to %{new} on the remote server.")
|
||||
);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Check LdapSaisie SSH support
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*
|
||||
* @return boolean true if SSH is fully supported, false otherwise
|
||||
*/
|
||||
function LSaddon_ssh_support() {
|
||||
function LSaddon_ssh_support() {
|
||||
$retval=true;
|
||||
|
||||
// Check PhpSecLib library
|
||||
|
@ -79,11 +79,9 @@ LSerror :: defineError('SSH_07',
|
|||
}
|
||||
|
||||
return $retval;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Connect to an SFTP server
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
|
@ -113,7 +111,7 @@ LSerror :: defineError('SSH_07',
|
|||
*
|
||||
* @return SSH2|SFTP|false SSH2/SFTP object or false
|
||||
*/
|
||||
function connectToSSH($params, $sftp=false) {
|
||||
function connectToSSH($params, $sftp=false) {
|
||||
$logger = LSlog :: get_logger('LSaddon_ssh');
|
||||
if (!isset($params['host'])) {
|
||||
LSerror :: addErrorCode('SSH_01',"host");
|
||||
|
@ -175,9 +173,9 @@ LSerror :: defineError('SSH_07',
|
|||
$logger -> debug("Connected.");
|
||||
|
||||
return $cnx;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Create one or more directories throught SFTP
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
|
@ -191,7 +189,7 @@ LSerror :: defineError('SSH_07',
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function createDirsBySFTP($connection_params, $dirs, $chmod=-1, $recursive=false, $continue=false) {
|
||||
function createDirsBySFTP($connection_params, $dirs, $chmod=-1, $recursive=false, $continue=false) {
|
||||
$cnx = connectToSSH($connection_params, true);
|
||||
if (!$cnx instanceof SFTP) return false;
|
||||
if (!is_array($dirs)) {
|
||||
|
@ -207,9 +205,9 @@ LSerror :: defineError('SSH_07',
|
|||
}
|
||||
}
|
||||
return $retval;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Delete one or more directories throught SFTP
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
|
@ -221,7 +219,7 @@ LSerror :: defineError('SSH_07',
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function removeDirsBySFTP($connection_params, $dirs, $recursive=false, $continue=false) {
|
||||
function removeDirsBySFTP($connection_params, $dirs, $recursive=false, $continue=false) {
|
||||
$cnx = connectToSSH($connection_params, true);
|
||||
if (!$cnx instanceof SFTP) return false;
|
||||
if (!is_array($dirs)) {
|
||||
|
@ -237,9 +235,9 @@ LSerror :: defineError('SSH_07',
|
|||
}
|
||||
}
|
||||
return $retval;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Rename a directory throught SFTP
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
|
@ -250,7 +248,7 @@ LSerror :: defineError('SSH_07',
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function renameDirBySFTP($connection_params, $old, $new) {
|
||||
function renameDirBySFTP($connection_params, $old, $new) {
|
||||
$cnx = connectToSSH($connection_params, true);
|
||||
if (!$cnx instanceof SFTP) return false;
|
||||
LSlog :: get_logger('LSaddon_ssh') -> debug("rename($old, $new)");
|
||||
|
@ -259,9 +257,9 @@ LSerror :: defineError('SSH_07',
|
|||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Exec a command throught SSH
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
|
@ -273,11 +271,11 @@ LSerror :: defineError('SSH_07',
|
|||
* exit code as first value and the command outup as second
|
||||
* one (stdout + stderr).
|
||||
*/
|
||||
function execBySSH($connection_params, $cmd) {
|
||||
function execBySSH($connection_params, $cmd) {
|
||||
$cnx = connectToSSH($connection_params);
|
||||
if (!$cnx instanceof SSH2) return false;
|
||||
LSlog :: get_logger('LSaddon_ssh') -> debug("exec($cmd)");
|
||||
$result = $cnx -> exec($cmd);
|
||||
$exit_status = $cnx->getExitStatus();
|
||||
return array($exit_status, $result);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue