dolibarr 25.0.0-alpha
modGeneratePassNone.class.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2024-2026 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
26require_once DOL_DOCUMENT_ROOT.'/core/modules/security/generate/modules_genpassword.php';
27
28
33{
37 public $position = 90;
38
42 public $id;
43
44 public $picto = 'fa-keyboard';
45
54 public function __construct($db, $conf, $langs, $user)
55 {
56 $this->id = "none";
57 $this->length = '0';
58 $this->length2 = 0;
59
60 $this->db = $db;
61 $this->conf = $conf;
62 $this->langs = $langs;
63 $this->user = $user;
64 }
65
71 public function isEnabled()
72 {
73 return isPasswordGenerationNoneForbidden() ? false : true;
74 }
75
81 public function getDescription()
82 {
83 global $langs;
84 return $langs->trans("PasswordGenerationNone");
85 }
86
92 public function getExample()
93 {
94 return $this->langs->trans("None");
95 }
96
102 public function getNewGeneratedPassword()
103 {
104 return "";
105 }
106
114 public function validatePassword($password)
115 {
116 dol_syslog("modGeneratePassNone::validatePassword");
117
118 return 1;
119 }
120}
Parent class for password rules/management modules.
Class to generate a password according to rule 'no password'.
isEnabled()
Return if a module can be used or not.
__construct($db, $conf, $langs, $user)
Constructor.
getExample()
Return an example of password generated by this module.
validatePassword($password)
Validate a password.
getDescription()
Return description of module.
getNewGeneratedPassword()
Build new password.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
conf($dolibarr_main_document_root, $realpathconf=null)
Load conf file (file must exists)
Definition inc.php:431
$conf db user
Active Directory does not allow anonymous connections.
Definition repair.php:166
isPasswordGenerationNoneForbidden()
Return if the 'none' password generation model (the one that applies no rule at all) is forbidden on ...