Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
UserModule Class Reference

Public Member Functions

 setAuthField ($value)
 getAuthField ()
 setLoginUrl (array $value)
 setRegistrationUrl (array $value)
 setRecoveryUrl (array $value)
 setReturnUrl (array $value)
 setReturnLogoutUrl (array $value)
 setHomePageUrl (array $value)
 setFriendListUrl (array $value)
 setRecoveryChangePasswordUrl (array $value)
 setNoPermissionsUrl (array $value)
 getRecoveryChangePasswordUrl ($locale= '')
 getLoginUrl ($locale= '')
 getFriendListUrl ($locale= '')
 getRegistrationUrl ($locale= '')
 getRecoveryUrl ($locale= '')
 getReturnUrl ($locale= '')
 getReturnLogoutUrl ($locale= '')
 getNoPermissionsUrl ($locale= '')
 getHomePageUrl ($locale= '')
 init ()
 getBehaviorsFor ($componentName)
 beforeControllerAction ($controller, $action)
 getAssetsUrl ()

Static Public Member Functions

static t ($str= '', $params=array(), $dic= 'user')
static encrypting ($string="")
static doCaptcha ($place= '')
static isAdmin ()
static user ($id=0)

Public Attributes

 $user_page_size = 10
 $fields_page_size = 10
 $hash = 'md5'
 $sendActivationMail = true
 $activationMailSubject = 'You registered from {site_name}'
 $activationEmail
 $loginNotActiv = false
 $activeAfterRegister = false
 $loginBadAttemps = 3
 $loginBlockTime = 300
 $loginAjax = false
 $autoLogin = true
 $fieldsMessage = ''
 $relations = array()
 $profileRelations = array()
 $captcha = array('registration' => true)
 $loggedInDuration = 0
 $usernameMin = 4
 $passwordForgottenEmail
 $passwordMin = 4
 $userLoginWidgetFlashSuccess = 'UserLoginWidget-success'
 $userLoginWidgetFlashError = 'UserLoginWidget-error'
 $registrationNotifyAdminEmail = null
 $registrationNotifyAdminTemplate = 'notifyAdminAboutRegister'
 $profileEditUrl = false
 $usernameUnique = true
 $usernameRequired = true
 $tableUsers = '{{users}}'
 $tableProfiles = '{{profiles}}'
 $tableProfileFields = '{{profiles_fields}}'
 $tableAccounts = '{{accounts}}'
 $componentBehaviors = array()

Detailed Description

Yii-User module

Author
Mikhail Mangushev misha.nosp@m.mx@g.nosp@m.mail..nosp@m.com http://www.opensource.org/licenses/bsd-license.php

Definition at line 11 of file UserModule.php.

Member Function Documentation

static UserModule::doCaptcha (   $place = '')
static
Parameters
$place
Returns
boolean

Definition at line 434 of file UserModule.php.

Referenced by RegistrationForm\rules().

{
if (!extension_loaded('gd'))
return false;
if (in_array($place, Yii::app()->getModule('user')->captcha))
return Yii::app()->getModule('user')->captcha[$place];
return false;
}
static UserModule::encrypting (   $string = "")
static
Returns
hash string.

Definition at line 419 of file UserModule.php.

Referenced by ActivationController\actionActivation(), ProfileController\actionChangepassword(), ProfileController\actionEdit(), and RegistrationController\actionRegistration().

{
$hash = Yii::app()->getModule('user')->hash;
if ($hash == "md5")
return md5($string);
if ($hash == "sha1")
return sha1($string);
else
return hash($hash, $string);
}
UserModule::getAuthField ( )

Public getter

Returns
string

Definition at line 199 of file UserModule.php.

{
return $this->_authField;
}
static UserModule::isAdmin ( )
static

Return admin status.

Returns
boolean

Definition at line 447 of file UserModule.php.

References user().

{
if (Yii::app()->user->isGuest)
return false;
else {
return Yii::app()->user->checkAccess('Admin');
}
}
UserModule::setAuthField (   $value)

Public setter

Parameters
string$valuevalue
Exceptions
Exception
Returns
void

Definition at line 186 of file UserModule.php.

{
if (!in_array($value, array('username', 'email'))) {
throw new Exception('authField can have value "username" or "email"');
}
$this->_authField = $value;
}
UserModule::setFriendListUrl ( array  $value)
Parameters
array$value

Definition at line 255 of file UserModule.php.

{
$this->_friendListUrl = $value;
}
UserModule::setHomePageUrl ( array  $value)
Parameters
array$value

Definition at line 247 of file UserModule.php.

{
$this->_homePageUrl = $value;
}
UserModule::setLoginUrl ( array  $value)
Parameters
array$value

Definition at line 207 of file UserModule.php.

{
$this->_loginUrl = $value;
}
UserModule::setNoPermissionsUrl ( array  $value)
Parameters
array$value

Definition at line 268 of file UserModule.php.

{
$this->_noPermissionsUrl = $value;
}
UserModule::setRecoveryUrl ( array  $value)
Parameters
array$value

Definition at line 223 of file UserModule.php.

{
$this->_recoveryUrl = $value;
}
UserModule::setRegistrationUrl ( array  $value)
Parameters
array$value

Definition at line 215 of file UserModule.php.

{
$this->_registrationUrl = $value;
}
UserModule::setReturnLogoutUrl ( array  $value)
Parameters
array$value

Definition at line 239 of file UserModule.php.

{
$this->_returnLogoutUrl = $value;
}
UserModule::setReturnUrl ( array  $value)
Parameters
array$value

Definition at line 231 of file UserModule.php.

{
$this->_returnUrl = $value;
}
static UserModule::t (   $str = '',
  $params = array(),
  $dic = 'user' 
)
static
static UserModule::user (   $id = 0)
static

Return safe user data.

Parameters
userid not required
Returns
user object or false

Definition at line 461 of file UserModule.php.

References User\model().

Referenced by isAdmin().

{
if ($id)
return User::model()->active()->findbyPk($id);
else {
if (Yii::app()->user->isGuest) {
return false;
} else {
if (!self::$_user)
self::$_user = User::model()->active()->findbyPk(Yii::app()->user->id);
return self::$_user;
}
}
}

Member Data Documentation

UserModule::$loginAjax = false

If login widget using Ajax for field validation

Definition at line 72 of file UserModule.php.

UserModule::$loginBadAttemps = 3

Amount of bad login attemps after which you couldnt login for $loginBlockTime

Definition at line 60 of file UserModule.php.

UserModule::$loginBlockTime = 300

Time in seconds for blocking ability to login after $loginBadAttemps times

string

Definition at line 67 of file UserModule.php.


The documentation for this class was generated from the following file: