Tutaj podobny, inny problem zwiazany ze skryptem przykladowego sklepu internetowego, moze popelnilem blad w konfiguracji...
to jest template
Kod
<?php echo $form->create('User', array('action' => 'register'));?>
<?php
echo $form->input('username', array('label' => 'Username *'));
echo $form->input('before_password', array('value' => '', 'type' => 'password', 'label' => 'Password *'));
echo $form->input('retype_password', array('value' => '', 'type' => 'password', 'label' => 'Retype Password *'));
echo $form->input('first_name', array('label' => 'First Name *'));
echo $form->input('last_name', array('label' => 'Last Name *'));
echo $form->input('email', array('label' => 'Email *'));
echo $form->input('date_of_birth', array('minYear' => $appConfigurations['Dob']['year_min'], 'maxYear' => $appConfigurations['Dob']['year_max'], 'label' => 'Date of Birth'));
echo $form->input('gender_id', array('type' => 'select', 'label' => 'Gender'));
echo $form->input('newsletter', array('label' => 'Sign up for the newsletter?'));
echo $form->input('referrer', array('label' => 'Referred By'));
?>
<div class="hint">Wpisz nazwe uzytkownika lub mail</div>
<?php
echo $form->end('Register');
?>
dalej kontroler:
Kod
function register($referrer = null) {
if (!empty($this->data)) {
if($this->appConfigurations['demoMode']) {
$this->data['User']['admin'] = 1;
} else {
$this->data['User']['admin'] = 0;
}
if ($data = $this->User->register($this->data)) {
if($this->_sendEmail($data)){
$this->Session->setFlash(__('Dzięki za rejestrację.', true), 'default', array('class' => 'success'));
$this->redirect(array('action'=>'login'));
}else{
$this->Session->setFlash(__('Błąd w wysyłaniu maila.', true));
}
} else {
$this->Session->setFlash(__('Problem z wysłaniem maila.', true), 'default', array('class' => 'message'));
}
} else {
$this->data['User']['referrer'] = $referrer;
$id = $id = $this->Auth->user('id');
if(!empty($id)) {
$this->redirect(array('action' => 'index'));
}
}
$this->set('genders', $this->User->Gender->find('list'));
$this->pageTitle = __('Register', true);
}
a tutaj mam kawałek configa, moze po prostu niepoprawnie uzupelniam dane i wszystko się sprowadza do tego ?:
Kod
'Email' => array(
'delivery' => 'smtp',
'sendAs' => 'both',
'host' => 'mojhost np. test@gmail?,
'port' => 25,
'timeout' => 60,
'username' => 'mail@stronawww.ugu.pl',
'password' => 'mojehaslodomaila?'
),