本文整理汇总了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();
}
示例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 );
示例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());
}