Fix scrutinizer errors
This commit is contained in:
parent
525598f6aa
commit
663998bab1
@ -745,7 +745,7 @@ IMG;
|
||||
private function _rrmdir($dir)
|
||||
{
|
||||
if ($handle = opendir($dir)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
if ($file != '.' && $file != '..') {
|
||||
if (is_dir($dir . '/' . $file)) {
|
||||
$this->_rrmdir($dir . '/' . $file);
|
||||
|
||||
@ -249,8 +249,8 @@ if (isset($_POST["ajoutercolonne"]) && $object->format == "D")
|
||||
|
||||
$dateinsertion = substr("$dateinsertion", 1);
|
||||
|
||||
//mise a jour avec les nouveaux sujets dans la base
|
||||
if (isset($erreur_ajout_date) && !$erreur_ajout_date)
|
||||
// update with new topics into database
|
||||
if (isset($erreur_ajout_date) && empty($erreur_ajout_date))
|
||||
{
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."opensurvey_sondage";
|
||||
$sql.= " SET sujet = '".$db->escape($dateinsertion)."'";
|
||||
|
||||
@ -153,7 +153,7 @@ if (empty($reshook))
|
||||
$db->begin();
|
||||
|
||||
$resql = $object->update($object->id, $user);
|
||||
if (! $resql || $resql < 0)
|
||||
if ($resql <= 0)
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
|
||||
@ -774,7 +774,7 @@ class User extends CommonObject
|
||||
dol_syslog(get_class($this)."::clearrights reset user->rights");
|
||||
$this->rights='';
|
||||
$this->nb_rights=0;
|
||||
$this->all_permissions_are_loaded=false;
|
||||
$this->all_permissions_are_loaded=0;
|
||||
$this->_tab_loaded=array();
|
||||
}
|
||||
|
||||
@ -799,16 +799,16 @@ class User extends CommonObject
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->all_permissions_are_loaded)
|
||||
if (! empty($this->all_permissions_are_loaded))
|
||||
{
|
||||
// We already loaded all rights for this user, so we leave
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Recuperation des droits utilisateurs + recuperation des droits groupes
|
||||
// Get permission of users + Get permissions of groups
|
||||
|
||||
// D'abord les droits utilisateurs
|
||||
// First user permissions
|
||||
$sql = "SELECT DISTINCT r.module, r.perms, r.subperms";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user_rights as ur";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."rights_def as r";
|
||||
@ -862,7 +862,7 @@ class User extends CommonObject
|
||||
$this->db->free($resql);
|
||||
}
|
||||
|
||||
// Maintenant les droits groupes
|
||||
// Now permissions of groups
|
||||
$sql = "SELECT DISTINCT r.module, r.perms, r.subperms";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."usergroup_rights as gr,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."usergroup_user as gu,";
|
||||
@ -933,7 +933,7 @@ class User extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
// Si module defini, on le marque comme charge en cache
|
||||
// If module defined, we flag it as loaded into cache
|
||||
$this->_tab_loaded[$moduletag]=1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -552,13 +552,13 @@ class UserGroup extends CommonObject
|
||||
|
||||
if ($moduletag && isset($this->_tab_loaded[$moduletag]) && $this->_tab_loaded[$moduletag])
|
||||
{
|
||||
// Le fichier de ce module est deja charge
|
||||
// Rights for this module are already loaded, so we leave
|
||||
return;
|
||||
}
|
||||
|
||||
if (! empty($this->all_permissions_are_loaded))
|
||||
{
|
||||
// Si les permissions ont deja ete chargees, on quitte
|
||||
// We already loaded all rights for this group, so we leave
|
||||
return;
|
||||
}
|
||||
|
||||
@ -618,7 +618,7 @@ class UserGroup extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
// Si module defini, on le marque comme charge en cache
|
||||
// If module defined, we flag it as loaded into cache
|
||||
$this->_tab_loaded[$moduletag]=1;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user