How is my progress? |
[eluser]Mutsop[/eluser]
Hi Before I continue, sorry for this long post. As I previously stated in another post I'm just a rookie. So I wanted to ask you guys what you think of my application so far. Is it well written? How about the placement of the files/code? What would you do? The following code has the basics of "CodeIgniter and Doctrine from Scratch" Series from phpandstuff Oke so lets get started: My application is a start of a cms system: Simple admin login and forgot password. When you forgot the password, a random new password will be emailed. Login screen: Quote:I created a table user for both the admins and users... I make the difference using a "user level" - 1 being the admin, 2 or above the normal users. authenticate function in the login controller: Code: public function authenticate() { Instead of duplicating the Current_User::login() model function, I kept the same code and added a user level check. fyi in the user model I added Code: $this->hasColumn('ulevel', 'integer', 5); And now for the diffcult part... Forgot Password: Quote:I have a simple form with one email imputbox and a submit button. forgot_password and _send_password from the forgot_password controller: Code: public function forgot_password() { current_user model (partial): Code: public static function forgot_password($email) { user model (partial): Code: public function Reset_Password() { Now I'm kind of lost, if this is well programmed or not?. What do you think? Any opinion is appreciated Kind regards
[eluser]Mutsop[/eluser]
Any help appreciated I know its alot to read but even a small hint would be welcome
[eluser]2think[/eluser]
Mutsop, don't be disheartened. A lot of the more experienced people on here are incredibly busy with their own private projects, work projects and other commitments so for them to go through a whole app or significant part thereof, it may take some time. What I know works for me is if the app produces what you think are acceptable outcomes and passes any unit tests or use case testing, then you could consider it a fair success. Also, don't forget that Doctrine is not the "default" DB ORM for Codeigniter so many people may not even know how to advise you (like me!) However, my quick read of your Forgot_password controller code is that it seems elegant and what little I know about Doctrine, same goes for the model...but that's about all I can say with such a quick read and at this hour is that it seems "sensible".
[eluser]Mutsop[/eluser]
I suppose you are correct... sorry for the rush But ain't Doctrine a well used ORM? I mean, when I check google and CI forums Doctrine is one of the only ORM used.... I thought. Also with the upcoming CI2 and Doctrine2 I suppose the working progress will be easier for most of the newcomers. But to get back On Topic: I know that when something works you might consider it a success. But it's like building a house. If you have all your functionalities it doesn't mean the house is well made. You won't be putting your kitchen on the top floor with a toilet in it. There has to be some simple rules to follow. |
Welcome Guest, Not a member yet? Register Sign In |