Tuesday, September 25, 2007

First steps from Wordpress to CakePHP

Felix Geisendörfer (aka the_undefined) in his own blog wrote about first step for migration from platform Wordpress to CakePHP.

Of course, CakePHP engine doesn't exist right now, but, as I say, it's just first step in this direction.

Planning about DB structure tables, and some migrations tools for cake console (1.2, of course! :)

Oh. Forget give to you link to this wonderful article ;-)


Thursday, September 06, 2007

FrameWork mania

It's strange, but, when I trying to write code on PHP without my favorite CakePHP, I got my own Waterloo...

I forget about _SESSION, how to work with him, how to cache, how to make simple SQL code...


It's terrible!

But... After 20 minutes of reminding I install N-th copy of CakePHP, and in 2 minutes wrote all needing code ;-)

CakePHP is my FrameWork. (& jQuery, of couse ;)

Tuesday, September 04, 2007

MySQL warning and CakePHP 1.2 error?

I wrote some code about adding users to MySQL Table.

In my table present two unique fields: username & email. Ok?


It's code for adding user:

if($this->User->save($this->data)) {
$this->flash('All good','/login');
$this->redirect(array('action'=>'index'), null, true);
} else {
$this->data['User']['password'] = null;
$this->Session->setFlash('All bad');
(of couse it's fragment!)

So. When debug = 1. And I add user with already present in table username or email, I get

1: SQL Error about key who must be unique
2. I see message: All bad
3. No new records in table.

Now, switch debug level = 0

1. We don't see SQL Error (fine!)
2. We see message "All good"
3. We have new record in table with NON unique email (or username)

Who is wrong???

Monday, September 03, 2007

Password Reminder

I have some idea about "How To Remind Password".

Firsd idea in: I don't want to store password in database. Only md5('pass').
Second idea: I haven't time to programming scheme like: Forgot password? -> Get e-mail with shortlifetime links -> Go To url -> Get new password in your mailbox Or Type in special fields.

So. For my small, fast forum engine I use remindpassword from CheeseCake (PhotoBlog) ;-)
for my user password. And. Yes, I bad boy ;), I had store user's password in DB ;-( Anyway admin password only in md5 ;-)

It's not commercial site, project, and not so secure forum, so, next time, I promise, I'll write more secure password remind code ;-)

But, I think, If cheesecake store admin pass in open-view i DB, why I cann't? ;-)))