From 5facc5a160d0d53dc51880b430bdab9b1356d12f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jan 2010 16:11:38 +0000 Subject: [PATCH] New: Add an option to make users email reuired. --- ChangeLog | 1 + htdocs/admin/adherent.php | 2 +- htdocs/admin/user.php | 121 ++++++++++++++++++++++ htdocs/includes/modules/modUser.class.php | 2 +- htdocs/langs/en_US/admin.lang | 2 + htdocs/langs/fr_FR/admin.lang | 2 + 6 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 htdocs/admin/user.php diff --git a/ChangeLog b/ChangeLog index 9106c99f99b..e1fa982cffe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 2.8 compared to 2.7 ***** For users: +- New: Add an option to make users email reuired. - New: Module notification can send mail on order or proposal validation. - New: Can use any antivirus on file upload. - New: A customer can also be a prospect. diff --git a/htdocs/admin/adherent.php b/htdocs/admin/adherent.php index 4fb19d27654..9df1552a2d3 100644 --- a/htdocs/admin/adherent.php +++ b/htdocs/admin/adherent.php @@ -97,7 +97,7 @@ $form = new Form($db); // Mail required for members $var=!$var; -print '
'; +print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php new file mode 100644 index 00000000000..1f5738a16d7 --- /dev/null +++ b/htdocs/admin/user.php @@ -0,0 +1,121 @@ + + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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. + */ + +/** + * \file htdocs/admin/user.php + * \ingroup core + * \brief Page to setup user module + * \version $Id$ + */ + +require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); + +$langs->load("admin"); +$langs->load("members"); +$langs->load("users"); + +if (!$user->admin) +accessforbidden(); + + +$typeconst=array('yesno','texte','chaine'); + + +// Action mise a jour ou ajout d'une constante +if ($_POST["action"] == 'update' || $_POST["action"] == 'add') +{ + $result=dolibarr_set_const($db, $_POST["constname"],$_POST["constvalue"],$typeconst[$_POST["consttype"]],0,isset($_POST["constnote"])?$_POST["constnote"]:'',$conf->entity); + if ($result < 0) + { + print $db->error(); + } +} + +// Action activation d'un sous module du module adherent +if ($_GET["action"] == 'set') +{ + $result=dolibarr_set_const($db, $_GET["name"],$_GET["value"],'',0,'',$conf->entity); + if ($result < 0) + { + print $db->error(); + } +} + +// Action desactivation d'un sous module du module adherent +if ($_GET["action"] == 'unset') +{ + $result=dolibarr_del_const($db,$_GET["name"],$conf->entity); + if ($result < 0) + { + print $db->error(); + } +} + + +/* + * View + */ + +llxHeader(); + + +$var=True; + +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("UsersSetup"),$linkback,'setup'); +print "
"; + + +print_fiche_titre($langs->trans("MemberMainOptions"),'',''); +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; +$var=true; +$form = new Form($db); + +// Mail required for members +$var=!$var; +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; +print ''; + +print '
'.$langs->trans("Description").''.$langs->trans("Value").''.$langs->trans("Action").'
".$langs->trans("UserMailRequired").''; +print $form->selectyesno('constvalue',$conf->global->USER_MAIL_REQUIRED,1); +print ''; +print ''; +print "
'; +print '
'; + +$db->close(); + +print '
'; + +llxFooter('$Date$ - $Revision$'); +?> \ No newline at end of file diff --git a/htdocs/includes/modules/modUser.class.php b/htdocs/includes/modules/modUser.class.php index 6a6df3caff2..508c21965c3 100644 --- a/htdocs/includes/modules/modUser.class.php +++ b/htdocs/includes/modules/modUser.class.php @@ -66,7 +66,7 @@ class modUser extends DolibarrModules $this->dirs = array("/users/temp"); // Config pages - // $this->config_page_url = array("/user/admin/index.php"); + $this->config_page_url = array("/admin/user.php"); // Dependancies $this->depends = array(); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 0101607c3cd..8cd28fef944 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -751,6 +751,8 @@ RuleForGeneratedPasswords=Rule to generate suggested passwords or validate passw DoNotSuggest=Do not suggest any password EncryptedPasswordInDatabase=To allow the encryption of the passwords in the database DisableForgetPasswordLinkOnLogonPage=Do not show the link "Forget password" on login page +UsersSetup=Users module setup +UserMailRequired=EMail required to create a new user ##### Company setup ##### CompanySetup=Companies module setup CompanyCodeChecker=Module for third parties code generation and checking (customer or supplier) diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index ce7b9d2bbcc..350bb2f196f 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -751,6 +751,8 @@ RuleForGeneratedPasswords = Règle pour la génération des mots de passe propos DoNotSuggest = Ne pas proposer EncryptedPasswordInDatabase = Permettre l'encryption des mots de passe dans la base de données (Activation recommandée) DisableForgetPasswordLinkOnLogonPage = Ne pas afficher le lien "Mot de passe oublié" sur la page de connexion +UsersSetup=Configuration du module utilisateurs +UserMailRequired=EMail requis pour créer un nouvel utilisateur ##### Company setup ##### = undefined CompanySetup = Configuration du module Sociétés CompanyCodeChecker = Module de génération et contrôle des codes tiers (clients/fournisseurs)