dolibarr  13.0.2
modGeneratePassNone.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <https://www.gnu.org/licenses/>.
16  * or see https://www.gnu.org/
17  */
18 
25 require_once DOL_DOCUMENT_ROOT.'/core/modules/security/generate/modules_genpassword.php';
26 
27 
33 {
37  public $id;
38 
39  public $length;
40 
44  public $db;
45 
46  public $conf;
47  public $lang;
48  public $user;
49 
50 
59  public function __construct($db, $conf, $langs, $user)
60  {
61  $this->id = "none";
62  $this->length = 0;
63 
64  $this->db = $db;
65  $this->conf = $conf;
66  $this->langs = $langs;
67  $this->user = $user;
68  }
69 
75  public function getDescription()
76  {
77  global $langs;
78  return $langs->trans("PasswordGenerationNone");
79  }
80 
86  public function getExample()
87  {
88  return $this->langs->trans("None");
89  }
90 
96  public function getNewGeneratedPassword()
97  {
98  return "";
99  }
100 
107  public function validatePassword($password)
108  {
109  return 1;
110  }
111 }
Parent class for password rules/management modules.
conf($dolibarr_main_document_root)
Load conf file (file must exists)
Definition: inc.php:262
getExample()
Return an example of password generated by this module.
$conf db
API class for accounts.
Definition: inc.php:54
getNewGeneratedPassword()
Build new password.
$conf db user
Definition: repair.php:109
__construct($db, $conf, $langs, $user)
Constructor.
validatePassword($password)
Validate a password.
getDescription()
Return description of module.
Class to generate a password according to rule &#39;no password&#39;.