dolibarr 21.0.0-beta
modules_captcha.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 ModeleCaptcha
33{
37 public $id;
38
42 public $version;
43
47 public $picto = 'generic';
48
52 public $error = '';
53
57 public $db;
58
62 public $conf;
63
67 public $langs;
68
72 public $user;
73
74
80 public function isEnabled()
81 {
82 return true;
83 }
84
85
91 public function getDescription()
92 {
93 global $langs;
94 return $langs->trans("NoDescription");
95 }
96
102 public function getExample()
103 {
104 global $langs;
105 $langs->load("bills");
106 return $langs->trans("NoExample");
107 }
108
115 public function getCaptchaCodeForForm($php_self = '')
116 {
117 return '';
118 }
119
127 {
128 return 1;
129 }
130}
Parent class for password rules/management modules.
validateCodeAfterLoginSubmit()
Validate a captcha This function is called after a log to validate a captcha, before validating a pas...
getDescription()
Return description of module.
getExample()
Return an example of password generated by this module.
isEnabled()
Return if a module can be used or not.
getCaptchaCodeForForm($php_self='')
Return the HTML content to output on a form that need the captcha.