problem with login

I am adding this code in my UserIdentity.php file :

[size="1"]class UserIdentity extends CUserIdentity

{

private $_id;


public function authenticate()


{


    $record=User::model()->findByAttributes(array('username'=>$this->username));


    if($record===null)


        $this->errorCode=self::ERROR_USERNAME_INVALID;


    else if($record->password!==md5($this->password))


        $this->errorCode=self::ERROR_PASSWORD_INVALID;


    else


    {


        $this->_id=$record->id;


        $this->setState('title', $record->title);


        $this->errorCode=self::ERROR_NONE;


    }


    return !$this->errorCode;


}


public function getId()


{


    return $this->_id;


}

}

[/size]

However, i always received this error :

include(User.php) [<a href=‘function.include’>function.include</a>]: failed to open stream: No such file or directory

Anyone knows what kind of error i encounter ?

thank you

Do you have a user model?

I am a complete newbie.

How do i get that user model ?

Please read here - http://www.yiiframework.com/forum/index.php?/topic/13697-what-does-this-code-do/page__view__findpost__p__67387

Thank’s mdomba.

I might reinstall everything again, might have screwed up the installation

As I wrote on that post… take a read at the Definitive guide to Yii…

You don’t need to reinstall… a User model needs to be created it’s not part of Yii download… before that you need to create a user database…

but again

take a read at the guide… all this steps are explained there… and if it happens that you don’t understand something in the guide… just ask here in the forum…

thank’s mdomba.

Apparently, i never configured the gii.

After enabled it inside config/main.php & run http://mysite.com/testdrive/index.php?r=gii

i received

Error 404

Unable to resolve the request "gii".

Any ideas ?

thank’s

Do you have the latest version of Yii?

post here your Gii and urlManager config from config/main.php

I downloaded the yii a few days ago. i believe should be the latest

this is my config/main.php

<?php

// uncomment the following to define a path alias

// Yii::setPathOfAlias(‘local’,‘path/to/local-folder’);

// This is the main Web application configuration. Any writable

// CWebApplication properties can be configured here.

return array(

'basePath'=&gt;dirname(__FILE__).DIRECTORY_SEPARATOR.'..',


'name'=&gt;'My Web Application',





// preloading 'log' component


'preload'=&gt;array('log'),





// autoloading model and component classes


'import'=&gt;array(


	'application.models.*',


	'application.components.*',


),





'modules'=&gt;array(


	// uncomment the following to enable the Gii tool





	'gii'=&gt;array(


		'class'=&gt;'system.gii.GiiModule',


		'password'=&gt;'mynewpassword',


	),





),





// application components


'components'=&gt;array(


	'user'=&gt;array(


		// enable cookie-based authentication


		'allowAutoLogin'=&gt;true,


	),


	// uncomment the following to enable URLs in path-format


	/*


	'urlManager'=&gt;array(


		'urlFormat'=&gt;'path',


		'rules'=&gt;array(


			'&lt;controller:&#092;w+&gt;/&lt;id:&#092;d+&gt;'=&gt;'&lt;controller&gt;/view',


			'&lt;controller:&#092;w+&gt;/&lt;action:&#092;w+&gt;/&lt;id:&#092;d+&gt;'=&gt;'&lt;controller&gt;/&lt;action&gt;',


			'&lt;controller:&#092;w+&gt;/&lt;action:&#092;w+&gt;'=&gt;'&lt;controller&gt;/&lt;action&gt;',


		),


	),


	*/

/*

	'db'=&gt;array(


		'connectionString' =&gt; 'sqlite:'.dirname(__FILE__).'/&#46;&#46;/data/testdrive.db',


	),

*/

	// uncomment the following to use a MySQL database


	


	'db'=&gt;array(


		'connectionString' =&gt; 'mysql:host=localhost;dbname=server_db',


		'emulatePrepare' =&gt; true,


		'username' =&gt; 'server_db',


		'password' =&gt; 'serverpassword',


		'charset' =&gt; 'utf8',


	),


	


	'errorHandler'=&gt;array(


		// use 'site/error' action to display errors


        'errorAction'=&gt;'site/error',


    ),


	'log'=&gt;array(


		'class'=&gt;'CLogRouter',


		'routes'=&gt;array(


			array(


				'class'=&gt;'CFileLogRoute',


				'levels'=&gt;'error, warning',


			),


			// uncomment the following to show log messages on web pages


			/*


			array(


				'class'=&gt;'CWebLogRoute',


			),


			*/


		),


	),


),





// application-level parameters that can be accessed


// using Yii::app()-&gt;params['paramName']


'params'=&gt;array(


	// this is used in contact page


	'adminEmail'=&gt;'webmaster@example.com',


),

);

thank you

You need to be on localhost to use Gii.

If you’re not, you need to tell it what IP you’re using it from.

By default, Gii only works on 127.0.0.1:


public $ipFilters=array('127.0.0.1','::1');

Unless you have a really good reason not to, use localhost.

Otherwise, you need to add your IP to ipFilters in your gii module configuration settings.

When posting code please use the <> (Insert code snippet) button of the editor… it gives more readable code…

You config is OK… it should work… or at least you should get a Error 403… not the 404…

thank’s mdomba, jacmoe.

I’ll try it & update the result

I don’t have permission for my windows to install php etc.

Is there any other way to install gii ?

I tried to filter the ip, but my isp is running through proxy and the ip keep on changing.

If you have any different method, please let me know.

Thank you

Well.

You could probably run a LAMP stack on a usb stick?

Maybe. :)