Lowercase NULL, TRUE, FALSE according to PSR2
This commit is contained in:
parent
c702c88fde
commit
0d0da234b1
@ -118,9 +118,9 @@ class PrestaShopWebservice
|
|||||||
public function executeRequest($url, $curl_params = array())
|
public function executeRequest($url, $curl_params = array())
|
||||||
{
|
{
|
||||||
$defaultParams = array(
|
$defaultParams = array(
|
||||||
CURLOPT_HEADER => TRUE,
|
CURLOPT_HEADER => true,
|
||||||
CURLOPT_RETURNTRANSFER => TRUE,
|
CURLOPT_RETURNTRANSFER => true,
|
||||||
CURLINFO_HEADER_OUT => TRUE,
|
CURLINFO_HEADER_OUT => true,
|
||||||
CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
|
CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
|
||||||
CURLOPT_USERPWD => $this->key.':',
|
CURLOPT_USERPWD => $this->key.':',
|
||||||
CURLOPT_HTTPHEADER => array( 'Expect:' )
|
CURLOPT_HTTPHEADER => array( 'Expect:' )
|
||||||
|
|||||||
@ -280,7 +280,7 @@ function backup_tables($outputfile, $tables='*')
|
|||||||
|
|
||||||
//cycle through
|
//cycle through
|
||||||
$handle = fopen($outputfile, 'w+');
|
$handle = fopen($outputfile, 'w+');
|
||||||
if (fwrite($handle, '') === FALSE)
|
if (fwrite($handle, '') === false)
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
dol_syslog("Failed to open file ".$outputfile,LOG_ERR);
|
dol_syslog("Failed to open file ".$outputfile,LOG_ERR);
|
||||||
|
|||||||
@ -170,7 +170,7 @@ class Setup extends DolibarrApi
|
|||||||
// and then apply the filter if there is one.
|
// and then apply the filter if there is one.
|
||||||
$this->translateLabel($country, $lang);
|
$this->translateLabel($country, $lang);
|
||||||
|
|
||||||
if (empty($filter) || stripos($country->label, $filter) !== FALSE) {
|
if (empty($filter) || stripos($country->label, $filter) !== false) {
|
||||||
$list[] = $this->_cleanObjectDatas($country);
|
$list[] = $this->_cleanObjectDatas($country);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -292,7 +292,7 @@ class Facturation
|
|||||||
else if ( $aId == 'RESET' )
|
else if ( $aId == 'RESET' )
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->id = NULL;
|
$this->id = null;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -318,7 +318,7 @@ class Facturation
|
|||||||
}
|
}
|
||||||
else if ( $aRef == 'RESET' )
|
else if ( $aRef == 'RESET' )
|
||||||
{
|
{
|
||||||
$this->ref = NULL;
|
$this->ref = null;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -342,7 +342,7 @@ class Facturation
|
|||||||
else if ( $aQte == 'RESET' )
|
else if ( $aQte == 'RESET' )
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->qte = NULL;
|
$this->qte = null;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -366,7 +366,7 @@ class Facturation
|
|||||||
}
|
}
|
||||||
else if ( $aStock == 'RESET' )
|
else if ( $aStock == 'RESET' )
|
||||||
{
|
{
|
||||||
$this->stock = NULL;
|
$this->stock = null;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -390,7 +390,7 @@ class Facturation
|
|||||||
}
|
}
|
||||||
else if ($aRemisePercent == 'RESET')
|
else if ($aRemisePercent == 'RESET')
|
||||||
{
|
{
|
||||||
$this->remise_percent = NULL;
|
$this->remise_percent = null;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -414,7 +414,7 @@ class Facturation
|
|||||||
|
|
||||||
} else if ( $aMontantRemise == 'RESET' ) {
|
} else if ( $aMontantRemise == 'RESET' ) {
|
||||||
|
|
||||||
$this->montant_remise = NULL;
|
$this->montant_remise = null;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -439,7 +439,7 @@ class Facturation
|
|||||||
|
|
||||||
} else if ( $aPrix == 'RESET' ) {
|
} else if ( $aPrix == 'RESET' ) {
|
||||||
|
|
||||||
$this->prix = NULL;
|
$this->prix = null;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -463,7 +463,7 @@ class Facturation
|
|||||||
|
|
||||||
} else if ( $aTva == 'RESET' ) {
|
} else if ( $aTva == 'RESET' ) {
|
||||||
|
|
||||||
$this->tva = NULL;
|
$this->tva = null;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -487,7 +487,7 @@ class Facturation
|
|||||||
|
|
||||||
} else if ( $aNumFacture == 'RESET' ) {
|
} else if ( $aNumFacture == 'RESET' ) {
|
||||||
|
|
||||||
$this->num_facture = NULL;
|
$this->num_facture = null;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -511,7 +511,7 @@ class Facturation
|
|||||||
|
|
||||||
} else if ( $aModeReglement == 'RESET' ) {
|
} else if ( $aModeReglement == 'RESET' ) {
|
||||||
|
|
||||||
$this->mode_reglement = NULL;
|
$this->mode_reglement = null;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -536,7 +536,7 @@ class Facturation
|
|||||||
|
|
||||||
} else if ( $aMontantEncaisse == 'RESET' ) {
|
} else if ( $aMontantEncaisse == 'RESET' ) {
|
||||||
|
|
||||||
$this->montant_encaisse = NULL;
|
$this->montant_encaisse = null;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -560,7 +560,7 @@ class Facturation
|
|||||||
return $this->montant_rendu;
|
return $this->montant_rendu;
|
||||||
} else if ( $aMontantRendu == 'RESET' ) {
|
} else if ( $aMontantRendu == 'RESET' ) {
|
||||||
|
|
||||||
$this->montant_rendu = NULL;
|
$this->montant_rendu = null;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -584,7 +584,7 @@ class Facturation
|
|||||||
|
|
||||||
} else if ( $aPaiementLe == 'RESET' ) {
|
} else if ( $aPaiementLe == 'RESET' ) {
|
||||||
|
|
||||||
$this->paiement_le = NULL;
|
$this->paiement_le = null;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -607,7 +607,7 @@ class Facturation
|
|||||||
|
|
||||||
} else if ( $aTotalHt == 'RESET' ) {
|
} else if ( $aTotalHt == 'RESET' ) {
|
||||||
|
|
||||||
$this->prix_total_ht = NULL;
|
$this->prix_total_ht = null;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -630,7 +630,7 @@ class Facturation
|
|||||||
|
|
||||||
} else if ( $aMontantTva == 'RESET' ) {
|
} else if ( $aMontantTva == 'RESET' ) {
|
||||||
|
|
||||||
$this->montant_tva = NULL;
|
$this->montant_tva = null;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -654,7 +654,7 @@ class Facturation
|
|||||||
}
|
}
|
||||||
else if ( $aTotalTtc == 'RESET' )
|
else if ( $aTotalTtc == 'RESET' )
|
||||||
{
|
{
|
||||||
$this->prix_total_ttc = NULL;
|
$this->prix_total_ttc = null;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -172,7 +172,7 @@ class Categories extends DolibarrApi
|
|||||||
* @param array $request_data Request data
|
* @param array $request_data Request data
|
||||||
* @return int ID of category
|
* @return int ID of category
|
||||||
*/
|
*/
|
||||||
function post($request_data = NULL)
|
function post($request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->categorie->creer) {
|
if(! DolibarrApiAccess::$user->rights->categorie->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -197,7 +197,7 @@ class Categories extends DolibarrApi
|
|||||||
* @param array $request_data Datas
|
* @param array $request_data Datas
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = NULL)
|
function put($id, $request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->categorie->creer) {
|
if(! DolibarrApiAccess::$user->rights->categorie->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
|
|||||||
@ -187,7 +187,7 @@ class AgendaEvents extends DolibarrApi
|
|||||||
* @param array $request_data Request data
|
* @param array $request_data Request data
|
||||||
* @return int ID of Agenda Event
|
* @return int ID of Agenda Event
|
||||||
*/
|
*/
|
||||||
function post($request_data = NULL)
|
function post($request_data = null)
|
||||||
{
|
{
|
||||||
if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) {
|
if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) {
|
||||||
throw new RestException(401, "Insuffisant rights to create your Agenda Event");
|
throw new RestException(401, "Insuffisant rights to create your Agenda Event");
|
||||||
@ -226,7 +226,7 @@ class AgendaEvents extends DolibarrApi
|
|||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
function put($id, $request_data = NULL) {
|
function put($id, $request_data = null) {
|
||||||
if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) {
|
if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) {
|
||||||
throw new RestException(401, "Insuffisant rights to create your Agenda Event");
|
throw new RestException(401, "Insuffisant rights to create your Agenda Event");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -176,7 +176,7 @@ class Proposals extends DolibarrApi
|
|||||||
* @param array $request_data Request data
|
* @param array $request_data Request data
|
||||||
* @return int ID of proposal
|
* @return int ID of proposal
|
||||||
*/
|
*/
|
||||||
function post($request_data = NULL)
|
function post($request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||||
throw new RestException(401, "Insuffisant rights");
|
throw new RestException(401, "Insuffisant rights");
|
||||||
@ -241,7 +241,7 @@ class Proposals extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function postLine($id, $request_data = NULL)
|
function postLine($id, $request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -307,7 +307,7 @@ class Proposals extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
function putLine($id, $lineid, $request_data = NULL)
|
function putLine($id, $lineid, $request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -410,7 +410,7 @@ class Proposals extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = NULL) {
|
function put($id, $request_data = null) {
|
||||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -179,7 +179,7 @@ class Orders extends DolibarrApi
|
|||||||
* @param array $request_data Request data
|
* @param array $request_data Request data
|
||||||
* @return int ID of order
|
* @return int ID of order
|
||||||
*/
|
*/
|
||||||
function post($request_data = NULL)
|
function post($request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->commande->creer) {
|
if(! DolibarrApiAccess::$user->rights->commande->creer) {
|
||||||
throw new RestException(401, "Insuffisant rights");
|
throw new RestException(401, "Insuffisant rights");
|
||||||
@ -245,7 +245,7 @@ class Orders extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function postLine($id, $request_data = NULL) {
|
function postLine($id, $request_data = null) {
|
||||||
if(! DolibarrApiAccess::$user->rights->commande->creer) {
|
if(! DolibarrApiAccess::$user->rights->commande->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -308,7 +308,7 @@ class Orders extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
function putLine($id, $lineid, $request_data = NULL) {
|
function putLine($id, $lineid, $request_data = null) {
|
||||||
if(! DolibarrApiAccess::$user->rights->commande->creer) {
|
if(! DolibarrApiAccess::$user->rights->commande->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -402,7 +402,7 @@ class Orders extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = NULL) {
|
function put($id, $request_data = null) {
|
||||||
if (! DolibarrApiAccess::$user->rights->commande->creer) {
|
if (! DolibarrApiAccess::$user->rights->commande->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -823,7 +823,7 @@ class Commande extends CommonOrder
|
|||||||
$line = $this->lines[$i];
|
$line = $this->lines[$i];
|
||||||
|
|
||||||
// Test and convert into object this->lines[$i]. When coming from REST API, we may still have an array
|
// Test and convert into object this->lines[$i]. When coming from REST API, we may still have an array
|
||||||
//if (! is_object($line)) $line=json_decode(json_encode($line), FALSE); // convert recursively array into object.
|
//if (! is_object($line)) $line=json_decode(json_encode($line), false); // convert recursively array into object.
|
||||||
if (! is_object($line)) $line = (object) $line;
|
if (! is_object($line)) $line = (object) $line;
|
||||||
|
|
||||||
// Reset fk_parent_line for no child products and special product
|
// Reset fk_parent_line for no child products and special product
|
||||||
|
|||||||
@ -196,7 +196,7 @@ class Invoices extends DolibarrApi
|
|||||||
* @param array $request_data Request datas
|
* @param array $request_data Request datas
|
||||||
* @return int ID of invoice
|
* @return int ID of invoice
|
||||||
*/
|
*/
|
||||||
function post($request_data = NULL)
|
function post($request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||||
throw new RestException(401, "Insuffisant rights");
|
throw new RestException(401, "Insuffisant rights");
|
||||||
@ -313,7 +313,7 @@ class Invoices extends DolibarrApi
|
|||||||
* @throws 401
|
* @throws 401
|
||||||
* @throws 404
|
* @throws 404
|
||||||
*/
|
*/
|
||||||
function putLine($id, $lineid, $request_data = NULL) {
|
function putLine($id, $lineid, $request_data = null) {
|
||||||
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -414,7 +414,7 @@ class Invoices extends DolibarrApi
|
|||||||
* @param array $request_data Datas
|
* @param array $request_data Datas
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = NULL)
|
function put($id, $request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -499,7 +499,7 @@ class Invoices extends DolibarrApi
|
|||||||
* @throws 404
|
* @throws 404
|
||||||
* @throws 400
|
* @throws 400
|
||||||
*/
|
*/
|
||||||
function postLine($id, $request_data = NULL) {
|
function postLine($id, $request_data = null) {
|
||||||
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -613,7 +613,7 @@ class Facture extends CommonInvoice
|
|||||||
$line = $this->lines[$i];
|
$line = $this->lines[$i];
|
||||||
|
|
||||||
// Test and convert into object this->lines[$i]. When coming from REST API, we may still have an array
|
// Test and convert into object this->lines[$i]. When coming from REST API, we may still have an array
|
||||||
//if (! is_object($line)) $line=json_decode(json_encode($line), FALSE); // convert recursively array into object.
|
//if (! is_object($line)) $line=json_decode(json_encode($line), false); // convert recursively array into object.
|
||||||
if (! is_object($line)) $line = (object) $line;
|
if (! is_object($line)) $line = (object) $line;
|
||||||
|
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
|
|||||||
@ -182,7 +182,7 @@ class Contracts extends DolibarrApi
|
|||||||
* @param array $request_data Request data
|
* @param array $request_data Request data
|
||||||
* @return int ID of contrat
|
* @return int ID of contrat
|
||||||
*/
|
*/
|
||||||
function post($request_data = NULL)
|
function post($request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
||||||
throw new RestException(401, "Insuffisant rights");
|
throw new RestException(401, "Insuffisant rights");
|
||||||
@ -247,7 +247,7 @@ class Contracts extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function postLine($id, $request_data = NULL) {
|
function postLine($id, $request_data = null) {
|
||||||
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -300,7 +300,7 @@ class Contracts extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
function putLine($id, $lineid, $request_data = NULL) {
|
function putLine($id, $lineid, $request_data = null) {
|
||||||
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -359,7 +359,7 @@ class Contracts extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
function activateLine($id, $lineid, $datestart, $dateend = NULL, $comment = NULL) {
|
function activateLine($id, $lineid, $datestart, $dateend = null, $comment = null) {
|
||||||
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -396,7 +396,7 @@ class Contracts extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
function unactivateLine($id, $lineid, $datestart, $comment = NULL) {
|
function unactivateLine($id, $lineid, $datestart, $comment = null) {
|
||||||
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -470,7 +470,7 @@ class Contracts extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = NULL) {
|
function put($id, $request_data = null) {
|
||||||
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -347,9 +347,9 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
if (!$folder) $folder = "Sent"; // Default Sent folder
|
if (!$folder) $folder = "Sent"; // Default Sent folder
|
||||||
|
|
||||||
$mailboxconfig->mbox = imap_open($mailboxconfig->get_connector_url().$folder, $mailboxconfig->mailbox_imap_login, $mailboxconfig->mailbox_imap_password);
|
$mailboxconfig->mbox = imap_open($mailboxconfig->get_connector_url().$folder, $mailboxconfig->mailbox_imap_login, $mailboxconfig->mailbox_imap_password);
|
||||||
if (FALSE === $mailboxconfig->mbox)
|
if (false === $mailboxconfig->mbox)
|
||||||
{
|
{
|
||||||
$info = FALSE;
|
$info = false;
|
||||||
$err = $langs->trans('Error3_Imap_Connection_Error');
|
$err = $langs->trans('Error3_Imap_Connection_Error');
|
||||||
setEventMessages($err,$mailboxconfig->element, null, 'errors');
|
setEventMessages($err,$mailboxconfig->element, null, 'errors');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6644,7 +6644,7 @@ abstract class CommonObject
|
|||||||
{
|
{
|
||||||
$this->{$field} = @unserialize($obj->{$field});
|
$this->{$field} = @unserialize($obj->{$field});
|
||||||
// Hack for data not in UTF8
|
// Hack for data not in UTF8
|
||||||
if($this->{$field } === FALSE) @unserialize(utf8_decode($obj->{$field}));
|
if($this->{$field } === false) @unserialize(utf8_decode($obj->{$field}));
|
||||||
}
|
}
|
||||||
elseif($this->isInt($info))
|
elseif($this->isInt($info))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -50,7 +50,7 @@ class DolCookie
|
|||||||
*/
|
*/
|
||||||
function __construct($key = '')
|
function __construct($key = '')
|
||||||
{
|
{
|
||||||
$this->_myKey = hash('sha256', $key, TRUE);
|
$this->_myKey = hash('sha256', $key, true);
|
||||||
$this->_iv = md5(md5($this->_myKey));
|
$this->_iv = md5(md5($this->_myKey));
|
||||||
$this->cookie = "";
|
$this->cookie = "";
|
||||||
$this->myCookie = "";
|
$this->myCookie = "";
|
||||||
|
|||||||
@ -674,7 +674,7 @@ class DolGraph
|
|||||||
$group->setPadding($paddleft, $paddright); // Width on left and right for Y axis values
|
$group->setPadding($paddleft, $paddright); // Width on left and right for Y axis values
|
||||||
$group->legend->setSpace(0);
|
$group->legend->setSpace(0);
|
||||||
$group->legend->setPadding(2,2,2,2);
|
$group->legend->setPadding(2,2,2,2);
|
||||||
$group->legend->setPosition(NULL,0.1);
|
$group->legend->setPosition(null, 0.1);
|
||||||
$group->legend->setBackgroundColor($colorsemitrans);
|
$group->legend->setBackgroundColor($colorsemitrans);
|
||||||
|
|
||||||
if (is_array($this->bgcolorgrid)) $group->grid->setBackgroundColor($bgcolorgrid);
|
if (is_array($this->bgcolorgrid)) $group->grid->setBackgroundColor($bgcolorgrid);
|
||||||
@ -734,7 +734,7 @@ class DolGraph
|
|||||||
$plot->barShadow->setSize($this->SetShading);
|
$plot->barShadow->setSize($this->SetShading);
|
||||||
$plot->barShadow->setPosition(SHADOW_RIGHT_TOP);
|
$plot->barShadow->setPosition(SHADOW_RIGHT_TOP);
|
||||||
$plot->barShadow->setColor(new Color(160, 160, 160, 50));
|
$plot->barShadow->setColor(new Color(160, 160, 160, 50));
|
||||||
$plot->barShadow->smooth(TRUE);
|
$plot->barShadow->smooth(true);
|
||||||
//$plot->setSize(1, 0.96);
|
//$plot->setSize(1, 0.96);
|
||||||
//$plot->setCenter(0.5, 0.52);
|
//$plot->setCenter(0.5, 0.52);
|
||||||
|
|
||||||
|
|||||||
@ -225,7 +225,7 @@ class FileUpload
|
|||||||
* getFileObject
|
* getFileObject
|
||||||
*
|
*
|
||||||
* @param string $file_name Filename
|
* @param string $file_name Filename
|
||||||
* @return stdClass|NULL
|
* @return stdClass|null
|
||||||
*/
|
*/
|
||||||
protected function getFileObject($file_name)
|
protected function getFileObject($file_name)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -502,7 +502,7 @@ class Ldap
|
|||||||
* @param string $newrdn New RDN entry key (uid=qqq)
|
* @param string $newrdn New RDN entry key (uid=qqq)
|
||||||
* @param string $newparent New parent (ou=xxx,dc=aaa,dc=bbb)
|
* @param string $newparent New parent (ou=xxx,dc=aaa,dc=bbb)
|
||||||
* @param User $user Objet user that modify
|
* @param User $user Objet user that modify
|
||||||
* @param bool $deleteoldrdn If TRUE the old RDN value(s) is removed, else the old RDN value(s) is retained as non-distinguished values of the entry.
|
* @param bool $deleteoldrdn If true the old RDN value(s) is removed, else the old RDN value(s) is retained as non-distinguished values of the entry.
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function rename($dn, $newrdn, $newparent, $user, $deleteoldrdn = true)
|
function rename($dn, $newrdn, $newparent, $user, $deleteoldrdn = true)
|
||||||
|
|||||||
@ -753,7 +753,7 @@ function xml2php($xml)
|
|||||||
{
|
{
|
||||||
//If this element is already in the array we will create an indexed array
|
//If this element is already in the array we will create an indexed array
|
||||||
$tmp = $array[$key];
|
$tmp = $array[$key];
|
||||||
$array[$key] = NULL;
|
$array[$key] = null;
|
||||||
$array[$key][] = $tmp;
|
$array[$key][] = $tmp;
|
||||||
$array[$key][] = $child;
|
$array[$key][] = $child;
|
||||||
$tab = true;
|
$tab = true;
|
||||||
|
|||||||
@ -647,7 +647,7 @@ class SMTPs
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Returns constructed SELECT Object string or boolean upon failure
|
* Returns constructed SELECT Object string or boolean upon failure
|
||||||
* Default value is set at TRUE
|
* Default value is set at true
|
||||||
*/
|
*/
|
||||||
$_retVal = true;
|
$_retVal = true;
|
||||||
|
|
||||||
@ -655,7 +655,7 @@ class SMTPs
|
|||||||
if ( ! empty ($_strConfigPath) )
|
if ( ! empty ($_strConfigPath) )
|
||||||
{
|
{
|
||||||
// If the path is not valid, this will NOT generate an error,
|
// If the path is not valid, this will NOT generate an error,
|
||||||
// it will simply return FALSE.
|
// it will simply return false.
|
||||||
if ( ! @include ( $_strConfigPath ) )
|
if ( ! @include ( $_strConfigPath ) )
|
||||||
{
|
{
|
||||||
$this->_setErr(110, '"' . $_strConfigPath . '" is not a valid path.');
|
$this->_setErr(110, '"' . $_strConfigPath . '" is not a valid path.');
|
||||||
@ -1756,7 +1756,7 @@ class SMTPs
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Returns constructed SELECT Object string or boolean upon failure
|
* Returns constructed SELECT Object string or boolean upon failure
|
||||||
* Default value is set at TRUE
|
* Default value is set at true
|
||||||
*/
|
*/
|
||||||
$_retVal = true;
|
$_retVal = true;
|
||||||
|
|
||||||
|
|||||||
@ -145,7 +145,7 @@ function CreateFolder( $resourceType, $currentFolder )
|
|||||||
$sNewFolderName = $_GET['NewFolderName'] ;
|
$sNewFolderName = $_GET['NewFolderName'] ;
|
||||||
$sNewFolderName = SanitizeFolderName($sNewFolderName);
|
$sNewFolderName = SanitizeFolderName($sNewFolderName);
|
||||||
|
|
||||||
if (strpos($sNewFolderName, '..') !== FALSE)
|
if (strpos($sNewFolderName, '..') !== false)
|
||||||
$sErrorNumber = '102' ; // Invalid folder name.
|
$sErrorNumber = '102' ; // Invalid folder name.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -32,7 +32,7 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
|
|||||||
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
||||||
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
||||||
|
|
||||||
session_cache_limiter(FALSE);
|
session_cache_limiter(false);
|
||||||
|
|
||||||
require_once '../../main.inc.php';
|
require_once '../../main.inc.php';
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,7 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
|
|||||||
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
||||||
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
||||||
|
|
||||||
session_cache_limiter(FALSE);
|
session_cache_limiter(false);
|
||||||
|
|
||||||
require_once '../../main.inc.php';
|
require_once '../../main.inc.php';
|
||||||
|
|
||||||
|
|||||||
@ -35,7 +35,7 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
|
|||||||
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
||||||
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
||||||
|
|
||||||
session_cache_limiter(FALSE);
|
session_cache_limiter(false);
|
||||||
|
|
||||||
require_once '../../main.inc.php';
|
require_once '../../main.inc.php';
|
||||||
|
|
||||||
|
|||||||
@ -40,7 +40,7 @@ if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['H
|
|||||||
|
|
||||||
// TODO Try to make a solution with only a javascript timer that is easier. Difficulty is to avoid notification twice when.
|
// TODO Try to make a solution with only a javascript timer that is easier. Difficulty is to avoid notification twice when.
|
||||||
/* session already started into main
|
/* session already started into main
|
||||||
session_cache_limiter(FALSE);
|
session_cache_limiter(false);
|
||||||
header('Cache-Control: no-cache');
|
header('Cache-Control: no-cache');
|
||||||
session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie
|
session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie
|
||||||
session_start();*/
|
session_start();*/
|
||||||
|
|||||||
@ -32,7 +32,7 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
|
|||||||
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
||||||
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
||||||
|
|
||||||
session_cache_limiter(FALSE);
|
session_cache_limiter(false);
|
||||||
|
|
||||||
require_once '../../main.inc.php';
|
require_once '../../main.inc.php';
|
||||||
|
|
||||||
|
|||||||
@ -1949,7 +1949,7 @@ function dol_uncompress($inputfile,$outputdir)
|
|||||||
dol_syslog("Class ZipArchive is set so we unzip using ZipArchive to unzip into ".$outputdir);
|
dol_syslog("Class ZipArchive is set so we unzip using ZipArchive to unzip into ".$outputdir);
|
||||||
$zip = new ZipArchive;
|
$zip = new ZipArchive;
|
||||||
$res = $zip->open($inputfile);
|
$res = $zip->open($inputfile);
|
||||||
if ($res === TRUE)
|
if ($res === true)
|
||||||
{
|
{
|
||||||
$zip->extractTo($outputdir.'/');
|
$zip->extractTo($outputdir.'/');
|
||||||
$zip->close();
|
$zip->close();
|
||||||
|
|||||||
@ -272,7 +272,7 @@ function GETPOSTISSET($paramname)
|
|||||||
* @param string $noreplace Force disable of replacement of __xxx__ strings.
|
* @param string $noreplace Force disable of replacement of __xxx__ strings.
|
||||||
* @return string|string[] Value found (string or array), or '' if check fails
|
* @return string|string[] Value found (string or array), or '' if check fails
|
||||||
*/
|
*/
|
||||||
function GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
|
function GETPOST($paramname, $check='none', $method=0, $filter=null, $options=null, $noreplace=0)
|
||||||
{
|
{
|
||||||
global $mysoc,$user,$conf;
|
global $mysoc,$user,$conf;
|
||||||
|
|
||||||
@ -6519,7 +6519,7 @@ function dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensiti
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
($case_sensitive) ? natsort($temp) : natcasesort($temp);
|
($case_sensitive) ? natsort($temp) : natcasesort($temp);
|
||||||
if($order!='asc') $temp=array_reverse($temp,TRUE);
|
if($order!='asc') $temp=array_reverse($temp, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sorted = array();
|
$sorted = array();
|
||||||
|
|||||||
@ -65,8 +65,8 @@ function getURLContent($url,$postorget='GET',$param='',$followlocation=1,$addhea
|
|||||||
//curl_setopt($ch, CURLOPT_SSLVERSION, 6); for tls 1.2
|
//curl_setopt($ch, CURLOPT_SSLVERSION, 6); for tls 1.2
|
||||||
|
|
||||||
//turning off the server and peer verification(TrustManager Concept).
|
//turning off the server and peer verification(TrustManager Concept).
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
|
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||||
|
|
||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, empty($conf->global->MAIN_USE_CONNECT_TIMEOUT)?5:$conf->global->MAIN_USE_CONNECT_TIMEOUT);
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, empty($conf->global->MAIN_USE_CONNECT_TIMEOUT)?5:$conf->global->MAIN_USE_CONNECT_TIMEOUT);
|
||||||
curl_setopt($ch, CURLOPT_TIMEOUT, empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT)?30:$conf->global->MAIN_USE_RESPONSE_TIMEOUT);
|
curl_setopt($ch, CURLOPT_TIMEOUT, empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT)?30:$conf->global->MAIN_USE_RESPONSE_TIMEOUT);
|
||||||
|
|||||||
@ -244,7 +244,7 @@ class CdavLib
|
|||||||
*
|
*
|
||||||
* @param int $calendarId Calendar id
|
* @param int $calendarId Calendar id
|
||||||
* @param int $bCalendarData Add calendar data
|
* @param int $bCalendarData Add calendar data
|
||||||
* @return array|string[][]|unknown[][]|NULL[][]
|
* @return array|string[][]
|
||||||
*/
|
*/
|
||||||
public function getFullCalendarObjects($calendarId, $bCalendarData)
|
public function getFullCalendarObjects($calendarId, $bCalendarData)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -181,7 +181,7 @@ class Shipments extends DolibarrApi
|
|||||||
* @param array $request_data Request data
|
* @param array $request_data Request data
|
||||||
* @return int ID of shipment
|
* @return int ID of shipment
|
||||||
*/
|
*/
|
||||||
function post($request_data = NULL)
|
function post($request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->expedition->creer) {
|
if(! DolibarrApiAccess::$user->rights->expedition->creer) {
|
||||||
throw new RestException(401, "Insuffisant rights");
|
throw new RestException(401, "Insuffisant rights");
|
||||||
@ -250,7 +250,7 @@ class Shipments extends DolibarrApi
|
|||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
function postLine($id, $request_data = NULL) {
|
function postLine($id, $request_data = null) {
|
||||||
if(! DolibarrApiAccess::$user->rights->expedition->creer) {
|
if(! DolibarrApiAccess::$user->rights->expedition->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -312,7 +312,7 @@ class Shipments extends DolibarrApi
|
|||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
function putLine($id, $lineid, $request_data = NULL) {
|
function putLine($id, $lineid, $request_data = null) {
|
||||||
if(! DolibarrApiAccess::$user->rights->expedition->creer) {
|
if(! DolibarrApiAccess::$user->rights->expedition->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -407,7 +407,7 @@ class Shipments extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = NULL) {
|
function put($id, $request_data = null) {
|
||||||
if (! DolibarrApiAccess::$user->rights->expedition->creer) {
|
if (! DolibarrApiAccess::$user->rights->expedition->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -160,7 +160,7 @@ class ExpenseReports extends DolibarrApi
|
|||||||
* @param array $request_data Request data
|
* @param array $request_data Request data
|
||||||
* @return int ID of Expense Report
|
* @return int ID of Expense Report
|
||||||
*/
|
*/
|
||||||
function post($request_data = NULL)
|
function post($request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
|
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
|
||||||
throw new RestException(401, "Insuffisant rights");
|
throw new RestException(401, "Insuffisant rights");
|
||||||
@ -228,7 +228,7 @@ class ExpenseReports extends DolibarrApi
|
|||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
function postLine($id, $request_data = NULL) {
|
function postLine($id, $request_data = null) {
|
||||||
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
|
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -290,7 +290,7 @@ class ExpenseReports extends DolibarrApi
|
|||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
function putLine($id, $lineid, $request_data = NULL) {
|
function putLine($id, $lineid, $request_data = null) {
|
||||||
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
|
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -380,7 +380,7 @@ class ExpenseReports extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = NULL) {
|
function put($id, $request_data = null) {
|
||||||
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
|
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -188,7 +188,7 @@ class Interventions extends DolibarrApi
|
|||||||
* @param array $request_data Request data
|
* @param array $request_data Request data
|
||||||
* @return int ID of intervention
|
* @return int ID of intervention
|
||||||
*/
|
*/
|
||||||
function post($request_data = NULL)
|
function post($request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->ficheinter->creer) {
|
if(! DolibarrApiAccess::$user->rights->ficheinter->creer) {
|
||||||
throw new RestException(401, "Insuffisant rights");
|
throw new RestException(401, "Insuffisant rights");
|
||||||
@ -249,7 +249,7 @@ class Interventions extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function postLine($id, $request_data = NULL)
|
function postLine($id, $request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->ficheinter->creer) {
|
if(! DolibarrApiAccess::$user->rights->ficheinter->creer) {
|
||||||
throw new RestException(401, "Insuffisant rights");
|
throw new RestException(401, "Insuffisant rights");
|
||||||
|
|||||||
@ -182,7 +182,7 @@ class SupplierInvoices extends DolibarrApi
|
|||||||
* @param array $request_data Request datas
|
* @param array $request_data Request datas
|
||||||
* @return int ID of supplier invoice
|
* @return int ID of supplier invoice
|
||||||
*/
|
*/
|
||||||
function post($request_data = NULL)
|
function post($request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->fournisseur->facture->creer) {
|
if(! DolibarrApiAccess::$user->rights->fournisseur->facture->creer) {
|
||||||
throw new RestException(401, "Insuffisant rights");
|
throw new RestException(401, "Insuffisant rights");
|
||||||
@ -218,7 +218,7 @@ class SupplierInvoices extends DolibarrApi
|
|||||||
* @param array $request_data Datas
|
* @param array $request_data Datas
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = NULL)
|
function put($id, $request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->fournisseur->facture->creer) {
|
if(! DolibarrApiAccess::$user->rights->fournisseur->facture->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
|
|||||||
@ -186,7 +186,7 @@ class SupplierOrders extends DolibarrApi
|
|||||||
* @param array $request_data Request datas
|
* @param array $request_data Request datas
|
||||||
* @return int ID of supplier order
|
* @return int ID of supplier order
|
||||||
*/
|
*/
|
||||||
function post($request_data = NULL)
|
function post($request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->fournisseur->commande->creer) {
|
if(! DolibarrApiAccess::$user->rights->fournisseur->commande->creer) {
|
||||||
throw new RestException(401, "Insuffisant rights");
|
throw new RestException(401, "Insuffisant rights");
|
||||||
@ -222,7 +222,7 @@ class SupplierOrders extends DolibarrApi
|
|||||||
* @param array $request_data Datas
|
* @param array $request_data Datas
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = NULL)
|
function put($id, $request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->fournisseur->commande->creer) {
|
if(! DolibarrApiAccess::$user->rights->fournisseur->commande->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
|
|||||||
@ -404,7 +404,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$line = $this->lines[$i];
|
$line = $this->lines[$i];
|
||||||
|
|
||||||
// Test and convert into object this->lines[$i]. When coming from REST API, we may still have an array
|
// Test and convert into object this->lines[$i]. When coming from REST API, we may still have an array
|
||||||
//if (! is_object($line)) $line=json_decode(json_encode($line), FALSE); // convert recursively array into object.
|
//if (! is_object($line)) $line=json_decode(json_encode($line), false); // convert recursively array into object.
|
||||||
if (! is_object($line)) $line = (object) $line;
|
if (! is_object($line)) $line = (object) $line;
|
||||||
|
|
||||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn)';
|
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn)';
|
||||||
|
|||||||
@ -878,7 +878,7 @@ function write_conf_file($conffile)
|
|||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
$key = md5(uniqid(mt_rand(),TRUE)); // Generate random hash
|
$key = md5(uniqid(mt_rand(), true)); // Generate random hash
|
||||||
|
|
||||||
$fp = fopen("$conffile", "w");
|
$fp = fopen("$conffile", "w");
|
||||||
if($fp)
|
if($fp)
|
||||||
|
|||||||
@ -28,7 +28,7 @@ $default_sale_price = "150000";
|
|||||||
$default_annual_interest_percent = 7.0;
|
$default_annual_interest_percent = 7.0;
|
||||||
$default_year_term = 30;
|
$default_year_term = 30;
|
||||||
$default_down_percent = 10;
|
$default_down_percent = 10;
|
||||||
$default_show_progress = TRUE;
|
$default_show_progress = true;
|
||||||
|
|
||||||
/* --------------------------------------------------- *
|
/* --------------------------------------------------- *
|
||||||
* Initialize Variables
|
* Initialize Variables
|
||||||
@ -352,7 +352,7 @@ if ($form_complete && $show_progress) {
|
|||||||
print '<td align="right">' . number_format($remaining_balance, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . '</td>';
|
print '<td align="right">' . number_format($remaining_balance, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
($current_month % 12) ? $show_legend = FALSE : $show_legend = TRUE;
|
($current_month % 12) ? ($show_legend = false) : ($show_legend = true);
|
||||||
|
|
||||||
if ($show_legend) {
|
if ($show_legend) {
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
|
|||||||
@ -350,7 +350,7 @@ if (! defined('NOTOKENRENEWAL'))
|
|||||||
if (isset($_SESSION['newtoken'])) $_SESSION['token'] = $_SESSION['newtoken'];
|
if (isset($_SESSION['newtoken'])) $_SESSION['token'] = $_SESSION['newtoken'];
|
||||||
|
|
||||||
// Save in $_SESSION['newtoken'] what will be next token. Into forms, we will add param token = $_SESSION['newtoken']
|
// Save in $_SESSION['newtoken'] what will be next token. Into forms, we will add param token = $_SESSION['newtoken']
|
||||||
$token = dol_hash(uniqid(mt_rand(),TRUE)); // Generates a hash of a random number
|
$token = dol_hash(uniqid(mt_rand(), true)); // Generates a hash of a random number
|
||||||
$_SESSION['newtoken'] = $token;
|
$_SESSION['newtoken'] = $token;
|
||||||
}
|
}
|
||||||
if ((! defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && ! empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN))
|
if ((! defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && ! empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN))
|
||||||
@ -468,7 +468,7 @@ if (! defined('NOLOGIN'))
|
|||||||
if (GETPOST("username","alpha",2) && ! empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA))
|
if (GETPOST("username","alpha",2) && ! empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA))
|
||||||
{
|
{
|
||||||
$sessionkey = 'dol_antispam_value';
|
$sessionkey = 'dol_antispam_value';
|
||||||
$ok=(array_key_exists($sessionkey, $_SESSION) === TRUE && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code'])));
|
$ok=(array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code'])));
|
||||||
|
|
||||||
// Check code
|
// Check code
|
||||||
if (! $ok)
|
if (! $ok)
|
||||||
|
|||||||
@ -192,7 +192,7 @@ class MyModuleApi extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @url POST myobjects/
|
* @url POST myobjects/
|
||||||
*/
|
*/
|
||||||
function post($request_data = NULL)
|
function post($request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->myobject->create) {
|
if(! DolibarrApiAccess::$user->rights->myobject->create) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -218,7 +218,7 @@ class MyModuleApi extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @url PUT myobjects/{id}
|
* @url PUT myobjects/{id}
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = NULL)
|
function put($id, $request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->myobject->create) {
|
if(! DolibarrApiAccess::$user->rights->myobject->create) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
|
|||||||
@ -48,7 +48,7 @@ if (! $res) die("Include of main fails");
|
|||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
|
||||||
session_cache_limiter(FALSE);
|
session_cache_limiter(false);
|
||||||
|
|
||||||
// Load user to have $user->conf loaded (not done by default here because of NOLOGIN constant defined) and load permission if we need to use them in CSS
|
// Load user to have $user->conf loaded (not done by default here because of NOLOGIN constant defined) and load permission if we need to use them in CSS
|
||||||
/*if (empty($user->id) && ! empty($_SESSION['dol_login']))
|
/*if (empty($user->id) && ! empty($_SESSION['dol_login']))
|
||||||
|
|||||||
@ -630,8 +630,8 @@ function hash_call($methodName,$nvpStr)
|
|||||||
curl_setopt($ch, CURLOPT_SSLVERSION, (empty($conf->global->PAYPAL_SSLVERSION)?1:$conf->global->PAYPAL_SSLVERSION));
|
curl_setopt($ch, CURLOPT_SSLVERSION, (empty($conf->global->PAYPAL_SSLVERSION)?1:$conf->global->PAYPAL_SSLVERSION));
|
||||||
|
|
||||||
//turning off the server and peer verification(TrustManager Concept).
|
//turning off the server and peer verification(TrustManager Concept).
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
|
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||||
|
|
||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, empty($conf->global->MAIN_USE_CONNECT_TIMEOUT)?5:$conf->global->MAIN_USE_CONNECT_TIMEOUT);
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, empty($conf->global->MAIN_USE_CONNECT_TIMEOUT)?5:$conf->global->MAIN_USE_CONNECT_TIMEOUT);
|
||||||
curl_setopt($ch, CURLOPT_TIMEOUT, empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT)?30:$conf->global->MAIN_USE_RESPONSE_TIMEOUT);
|
curl_setopt($ch, CURLOPT_TIMEOUT, empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT)?30:$conf->global->MAIN_USE_RESPONSE_TIMEOUT);
|
||||||
@ -639,7 +639,7 @@ function hash_call($methodName,$nvpStr)
|
|||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
|
||||||
curl_setopt($ch, CURLOPT_POST, 1);
|
curl_setopt($ch, CURLOPT_POST, 1);
|
||||||
|
|
||||||
//if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled.
|
//if USE_PROXY constant set to true in Constants.php, then only proxy will be enabled.
|
||||||
if ($USE_PROXY)
|
if ($USE_PROXY)
|
||||||
{
|
{
|
||||||
dol_syslog("Paypal API hash_call set proxy to ".$PROXY_HOST. ":" . $PROXY_PORT." - ".$PROXY_USER. ":" . $PROXY_PASS);
|
dol_syslog("Paypal API hash_call set proxy to ".$PROXY_HOST. ":" . $PROXY_PORT." - ".$PROXY_USER. ":" . $PROXY_PASS);
|
||||||
|
|||||||
@ -178,7 +178,7 @@ class Products extends DolibarrApi
|
|||||||
* @param array $request_data Request data
|
* @param array $request_data Request data
|
||||||
* @return int ID of product
|
* @return int ID of product
|
||||||
*/
|
*/
|
||||||
function post($request_data = NULL)
|
function post($request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->produit->creer) {
|
if(! DolibarrApiAccess::$user->rights->produit->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -208,7 +208,7 @@ class Products extends DolibarrApi
|
|||||||
* @throws 401
|
* @throws 401
|
||||||
* @throws 404
|
* @throws 404
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = NULL)
|
function put($id, $request_data = null)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
|
|||||||
@ -173,7 +173,7 @@ class StockMovements extends DolibarrApi
|
|||||||
* @return int ID of stock movement
|
* @return int ID of stock movement
|
||||||
*/
|
*/
|
||||||
//function post($product_id, $warehouse_id, $qty, $lot='', $movementcode='', $movementlabel='', $price=0)
|
//function post($product_id, $warehouse_id, $qty, $lot='', $movementcode='', $movementlabel='', $price=0)
|
||||||
function post($request_data = NULL)
|
function post($request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->stock->creer) {
|
if(! DolibarrApiAccess::$user->rights->stock->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -212,7 +212,7 @@ class StockMovements extends DolibarrApi
|
|||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
function put($id, $request_data = NULL)
|
function put($id, $request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->stock->creer) {
|
if(! DolibarrApiAccess::$user->rights->stock->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
|
|||||||
@ -158,7 +158,7 @@ class Warehouses extends DolibarrApi
|
|||||||
* @param array $request_data Request data
|
* @param array $request_data Request data
|
||||||
* @return int ID of warehouse
|
* @return int ID of warehouse
|
||||||
*/
|
*/
|
||||||
function post($request_data = NULL)
|
function post($request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->stock->creer) {
|
if(! DolibarrApiAccess::$user->rights->stock->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -183,7 +183,7 @@ class Warehouses extends DolibarrApi
|
|||||||
* @param array $request_data Datas
|
* @param array $request_data Datas
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = NULL)
|
function put($id, $request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->stock->creer) {
|
if(! DolibarrApiAccess::$user->rights->stock->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
|
|||||||
@ -179,7 +179,7 @@ class Projects extends DolibarrApi
|
|||||||
* @param array $request_data Request data
|
* @param array $request_data Request data
|
||||||
* @return int ID of project
|
* @return int ID of project
|
||||||
*/
|
*/
|
||||||
function post($request_data = NULL)
|
function post($request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||||
throw new RestException(401, "Insuffisant rights");
|
throw new RestException(401, "Insuffisant rights");
|
||||||
@ -300,7 +300,7 @@ class Projects extends DolibarrApi
|
|||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
function postLine($id, $request_data = NULL) {
|
function postLine($id, $request_data = null) {
|
||||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -362,7 +362,7 @@ class Projects extends DolibarrApi
|
|||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
function putLine($id, $lineid, $request_data = NULL) {
|
function putLine($id, $lineid, $request_data = null) {
|
||||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -418,7 +418,7 @@ class Projects extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = NULL) {
|
function put($id, $request_data = null) {
|
||||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -187,7 +187,7 @@ class Tasks extends DolibarrApi
|
|||||||
* @param array $request_data Request data
|
* @param array $request_data Request data
|
||||||
* @return int ID of project
|
* @return int ID of project
|
||||||
*/
|
*/
|
||||||
function post($request_data = NULL)
|
function post($request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||||
throw new RestException(401, "Insuffisant rights");
|
throw new RestException(401, "Insuffisant rights");
|
||||||
@ -305,7 +305,7 @@ class Tasks extends DolibarrApi
|
|||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
function postLine($id, $request_data = NULL) {
|
function postLine($id, $request_data = null) {
|
||||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -367,7 +367,7 @@ class Tasks extends DolibarrApi
|
|||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
function putLine($id, $lineid, $request_data = NULL) {
|
function putLine($id, $lineid, $request_data = null) {
|
||||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
@ -422,7 +422,7 @@ class Tasks extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = NULL) {
|
function put($id, $request_data = null) {
|
||||||
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
if(! DolibarrApiAccess::$user->rights->projet->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -194,7 +194,7 @@ class Contacts extends DolibarrApi
|
|||||||
* @param array $request_data Request datas
|
* @param array $request_data Request datas
|
||||||
* @return int ID of contact
|
* @return int ID of contact
|
||||||
*/
|
*/
|
||||||
function post($request_data = NULL) {
|
function post($request_data = null) {
|
||||||
if (!DolibarrApiAccess::$user->rights->societe->contact->creer)
|
if (!DolibarrApiAccess::$user->rights->societe->contact->creer)
|
||||||
{
|
{
|
||||||
throw new RestException(401, 'No permission to create/update contacts');
|
throw new RestException(401, 'No permission to create/update contacts');
|
||||||
@ -219,7 +219,7 @@ class Contacts extends DolibarrApi
|
|||||||
* @param array $request_data Datas
|
* @param array $request_data Datas
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = NULL) {
|
function put($id, $request_data = null) {
|
||||||
if (!DolibarrApiAccess::$user->rights->societe->contact->creer)
|
if (!DolibarrApiAccess::$user->rights->societe->contact->creer)
|
||||||
{
|
{
|
||||||
throw new RestException(401, 'No permission to create/update contacts');
|
throw new RestException(401, 'No permission to create/update contacts');
|
||||||
@ -282,7 +282,7 @@ class Contacts extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @url POST {id}/createUser
|
* @url POST {id}/createUser
|
||||||
*/
|
*/
|
||||||
function createUser($id, $request_data = NULL) {
|
function createUser($id, $request_data = null) {
|
||||||
//if (!DolibarrApiAccess::$user->rights->user->user->creer) {
|
//if (!DolibarrApiAccess::$user->rights->user->user->creer) {
|
||||||
//throw new RestException(401);
|
//throw new RestException(401);
|
||||||
//}
|
//}
|
||||||
|
|||||||
@ -199,7 +199,7 @@ class Thirdparties extends DolibarrApi
|
|||||||
* @param array $request_data Request datas
|
* @param array $request_data Request datas
|
||||||
* @return int ID of thirdparty
|
* @return int ID of thirdparty
|
||||||
*/
|
*/
|
||||||
function post($request_data = NULL)
|
function post($request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->societe->creer) {
|
if(! DolibarrApiAccess::$user->rights->societe->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
@ -223,7 +223,7 @@ class Thirdparties extends DolibarrApi
|
|||||||
* @param array $request_data Datas
|
* @param array $request_data Datas
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = NULL)
|
function put($id, $request_data = null)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->societe->creer) {
|
if(! DolibarrApiAccess::$user->rights->societe->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
|
|||||||
@ -334,10 +334,10 @@ class Stripe extends CommonObject
|
|||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
$key = $obj->fk_soc;
|
$key = $obj->fk_soc;
|
||||||
} else {
|
} else {
|
||||||
$key = NULL;
|
$key = null;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$key = NULL;
|
$key = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF');
|
$arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF');
|
||||||
|
|||||||
@ -418,7 +418,7 @@ else {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST('error')){
|
if (GETPOST('error')){
|
||||||
setEventMessages(GETPOST('error'), NULL, 'errors');
|
setEventMessages(GETPOST('error'), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paiement')
|
if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paiement')
|
||||||
|
|||||||
@ -58,7 +58,7 @@ $fontsizesmaller='0.75em';
|
|||||||
|
|
||||||
if (defined('THEME_ONLY_CONSTANT')) return;
|
if (defined('THEME_ONLY_CONSTANT')) return;
|
||||||
|
|
||||||
session_cache_limiter(FALSE);
|
session_cache_limiter(false);
|
||||||
|
|
||||||
require_once '../../main.inc.php';
|
require_once '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
|||||||
@ -59,7 +59,7 @@ $fontsizesmaller='11';
|
|||||||
|
|
||||||
if (defined('THEME_ONLY_CONSTANT')) return;
|
if (defined('THEME_ONLY_CONSTANT')) return;
|
||||||
|
|
||||||
session_cache_limiter(FALSE);
|
session_cache_limiter(false);
|
||||||
|
|
||||||
require_once '../../main.inc.php';
|
require_once '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
|||||||
@ -31,7 +31,7 @@ if (! defined('NOLOGIN')) define('NOLOGIN',1); // File must be
|
|||||||
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
||||||
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
||||||
|
|
||||||
session_cache_limiter(FALSE);
|
session_cache_limiter(false);
|
||||||
|
|
||||||
require_once '../../main.inc.php';
|
require_once '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
|||||||
@ -162,7 +162,7 @@ class Users extends DolibarrApi
|
|||||||
* @param array $request_data New user data
|
* @param array $request_data New user data
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function post($request_data = NULL) {
|
function post($request_data = null) {
|
||||||
// check user authorization
|
// check user authorization
|
||||||
//if(! DolibarrApiAccess::$user->rights->user->creer) {
|
//if(! DolibarrApiAccess::$user->rights->user->creer) {
|
||||||
// throw new RestException(401, "User creation not allowed");
|
// throw new RestException(401, "User creation not allowed");
|
||||||
@ -194,7 +194,7 @@ class Users extends DolibarrApi
|
|||||||
* @param array $request_data Datas
|
* @param array $request_data Datas
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function put($id, $request_data = NULL) {
|
function put($id, $request_data = null) {
|
||||||
//if (!DolibarrApiAccess::$user->rights->user->user->creer) {
|
//if (!DolibarrApiAccess::$user->rights->user->user->creer) {
|
||||||
//throw new RestException(401);
|
//throw new RestException(401);
|
||||||
//}
|
//}
|
||||||
|
|||||||
@ -96,7 +96,7 @@ if ($action == 'validatenewpassword' && $username && $passwordhash)
|
|||||||
if ($action == 'buildnewpassword' && $username)
|
if ($action == 'buildnewpassword' && $username)
|
||||||
{
|
{
|
||||||
$sessionkey = 'dol_antispam_value';
|
$sessionkey = 'dol_antispam_value';
|
||||||
$ok=(array_key_exists($sessionkey, $_SESSION) === TRUE && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code'])));
|
$ok=(array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code'])));
|
||||||
|
|
||||||
// Verify code
|
// Verify code
|
||||||
if (! $ok)
|
if (! $ok)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user