Fix: Checkstyle warnings

This commit is contained in:
Laurent Destailleur 2012-01-07 23:57:42 +01:00
parent 896cfe62ba
commit ad7aee9fc2
3 changed files with 237 additions and 239 deletions

View File

@ -1,304 +1,304 @@
<?php <?php
# Dolibarr example for conf.php file // Dolibarr example for conf.php file
# //
# Do not edit this file without changing its name. // Do not edit this file without changing its name.
# This file is an example of empty config file for Dolibarr than can be used to create "conf.php". // This file is an example of empty config file for Dolibarr than can be used to create "conf.php".
# //
# Warning: Be sure to not add line feed or spaces after closing php tag. // Warning: Be sure to not add line feed or spaces after closing php tag.
#
################### //###################
# Main parameters # // Main parameters
################### //###################
# dolibarr_main_url_root // dolibarr_main_url_root
# This parameter defines the root URL of your Dolibarr index.php page. // This parameter defines the root URL of your Dolibarr index.php page.
# It must link to the htdocs directory htdocs. // It must link to the htdocs directory htdocs.
# In most cases, this is autodetected but it still required to show full // In most cases, this is autodetected but it still required to show full
# url bookmarks for some services (ie: agenda rss export url, ...) or // url bookmarks for some services (ie: agenda rss export url, ...) or
# when using Apache dir aliases (autodetect fails). // when using Apache dir aliases (autodetect fails).
# Examples: // Examples:
# $dolibarr_main_url_root='http://localhost'; // $dolibarr_main_url_root='http://localhost';
# $dolibarr_main_url_root='http://mydolibarrvirtualhost'; // $dolibarr_main_url_root='http://mydolibarrvirtualhost';
# $dolibarr_main_url_root='http://myserver/dolibarr/htdocs'; // $dolibarr_main_url_root='http://myserver/dolibarr/htdocs';
# $dolibarr_main_url_root='http://myserver/dolibarralias'; // $dolibarr_main_url_root='http://myserver/dolibarralias';
# //
$dolibarr_main_url_root=''; $dolibarr_main_url_root='';
# dolibarr_main_document_root // dolibarr_main_document_root
# This parameter contains absolute file system directory of Dolibarr // This parameter contains absolute file system directory of Dolibarr
# htdocs directory // htdocs directory
# Examples: // Examples:
# $dolibarr_main_document_root='/var/www/dolibarr/htdocs'; // $dolibarr_main_document_root='/var/www/dolibarr/htdocs';
# $dolibarr_main_document_root='C:/My web sites/dolibarr/htdocs'; // $dolibarr_main_document_root='C:/My web sites/dolibarr/htdocs';
# //
$dolibarr_main_document_root=''; $dolibarr_main_document_root='';
# dolibarr_main_url_root_alt // dolibarr_main_url_root_alt
# This parameter defines the alternative URL of your Dolibarr. // This parameter defines the alternative URL of your Dolibarr.
# It must link to a secondary directory htdocs. // It must link to a secondary directory htdocs.
# Examples: // Examples:
# $dolibarr_main_url_root_alt='http://localhost/custom'; // $dolibarr_main_url_root_alt='http://localhost/custom';
# $dolibarr_main_url_root_alt='http://mydolibarrvirtualhost/custom'; // $dolibarr_main_url_root_alt='http://mydolibarrvirtualhost/custom';
# $dolibarr_main_url_root_alt='http://myserver/dolibarr/htdocs/custom'; // $dolibarr_main_url_root_alt='http://myserver/dolibarr/htdocs/custom';
# //
$dolibarr_main_url_root_alt=''; $dolibarr_main_url_root_alt='';
# dolibarr_main_document_root_alt // dolibarr_main_document_root_alt
# This parameter contains absolute alternative file system directory of Dolibarr // This parameter contains absolute alternative file system directory of Dolibarr
# Examples: // Examples:
# $dolibarr_main_document_root_alt='/var/www/dolibarr/htdocs/custom'; // $dolibarr_main_document_root_alt='/var/www/dolibarr/htdocs/custom';
# $dolibarr_main_document_root_alt='C:/My web sites/dolibarr/htdocs/custom'; // $dolibarr_main_document_root_alt='C:/My web sites/dolibarr/htdocs/custom';
# //
$dolibarr_main_document_root_alt=''; $dolibarr_main_document_root_alt='';
# dolibarr_main_data_root // dolibarr_main_data_root
# This parameter contains absolute file system directory of Dolibarr // This parameter contains absolute file system directory of Dolibarr
# directory used to store uploaded and generated physical files. // directory used to store uploaded and generated physical files.
# Examples: // Examples:
# $dolibarr_main_data_root='/var/www/dolibarr/documents'; // $dolibarr_main_data_root='/var/www/dolibarr/documents';
# $dolibarr_main_data_root='E:/My web sites/dolibarr/documents'; // $dolibarr_main_data_root='E:/My web sites/dolibarr/documents';
# //
$dolibarr_main_data_root=''; $dolibarr_main_data_root='';
# dolibarr_main_db_host // dolibarr_main_db_host
# This parameter contains host name or ip address of Dolibarr database // This parameter contains host name or ip address of Dolibarr database
# server. // server.
# Examples: // Examples:
# $dolibarr_main_db_host='localhost'; // $dolibarr_main_db_host='localhost';
# $dolibarr_main_db_host='127.0.0.1'; // $dolibarr_main_db_host='127.0.0.1';
# $dolibarr_main_db_host='192.168.0.10'; // $dolibarr_main_db_host='192.168.0.10';
# $dolibarr_main_db_host='mysql.myserver.com'; // $dolibarr_main_db_host='mysql.myserver.com';
# //
$dolibarr_main_db_host=''; $dolibarr_main_db_host='';
# dolibarr_main_db_port // dolibarr_main_db_port
# This parameter contains the port of the Dolibarr database. // This parameter contains the port of the Dolibarr database.
# Default value: none // Default value: none
# Examples: // Examples:
# $dolibarr_main_db_host='3306'; // $dolibarr_main_db_host='3306';
# //
$dolibarr_main_db_port=''; $dolibarr_main_db_port='';
# dolibarr_main_db_name // dolibarr_main_db_name
# This parameter contains name of Dolibarr database. // This parameter contains name of Dolibarr database.
# Examples: // Examples:
# $dolibarr_main_db_name='dolibarr'; // $dolibarr_main_db_name='dolibarr';
# $dolibarr_main_db_name='mydatabase'; // $dolibarr_main_db_name='mydatabase';
# //
$dolibarr_main_db_name=''; $dolibarr_main_db_name='';
# dolibarr_main_db_prefix // dolibarr_main_db_prefix
# This parameter contains prefix of Dolibarr database. // This parameter contains prefix of Dolibarr database.
# Examples: // Examples:
# $dolibarr_main_db_prefix='llx_'; // $dolibarr_main_db_prefix='llx_';
# //
$dolibarr_main_db_prefix=''; $dolibarr_main_db_prefix='';
# dolibarr_main_db_user // dolibarr_main_db_user
# This parameter contains user name used to read and write into // This parameter contains user name used to read and write into
# Dolibarr database. // Dolibarr database.
# Examples: // Examples:
# $dolibarr_main_db_user='admin'; // $dolibarr_main_db_user='admin';
# $dolibarr_main_db_user='dolibarruser'; // $dolibarr_main_db_user='dolibarruser';
# //
$dolibarr_main_db_user=''; $dolibarr_main_db_user='';
# dolibarr_main_db_pass // dolibarr_main_db_pass
# This parameter contains password used to read and write into // This parameter contains password used to read and write into
# Dolibarr database. // Dolibarr database.
# Examples: // Examples:
# $dolibarr_main_db_pass='myadminpass'; // $dolibarr_main_db_pass='myadminpass';
# $dolibarr_main_db_pass='myuserpassword'; // $dolibarr_main_db_pass='myuserpassword';
# //
$dolibarr_main_db_pass=''; $dolibarr_main_db_pass='';
# dolibarr_main_db_type // dolibarr_main_db_type
# This parameter contains the name of the driver used to access your // This parameter contains the name of the driver used to access your
# Dolibarr database. // Dolibarr database.
# Default value: none // Default value: none
# Possible values: mysql, mysqli, pgsql // Possible values: mysql, mysqli, pgsql
# Examples: // Examples:
# $dolibarr_main_db_type='mysql'; // $dolibarr_main_db_type='mysql';
# $dolibarr_main_db_type='mysqli'; // $dolibarr_main_db_type='mysqli';
# $dolibarr_main_db_type='pgsql'; // $dolibarr_main_db_type='pgsql';
# //
$dolibarr_main_db_type=''; $dolibarr_main_db_type='';
# dolibarr_main_db_character_set // dolibarr_main_db_character_set
# Database character set used to store data (forced during database creation). // Database character set used to store data (forced during database creation).
# Default value: depends on database driver // Default value: depends on database driver
# Examples: // Examples:
# dolibarr_main_db_character_set='latin1'; // dolibarr_main_db_character_set='latin1';
# //
$dolibarr_main_db_character_set='latin1'; $dolibarr_main_db_character_set='latin1';
# dolibarr_main_db_collation // dolibarr_main_db_collation
# Database character set used to sort data (forced during database creation). // Database character set used to sort data (forced during database creation).
# Default value: depends on database driver // Default value: depends on database driver
# Examples: // Examples:
# dolibarr_main_db_collation='latin1_swedish_ci'; // dolibarr_main_db_collation='latin1_swedish_ci';
# //
$dolibarr_main_db_collation='latin1_swedish_ci'; $dolibarr_main_db_collation='latin1_swedish_ci';
################## //##################
# Login # // Login
################## //##################
# dolibarr_main_authentication // dolibarr_main_authentication
# This parameter contains the way authentication is done. // This parameter contains the way authentication is done.
# If value "ldap" is used, you must also set parameters dolibarr_main_auth_ldap_* // If value "ldap" is used, you must also set parameters dolibarr_main_auth_ldap_*
# Default value: dolibarr // Default value: dolibarr
# Possible values: Any values found in files in htdocs/core/login directory after // Possible values: Any values found in files in htdocs/core/login directory after
# the "function_" string and before the ".php" string. You can also separate several // the "function_" string and before the ".php" string. You can also separate several
# values using a ",". In this case, Dolibarr will check login/pass for each value in // values using a ",". In this case, Dolibarr will check login/pass for each value in
# order defined into value. However, note that this can't work with all values. // order defined into value. However, note that this can't work with all values.
# Examples: // Examples:
# $dolibarr_main_authentication='http'; // $dolibarr_main_authentication='http';
# $dolibarr_main_authentication='dolibarr'; // $dolibarr_main_authentication='dolibarr';
# $dolibarr_main_authentication='ldap'; // $dolibarr_main_authentication='ldap';
# $dolibarr_main_authentication='openid,dolibarr'; // $dolibarr_main_authentication='openid,dolibarr';
# //
$dolibarr_main_authentication='dolibarr'; $dolibarr_main_authentication='dolibarr';
# Parameters used to setup LDAP authentication. // Parameters used to setup LDAP authentication.
# Uncomment them if dolibarr_main_authentication = 'ldap' // Uncomment them if dolibarr_main_authentication = 'ldap'
# //
# $dolibarr_main_auth_ldap_host='127.0.0.1'; // $dolibarr_main_auth_ldap_host='127.0.0.1';
# $dolibarr_main_auth_ldap_port='389'; // $dolibarr_main_auth_ldap_port='389';
# $dolibarr_main_auth_ldap_version='3'; // $dolibarr_main_auth_ldap_version='3';
# $dolibarr_main_auth_ldap_servertype='openldap'; # openldap, activedirectory or egroupware // $dolibarr_main_auth_ldap_servertype='openldap'; // openldap, activedirectory or egroupware
# $dolibarr_main_auth_ldap_login_attribute='loginfield'; # Ex: uid or samaccountname for active directory // $dolibarr_main_auth_ldap_login_attribute='loginfield'; // Ex: uid or samaccountname for active directory
# $dolibarr_main_auth_ldap_dn='ou=users,dc=my-domain,dc=com'; # Ex: ou=users,dc=my-domain,dc=com // $dolibarr_main_auth_ldap_dn='ou=users,dc=my-domain,dc=com'; // Ex: ou=users,dc=my-domain,dc=com
# $dolibarr_main_auth_ldap_filter = ''; # If defined, two previous parameters are not used to find a user into LDAP. Ex: (uid=%1%) or &(uid=%1%)(isMemberOf=cn=Sales,ou=Groups,dc=opencsi,dc=com). // $dolibarr_main_auth_ldap_filter = ''; // If defined, two previous parameters are not used to find a user into LDAP. Ex: (uid=%1%) or &(uid=%1%)(isMemberOf=cn=Sales,ou=Groups,dc=opencsi,dc=com).
# $dolibarr_main_auth_ldap_admin_login=''; # Required only if anonymous bind disabled. Ex: cn=admin,dc=example,dc=com // $dolibarr_main_auth_ldap_admin_login=''; // Required only if anonymous bind disabled. Ex: cn=admin,dc=example,dc=com
# $dolibarr_main_auth_ldap_admin_pass=''; # Required only if anonymous bind disabled. Ex: secret // $dolibarr_main_auth_ldap_admin_pass=''; // Required only if anonymous bind disabled. Ex: secret
# $dolibarr_main_auth_ldap_debug='false'; // $dolibarr_main_auth_ldap_debug='false';
# dolibarr_main_demo // dolibarr_main_demo
# Login and pass to use in a demo mode // Login and pass to use in a demo mode
# Default value: '' // Default value: ''
# Examples: // Examples:
# $dolibarr_main_demo='autologin,autopass' // $dolibarr_main_demo='autologin,autopass'
################## //##################
# Security # // Security
################## //##################
# dolibarr_main_force_https // dolibarr_main_force_https
# This parameter allows to force the HTTPS mode. // This parameter allows to force the HTTPS mode.
# Warning: If you enable this parameter, your web server must be configured // Warning: If you enable this parameter, your web server must be configured
# to respond URL with https protocol. // to respond URL with https protocol.
# Default value: 0 // Default value: 0
# Possible values: 0 or 1 // Possible values: 0 or 1
# Examples: // Examples:
# $dolibarr_main_force_https='0'; // $dolibarr_main_force_https='0';
# //
$dolibarr_main_force_https='0'; $dolibarr_main_force_https='0';
# dolibarr_nocsrfcheck // dolibarr_nocsrfcheck
# This parameter can be used to disable CSRF protection. // This parameter can be used to disable CSRF protection.
# This might be required if you access Dolibarr behind a proxy that make // This might be required if you access Dolibarr behind a proxy that make
# URL rewriting, to avoid false alarms. // URL rewriting, to avoid false alarms.
# Default value: 0 // Default value: 0
# Possible values: 0 or 1 // Possible values: 0 or 1
# Examples: // Examples:
# $dolibarr_nocsrfcheck='0'; // $dolibarr_nocsrfcheck='0';
# //
$dolibarr_nocsrfcheck='0'; $dolibarr_nocsrfcheck='0';
# dolibarr_main_prod // dolibarr_main_prod
# When this parameter is defined, all errors messages are not reported. // When this parameter is defined, all errors messages are not reported.
# This feature exists for production usage to avoid to give any information to hackers. // This feature exists for production usage to avoid to give any information to hackers.
# Default value: 0 // Default value: 0
# Possible values: 0 or 1 // Possible values: 0 or 1
# Examples: // Examples:
# $dolibarr_main_prod='0'; // $dolibarr_main_prod='0';
# //
$dolibarr_main_prod='0'; $dolibarr_main_prod='0';
################## //##################
# Other # // Other
################## //##################
# dolibarr_main_limit_users // dolibarr_main_limit_users
# Can set a limit on the number of users it will be possible to create // Can set a limit on the number of users it will be possible to create
# (the superadmin not included), can be used for a restricted mode. // (the superadmin not included), can be used for a restricted mode.
# Default value: 0 (unlimited) // Default value: 0 (unlimited)
# Examples: // Examples:
# $dolibarr_main_limit_users='0'; // $dolibarr_main_limit_users='0';
# dolibarr_mailing_limit_sendbyweb // dolibarr_mailing_limit_sendbyweb
# Can set a limit for mailing send by web, can be used for a restricted mode. // Can set a limit for mailing send by web, can be used for a restricted mode.
# Default value: 0 (use database value if exist) // Default value: 0 (use database value if exist)
# Examples: // Examples:
# $dolibarr_mailing_limit_sendbyweb='0'; // $dolibarr_mailing_limit_sendbyweb='0';
############################## //##############################
# Path to external libraries # // Path to external libraries
############################## //##############################
# Value to overwrite path to use shared libraries instead of embedded one // Value to overwrite path to use shared libraries instead of embedded one
#$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; //$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
# Value to overwrite path to use shared libraries instead of embedded one // Value to overwrite path to use shared libraries instead of embedded one
#$dolibarr_lib_TCPDF_PATH=''; //$dolibarr_lib_TCPDF_PATH='';
# Value to overwrite path to use shared libraries instead of embedded one // Value to overwrite path to use shared libraries instead of embedded one
#$dolibarr_lib_FPDFI_PATH=''; //$dolibarr_lib_FPDFI_PATH='';
# Value to overwrite path to use shared libraries instead of embedded one // Value to overwrite path to use shared libraries instead of embedded one
#$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; //$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
# Value to overwrite path to use shared libraries instead of embedded one // Value to overwrite path to use shared libraries instead of embedded one
#$dolibarr_lib_PHPEXCEL_PATH=''; //$dolibarr_lib_PHPEXCEL_PATH='';
# Value to overwrite path to use shared libraries instead of embedded one // Value to overwrite path to use shared libraries instead of embedded one
#$dolibarr_lib_GEOIP_PATH=''; //$dolibarr_lib_GEOIP_PATH='';
# Value to overwrite path to use shared libraries instead of embedded one // Value to overwrite path to use shared libraries instead of embedded one
#$dolibarr_lib_ODTPHP_PATH=''; //$dolibarr_lib_ODTPHP_PATH='';
# Value to overwrite some path to use shared libraries instead of embedded one // Value to overwrite some path to use shared libraries instead of embedded one
#$dolibarr_lib_ODTPHP_PATHTOPCLZIP="/usr/share/php/libphp-pclzip"; //$dolibarr_lib_ODTPHP_PATHTOPCLZIP="/usr/share/php/libphp-pclzip";
############################## //##############################
# Path to external font # // Path to external font
############################## //##############################
# Value to overwrite some path to use font instead of embedded one // Value to overwrite some path to use font instead of embedded one
#$dolibarr_font_DOL_DEFAULT_TTF="/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf"; //$dolibarr_font_DOL_DEFAULT_TTF="/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf";
#$dolibarr_font_DOL_DEFAULT_TTF_BOLD="/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf"; //$dolibarr_font_DOL_DEFAULT_TTF_BOLD="/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf";
##############################
# Extrernal module #
##############################
# multicompany_transverse_mode //##############################
# Pyramidal (0): The rights and groups are managed in each entity, // Extrernal module
# users belong to the entity for their rights. //##############################
# Transversal (1): The groups can belong only to the master entity
# and that the user belongs to a particular entity // multicompany_transverse_mode
# Default value: 0 (pyramidal) // Pyramidal (0): The rights and groups are managed in each entity,
# Examples: // users belong to the entity for their rights.
# $multicompany_transverse_mode='1'; // Transversal (1): The groups can belong only to the master entity
// and that the user belongs to a particular entity
// Default value: 0 (pyramidal)
// Examples:
// $multicompany_transverse_mode='1';
?> ?>

View File

@ -217,11 +217,11 @@ class InterfaceLdapsynchro
$info=$object->_load_ldap_info(); $info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info); $dn=$object->_load_ldap_dn($info);
// Get a gid number for objectclass PosixGroup // Get a gid number for objectclass PosixGroup
if(in_array('posixGroup',$info['objectclass'])) if(in_array('posixGroup',$info['objectclass']))
$info['gidNumber'] = $ldap->getNextGroupGid(); $info['gidNumber'] = $ldap->getNextGroupGid();
$result=$ldap->add($dn,$info,$user); $result=$ldap->add($dn,$info,$user);
if ($result < 0) if ($result < 0)
{ {
@ -482,7 +482,7 @@ class InterfaceLdapsynchro
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE) if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE)
{ {
# If status field is setup to be synchronized // If status field is setup to be synchronized
if ($conf->global->LDAP_FIELD_MEMBER_STATUS) if ($conf->global->LDAP_FIELD_MEMBER_STATUS)
{ {
$ldap=new Ldap(); $ldap=new Ldap();

View File

@ -753,15 +753,13 @@ function write_conf_file($conffile)
{ {
clearstatcache(); clearstatcache();
fputs($fp, '<?php'); fputs($fp,'<?php'."\n");
fputs($fp,"\n"); fputs($fp,'//'."\n");
fputs($fp,"#\n"); fputs($fp,'// File generated by Dolibarr installer '.DOL_VERSION.' on '.dol_print_date(dol_now(),'')."\n");
fputs($fp,"# File generated by Dolibarr installer ".DOL_VERSION." on ".dol_print_date(dol_now(),'')); fputs($fp,'//'."\n");
fputs($fp,"\n"); fputs($fp,'// Take a look at conf.php.example file for an example of '.$conffiletoshowshort.' file'."\n");
fputs($fp,"#\n"); fputs($fp,'// and explanations for all possibles parameters.'."\n");
fputs($fp,"# Take a look at conf.php.example file for an example of ".$conffiletoshowshort." file\n"); fputs($fp,'//'."\n");
fputs($fp,"# and explanations for all possibles parameters.\n");
fputs($fp,"#\n");
fputs($fp, '$dolibarr_main_url_root=\''.str_replace("'","\'",($_POST["main_url"])).'\';'); fputs($fp, '$dolibarr_main_url_root=\''.str_replace("'","\'",($_POST["main_url"])).'\';');
fputs($fp,"\n"); fputs($fp,"\n");
@ -808,7 +806,7 @@ function write_conf_file($conffile)
fputs($fp, '$dolibarr_main_authentication=\'dolibarr\';'); fputs($fp, '$dolibarr_main_authentication=\'dolibarr\';');
fputs($fp,"\n\n"); fputs($fp,"\n\n");
fputs($fp, '# Specific settings'); fputs($fp, '// Specific settings');
fputs($fp,"\n"); fputs($fp,"\n");
fputs($fp, '$dolibarr_main_prod=\'0\';'); fputs($fp, '$dolibarr_main_prod=\'0\';');