
Tworze sobie od nowa portal uzyczam.pl, zaczalem od rejestracji uzytkownikow i tutaj schody, rejestracja pod adresem:
http://uzyczam.pl/rejestracja
Tabele z uzytkownikami standardowe z modulu Auth, jedyna zmiana to w Users pole username to bedzie tak naprawde email
CREATE TABLE IF NOT EXISTS `upl_users` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `username` varchar(254) NOT NULL, `password` varchar(64) NOT NULL, `logins` int(10) UNSIGNED NOT NULL DEFAULT '0', `last_login` int(10) UNSIGNED, PRIMARY KEY (`id`), UNIQUE KEY `uniq_email` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Metoda:
public function action_register() { $this->template->title = __('Uzyczam.pl - rejestracja'); $error = ''; $success = ''; { if(ORM::factory('User')->where('username', '=', $_POST['email'])->count_all()>0) $error .= __('Użytkownik korzystający z tego emaila istnieje już w bazie. '); if(ORM::factory('City')->where('nazwa', '=', $_POST['city'])->count_all()==0) $error .= __('Nie znaleziono podanej nazwy miejscowości w bazie. '); if($error == '') { $user = ORM::factory('User'); $user->username = $this->request->post('email'); $user->password = $this->request->post('password'); $user->save(); #$user->role = $user->id; $success .= __('Zostałeś zarejestrowany, możesz się zalogować.'); } } $this->template->content = View::factory('template/rejestracja'); $this->template->content->error = $error; $this->template->content->success = $success; }
ale nawet gdy na sztywno podalem dane to wyskakuje ten sam blad:
$user = ORM::factory('User'); $user->username = 'adfadadfadsf'; $user->password = 'qwerqwerqwer'; $user->save(); #$user->role = $user->id;
Cytat
ORM_Validation_Exception [ 0 ]: Failed to validate array
MODPATH/orm/classes/Kohana/ORM.php [ 1275 ]
1270
1271 $array = $this->_validation;
1272
1273 if (($this->_valid = $array->check()) === FALSE OR $extra_errors)
1274 {
1275 $exception = new ORM_Validation_Exception($this->errors_filename(), $array);
1276
1277 if ($extra_errors)
1278 {
1279 // Merge any possible errors from the external object
1280 $exception->add_object('_external', $extra_validation);
MODPATH/orm/classes/Kohana/ORM.php [ 1275 ]
1270
1271 $array = $this->_validation;
1272
1273 if (($this->_valid = $array->check()) === FALSE OR $extra_errors)
1274 {
1275 $exception = new ORM_Validation_Exception($this->errors_filename(), $array);
1276
1277 if ($extra_errors)
1278 {
1279 // Merge any possible errors from the external object
1280 $exception->add_object('_external', $extra_validation);
Mozecie tam pod tym adresem sprobowac sie zarejestrowac i dokladny komunikat sprawdzic. Rece mi juz opadaja, siedze na tym juz 1,5 dnia, nie wiem gdzie lezy blad, probowalem roznie do tego podejsc, ale ciagle to samo
