当前位置: 首页>>代码示例>>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;未经允许,请勿转载。