- LSaddons : Déplacement de la configuration dans conf/LSaddons/* (Feature Request #1748)

- ftp : Ajout de la possiblité d'un chmod après la création des dossiers
					avec la méthode createDirsByFTP()
	- Maildir : Ajout d'un chmod après la création de la maildir
This commit is contained in:
Benjamin Renard 2009-01-12 10:57:27 +00:00
parent b2e585b7c2
commit 963714a5dd
13 changed files with 441 additions and 293 deletions

View file

@ -0,0 +1,32 @@
<?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.
******************************************************************************/
/*
************************************************
* Données de configuration pour le support FTP *
************************************************
*/
// Pear :: NET_FTP
define('NET_FTP','/usr/share/php/Net/FTP.php');
?>

View file

@ -0,0 +1,84 @@
<?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.
******************************************************************************/
/*
************************************************
* Données de configuration pour le support FTP *
************************************************
*/
// Pear :: Mail
define('PEAR_MAIL','/usr/share/php/Mail.php');
/*
* Méthode d'envoie :
* - mail : envoie avec la méthode PHP mail()
* - sendmail : envoie la commande sendmail du système
* - smtp : envoie en utilisant un serveur SMTP
*/
define('MAIL_SEND_METHOD','smtp');
/*
* Paramètres d'envoie :
* Ces paramètres dépende de la méthode utilisé. Repporté vous à la documentation
* de PEAR :: Mail pour plus d'information.
* Lien : http://pear.php.net/manual/en/package.mail.mail.factory.php
* Infos :
* List of parameter for the backends
* mail
* o If safe mode is disabled, $params will be passed as the fifth
* argument to the PHP mail() function. If $params is an array,
* its elements will be joined as a space-delimited string.
* sendmail
* o $params["sendmail_path"] - The location of the sendmail program
* on the filesystem. Default is /usr/bin/sendmail.
* o $params["sendmail_args"] - Additional parameters to pass to the
* sendmail. Default is -i.
* smtp
* o $params["host"] - The server to connect. Default is localhost.
* o $params["port"] - The port to connect. Default is 25.
* o $params["auth"] - Whether or not to use SMTP authentication.
* Default is FALSE.
* o $params["username"] - The username to use for SMTP authentication.
* o $params["password"] - The password to use for SMTP authentication.
* o $params["localhost"] - The value to give when sending EHLO or HELO.
* Default is localhost
* o $params["timeout"] - The SMTP connection timeout.
* Default is NULL (no timeout).
* o $params["verp"] - Whether to use VERP or not. Default is FALSE.
* o $params["debug"] - Whether to enable SMTP debug mode or not.
* Default is FALSE.
* o $params["persist"] - Indicates whether or not the SMTP connection
* should persist over multiple calls to the send() method.
*/
$MAIL_SEND_PARAMS = NULL;
/*
* Headers :
*/
$MAIL_HEARDERS = array(
"Content-Type" => "text/plain",
"charset" => "UTF-8",
"format" => "flowed"
);
?>

View file

@ -0,0 +1,47 @@
<?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.
******************************************************************************/
/*
****************************************************
* Données de configuration pour le support Maildir *
****************************************************
*/
// Serveur FTP - Host
define('LS_MAILDIR_FTP_HOST','127.0.0.1');
// Serveur FTP - Port
define('LS_MAILDIR_FTP_PORT',21);
// Serveur FTP - User
define('LS_MAILDIR_FTP_USER','vmail');
// Serveur FTP - Passorwd
define('LS_MAILDIR_FTP_PWD','password');
// Serveur FTP - Maildir Path
define('LS_MAILDIR_FTP_MAILDIR_PATH','%{uid}');
// Serveur FTP - Maildir CHMOD
define('LS_MAILDIR_FTP_MAILDIR_CHMOD','700');
?>

View file

@ -0,0 +1,62 @@
<?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.
******************************************************************************/
/*
**************************************************
* Données de configuration pour le support POSIX *
**************************************************
*/
// Nom de l'attribut LDAP uid
define('LS_POSIX_UID_ATTR','uid');
// Nom de l'attribut LDAP uidNumber
define('LS_POSIX_UIDNUMBER_ATTR','uidNumber');
// Valeur minimum d'un uidNumber
define('LS_POSIX_UIDNUMBER_MIN_VAL','100000');
// Nom de l'attribut LDAP gidNumber
define('LS_POSIX_GIDNUMBER_ATTR','gidNumber');
// Valeur minimum d'un gidNumber
define('LS_POSIX_GIDNUMBER_MIN_VAL','100000');
// Dossier contenant les homes des utilisateurs (defaut: /home/)
define('LS_POSIX_HOMEDIRECTORY','/home/');
// Create homeDirectory by FTP - Host
define('LS_POSIX_HOMEDIRECTORY_FTP_HOST','127.0.0.1');
// Create homeDirectory by FTP - Port
define('LS_POSIX_HOMEDIRECTORY_FTP_PORT',21);
// Create homeDirectory by FTP - User
define('LS_POSIX_HOMEDIRECTORY_FTP_USER','admin');
// Create homeDirectory by FTP - Password
define('LS_POSIX_HOMEDIRECTORY_FTP_PWD','password');
// Create homeDirectory by FTP - Path
define('LS_POSIX_HOMEDIRECTORY_FTP_PATH','%{homeDirectory}');
?>

View file

@ -0,0 +1,52 @@
<?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.
******************************************************************************/
/*
**************************************************
* Données de configuration pour le support SAMBA *
**************************************************
*/
// SID du domaine Samba géré
define('LS_SAMBA_DOMAIN_SID','S-1-5-21-2421470416-3566881284-3047381809');
// Nombre de base pour le calcul des sambaSID Utilisateur
define('LS_SAMBA_SID_BASE_USER',1000);
// Nombre de base pour le calcul des sambaSID Groupe
define('LS_SAMBA_SID_BASE_GROUP',1001);
/**
* NB : C'est deux nombres doivent être pour l'un paire et pour l'autre impaire
* pour conserver l'unicité des SID
**/
// Nom de l'attribut LDAP uidNumber
define('LS_SAMBA_UIDNUMBER_ATTR','uidNumber');
// Nom de l'attribut LDAP gidNumber
define('LS_SAMBA_GIDNUMBER_ATTR','gidNumber');
// Nom de l'attribut LDAP userPassword
define('LS_SAMBA_USERPASSWORD_ATTR','userPassword');
?>

View file

@ -0,0 +1,35 @@
<?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.
******************************************************************************/
/*
***************************************************
* Données de configuration pour le support SUPANN *
***************************************************
*/
// Nom de l'attribut LDAP nom
define('LS_SUPANN_LASTNAME_ATTR','sn');
// Nom de l'attribut LDAP prenom
define('LS_SUPANN_FIRSTNAME_ATTR','givenName');
?>

View file

@ -20,44 +20,42 @@
******************************************************************************/
// Messages d'erreur
/**
* Données de configuration pour le support FTP
*/
// Support
$GLOBALS['LSerror_code']['FTP_SUPPORT_01']= array (
'msg' => _("FTP Support : Pear::Net_FTP est introuvable."),
'level' => 'c'
);
// Pear :: NET_FTP
define('NET_FTP','/usr/share/php/Net/FTP.php');
// Message d'erreur
$GLOBALS['LSerror_code']['FTP_SUPPORT_01']= array (
'msg' => _("FTP Support : Pear::Net_FTP est introuvable."),
'level' => 'c'
);
$GLOBALS['LSerror_code']['FTP_00']= array (
'msg' => _("Net_FTP Error : %{msg}"),
'level' => 'c'
);
$GLOBALS['LSerror_code']['FTP_01']= array (
'msg' => _("FTP Support : Impossible de se connecter au serveur FTP (Etape : %{etape})."),
'level' => 'c'
);
$GLOBALS['LSerror_code']['FTP_02']= array (
'msg' => _("FTP Support : Impossible de créer le dossier %{dir} sur le serveur distant."),
'level' => 'c'
);
$GLOBALS['LSerror_code']['FTP_03']= array (
'msg' => _("FTP Support : Impossible de supprimer le dossier %{dir} sur le serveur distant."),
'level' => 'c'
);
$GLOBALS['LSerror_code']['FTP_SUPPORT_02']= array (
'msg' => _("FTP Support : La constante %{const} n'est pas défini."),
'level' => 'c'
);
/**
* Fin des données de configuration
*/
// Autres erreurs
$GLOBALS['LSerror_code']['FTP_00']= array (
'msg' => _("Net_FTP Error : %{msg}"),
'level' => 'c'
);
$GLOBALS['LSerror_code']['FTP_01']= array (
'msg' => _("FTP Support : Impossible de se connecter au serveur FTP (Etape : %{etape})."),
'level' => 'c'
);
$GLOBALS['LSerror_code']['FTP_02']= array (
'msg' => _("FTP Support : Impossible de créer le dossier %{dir} sur le serveur distant."),
'level' => 'c'
);
$GLOBALS['LSerror_code']['FTP_03']= array (
'msg' => _("FTP Support : Impossible de supprimer le dossier %{dir} sur le serveur distant."),
'level' => 'c'
);
$GLOBALS['LSerror_code']['FTP_04']= array (
'msg' => _("FTP Support : Impossible de modifier les droits du dossier %{dir} sur le serveur distant."),
'level' => 'c'
);
/**
* Verification du support FTP par ldapSaisie
@ -71,7 +69,10 @@
// Dependance de librairie
if (!class_exists('Net_FTP')) {
if(!@include(NET_FTP)) {
if (!defined('NET_FTP')) {
$GLOBALS['LSerror'] -> addErrorCode('FTP_SUPPORT_02','NET_FTP');
$retval=false;
} else if(!@include(NET_FTP)) {
$GLOBALS['LSerror'] -> addErrorCode('FTP_SUPPORT_01');
$retval=false;
}
@ -128,7 +129,7 @@
*
* @retval string True ou false si il y a un problème durant la création du/des dossier(s)
*/
function createDirsByFTP($host,$port,$user,$pwd,$dirs) {
function createDirsByFTP($host,$port,$user,$pwd,$dirs,$chmod=NULL) {
$cnx = connectToFTP($host,$port,$user,$pwd);
if (! $cnx){
return;
@ -143,6 +144,13 @@
$GLOBALS['LSerror'] -> addErrorCode('FTP_00',$do -> getMessage());
return;
}
if ($chmod) {
$do = $cnx -> chmod($dir,$chmod);
if ($do instanceof PEAR_Error) {
$GLOBALS['LSerror'] -> addErrorCode('FTP_04',$dir);
$GLOBALS['LSerror'] -> addErrorCode('FTP_00',$do -> getMessage());
}
}
}
return true;
}

View file

@ -20,87 +20,24 @@
******************************************************************************/
// Messages d'erreur
/**
* Données de configuration pour le support FTP
*/
// Support
$GLOBALS['LSerror_code']['MAIL_SUPPORT_01']= array (
'msg' => _("MAIL Support : Pear::MAIL est introuvable."),
'level' => 'c'
);
// Pear :: Mail
define('PEAR_MAIL','/usr/share/php/Mail.php');
/*
* Méthode d'envoie :
* - mail : envoie avec la méthode PHP mail()
* - sendmail : envoie la commande sendmail du système
* - smtp : envoie en utilisant un serveur SMTP
*/
define('MAIL_SEND_METHOD','smtp');
/*
* Paramètres d'envoie :
* Ces paramètres dépende de la méthode utilisé. Repporté vous à la documentation
* de PEAR :: Mail pour plus d'information.
* Lien : http://pear.php.net/manual/en/package.mail.mail.factory.php
* Infos :
* List of parameter for the backends
* mail
* o If safe mode is disabled, $params will be passed as the fifth
* argument to the PHP mail() function. If $params is an array,
* its elements will be joined as a space-delimited string.
* sendmail
* o $params["sendmail_path"] - The location of the sendmail program
* on the filesystem. Default is /usr/bin/sendmail.
* o $params["sendmail_args"] - Additional parameters to pass to the
* sendmail. Default is -i.
* smtp
* o $params["host"] - The server to connect. Default is localhost.
* o $params["port"] - The port to connect. Default is 25.
* o $params["auth"] - Whether or not to use SMTP authentication.
* Default is FALSE.
* o $params["username"] - The username to use for SMTP authentication.
* o $params["password"] - The password to use for SMTP authentication.
* o $params["localhost"] - The value to give when sending EHLO or HELO.
* Default is localhost
* o $params["timeout"] - The SMTP connection timeout.
* Default is NULL (no timeout).
* o $params["verp"] - Whether to use VERP or not. Default is FALSE.
* o $params["debug"] - Whether to enable SMTP debug mode or not.
* Default is FALSE.
* o $params["persist"] - Indicates whether or not the SMTP connection
* should persist over multiple calls to the send() method.
*/
$MAIL_SEND_PARAMS = NULL;
/*
* Headers :
*/
$MAIL_HEARDERS = array(
"Content-Type" => "text/plain",
"charset" => "UTF-8",
"format" => "flowed"
);
// Message d'erreur
$GLOBALS['LSerror_code']['FTP_SUPPORT_01']= array (
'msg' => _("MAIL Support : Pear::MAIL est introuvable."),
'level' => 'c'
);
$GLOBALS['LSerror_code']['MAIL_00']= array (
'msg' => _("MAIL Error : %{msg}"),
'level' => 'c'
);
$GLOBALS['LSerror_code']['MAIL_01']= array (
'msg' => _("MAIL : Problème durant l'envoie de votre mail"),
'level' => 'c'
);
/**
* Fin des données de configuration
*/
// Autres erreurs
$GLOBALS['LSerror_code']['MAIL_00']= array (
'msg' => _("MAIL Error : %{msg}"),
'level' => 'c'
);
$GLOBALS['LSerror_code']['MAIL_01']= array (
'msg' => _("MAIL : Problème durant l'envoie de votre mail"),
'level' => 'c'
);
/**
* Verification du support MAIL par ldapSaisie

View file

@ -20,49 +20,27 @@
******************************************************************************/
// Messages d'erreur
/**
* Données de configuration pour le support Maildir
*/
// Serveur FTP - Host
define('LS_MAILDIR_FTP_HOST','127.0.0.1');
// Serveur FTP - Port
define('LS_MAILDIR_FTP_PORT',21);
// Serveur FTP - User
define('LS_MAILDIR_FTP_USER','vmail');
// Serveur FTP - Passorwd
define('LS_MAILDIR_FTP_PWD','password');
// Serveur FTP - Maildir Path
define('LS_MAILDIR_FTP_MAILDIR_PATH','%{uid}');
// Message d'erreur
$GLOBALS['LSerror_code']['MAILDIR_SUPPORT_01']= array (
'msg' => _("MAILDIR Support : Impossible de charger LSaddons::FTP."),
'level' => 'c'
);
$GLOBALS['LSerror_code']['MAILDIR_SUPPORT_02']= array (
'msg' => _("MAILDIR Support : La constante %{const} n'est pas définie."),
'level' => 'c'
);
$GLOBALS['LSerror_code']['MAILDIR_01']= array (
'msg' => _("MAILDIR Support : Erreur durant la création de la maildir sur le serveur distant."),
'level' => 'c'
);
$GLOBALS['LSerror_code']['MAILDIR_02']= array (
'msg' => _("MAILDIR Support : Erreur durant la création de la maildir sur le serveur distant."),
'level' => 'c'
);
/**
* Fin des données de configuration
*/
// Support
$GLOBALS['LSerror_code']['MAILDIR_SUPPORT_01']= array (
'msg' => _("MAILDIR Support : Impossible de charger LSaddons::FTP."),
'level' => 'c'
);
$GLOBALS['LSerror_code']['MAILDIR_SUPPORT_02']= array (
'msg' => _("MAILDIR Support : La constante %{const} n'est pas définie."),
'level' => 'c'
);
// Autres erreurs
$GLOBALS['LSerror_code']['MAILDIR_01']= array (
'msg' => _("MAILDIR Support : Erreur durant la création de la maildir sur le serveur distant."),
'level' => 'c'
);
$GLOBALS['LSerror_code']['MAILDIR_02']= array (
'msg' => _("MAILDIR Support : Erreur durant la création de la maildir sur le serveur distant."),
'level' => 'c'
);
/**
* Verification du support Maildir par ldapSaisie
@ -89,7 +67,7 @@ $retval=true;
);
foreach($MUST_DEFINE_CONST as $const) {
if ( constant($const) == '' ) {
if ( (!defined($const)) || (constant($const) == "")) {
$GLOBALS['LSerror'] -> addErrorCode('MAILDIR_SUPPORT_02',$const);
$retval=false;
}
@ -113,7 +91,7 @@ $retval=true;
$dir.'/new',
$dir.'/tmp'
);
if (!createDirsByFTP(LS_MAILDIR_FTP_HOST,LS_MAILDIR_FTP_PORT,LS_MAILDIR_FTP_USER,LS_MAILDIR_FTP_PWD,$dirs)) {
if (!createDirsByFTP(LS_MAILDIR_FTP_HOST,LS_MAILDIR_FTP_PORT,LS_MAILDIR_FTP_USER,LS_MAILDIR_FTP_PWD,$dirs,LS_MAILDIR_FTP_MAILDIR_CHMOD)) {
$GLOBALS['LSerror'] -> addErrorCode('MAILDIR_01');
return;
}

View file

@ -20,67 +20,24 @@
******************************************************************************/
// Messages d'erreur
/**
* Données de configuration pour le support POSIX
*/
// Support
$GLOBALS['LSerror_code']['POSIX_SUPPORT_01']= array (
'msg' => _("POSIX Support : La constante %{const} n'est pas définie."),
'level' => 'c'
);
// Nom de l'attribut LDAP uid
define('LS_POSIX_UID_ATTR','uid');
// Nom de l'attribut LDAP uidNumber
define('LS_POSIX_UIDNUMBER_ATTR','uidNumber');
// Valeur minimum d'un uidNumber
define('LS_POSIX_UIDNUMBER_MIN_VAL','100000');
// Nom de l'attribut LDAP gidNumber
define('LS_POSIX_GIDNUMBER_ATTR','gidNumber');
// Valeur minimum d'un gidNumber
define('LS_POSIX_GIDNUMBER_MIN_VAL','100000');
// Dossier contenant les homes des utilisateurs (defaut: /home/)
define('LS_POSIX_HOMEDIRECTORY','/home/');
// Create homeDirectory by FTP - Host
define('LS_POSIX_HOMEDIRECTORY_FTP_HOST','127.0.0.1');
// Create homeDirectory by FTP - Port
define('LS_POSIX_HOMEDIRECTORY_FTP_PORT',21);
// Create homeDirectory by FTP - User
define('LS_POSIX_HOMEDIRECTORY_FTP_USER','admin');
// Create homeDirectory by FTP - Password
define('LS_POSIX_HOMEDIRECTORY_FTP_PWD','password');
// Create homeDirectory by FTP - Path
define('LS_POSIX_HOMEDIRECTORY_FTP_PATH','%{homeDirectory}');
// -- Message d'erreur --
// Support
$GLOBALS['LSerror_code']['POSIX_SUPPORT_01']= array (
'msg' => _("POSIX Support : La constante %{const} n'est pas définie."),
'level' => 'c'
);
$GLOBALS['LSerror_code']['POSIX_SUPPORT_02']= array (
'msg' => _("POSIX Support : Impossible de charger LSaddons::FTP."),
'level' => 'c'
);
// Autres erreurs
$GLOBALS['LSerror_code']['POSIX_01']= array (
'msg' => _("POSIX : L'attribut %{dependency} est introuvable. Impossible de générer l'attribut %{attr}."),
'level' => 'c'
);
/**
* Fin des données de configuration
*/
$GLOBALS['LSerror_code']['POSIX_SUPPORT_02']= array (
'msg' => _("POSIX Support : Impossible de charger LSaddons::FTP."),
'level' => 'c'
);
// Autres erreurs
$GLOBALS['LSerror_code']['POSIX_01']= array (
'msg' => _("POSIX : L'attribut %{dependency} est introuvable. Impossible de générer l'attribut %{attr}."),
'level' => 'c'
);
/**
* Verification du support POSIX par ldapSaisie
@ -116,7 +73,7 @@
);
foreach($MUST_DEFINE_CONST as $const) {
if ( constant($const) == '' ) {
if ( (!defined($const)) || (constant($const) == "")) {
$GLOBALS['LSerror'] -> addErrorCode('POSIX_SUPPORT_O1',$const);
$retval=false;
}

View file

@ -20,60 +20,28 @@
******************************************************************************/
// Messages d'erreur
/**
* Données de configuration pour le support SAMBA
*/
// Support
$GLOBALS['LSerror_code']['SAMBA_SUPPORT_01']= array (
'msg' => _("SAMBA Support : la classe smHash ne peut pas être chargée."),
'level' => 'c'
);
$GLOBALS['LSerror_code']['SAMBA_SUPPORT_02']= array (
'msg' => _("SAMBA Support : La constante %{const} n'est pas définie."),
'level' => 'c'
);
// SID du domaine Samba géré
define('LS_SAMBA_DOMAIN_SID','S-1-5-21-2421470416-3566881284-3047381809');
// Nombre de base pour le calcul des sambaSID Utilisateur
define('LS_SAMBA_SID_BASE_USER',1000);
// Nombre de base pour le calcul des sambaSID Groupe
define('LS_SAMBA_SID_BASE_GROUP',1001);
/**
* NB : C'est deux nombres doivent être pour l'un paire et pour l'autre impaire
* pour conserver l'unicité des SID
*/
// Nom de l'attribut LDAP uidNumber
define('LS_SAMBA_UIDNUMBER_ATTR','uidNumber');
// Nom de l'attribut LDAP gidNumber
define('LS_SAMBA_GIDNUMBER_ATTR','gidNumber');
// Nom de l'attribut LDAP userPassword
define('LS_SAMBA_USERPASSWORD_ATTR','userPassword');
// Message d'erreur
$GLOBALS['LSerror_code']['SAMBA_SUPPORT_01']= array (
'msg' => _("SAMBA Support : la classe smHash ne peut pas être chargée."),
'level' => 'c'
);
$GLOBALS['LSerror_code']['SAMBA_SUPPORT_02']= array (
'msg' => _("SAMBA Support : La constante %{const} n'est pas définie."),
'level' => 'c'
);
$GLOBALS['LSerror_code']['SAMBA_SUPPORT_03']= array (
'msg' => _("SAMBA Support : Les constantes LS_SAMBA_SID_BASE_USER et LS_SAMBA_SID_BASE_GROUP ne doivent pas avoir la même parité pour l'unicité des sambaSID."),
'level' => 'c'
);
$GLOBALS['LSerror_code']['SAMBA_01']= array (
'msg' => _("SAMBA Support : L'attribut %{dependency} est introuvable. Impossible de générer l'attribut %{attr}."),
'level' => 'c'
);
/**
* Fin des données de configuration
*/
$GLOBALS['LSerror_code']['SAMBA_SUPPORT_03']= array (
'msg' => _("SAMBA Support : Les constantes LS_SAMBA_SID_BASE_USER et LS_SAMBA_SID_BASE_GROUP ne doivent pas avoir la même parité pour l'unicité des sambaSID."),
'level' => 'c'
);
// Autres erreurs
$GLOBALS['LSerror_code']['SAMBA_01']= array (
'msg' => _("SAMBA Support : L'attribut %{dependency} est introuvable. Impossible de générer l'attribut %{attr}."),
'level' => 'c'
);
/**
* Verification du support Samba par ldapSaisie
@ -105,7 +73,7 @@
);
foreach($MUST_DEFINE_CONST as $const) {
if ( constant($const) == '' ) {
if ( (!defined($const)) || (constant($const) == "")) {
$GLOBALS['LSerror'] -> addErrorCode('SAMBA_SUPPORT_02',$const);
$retval=false;
}

View file

@ -20,32 +20,19 @@
******************************************************************************/
// Messages d'erreur
/**
* Données de configuration pour le support SUPANN
*/
// Nom de l'attribut LDAP nom
define('LS_SUPANN_LASTNAME_ATTR','sn');
// Nom de l'attribut LDAP prenom
define('LS_SUPANN_FIRSTNAME_ATTR','givenName');
// Message d'erreur
$GLOBALS['LSerror_code']['SUPANN_SUPPORT_01']= array (
'msg' => _("SUPANN Support : La constante %{const} n'est pas définie."),
'level' => 'c'
);
$GLOBALS['LSerror_code']['SUPANN_01']= array (
'msg' => _("SUPANN Support : L'attribut %{dependency} est introuvable. Impossible de générer l'attribut %{attr}."),
'level' => 'c'
);
/**
* Fin des données de configuration
*/
// Support
$GLOBALS['LSerror_code']['SUPANN_SUPPORT_01']= array (
'msg' => _("SUPANN Support : La constante %{const} n'est pas définie."),
'level' => 'c'
);
// Autres erreurs
$GLOBALS['LSerror_code']['SUPANN_01']= array (
'msg' => _("SUPANN Support : L'attribut %{dependency} est introuvable. Impossible de générer l'attribut %{attr}."),
'level' => 'c'
);
/**
* Verification du support SUPANN par ldapSaisie
@ -63,7 +50,7 @@
);
foreach($MUST_DEFINE_CONST as $const) {
if ( constant($const) == '' ) {
if ( (!defined($const)) || (constant($const) == "")) {
$GLOBALS['LSerror'] -> addErrorCode('SUPANN_SUPPORT_01',$const);
$retval=false;
}

View file

@ -168,6 +168,7 @@ class LSsession {
*/
function loadLSaddon($addon) {
if(require_once LS_ADDONS_DIR .'LSaddons.'.$addon.'.php') {
@include_once(LS_CONF_DIR."LSaddons/config.LSaddons.".$addon.".php");
if (!call_user_func('LSaddon_'. $addon .'_support')) {
$GLOBALS['LSerror'] -> addErrorCode('LSsession_02',$addon);
return;