The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
register-cakephp
Posted by: josh | November 10, 2007 @ 6:45am
PHP Code
[
Download
]
function register() { $this->set('username_error', 'Username must be between 6 and 40 characters.'); if (!empty($this->data)) { if ($this->User->validates($this->data)) { if ($this->User->findByUsername($this->data['User']['username'])) { $this->User->invalidate('username'); $this->set('username_error', 'User already exists.'); } else { $this->data['User']['password'] = md5($this->data['User']['password']); if ($this->User->save($this->data)) { $aro = new Aro(); $aro->create($this->User->id, 'User', $this->data['User']['username']); $this->Session->write('user', $this->data['User']['username']); $this->redirect('/users/cp'); } else { $this->flash('There was a problem saving this information', '/users/register'); } } } else { $this->validateErrors($this->User); } } }
Syntax Highlighting
[
Open in new window
]
Author Comments
Register function in users controller
Rating
4.49 / 8
276 Votes
http://codebin.yi.org/58
page generated in 0.01 seconds