dolibarr/htdocs/includes/modules/security/generate/modules_genpassword.php

93 lines
2.3 KiB
PHP
Raw Normal View History

<?php
2011-09-24 15:44:04 +02:00
/* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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/>.
* or see http://www.gnu.org/
*/
/**
* \file htdocs/includes/modules/security/generate/modules_genpassword.php
* \ingroup core
* \brief File with parent class for password generating classes
*/
require_once(DOL_DOCUMENT_ROOT.'/lib/functions.lib.php');
2007-09-13 20:10:51 +02:00
/**
* \class ModeleGenPassword
* \brief Parent class for password rules/management modules
*/
abstract class ModeleGenPassword
{
2011-09-24 15:44:04 +02:00
var $error='';
2011-09-24 15:44:04 +02:00
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
function isEnabled()
{
return true;
}
2011-09-24 15:44:04 +02:00
/**
* Return description of module
*
* @return string Description of text
*/
function getDescription()
{
global $langs;
return $langs->trans("NoDescription");
}
2011-09-24 15:44:04 +02:00
/**
* Return an example of password generated by this module
*
* @return string Example of password
*/
function getExample()
{
global $langs;
$langs->load("bills");
return $langs->trans("NoExample");
}
/**
2011-09-24 15:44:04 +02:00
* Build new password
*
* @return string Return a new generated password
*/
2011-09-24 15:44:04 +02:00
function getNewGeneratedPassword()
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
2011-09-24 15:44:04 +02:00
* Validate a password
*
* @param string $password Password to check
* @return int 0 if KO, >0 if OK
*/
2011-09-24 15:44:04 +02:00
function validatePassword($password)
{
return 1;
}
}
?>