當前位置: 首頁>>代碼示例>>PHP>>正文


PHP eZUser::createPassword方法代碼示例

本文整理匯總了PHP中eZUser::createPassword方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZUser::createPassword方法的具體用法?PHP eZUser::createPassword怎麽用?PHP eZUser::createPassword使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在eZUser的用法示例。


在下文中一共展示了eZUser::createPassword方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: process

 /**
  * Main method to process current row returned by getNextRow() method.
  * You may throw an exception if something goes wrong. It will be logged but won't break the import process
  * @param mixed $row Depending on your data format, can be DOMNode, SimpleXMLIterator, SimpleXMLElement, CSV row...
  */
 public function process($row)
 {
     $contentOptions = new SQLIContentOptions(array('class_identifier' => 'user', 'remote_id' => (string) $row->login));
     $content = SQLIContent::create($contentOptions);
     $content->fields->first_name = (string) $row->firstName;
     $content->fields->last_name = (string) $row->lastName;
     $userParts = array((string) $row->login, (string) $row->email);
     //password management : if empty, generate it, use custom default or fixed default
     $password = $row->password;
     if (!$password) {
         if (isset($this->options->generate_password) && $this->options->generate_password) {
             $password = eZUser::createPassword(6);
         } elseif (isset($this->options->default_password) && $this->options->default_password) {
             $password = $this->options->default_password;
         } else {
             $password = '_ezpassword';
         }
     }
     $userParts[] = $password;
     $userParts[] = eZUser::createHash((string) $row->login, $password, eZUser::site(), eZUser::hashType());
     $userParts[] = eZUser::hashType();
     $content->fields->user_account = implode('|', $userParts);
     // Now publish content
     $content->addLocation(SQLILocation::fromNodeID($this->handlerConfArray['DefaultParentNodeID']));
     $publisher = SQLIContentPublisher::getInstance();
     $publisher->publish($content);
     // Free some memory. Internal methods eZContentObject::clearCache() and eZContentObject::resetDataMap() will be called
     // @see SQLIContent::__destruct()
     unset($content);
     $this->csv->rows->next();
 }
開發者ID:heliopsis,項目名稱:SQLIImport,代碼行數:36,代碼來源:sqliusersimporthandler.php

示例2: if

    }
    else
    {
        $tpl->setVariable( 'wrong_key', true );
    }
}
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 );
開發者ID:robinmuilwijk,項目名稱:ezpublish,代碼行數:31,代碼來源:forgotpassword.php

示例3: getUserAccountString

 protected function getUserAccountString($login, $email)
 {
     $password = eZUser::createPassword(8);
     $passwordHash = eZUser::createHash($login, $password, eZUser::site(), eZUser::hashType());
     return $login . '|' . $email . '|' . $passwordHash . '|' . eZUser::passwordHashTypeName(eZUser::hashType());
 }
開發者ID:sdaoudi,項目名稱:nxc_social_networks,代碼行數:6,代碼來源:login.php


注:本文中的eZUser::createPassword方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。