Fix: avoid warning with php 5.4
This commit is contained in:
parent
fe672e1e4b
commit
da29ea89a7
@ -112,6 +112,7 @@ class User extends CommonObject
|
|||||||
$this->all_permissions_are_loaded = 0;
|
$this->all_permissions_are_loaded = 0;
|
||||||
$this->admin=0;
|
$this->admin=0;
|
||||||
|
|
||||||
|
$this->conf = (object) array();
|
||||||
$this->rights = (object) array();
|
$this->rights = (object) array();
|
||||||
$this->rights->user = (object) array();
|
$this->rights->user = (object) array();
|
||||||
$this->rights->user->user = (object) array();
|
$this->rights->user->user = (object) array();
|
||||||
@ -530,17 +531,13 @@ class User extends CommonObject
|
|||||||
|
|
||||||
if ($perms)
|
if ($perms)
|
||||||
{
|
{
|
||||||
if (! is_object($this->rights->$module)) $this->rights->$module = (object) array();
|
if (! isset($this->rights) || ! is_object($this->rights)) $this->rights = (object) array(); // For avoid error
|
||||||
if (! is_object($this->rights->$module->$perms)) $this->rights->$module->$perms = (object) array();
|
if (! isset($this->rights->$module) || ! is_object($this->rights->$module)) $this->rights->$module = (object) array();
|
||||||
if ($subperms)
|
if ($subperms)
|
||||||
{
|
{
|
||||||
if (! isset($this->rights->$module) ||
|
if (! isset($this->rights->$module->$perms) || ! is_object($this->rights->$module->$perms)) $this->rights->$module->$perms = (object) array();
|
||||||
(is_object($this->rights->$module) && ! isset($this->rights->$module->$perms)) ||
|
|
||||||
(is_object($this->rights->$module->$perms)) )
|
|
||||||
{
|
|
||||||
$this->rights->$module->$perms->$subperms = 1;
|
$this->rights->$module->$perms->$subperms = 1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->rights->$module->$perms = 1;
|
$this->rights->$module->$perms = 1;
|
||||||
@ -581,8 +578,11 @@ class User extends CommonObject
|
|||||||
|
|
||||||
if ($perms)
|
if ($perms)
|
||||||
{
|
{
|
||||||
|
if (! isset($this->rights) || ! is_object($this->rights)) $this->rights = (object) array(); // For avoid error
|
||||||
|
if (! isset($this->rights->$module) || ! is_object($this->rights->$module)) $this->rights->$module = (object) array();
|
||||||
if ($subperms)
|
if ($subperms)
|
||||||
{
|
{
|
||||||
|
if (! isset($this->rights->$module->$perms) || ! is_object($this->rights->$module->$perms)) $this->rights->$module->$perms = (object) array();
|
||||||
$this->rights->$module->$perms->$subperms = 1;
|
$this->rights->$module->$perms->$subperms = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user