You may use this code in any way you wish. You can use it as your own skeleton app, or use it as a reference, or for ideas, or to get a better under standing for Yii, or some part of it. Whatever you want.
If anyone has any comments on it that would be great.
I noticed that GroupController::actionList() is using the old code. Perhaps it should be updated to be consistent with that in UserController.
Today I checked in a minor enhancement to access control filter. You can use specify an expression in the rule. Perhaps that may eliminate the need for you to extend the existing access control filter?
very useful - I especially like the included debug features.
One small point, when creating a new user and trying to verify the email address I seeing 'Page Not Found The requested controller "users" does not exist'.
very useful - I especially like the included debug features.
One small point, when creating a new user and trying to verify the email address I seeing 'Page Not Found The requested controller "users" does not exist'.
I just updated the groups controller to not use the "old" code. I'll try to upload today…
And yes, the enhancement you made to the access control feature destroys the need for me to extend it, I still like my extension of it better as it requires less typing when setting access controls, so I think i’ll leave it. You can see I commented in documentation as to how it works in the AccessControlFilter.php . I also put in some instructions to un-extend it (just now).
Quote
One small point, when creating a new user and trying to verify the email address I seeing 'Page Not Found The requested controller "users" does not exist'.
Oops! Sorry, I totally forgot to implant that part of the application. I'll try to get that in the next update.
This may sound absurd but I'm still learning my revision control. I have mixed feeling about putting it under SVN because I know different people have different needs for a skeleton app (for instance I extended the access control filter and I think a lot of people would not like that for themselves personally).
In any case, if anyone would like to fork the project that's fine.
This may sound absurd but I'm still learning my revision control. I have mixed feeling about putting it under SVN because I know different people have different needs for a skeleton app (for instance I extended the access control filter and I think a lot of people would not like that for themselves personally).
In any case, if anyone would like to fork the project that's fine.
I'll try to get an update in today
Well We could always setup a few branches of it. If you like I can setup a google code project and If you want you can just E-mail me the updates and I'll manage Uploading them and such for you. Might be a bit easier if you've never done SVN before.
Of course people have different needs but a 'clean'-ish starting point is always the best for people to work off.
I need to learn it anyways so I think i'll give it a try myself when I get time. I just uploaded an update but now I got to get some other work done off the computer.
Anyways, the update includes:
Replaced "old" code in group controller
(btw, the group create view now has some JS that might be interesting to some)
Added a few more comments/documentation here and there
Added user verification action
Added User::get/setActivated() and User::getActivationCode()
Depreciated use of User::unconfirmEmail() in favor of $user->activated = true/false;
This list is from memory and may not include everything
If you like I can setup a google code project and If you want you can just E-mail me the updates and I'll manage Uploading them and such for you. Might be a bit easier if you've never done SVN before.
Of course people have different needs but a 'clean'-ish starting point is always the best for people to work off.
Please do it, for I found following message when I clicked the tab of Users.
Quote
CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'User.group_id' in 'on clause'
If you like I can setup a google code project and If you want you can just E-mail me the updates and I'll manage Uploading them and such for you. Might be a bit easier if you've never done SVN before.
Of course people have different needs but a 'clean'-ish starting point is always the best for people to work off.
Please do it, for I found following message when I clicked the tab of Users.
Quote
CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'User.group_id' in 'on clause'
I’ll only do so with Jonah permission which I don’t have yet. But as soon as he consents I’ll be happy to set it up and get a bug system going.
I don't see any obvious reasons that you are getting that area. Can you confirm that your user table actually does have the group_id column? It should. Did it spit out any other debug info that might help me?
@creator
fixed and uploaded. The problem is that when the user verified his account, it rehashed his password. So now it makes sure the password actually changed before hashing it, unless it is a new user in which case it hashes it anyways
btw, do you also get the error that mocapapa gets?
@Bios Element
You have permission to do whatever you want with it, but I wont send the the patches directly to you (but you could theoretically still do it). I will try to get a svn up myself pretty soon (hopefully).
I don't see any obvious reasons that you are getting that area. Can you confirm that your user table actually does have the group_id column? It should. Did it spit out any other debug info that might help me?
I found that there already was a table named 'user' and it conflicts the new one.
I changed the database and created the new tables. Though I have to rename the table ‘user’ to ‘User’ and ‘group’ to ‘Group’, it begins to work. Sorry for bothering you.
For me it works with the tables as under-case… And I'm not sure why Yii is making the first letter capital, within the app all the tables are written in lower-case.
Could it be a mysql setting that turns on case-sensitivity?
Also, I can't think of any way for a user to be able to recover his password, because it is encrypted in the database. Not sure what I'm going to do about that, but i'll probably remove that silly little message and instead have a password reset option for those who correctly know their username and email (and then the new password will be sent to their email)
Added the ability for a user to reset his password
Removed auto-password encryption in beforeSave() (in favor of just directly calling a new method encryptPassword() ) - Note: this is not something you need to know unless you were messing around with the code I wrote
For me it works with the tables as under-case... And I'm not sure why Yii is making the first letter capital, within the app all the tables are written in lower-case.
Could it be a mysql setting that turns on case-sensitivity?
I am not sure about that. Would some one please describe this case sensitivity?
Quote
Also, I can't think of any way for a user to be able to recover his password, because it is encrypted in the database. Not sure what I'm going to do about that, but i'll probably remove that silly little message and instead have a password reset option for those who correctly know their username and email (and then the new password will be sent to their email)
I have the same opinion. The system should generate a random password which is sent to end users and should be replaced by the one supplied by end users.
Quote
BTW thanks for reminding me
Thank you for this skeleton application as a common base for every Yii application. As I would like to extend this, I hope to have an open SVN system such as google code.