本文整理汇总了PHP中eZUser::definition方法的典型用法代码示例。如果您正苦于以下问题:PHP eZUser::definition方法的具体用法?PHP eZUser::definition怎么用?PHP eZUser::definition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZUser
的用法示例。
在下文中一共展示了eZUser::definition方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Will check if UserID provided in credentials is valid
* @see ezcAuthenticationFilter::run()
*/
public function run($credentials)
{
$status = self::STATUS_INVALID_USER;
$count = eZPersistentObject::count(eZUser::definition(), array('contentobject_id' => (int) $credentials->id));
if ($count > 0) {
$status = self::STATUS_OK;
}
return $status;
}
示例2: fetchUserList
/**
* @param eZTags $tags
*
* @return eZUser[]
*/
public static function fetchUserList(eZTags $tags)
{
$tagIds = $tags->attribute('tag_ids');
$roles = array();
if (is_array($tagIds) && !empty($tagIds)) {
$roles = eZPersistentObject::fetchObjectList(ITNewsletterNotificationRule::definition(), array('user_id'), array('tag_id' => array($tagIds)), null, null, false);
}
$userIds = array();
foreach ($roles as $role) {
$userIds[] = $role['user_id'];
}
$userIds = array_unique($userIds);
$users = array();
if (!empty($userIds)) {
$users = eZPersistentObject::fetchObjectList(eZUser::definition(), null, array('contentobject_id' => array($userIds)));
}
foreach ($users as $index => $user) {
if (!$user->attribute('is_enabled')) {
unset($users[$index]);
}
}
return $users;
}
示例3: array
if ( $module->isCurrentAction( "Generate" ) )
{
$ini = eZINI::instance();
$passwordLength = $ini->variable( "UserSettings", "GeneratePasswordLength" );
$password = eZUser::createPassword( $passwordLength );
$passwordConfirm = $password;
// $http->setSessionVariable( "GeneratedPassword", $password );
if ( $module->hasActionParameter( "Email" ) )
{
$email = $module->actionParameter( "Email" );
if ( trim( $email ) != "" )
{
$users = eZPersistentObject::fetchObjectList( eZUser::definition(),
null,
array( 'email' => $email ),
null,
null,
true );
}
if ( isset($users) && count($users) > 0 )
{
$user = $users[0];
$time = time();
$userID = $user->id();
$hashKey = md5( $userID . ':' . $time . ':' . mt_rand() );
// Create forgot password object
if ( eZOperationHandler::operationIsAvailable( 'user_forgotpassword' ) )
示例4: removeUser
static function removeUser($userID)
{
$user = eZUser::fetch($userID);
if (!$user) {
eZDebug::writeError("unable to find user with ID {$userID}", __METHOD__);
return false;
}
eZUser::removeSessionData($userID);
eZSubtreeNotificationRule::removeByUserID($userID);
eZCollaborationNotificationRule::removeByUserID($userID);
eZUserSetting::removeByUserID($userID);
eZUserAccountKey::removeByUserID($userID);
eZForgotPassword::removeByUserID($userID);
eZWishList::removeByUserID($userID);
eZGeneralDigestUserSettings::removeByUserId($userID);
eZPersistentObject::removeObject(eZUser::definition(), array('contentobject_id' => $userID));
return true;
}
示例5: removeUser
static function removeUser($userID)
{
$user = eZUser::fetch($userID);
if (!$user) {
eZDebug::writeError("unable to find user with ID {$userID}", __METHOD__);
return false;
}
eZUser::removeSessionData($userID);
eZSubtreeNotificationRule::removeByUserID($userID);
eZCollaborationNotificationRule::removeByUserID($userID);
eZUserSetting::removeByUserID($userID);
eZUserAccountKey::removeByUserID($userID);
eZForgotPassword::removeByUserID($userID);
eZWishList::removeByUserID($userID);
// only remove general digest setting if there are no other users with the same e-mail
$email = $user->attribute('email');
$usersWithEmailCount = eZPersistentObject::count(eZUser::definition(), array('email' => $email));
if ($usersWithEmailCount == 1) {
eZGeneralDigestUserSettings::removeByAddress($email);
}
eZPersistentObject::removeObject(eZUser::definition(), array('contentobject_id' => $userID));
return true;
}
示例6: array
}
} else {
if (strlen($hashKey) > 4) {
$tpl->setVariable('wrong_key', true);
}
}
if ($module->isCurrentAction("Generate")) {
$ini = eZINI::instance();
$passwordLength = $ini->variable("UserSettings", "GeneratePasswordLength");
$password = eZUser::createPassword($passwordLength);
$passwordConfirm = $password;
// $http->setSessionVariable( "GeneratedPassword", $password );
if ($module->hasActionParameter("Email")) {
$email = $module->actionParameter("Email");
if (trim($email) != "") {
$users = eZPersistentObject::fetchObjectList(eZUser::definition(), null, array('email' => $email), null, null, true);
}
if (isset($users) && count($users) > 0) {
$user = $users[0];
$time = time();
$userID = $user->id();
$hashKey = md5($userID . ':' . microtime() . ':' . (function_exists("openssl_random_pseudo_bytes") ? openssl_random_pseudo_bytes(32) : mt_rand()));
// Create forgot password object
if (eZOperationHandler::operationIsAvailable('user_forgotpassword')) {
$operationResult = eZOperationHandler::execute('user', 'forgotpassword', array('user_id' => $userID, 'password_hash' => $hashKey, 'time' => $time));
} else {
eZUserOperationCollection::forgotpassword($userID, $hashKey, $time);
}
$userToSendEmail = $user;
$receiver = $email;
$mail = new eZMail();