dolibarr 21.0.0-alpha
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 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 * or see https://www.gnu.org/
18 */
19
25require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
26
27
31abstract class ModeleGenPassword
32{
33 public $picto = 'generic';
34
40 public $WithoutAmbi = 0;
41
45 public $error = '';
46
50 public $db;
51
55 public $conf;
56
60 public $langs;
61
65 public $user;
66
72 public $length;
73
79 public $length2;
80
86 public function isEnabled()
87 {
88 return true;
89 }
90
96 public function getDescription()
97 {
98 global $langs;
99 return $langs->trans("NoDescription");
100 }
101
107 public function getExample()
108 {
109 global $langs;
110 $langs->load("bills");
111 return $langs->trans("NoExample");
112 }
113
119 public function getNewGeneratedPassword()
120 {
121 global $langs;
122 return $langs->trans("NotAvailable");
123 }
124
132 public function validatePassword($password)
133 {
134 return 1;
135 }
136}
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.