New: Add an option to make users email reuired.

This commit is contained in:
Laurent Destailleur 2010-01-09 16:11:38 +00:00
parent 950555a2fc
commit 5facc5a160
6 changed files with 128 additions and 2 deletions

View File

@ -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.

View File

@ -97,7 +97,7 @@ $form = new Form($db);
// Mail required for members
$var=!$var;
print '<form action="adherent.php" method="POST">';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">';

121
htdocs/admin/user.php Normal file
View File

@ -0,0 +1,121 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
*
* 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='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("UsersSetup"),$linkback,'setup');
print "<br>";
print_fiche_titre($langs->trans("MemberMainOptions"),'','');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Description").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '<td align="center">'.$langs->trans("Action").'</td>';
print "</tr>\n";
$var=true;
$form = new Form($db);
// Mail required for members
$var=!$var;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="hidden" name="constname" value="USER_MAIL_REQUIRED">';
print "<tr $bc[$var] class=value><td>".$langs->trans("UserMailRequired").'</td><td>';
print $form->selectyesno('constvalue',$conf->global->USER_MAIL_REQUIRED,1);
print '</td><td align="center" width="80">';
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
print "</td></tr>\n";
print '</form>';
print '</table>';
print '<br>';
$db->close();
print '<br>';
llxFooter('$Date$ - $Revision$');
?>

View File

@ -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();

View File

@ -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)

View File

@ -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)