Book Image

Yii Project Blueprints

By : Charles R. Portwood ll
Book Image

Yii Project Blueprints

By: Charles R. Portwood ll

Overview of this book

Table of Contents (15 chapters)
Yii Project Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Enabling users to manage their information


In the previous chapters, our users haven't been able to do much besides interacting with content. In this chapter, we'll be expanding upon the base User model so that they can register with our application, securely activate their accounts, reset their passwords if they forget them, and change their e-mail address.

Upgrading our UserIdentity class

Before implementing the previously mentioned functionality, we need to make sure that we can address our users appropriately without having to ask our database for some basic information about the currently logged-in user. To do this, we're going to add some information to our UserIdentity.php file located at protected/components/ as shown next in the highlighted sections of our authenticate() method. Additionally, we're going to enhance this class so that if YII_DEBUG is enabled, we can get more information about what is going on if authentication fails:

public function authenticate()
{
   $record = User...