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)
mixedArray, \Zend_Session_Namespace or \ArrayObject for this user.
\Gems_User_UserDefinitionInterfaceThe user class definition.
applyToMenuSource(\Gems_Menu_ParameterSource $source) : \Gems_User_User
\Gems_Menu_ParameterSource
\Gems_User_Userauthenticate(string $password, boolean $testPassword = true) : \Zend_Auth_Result
stringThe password to test
booleanSet to false to test the non-password checks only
\Zend_Auth_ResultcanLoginHere() : boolean
If the url is a fixed organization url and the user is not allowed to access this organization, then this function returns false.
booleancanResetPassword() : boolean
booleancanSetPassword() : boolean
booleancheckRegistryRequestsAnswers() : boolean
booleanFalse if required values are missing.getAllowedIPRanges() : string
stringgetAllowedOrganizations() : array
arraygetAllowedRoles() : 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.
arrayWith identical keys and values roleId => roleIdgetAllowedStaffGroups() : array
arraygetBaseOrganization() : \Gems_User_Organization
\Gems_User_OrganizationgetBaseOrganizationId() : integer
integergetChangePasswordForm($args_array = null) : \Gems_Form
\Gems_FormgetCurrentOrganization() : \Gems_User_Organization
\Gems_User_OrganizationgetCurrentOrganizationId() : integer
integergetEmailAddress() : boolean
booleangetFrom() : string
stringE-Mail addressgetFullName() : string
stringgetGreeting(string $locale = null) : integer
string
integergetGroup() : integer
integergetLocale() : string
.
stringgetLoginName() : string
stringgetMailFields(string $locale = null) : array
string
arraygetPasswordAge() : integer
integergetPasswordResetKey() : string
stringgetRequest() : \Zend_Controller_Request_Abstract
\Zend_Controller_Request_AbstractgetResetPasswordMailFields(string $locale = null) : array
string
arraygetRespondentOrgFilter() : array
arraygetRespondentOrgWhere(string $fieldName, string $sep = '|') : string
stringField name separator
stringOptional different value seperator
stringgetRespondentOrganizations() : array
arraygetRole() : string
stringgetRoles() : array
arrayWith identical keys and values roleId => roleIdgetSurveyReturn() : array
arraygetUserId() : integer
One user id might be connected to multiple logins for multiple organizations.
YES! This is the one you need, not getUserLoginId().
integergetUserLoginId() : 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.
integergotoStartPage(\Gems_Menu $menu, \Zend_Controller_Request_Abstract $request) : \Gems_Menu_SubMenuItem
\Gems_Menu
\Zend_Controller_Request_Abstract
\Gems_Menu_SubMenuItemhasAllowedRole() : boolean
booleanhasEmailAddress() : boolean
booleanhasPassword() : boolean
booleanhasPrivilege(string $privilege) : boolean
string
booleanhasRole(string $role) : boolean
string
booleanhasValidResetKey() : boolean
booleanisActive() : boolean
booleanTrue when a user can log in.isAllowedOrganization(integer $organizationId) : boolean
integer
booleanisBlockable() : boolean
booleanisCurrentUser() : boolean
booleanisLogoutOnSurvey() : boolean
booleanisPasswordResetRequired() : boolean
booleanisStaff() : boolean
booleanrefresh(string $defName = null) : \Gems_User_User
stringOptional
\Gems_User_User(continuation pattern)refreshAllowedOrganizations() : \Gems_User_User
\Gems_User_User(continuation pattern)refreshAllowedStaffGroups() : array
arrayreportPasswordWeakness(string $password = null) : mixed
stringOr null when you want a report on all the rules for this password.
mixedString or array of strings containing warning messages or nothingsendMail(string $subjectTemplate, string $bbBodyTemplate, boolean $useResetFields= false, string $locale= null) : mixed
stringA subject template in which {fields} are replaced
stringA BB Code body template in which {fields} are replaced
booleanWhen true get a reset key for this user
stringOptional locale
mixedString 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.
booleanDo not set, except from UserLoader
booleanShould 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_UsersetSurveyReturn(mixed $return = null) : \Gems_User_User
mixed\Zend_Controller_Request_Abstract, array of something that can be turned into one.
\Gems_User_UserunsetAsCurrentUser(boolean $signalLoader = true) : \Gems_User_User
This means that the data about this user will no longer be stored in a session.
booleanDo 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
arraygender => stringgetGenderHello(string $locale = null) : array
In practice: starts uppercase
string
arraygender => 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
booleanSet to false to test on the non-password checks only
arrayOf 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.
arrayOf 'label name' => 'required values' or \Zend_Form_Element elements_getVariableStore() : \ArrayObject
\ArrayObjector \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