forked from extern/egroupware
fixed error because using (by loading order sometimes) uninitialised class-variable instead of documented and initialies private var
This commit is contained in:
parent
d6747117ca
commit
115aabf21a
@ -16,8 +16,8 @@
|
|||||||
egw_core;
|
egw_core;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
egw.extend('user', egw.MODULE_GLOBAL, function() {
|
egw.extend('user', egw.MODULE_GLOBAL, function()
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
* Data about current user
|
* Data about current user
|
||||||
*
|
*
|
||||||
@ -29,25 +29,25 @@ egw.extend('user', egw.MODULE_GLOBAL, function() {
|
|||||||
/**
|
/**
|
||||||
* Set data of current user
|
* Set data of current user
|
||||||
*
|
*
|
||||||
* @param object _data
|
* @param {object} _data
|
||||||
*/
|
*/
|
||||||
set_user: function(_data)
|
set_user: function(_data)
|
||||||
{
|
{
|
||||||
this.userData = _data;
|
userData = _data;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get data about current user
|
* Get data about current user
|
||||||
*
|
*
|
||||||
* @param string _field
|
* @param {string} _field
|
||||||
* - 'account_id','account_lid','person_id','account_status',
|
* - 'account_id','account_lid','person_id','account_status',
|
||||||
* - 'account_firstname','account_lastname','account_email','account_fullname','account_phone'
|
* - 'account_firstname','account_lastname','account_email','account_fullname','account_phone'
|
||||||
* - 'apps': object with app => data pairs the user has run-rights for
|
* - 'apps': object with app => data pairs the user has run-rights for
|
||||||
* @return string|array|null
|
* @return {string|array|null}
|
||||||
*/
|
*/
|
||||||
user: function (_field)
|
user: function (_field)
|
||||||
{
|
{
|
||||||
return this.userData[_field];
|
return userData[_field];
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -55,14 +55,14 @@ egw.extend('user', egw.MODULE_GLOBAL, function() {
|
|||||||
*
|
*
|
||||||
* Can be used the check of run rights like: if (egw.app('addressbook')) { do something if user has addressbook rights }
|
* Can be used the check of run rights like: if (egw.app('addressbook')) { do something if user has addressbook rights }
|
||||||
*
|
*
|
||||||
* @param string _app
|
* @param {string} _app
|
||||||
* @param string _name attribute to return, default return whole app-data-object
|
* @param {string} _name attribute to return, default return whole app-data-object
|
||||||
* @return object|string|null null if not found
|
* @return object|string|null null if not found
|
||||||
*/
|
*/
|
||||||
app: function(_app, _name)
|
app: function(_app, _name)
|
||||||
{
|
{
|
||||||
return typeof _name == 'undefined' || typeof this.userData.apps[_app] == 'undefined' ?
|
return typeof _name == 'undefined' || typeof userData.apps[_app] == 'undefined' ?
|
||||||
this.userData.apps[_app] : this.userData.apps[_app][_name];
|
userData.apps[_app] : userData.apps[_app][_name];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user