2
0
forked from Wavyzz/dolibarr

Fix: include security.lib.php by default

This commit is contained in:
Regis Houssin
2011-09-06 07:41:14 +00:00
parent 7e8ec1688f
commit b50f9867e8
16 changed files with 2 additions and 21 deletions

View File

@@ -752,7 +752,6 @@ class Adherent extends CommonObject
// If new password not provided, we generate one // If new password not provided, we generate one
if (! $password) if (! $password)
{ {
include_once(DOL_DOCUMENT_ROOT.'/lib/security.lib.php');
$password=getRandomPassword(''); $password=getRandomPassword('');
} }
@@ -1389,8 +1388,6 @@ class Adherent extends CommonObject
*/ */
function add_to_spip() function add_to_spip()
{ {
require_once(DOL_DOCUMENT_ROOT.'/lib/security.lib.php');
dol_syslog(get_class($this)."::add_to_spip"); dol_syslog(get_class($this)."::add_to_spip");
if (defined("ADHERENT_USE_SPIP") && ADHERENT_USE_SPIP ==1 && if (defined("ADHERENT_USE_SPIP") && ADHERENT_USE_SPIP ==1 &&

View File

@@ -710,7 +710,6 @@ if ($action == 'create')
// Password // Password
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{ {
include_once(DOL_DOCUMENT_ROOT.'/lib/security.lib.php');
$generated_password=getRandomPassword(''); $generated_password=getRandomPassword('');
print '<tr><td><span class="fieldrequired">'.$langs->trans("Password").'</span></td><td>'; print '<tr><td><span class="fieldrequired">'.$langs->trans("Password").'</span></td><td>';
print '<input size="30" maxsize="32" type="text" name="password" value="'.$generated_password.'">'; print '<input size="30" maxsize="32" type="text" name="password" value="'.$generated_password.'">';

View File

@@ -25,7 +25,6 @@
*/ */
require("../main.inc.php"); require("../main.inc.php");
require_once(DOL_DOCUMENT_ROOT.'/lib/security.lib.php');
llxHeader(); llxHeader();

View File

@@ -24,7 +24,6 @@
require("../main.inc.php"); require("../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
require_once(DOL_DOCUMENT_ROOT.'/lib/security.lib.php');
$langs->load("users"); $langs->load("users");
$langs->load("admin"); $langs->load("admin");

View File

@@ -339,7 +339,6 @@ abstract class ActionsContactCardCommon
$generated_password=''; $generated_password='';
if (! $ldap_sid) if (! $ldap_sid)
{ {
include_once(DOL_DOCUMENT_ROOT.'/lib/security.lib.php');
$generated_password=getRandomPassword(''); $generated_password=getRandomPassword('');
} }
$password=$generated_password; $password=$generated_password;

View File

@@ -760,7 +760,6 @@ else
$generated_password=''; $generated_password='';
if (! $ldap_sid) // TODO ldap_sid ? if (! $ldap_sid) // TODO ldap_sid ?
{ {
include_once(DOL_DOCUMENT_ROOT.'/lib/security.lib.php');
$generated_password=getRandomPassword(''); $generated_password=getRandomPassword('');
} }
$password=$generated_password; $password=$generated_password;

View File

@@ -28,8 +28,6 @@ if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
require('../main.inc.php'); require('../main.inc.php');
require_once(DOL_DOCUMENT_ROOT."/lib/security.lib.php");
/* /*
* View * View

View File

@@ -187,12 +187,11 @@ if (! file_exists(DOL_DOCUMENT_ROOT ."/lib/functions.lib.php"))
} }
include_once(DOL_DOCUMENT_ROOT ."/lib/functions.lib.php"); // Need 970ko memory (1.1 in 2.2) include_once(DOL_DOCUMENT_ROOT ."/lib/functions.lib.php"); // Need 970ko memory (1.1 in 2.2)
include_once(DOL_DOCUMENT_ROOT ."/lib/security.lib.php"); // Include by default
// If password is encoded, we decode it // If password is encoded, we decode it
if (preg_match('/crypted:/i',$dolibarr_main_db_pass) || ! empty($dolibarr_main_db_encrypted_pass)) if (preg_match('/crypted:/i',$dolibarr_main_db_pass) || ! empty($dolibarr_main_db_encrypted_pass))
{ {
require_once(DOL_DOCUMENT_ROOT ."/lib/security.lib.php");
if (preg_match('/crypted:/i',$dolibarr_main_db_pass)) if (preg_match('/crypted:/i',$dolibarr_main_db_pass))
{ {
$dolibarr_main_db_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass); $dolibarr_main_db_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass);

View File

@@ -519,7 +519,6 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
// If we need to make a virus scan // If we need to make a virus scan
if (empty($disablevirusscan) && file_exists($src_file) && ! empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) if (empty($disablevirusscan) && file_exists($src_file) && ! empty($conf->global->MAIN_ANTIVIRUS_COMMAND))
{ {
require_once(DOL_DOCUMENT_ROOT.'/lib/security.lib.php');
require_once(DOL_DOCUMENT_ROOT.'/lib/antivir.class.php'); require_once(DOL_DOCUMENT_ROOT.'/lib/antivir.class.php');
$antivir=new AntiVir($db); $antivir=new AntiVir($db);
$result = $antivir->dol_avscan_file($src_file); $result = $antivir->dol_avscan_file($src_file);

View File

@@ -92,7 +92,7 @@ function GETPOST($paramname,$check='',$method=0)
*/ */
function dol_getprefix() function dol_getprefix()
{ {
return md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT.DOL_URL_ROOT); return dol_hash($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT.DOL_URL_ROOT);
} }
/** /**

View File

@@ -354,7 +354,6 @@ if (! defined('NOLOGIN'))
// Validation of login with a third party login module method // Validation of login with a third party login module method
if (is_array($conf->login_method_modules) && !empty($conf->login_method_modules)) if (is_array($conf->login_method_modules) && !empty($conf->login_method_modules))
{ {
include_once(DOL_DOCUMENT_ROOT . "/lib/security.lib.php");
$login = getLoginMethod(); $login = getLoginMethod();
if ($login) $test=false; if ($login) $test=false;
} }
@@ -426,7 +425,6 @@ if (! defined('NOLOGIN'))
if (! $login) if (! $login)
{ {
// We show login page // We show login page
include_once(DOL_DOCUMENT_ROOT."/lib/security.lib.php");
if (! is_object($langs)) // This can occurs when calling page with NOREQUIRETRAN defined if (! is_object($langs)) // This can occurs when calling page with NOREQUIRETRAN defined
{ {
include_once(DOL_DOCUMENT_ROOT."/core/class/translate.class.php"); include_once(DOL_DOCUMENT_ROOT."/core/class/translate.class.php");

View File

@@ -26,7 +26,6 @@
require("../../main.inc.php"); require("../../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypal.lib.php"); require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypal.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/security.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
$servicename='PayPal'; $servicename='PayPal';

View File

@@ -166,7 +166,6 @@ function paypaladmin_prepare_head()
function getPaypalPaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_free_tag') function getPaypalPaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_free_tag')
{ {
global $conf; global $conf;
require_once(DOL_DOCUMENT_ROOT."/lib/security.lib.php");
if ($type == 'free') if ($type == 'free')
{ {

View File

@@ -31,7 +31,6 @@ require("../../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypal.lib.php"); require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypal.lib.php");
require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypalfunctions.lib.php"); require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypalfunctions.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/security.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");

View File

@@ -1238,7 +1238,6 @@ class User extends CommonObject
// If new password not provided, we generate one // If new password not provided, we generate one
if (! $password) if (! $password)
{ {
include_once(DOL_DOCUMENT_ROOT.'/lib/security.lib.php');
$password=getRandomPassword(''); $password=getRandomPassword('');
} }

View File

@@ -631,7 +631,6 @@ if (($action == 'create') || ($action == 'adduserldap'))
$generated_password=''; $generated_password='';
if (! $ldap_sid) if (! $ldap_sid)
{ {
include_once(DOL_DOCUMENT_ROOT.'/lib/security.lib.php');
$generated_password=getRandomPassword(''); $generated_password=getRandomPassword('');
} }
$password=$generated_password; $password=$generated_password;