Jump to content
Larry Ullman's Book Forums
teutates

Custom-Authentication Question

Recommended Posts

Hello,

 

i'm a beginner at yii and i was hoping you could help me. i couldnt find a simmilair post so i sorry if i double post.

 

i used : http://www.larryullman.com/2010/01/07/custom-authentication-using-the-yii-framework/

 

but i have a strange error.

when i press the login button on my app. i get this error.

 

include(leraarCode.php): failed to open stream: No such file or directory

 

 

The strange thing is. the model is leraar. but i want leraarCode as username i followed every step.

But somehow $model is appointed leraarCode instead of leraar :S

And i cant find how it happend :/

 

http://pastebin.com/22pxH1TU (login.php)

http://pastebin.com/vqf3Sxvq (useridentity.php)

http://pastebin.com/TeqbUtyQ (loginform.php)

http://pastebin.com/aPiLVh1p (sql for the model)

 

Thanks for your time in advance.

 

Greetings,

 

Teutates

Share this post


Link to post
Share on other sites
include(leraarCode.php): failed to open stream: No such file or directory

 

This is the problem. PHP cannot find your file.

 

In the feature, do a search on the error message as it will often explain what's wrong. (The message kinda does too) This is a standard coding mistake and not related to YII per se. Make sure the file name is spelled correctly and has correct case.

Share this post


Link to post
Share on other sites

This is the problem. PHP cannot find your file.

 

In the feature, do a search on the error message as it will often explain what's wrong. (The message kinda does too) This is a standard coding mistake and not related to YII.

 

Well the reall problem is why it is looking for it.

the model is named leraar. but the field is named leraarCode.

as i grasp it. somehow the $model turned into a fieldname :/

Share this post


Link to post
Share on other sites

Ok. I can see a jumped to a conclusion too soon. Sorry about that.

 

Regardless, the problem is that you are missing a learaar model. You call learaar::findByAttributes() in you UserIdentity class, but it does not exist. The guide does not teach you have to implement the model part.

 

More info here: http://www.yiiframework.com/doc/guide/1.1/en/database.ar

 

It should be pretty straight forward to implement.

Share this post


Link to post
Share on other sites

Ok. I can see a jumped to a conclusion too soon. Sorry about that.

 

Regardless, the problem is that you are missing a learaar model. You call learaar::findByAttributes() in you UserIdentity class, but it does not exist. The guide does not teach you have to implement the model part.

 

More info here: http://www.yiiframew.../en/database.ar

 

It should be pretty straight forward to implement.

 

Well maybe i wasnt clear enough it can happen.

 

So the problem would be that the application can't find the model ( it does excists i used gii to create it before i started following the tutorial )

 

thanks for you time so far

Share this post


Link to post
Share on other sites

How about you clarify where you get that error? As in, what is the complete error message? The model is leraar (which, by the way, really should be uppercase), and your UserIdentity class uses it. So the question is where is it trying to create an object of type leraarCode?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...