当前位置: 首页>>代码示例>>PHP>>正文


PHP eZUser::definition方法代码示例

本文整理汇总了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;
 }
开发者ID:jordanmanning,项目名称:ezpublish,代码行数:13,代码来源:native_user_authfilter.php

示例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;
 }
开发者ID:informaticatrentina,项目名称:pat_base,代码行数:28,代码来源:itnewsletternotificationrule.php

示例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' ) )
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:30,代码来源:forgotpassword.php

示例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;
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:18,代码来源:ezuser.php

示例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;
 }
开发者ID:netbliss,项目名称:ezpublish,代码行数:23,代码来源:ezuser.php

示例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();
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:31,代码来源:forgotpassword.php


注:本文中的eZUser::definition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。