dolibarr 21.0.0-beta
modules_genpassword.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
4 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 * or see https://www.gnu.org/
19 */
20
26require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
27
28
32abstract class ModeleGenPassword
33{
37 public $id;
38
42 public $version;
43
47 public $picto = 'generic';
48
54 public $WithoutAmbi = 0;
55
59 public $error = '';
60
64 public $db;
65
69 public $conf;
70
74 public $langs;
75
79 public $user;
80
86 public $length;
87
93 public $length2;
94
100 public function isEnabled()
101 {
102 return true;
103 }
104
110 public function getDescription()
111 {
112 global $langs;
113 return $langs->trans("NoDescription");
114 }
115
121 public function getExample()
122 {
123 global $langs;
124 $langs->load("bills");
125 return $langs->trans("NoExample");
126 }
127
133 public function getNewGeneratedPassword()
134 {
135 global $langs;
136 return $langs->trans("NotAvailable");
137 }
138
146 public function validatePassword($password)
147 {
148 return 1;
149 }
150}
Parent class for password rules/management modules.
getDescription()
Return description of module.
isEnabled()
Return if a module can be used or not.
validatePassword($password)
Validate a password.
getExample()
Return an example of password generated by this module.
getNewGeneratedPassword()
Build new password.