2007-05-05 02:06:07 +02:00
|
|
|
<?php
|
2009-08-21 19:08:15 +02:00
|
|
|
/* Copyright (C) 2007-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
2007-05-05 02:06:07 +02:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2011-08-01 01:24:38 +02:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2007-05-05 02:06:07 +02:00
|
|
|
* or see http://www.gnu.org/
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
2009-08-21 19:08:15 +02:00
|
|
|
* \file htdocs/includes/modules/security/generate/modules_genpassword.php
|
|
|
|
|
* \ingroup core
|
2011-05-01 12:48:43 +02:00
|
|
|
* \brief File with parent class for password generating classes
|
2009-08-21 19:08:15 +02:00
|
|
|
*/
|
2008-04-05 16:18:13 +02:00
|
|
|
require_once(DOL_DOCUMENT_ROOT.'/lib/functions.lib.php');
|
2007-09-13 20:10:51 +02:00
|
|
|
|
2007-05-05 02:06:07 +02:00
|
|
|
|
|
|
|
|
/**
|
2009-08-21 19:08:15 +02:00
|
|
|
* \class ModeleGenPassword
|
|
|
|
|
* \brief Parent class for password rules/management modules
|
|
|
|
|
*/
|
2011-08-28 16:58:29 +02:00
|
|
|
abstract class ModeleGenPassword
|
2007-05-05 02:06:07 +02:00
|
|
|
{
|
|
|
|
|
var $error='';
|
|
|
|
|
|
2008-09-05 01:44:36 +02:00
|
|
|
/** \brief Return if a module can be used or not
|
|
|
|
|
* \return boolean true if module can be used
|
|
|
|
|
*/
|
|
|
|
|
function isEnabled()
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2007-05-05 02:06:07 +02:00
|
|
|
/** \brief Renvoi la description par defaut du modele
|
|
|
|
|
* \return string Texte descripif
|
|
|
|
|
*/
|
|
|
|
|
function info()
|
|
|
|
|
{
|
|
|
|
|
global $langs;
|
|
|
|
|
$langs->load("bills");
|
|
|
|
|
return $langs->trans("NoDescription");
|
|
|
|
|
}
|
2009-08-21 19:08:15 +02:00
|
|
|
|
2007-05-05 02:06:07 +02:00
|
|
|
/** \brief Renvoi un exemple de generation
|
|
|
|
|
* \return string Example
|
|
|
|
|
*/
|
|
|
|
|
function getExample()
|
|
|
|
|
{
|
|
|
|
|
global $langs;
|
|
|
|
|
$langs->load("bills");
|
|
|
|
|
return $langs->trans("NoExample");
|
|
|
|
|
}
|
2009-08-21 19:08:15 +02:00
|
|
|
|
2007-05-05 02:06:07 +02:00
|
|
|
/**
|
2009-08-21 19:08:15 +02:00
|
|
|
* \brief Build new password
|
|
|
|
|
* \return string Return a new generated password
|
2007-05-05 02:06:07 +02:00
|
|
|
*/
|
|
|
|
|
function getNewGeneratedPassword()
|
|
|
|
|
{
|
|
|
|
|
global $langs;
|
|
|
|
|
return $langs->trans("NotAvailable");
|
|
|
|
|
}
|
2009-08-21 19:08:15 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Validate a password
|
|
|
|
|
* \return int 0 if KO, >0 if OK
|
|
|
|
|
*/
|
|
|
|
|
function validatePassword($password)
|
|
|
|
|
{
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2007-05-05 02:06:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|