Commit 12227810 authored by Bate's avatar Bate

Les non connectes n'ont pas droit que de lire les fichiers

parent 1a71eb67
...@@ -104,9 +104,13 @@ abstract class basedb extends stdentity ...@@ -104,9 +104,13 @@ abstract class basedb extends stdentity
*/ */
function is_right ( &$user, $required ) function is_right ( &$user, $required )
{ {
if ( ($this->modere != 0) && (($required & ($this->droits_acces)) == $required) ) return true;
if(!$user->is_valid()) return false; if(!$user->is_valid()) {
if($required == DROIT_LECTURE && ($this->droits_access&DROIT_LECTURE > 0))
return true;
else
return false;
}
if ( $this->is_admin($user)) return true; if ( $this->is_admin($user)) return true;
...@@ -119,6 +123,8 @@ abstract class basedb extends stdentity ...@@ -119,6 +123,8 @@ abstract class basedb extends stdentity
if ( ($user->is_in_group_id($this->id_groupe)) && if ( ($user->is_in_group_id($this->id_groupe)) &&
($required & ($this->droits_acces >> 4)) == $required ) return true; ($required & ($this->droits_acces >> 4)) == $required ) return true;
if (($required & ($this->droits_acces)) == $required) return true;
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment