erste Mailversuche + registration sollte fertig sein + auser aktivierung

This commit is contained in:
Martin Müller 2014-04-08 19:47:05 +02:00
parent 34f07e3120
commit 78893148eb
5 changed files with 24 additions and 11 deletions

View File

@ -51,8 +51,8 @@ class EmailConfig {
'from' => array('noreply@dreamjob.cc'=>'Dreamjob-Site'),
'replyTo' => array('service@dreamjob.cc'=>'[Dreamjob] Service'),
'emailFormat'=>'both',
'charset' => 'utf-8',
'headerCharset' => 'utf-8',
//'charset' => 'utf-8',
//'headerCharset' => 'utf-8',
);
public $smtp = array(

View File

@ -34,6 +34,7 @@
Router::connect('/registration', array('controller' => 'registration', 'action' => 'main'));
Router::connect('/registration/user', array('controller' => 'registration', 'action' => 'worker'));
Router::connect('/registration/company', array('controller' => 'registration', 'action' => 'company'));
Router::connect('/registration/active/:code', array('controller' => 'registration', 'action' => 'active'),array("code" => "(?i:code)"));
Router::connect('/profil', array('controller' => 'user', 'action' => 'profil'));
Router::connect('/profil/page/:page', array('controller' => 'user', 'action' => 'profil'),array("page" => "[0-9]+"));

View File

@ -13,12 +13,12 @@ class RegistrationController extends AppController {
public $componens = array('Email','MiconwareSession');
public $uses = array('Mannerofaddress','DreamjobListGraducation','DreamjobListBranch','DreamjobWorker','DreamjobCompany');
private function registrationMail($data){
private function registrationMail($data,$key){
$Email = new CakeEmail('dreamjobMain');
$Email->to($data['User']['mail']);
$Email->subject('Welcome to our really cool thing');
$Email->template('simple_message');
$Email->viewVars(array('data'=>$data));
$Email->template('registration');
$Email->viewVars(array('data'=>$data,'key'=>$key));
return $Email->send();
}
@ -56,11 +56,13 @@ class RegistrationController extends AppController {
$data['DreamjobCompany']['bank_details'] = '';
//$data['DreamjobCompany']['bank_details'] = $this->request->data['DreamjobCompany']['bank_details'];
$data['DreamjobCompany']['website'] = $this->request->data['DreamjobCompany']['website'];
$data['User']['code'] = "a:".$this->MiconwareSession->generateKey();
$key = $this->MiconwareSession->generateKey();
$data['User']['code'] = "a:".$key;
$data['User']['is_active'] = false;
$result = $this->DreamjobCompany->registration($data);
if($result){
$result = $this->registrationMail($data);
$result = $this->registrationMail($data,$key);
if($result){
$this->log("Registratrion Mail:"+$data['User']['mail']);
}
@ -110,12 +112,14 @@ class RegistrationController extends AppController {
$data['DreamjobWorker']['searchhidden'] = true;
$data['DreamjobWorker']['workexperience'] = $this->request->data['DreamjobWorker']['workexperience'];
$data['User']['code'] = "a:".$this->MiconwareSession->generateKey();
$key = $this->MiconwareSession->generateKey();
$data['User']['code'] = "a:".$key;
$data['User']['is_active'] = false;
$result = $this->DreamjobWorker->registration($data);
if($result){
$result = $this->registrationMail($data);
$result = $this->registrationMail($data,$key);
if($result){
$this->log("Registratrion Mail:"+$data['User']['mail']);
}
@ -139,6 +143,11 @@ class RegistrationController extends AppController {
$this->set('error', 'dreamjob.error.loggedin');
$this->render('/Home/error');
}
public function active(){
$this->set('error', 'dreamjob.error.loggedin');
$this->render('/Home/error');
}
}
}
?>

View File

@ -19,6 +19,9 @@
<?php
$content = explode("\n", $content);
foreach ($content as $line):
echo '<p> ' . $line . "</p>\n";
endforeach;
foreach ($content as $line):
echo '<p> ' . $line . "</p>\n";
endforeach;

View File

@ -16,4 +16,4 @@
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
?>
<?php echo $content; ?>
<?php echo $content.$content; ?>