2006-03-12 14:15:29 +01:00
|
|
|
<?php
|
2011-05-01 12:48:43 +02:00
|
|
|
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
2006-03-12 14:15:29 +01: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/>.
|
2006-03-12 14:15:29 +01:00
|
|
|
* or see http://www.gnu.org/
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
2008-10-25 13:33:59 +02:00
|
|
|
* \file htdocs/includes/modules/security/generate/modGeneratePassNone.class.php
|
|
|
|
|
* \ingroup core
|
|
|
|
|
* \brief File to manage no password generation.
|
|
|
|
|
*/
|
2006-03-12 14:15:29 +01:00
|
|
|
|
2007-05-05 02:06:07 +02:00
|
|
|
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/security/generate/modules_genpassword.php");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2010-07-21 13:57:52 +02:00
|
|
|
* \class modGeneratePassNone
|
|
|
|
|
* \brief Class to generate a password according to rule 'no password'
|
|
|
|
|
*/
|
2007-05-05 02:06:07 +02:00
|
|
|
class modGeneratePassNone extends ModeleGenPassword
|
2006-03-12 14:15:29 +01:00
|
|
|
{
|
|
|
|
|
var $id;
|
|
|
|
|
var $length;
|
|
|
|
|
|
|
|
|
|
var $db;
|
|
|
|
|
var $conf;
|
|
|
|
|
var $lang;
|
|
|
|
|
var $user;
|
|
|
|
|
|
2009-08-21 19:08:15 +02:00
|
|
|
|
2006-03-12 14:15:29 +01:00
|
|
|
/**
|
2011-09-11 20:35:38 +02:00
|
|
|
* Constructor
|
|
|
|
|
*
|
2011-09-24 15:44:04 +02:00
|
|
|
* @param DoliDB $db Database handler
|
|
|
|
|
* @param Conf $conf Handler de conf
|
|
|
|
|
* @param Translate $langs Handler de langue
|
|
|
|
|
* @param User $user Handler du user connecte
|
2006-03-12 14:15:29 +01:00
|
|
|
*/
|
2006-04-01 14:03:31 +02:00
|
|
|
function modGeneratePassNone($db, $conf, $langs, $user)
|
2006-03-12 14:15:29 +01:00
|
|
|
{
|
2006-04-01 14:03:31 +02:00
|
|
|
$this->id = "none";
|
|
|
|
|
$this->length = 0;
|
2006-03-12 14:15:29 +01:00
|
|
|
|
|
|
|
|
$this->db=$db;
|
|
|
|
|
$this->conf=$conf;
|
|
|
|
|
$this->langs=$langs;
|
|
|
|
|
$this->user=$user;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2011-05-01 12:48:43 +02:00
|
|
|
* Return description of module
|
2011-09-24 15:44:04 +02:00
|
|
|
*
|
2011-05-01 12:48:43 +02:00
|
|
|
* @return string Description of text
|
2006-03-12 14:15:29 +01:00
|
|
|
*/
|
|
|
|
|
function getDescription()
|
|
|
|
|
{
|
2008-10-25 13:33:59 +02:00
|
|
|
global $langs;
|
|
|
|
|
return $langs->trans("PasswordGenerationNone");
|
2006-03-12 14:15:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2011-05-01 12:48:43 +02:00
|
|
|
* Return an example of password generated by this module
|
2011-09-24 15:44:04 +02:00
|
|
|
*
|
2011-05-01 12:48:43 +02:00
|
|
|
* @return string Example of password
|
2006-03-12 14:15:29 +01:00
|
|
|
*/
|
|
|
|
|
function getExample()
|
|
|
|
|
{
|
2006-04-01 14:03:31 +02:00
|
|
|
return $this->langs->trans("None");
|
2006-03-12 14:15:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2011-05-01 12:48:43 +02:00
|
|
|
* Build new password
|
2011-09-24 15:44:04 +02:00
|
|
|
*
|
2011-05-01 12:48:43 +02:00
|
|
|
* @return string Return a new generated password
|
2006-03-12 14:15:29 +01:00
|
|
|
*/
|
|
|
|
|
function getNewGeneratedPassword()
|
|
|
|
|
{
|
2006-04-01 14:03:31 +02:00
|
|
|
return "";
|
2006-03-12 14:15:29 +01:00
|
|
|
}
|
|
|
|
|
|
2009-08-21 19:08:15 +02:00
|
|
|
/**
|
2011-05-01 12:48:43 +02:00
|
|
|
* Validate a password
|
2011-09-24 15:44:04 +02:00
|
|
|
*
|
|
|
|
|
* @param string $password Password to check
|
|
|
|
|
* @return int 0 if KO, >0 if OK
|
2009-08-21 19:08:15 +02:00
|
|
|
*/
|
|
|
|
|
function validatePassword($password)
|
|
|
|
|
{
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2006-03-12 14:15:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|