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


PHP eZUser::attribute方法代码示例

本文整理汇总了PHP中eZUser::attribute方法的典型用法代码示例。如果您正苦于以下问题:PHP eZUser::attribute方法的具体用法?PHP eZUser::attribute怎么用?PHP eZUser::attribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eZUser的用法示例。


在下文中一共展示了eZUser::attribute方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: passwordHasExpired

 /**
  * Writes audit information and redirects the user to the password change form.
  *
  * @param eZUser $user
  */
 protected static function passwordHasExpired($user)
 {
     $userID = $user->attribute('contentobject_id');
     // Password expired
     eZDebugSetting::writeDebug('kernel-user', $user, 'user password expired');
     // Failed login attempts should be logged
     $userIDAudit = isset($userID) ? $userID : 'null';
     $loginEscaped = eZDB::instance()->escapeString($user->attribute('login'));
     eZAudit::writeAudit('user-failed-login', array('User id' => $userIDAudit, 'User login' => $loginEscaped, 'Comment' => 'Failed login attempt: Password Expired. eZPaExUser::loginUser()'));
     // Redirect user to password change form
     self::redirectToChangePasswordForm($userID);
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:17,代码来源:ezpaexuser.php

示例2: fetchForClientUser

 /**
  * Returns the authorization object for a user & application
  * @param ezpRestClient $client
  * @param eZUser $user
  */
 public static function fetchForClientUser(ezpRestClient $client, eZUser $user)
 {
     $session = ezcPersistentSessionInstance::get();
     $q = $session->createFindQuery(__CLASS__);
     $q->where($q->expr->eq('rest_client_id', $q->bindValue($client->id)))->where($q->expr->eq('user_id', $q->bindValue($user->attribute('contentobject_id'))));
     $results = $session->find($q, __CLASS__);
     if (count($results) != 1) {
         return false;
     } else {
         return array_shift($results);
     }
 }
开发者ID:legende91,项目名称:ez,代码行数:17,代码来源:restauthorizedclient.php

示例3: authorizeFor

 /**
  * Authorizes this application for a user
  * @param eZUser $user
  * @return void
  */
 public function authorizeFor($user = null)
 {
     $authorization = new ezpRestAuthorizedClient();
     $authorization->rest_client_id = $this->id;
     $authorization->user_id = $user->attribute('contentobject_id');
     $session = ezcPersistentSessionInstance::get();
     $session->save($authorization);
 }
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:13,代码来源:restclient.php

示例4: loginSucceeded

 /**
  * Does some house keeping work once a log in has succeeded.
  *
  * @param eZUser $user
  */
 protected static function loginSucceeded($user)
 {
     $userID = $user->attribute('contentobject_id');
     // if audit is enabled logins should be logged
     eZAudit::writeAudit('user-login', array('User id' => $userID, 'User login' => $user->attribute('login')));
     eZUser::updateLastVisit($userID, true);
     eZUser::setCurrentlyLoggedInUser($user, $userID);
     // Reset number of failed login attempts
     eZUser::setFailedLoginAttempts($userID, 0);
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:15,代码来源:ezuser.php

示例5: sendExpiryNotification

 /**
  * Send password expiry notification to user
  *
  * @param eZUser $user ezuser object that contains the destination email address
  * @return true if notification sent correctly, false if not.
  */
 function sendExpiryNotification($user)
 {
     $userToSendEmail = $user;
     require_once "kernel/common/template.php";
     $receiver = $userToSendEmail->attribute('email');
     $mail = new eZMail();
     if (!$mail->validate($receiver)) {
         eZDebug::writeError('Invalid email address set in user ' . $user->attribute('contentobject_id'), 'sendExpiryNotification');
         return false;
     }
     $tpl = templateInit();
     $tpl->setVariable('user', $userToSendEmail);
     $http = eZHTTPTool::instance();
     $http->UseFullUrl = false;
     $templateResult = $tpl->fetch('design:userpaex/expirynotificationmail.tpl');
     $ini = eZINI::instance();
     $emailSender = $ini->variable('MailSettings', 'EmailSender');
     if (!$emailSender) {
         $emailSender = $ini->variable('MailSettings', 'AdminEmail');
     }
     $mail->setSender($emailSender);
     $mail->setReceiver($receiver);
     $subject = ezpI18n::tr('mbpaex/userpaex', 'Your password is about to expire');
     if ($tpl->hasVariable('subject')) {
         $subject = $tpl->variable('subject');
     }
     $mail->setSubject($subject);
     $mail->setBody($templateResult);
     return eZMailTransport::send($mail);
 }
开发者ID:netbliss,项目名称:ezmbpaex,代码行数:36,代码来源:ezpaex.php

示例6: serializeDraft

 /**
  * Generates a serialized draft of the ezuser content
  *
  * @param eZUser $user
  * @return string
  */
 private function serializeDraft(eZUser $user)
 {
     return json_encode(array('login' => $user->attribute('login'), 'password_hash' => $user->attribute('password_hash'), 'email' => $user->attribute('email'), 'password_hash_type' => $user->attribute('password_hash_type')));
 }
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:10,代码来源:ezusertype.php

示例7: userIsParticipant

 /**
  * Checks if $user is a participant in this collaboration item
  * @param eZUser $user
  * @return bool
  */
 public function userIsParticipant(eZUser $user)
 {
     /** @var eZCollaborationItemParticipantLink $participantLink */
     foreach ($this->participantList() as $participantLink) {
         $participant = $participantLink->participant();
         if ($participant instanceof eZUser) {
             if ($participant->attribute('contentobject_id') == $user->attribute('contentobject_id')) {
                 return true;
             }
         } else {
             if ($participant instanceof eZContentObject) {
                 foreach ($user->groups() as $userGroup) {
                     if ($participant->attribute('id') == $userGroup->attribute('id')) {
                         return true;
                     }
                 }
             }
         }
     }
     return false;
 }
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:26,代码来源:ezcollaborationitem.php

示例8: setUser

 /**
  * User setter
  * @param eZUser $user
  */
 public function setUser(eZUser $user)
 {
     $this->user = $user;
     $this->setAttribute('user_id', $user->attribute('contentobject_id'));
 }
开发者ID:heliopsis,项目名称:SQLIImport,代码行数:9,代码来源:sqliimportitem.php

示例9: checkAccess

 public static function checkAccess(eZContentObject $contentobject, eZUser $user, $functionName, $originalClassID = false, $parentClassID = false, $returnAccessList = false, $language = false)
 {
     $classID = $originalClassID;
     $userID = $user->attribute('contentobject_id');
     $origFunctionName = $functionName;
     // Fetch the ID of the language if we get a string with a language code
     // e.g. 'eng-GB'
     $originalLanguage = $language;
     if (is_string($language) && strlen($language) > 0) {
         $language = eZContentLanguage::idByLocale($language);
     } else {
         $language = false;
     }
     // This will be filled in with the available languages of the object
     // if a Language check is performed.
     $languageList = false;
     // The 'move' function simply reuses 'edit' for generic access
     // but adds another top-level check below
     // The original function is still available in $origFunctionName
     if ($functionName == 'move') {
         $functionName = 'edit';
     }
     $accessResult = $user->hasAccessTo('content', $functionName);
     $accessWord = $accessResult['accessWord'];
     /*
     // Uncomment this part if 'create' permissions should become implied 'edit'.
     // Merges in 'create' policies with 'edit'
     if ( $functionName == 'edit' &&
          !in_array( $accessWord, array( 'yes', 'no' ) ) )
     {
         // Add in create policies.
         $accessExtraResult = $user->hasAccessTo( 'content', 'create' );
         if ( $accessExtraResult['accessWord'] != 'no' )
         {
             $accessWord = $accessExtraResult['accessWord'];
             if ( isset( $accessExtraResult['policies'] ) )
             {
                 $accessResult['policies'] = array_merge( $accessResult['policies'],
                                                          $accessExtraResult['policies'] );
             }
             if ( isset( $accessExtraResult['accessList'] ) )
             {
                 $accessResult['accessList'] = array_merge( $accessResult['accessList'],
                                                            $accessExtraResult['accessList'] );
             }
         }
     }
     */
     if ($origFunctionName == 'remove' or $origFunctionName == 'move') {
         $mainNode = $contentobject->attribute('main_node');
         // We do not allow these actions on objects placed at top-level
         // - remove
         // - move
         if ($mainNode and $mainNode->attribute('parent_node_id') <= 1) {
             return 0;
         }
     }
     if ($classID === false) {
         $classID = $contentobject->attribute('contentclass_id');
     }
     if ($accessWord == 'yes') {
         return 1;
     } else {
         if ($accessWord == 'no') {
             if ($functionName == 'edit') {
                 // Check if we have 'create' access under the main parent
                 if ($contentobject->attribute('current_version') == 1 && !$contentobject->attribute('status')) {
                     $mainNode = eZNodeAssignment::fetchForObject($contentobject->attribute('id'), $contentobject->attribute('current_version'));
                     $parentObj = $mainNode[0]->attribute('parent_contentobject');
                     $result = $parentObj->checkAccess('create', $contentobject->attribute('contentclass_id'), $parentObj->attribute('contentclass_id'), false, $originalLanguage);
                     return $result;
                 } else {
                     return 0;
                 }
             }
             if ($returnAccessList === false) {
                 return 0;
             } else {
                 return $accessResult['accessList'];
             }
         } else {
             $policies =& $accessResult['policies'];
             $access = 'denied';
             foreach (array_keys($policies) as $pkey) {
                 $limitationArray =& $policies[$pkey];
                 if ($access == 'allowed') {
                     break;
                 }
                 $limitationList = array();
                 if (isset($limitationArray['Subtree'])) {
                     $checkedSubtree = false;
                 } else {
                     $checkedSubtree = true;
                     $accessSubtree = false;
                 }
                 if (isset($limitationArray['Node'])) {
                     $checkedNode = false;
                 } else {
                     $checkedNode = true;
                     $accessNode = false;
//.........这里部分代码省略.........
开发者ID:rantoniazzi,项目名称:xrowmetadata,代码行数:101,代码来源:xrowsitemaptools.php


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