本文整理匯總了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());
}