Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- public function formSubmitted(AppForm $form) {
- $values = $form->getValues();
- foreach($values as $key => $value) {
- if($key != 'password_') {
- if($key == 'password') {
- $value = sha1($value);
- }
- $data[$key] = $value;
- }
- }
- if(false === AccountsTable::getInstance()->getAccountByParams(array('nick' => $values['nick']))) {
- AccountsTable::getInstance()->insertAccount($data);
- $this->flashMessage('Registrace proběhla vpořádku, děkujeme.','success');
- } else {
- $this->flashMessage('Uživatelské jméno je obsazené.','success');
- $form->setDefaults($values);
- }
- $this->redirect('this');
- }
- /////////////////////////////////////////
- ve formulari jsou policka ale prazdna
Add Comment
Please, Sign In to add comment