Revision #3 has been created by thyseus on May 21, 2011, 11:22:03 AM with the memo:
code fixes
« previous (#2)
Changes
Title
unchanged
Implementing a Registration Process using the yii-user-management module
Category
unchanged
Tutorials
Yii version
unchanged
Tags
unchanged
user, user management, registration, yii-user-management
Content
changed
[...]
<div class="form">
<?php $activeform = $this->beginWidget('CActiveForm', array(
'id'=>'registration-form',
'enableAjaxValidation'=>false,
'focus'=>array($form,'usernameprofile,'email'),
));
?>
<?php echo Yum::requiredFieldNote(); ?>
<?php echo CHtml::errorSummary(
array($form, $profile)); ?>$profile); ?>
<div class="row"> <?php
echo $activeform->labelEx($profile,'email');
echo $activeform->textField($profile,'email');
?> </div>
<div class="row"> <?php[...]
$user = new YumUser;
$password = YumUser::generatePassword();
// we generate a dummy username here, since yum requires one
$user->register(md5($profile->email), $password, $profile);
$this->sendRegistrationEmail($user, $password);[...]
Now, we also need to override the sendRegistrationEmail method, because we want to include the clear-text password in the email:
[...]
create a file models/Profile.php that extends the YumProfile:
```php
Yii::import('application.modules.profile.models.YumProfile');
class Profile extends YumProfile {
function rules() {[...]