User object that mimicks the old $this->session behaviour
package | Gems |
---|---|
subpackage | User |
copyright | Copyright (c) 2011 Erasmus MC |
license | New BSD License |
since | Class available since version 1.5 |
__construct(mixed $settings, \Gems_User_UserDefinitionInterface $definition)
mixed
Array, \Zend_Session_Namespace or \ArrayObject for this user.
\Gems_User_UserDefinitionInterface
The user class definition.
applyToMenuSource(\Gems_Menu_ParameterSource $source) : \Gems_User_User
\Gems_Menu_ParameterSource
\Gems_User_User
authenticate(string $password, boolean $testPassword = true
) : \Zend_Auth_Result
string
The password to test
boolean
Set to false to test the non-password checks only
\Zend_Auth_Result
canLoginHere() : boolean
If the url is a fixed organization url and the user is not allowed to access this organization, then this function returns false.
boolean
canResetPassword() : boolean
boolean
canSetPassword() : boolean
boolean
checkRegistryRequestsAnswers() : boolean
boolean
False if required values are missing.getAllowedIPRanges() : string
string
getAllowedOrganizations() : array
array
getAllowedRoles() : array
NOTE! A user can set a role, unless it requires a higher role level.
I.e. an admin is not allowed to set a super role as super inherits and expands admin. But it is allowed to set the nologin and respondent roles that are not inherited by the admin as they are in a different hierarchy.
An exception is the role master as it is set by the system. You gotta be a master to set the master role.
array
With identical keys and values roleId => roleIdgetAllowedStaffGroups() : array
array
getBaseOrganization() : \Gems_User_Organization
\Gems_User_Organization
getBaseOrganizationId() : integer
integer
getChangePasswordForm($args_array = null
) : \Gems_Form
\Gems_Form
getCurrentOrganization() : \Gems_User_Organization
\Gems_User_Organization
getCurrentOrganizationId() : integer
integer
getEmailAddress() : boolean
boolean
getFrom() : string
string
E-Mail addressgetFullName() : string
string
getGreeting(string $locale = null
) : integer
string
integer
getGroup() : integer
integer
getLocale() : string
.
string
getLoginName() : string
string
getMailFields(string $locale = null
) : array
string
array
getPasswordAge() : integer
integer
getPasswordResetKey() : string
string
getRequest() : \Zend_Controller_Request_Abstract
\Zend_Controller_Request_Abstract
getResetPasswordMailFields(string $locale = null
) : array
string
array
getRespondentOrgFilter() : array
array
getRespondentOrgWhere(string $fieldName, string $sep = '|'
) : string
string
Field name separator
string
Optional different value seperator
string
getRespondentOrganizations() : array
array
getRole() : string
string
getRoles() : array
array
With identical keys and values roleId => roleIdgetSurveyReturn() : array
array
getUserId() : integer
One user id might be connected to multiple logins for multiple organizations.
YES! This is the one you need, not getUserLoginId().
integer
getUserLoginId() : integer
Returns the User package user id, that is unique for each login / organization id combination, but does not directly identify this person.
In other words, this is not the id you use to track who changed what. It is only used by parts of the User package.
integer
gotoStartPage(\Gems_Menu $menu, \Zend_Controller_Request_Abstract $request) : \Gems_Menu_SubMenuItem
\Gems_Menu
\Zend_Controller_Request_Abstract
\Gems_Menu_SubMenuItem
hasAllowedRole() : boolean
boolean
hasEmailAddress() : boolean
boolean
hasPassword() : boolean
boolean
hasPrivilege(string $privilege) : boolean
string
boolean
hasRole(string $role) : boolean
string
boolean
hasValidResetKey() : boolean
boolean
isActive() : boolean
boolean
True when a user can log in.isAllowedOrganization(integer $organizationId) : boolean
integer
boolean
isBlockable() : boolean
boolean
isCurrentUser() : boolean
boolean
isLogoutOnSurvey() : boolean
boolean
isPasswordResetRequired() : boolean
boolean
isStaff() : boolean
boolean
refresh(string $defName = null
) : \Gems_User_User
string
Optional
\Gems_User_User
(continuation pattern)refreshAllowedOrganizations() : \Gems_User_User
\Gems_User_User
(continuation pattern)refreshAllowedStaffGroups() : array
array
reportPasswordWeakness(string $password = null
) : mixed
string
Or null when you want a report on all the rules for this password.
mixed
String or array of strings containing warning messages or nothingsendMail(string $subjectTemplate, string $bbBodyTemplate, boolean $useResetFields= false
, string $locale= null
) : mixed
string
A subject template in which {fields} are replaced
string
A BB Code body template in which {fields} are replaced
boolean
When true get a reset key for this user
string
Optional locale
mixed
String or array of warnings when something went wrongsetAsCurrentUser(boolean $signalLoader= true
, boolean $resetSessionId= true
) : \Gems_User_User
This means that the data about this user will be stored in a session.
boolean
Do not set, except from UserLoader
boolean
Should the session be reset?
\Gems_User_User
(continuation pattern)setCurrentOrganization(mixed $organization) : \Gems_User_User
mixed
\Gems_User_Organization or an organization id.
\Gems_User_User
(continuation pattern)setLocale(string $locale) : \Gems_User_User
.
string
\Gems_User_User
(continuation pattern)setPassword(string $password) : \Gems_User_User
string
\Gems_User_User
(continuation pattern)setPasswordResetRequired(boolean $reset = true
) : \Gems_User_User
boolean
\Gems_User_User
(continuation pattern)setRequest(\Zend_Controller_Request_Abstract $request) : \Gems_User_User
\Zend_Controller_Request_Abstract
\Gems_User_User
setSurveyReturn(mixed $return = null
) : \Gems_User_User
mixed
\Zend_Controller_Request_Abstract, array of something that can be turned into one.
\Gems_User_User
unsetAsCurrentUser(boolean $signalLoader = true
) : \Gems_User_User
This means that the data about this user will no longer be stored in a session.
boolean
Do not set, except from UserLoader
\Gems_User_User
(continuation pattern)_getVar(string $name) : mixed
string
mixed
_hasVar(string $name) : boolean
string
boolean
_setVar(string $name, mixed $value) : void
string
mixed
_unsetVar(string $name) : void
string
afterAuthorization(\Zend_Auth_Result $result, $lastAuthorizer = null
)
\Zend_Auth_Result
getGenderGreeting(string $locale = null
) : array
In practice: starts lowercase
string
array
gender => stringgetGenderHello(string $locale = null
) : array
In practice: starts uppercase
string
array
gender => stringloadAuthorizers(string $password, boolean $testPassword = true
) : array
A callable will be called, then an adapter authorizes and if the end result is boolean, string or array it is converted into a \Zend_Auth_Result.
string
boolean
Set to false to test on the non-password checks only
array
Of Callable|\Zend_Auth_Adapter_Interface|\Zend_Auth_Result|boolean|string|arrayloadResetPasswordCheckFields() : array
Default is asking for the username but you can e.g. ask for someones birthday.
array
Of 'label name' => 'required values' or \Zend_Form_Element elements_getVariableStore() : \ArrayObject
\ArrayObject
or \Zend_Session_Namespace$possibleOrgIds : array
array(\MUtil_Model::REQUEST_ID2, 'gr2o_id_organization', 'gr2t_id_organization', 'gap_id_organization', 'gto_id_organization', 'gor_id_organization', 'gla_organization', 'grco_organization')
$_authResult : \Zend_Auth_Result
$acl : \MUtil_Acl
$db : \Zend_Db_Adapter_Abstract
$definition : \Gems_User_UserDefinitionInterface
$failureBlockCount : integer
6
$failureIgnoreTime : integer
600
$project : \Gems_Project_ProjectSettings
$request : \Zend_Controller_Request_Abstract
$session : \Zend_Session_Namespace
$userLoader : \Gems_User_UserLoader
$util : \Gems_Util
$_vars : \ArrayObject