#92 Loginanfrage - mit Fehlermeldung

This commit is contained in:
Martin Müller 2014-10-04 15:44:21 +02:00
parent 082f2c826f
commit e041210296
9 changed files with 130 additions and 41 deletions

View File

@ -63,12 +63,7 @@ class HomeController extends AppController {
$this->MiconwareSession->initWeb($this);
$openings = $this->DreamjobJobOpening->find('all',array('conditions'=>$this->MiconwareSession->getOpeningCondition(),
'order'=>'DreamjobJobOpening.id DESC','limit'=> self::$opening_limit));
$this->set('openings',$openings);
$this->set('title', __('dreamjob.startpage'));
$this->set('MENU_START', true);
$this->render('/Home/home');
$this->render('/Home/login');
}
public function logout(){

View File

@ -27,7 +27,10 @@ class JobController extends AppController {
if (!is_array($self) or count($self) <= 0) {
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
$this->render('/Home/error');
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
} else {
if (!empty($this->request->query['del'])) {
$o = $this->DreamjobJobOpening->findById($this->request->query['del']);
@ -69,7 +72,10 @@ class JobController extends AppController {
$this->render('/Job/opening_edit');
} else {
$this->set('error', array('title'=>__('dreamjob.error.noCompany.title'),'text'=>__('dreamjob.error.noCompany.text')));
$this->render('/Home/error');
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
}
}
@ -80,8 +86,10 @@ class JobController extends AppController {
$a = $this->MiconwareSession->getCompany();
if (empty($a)) {
$this->set('error', array('title'=>__('dreamjob.error.noCompany.title'),'text'=>__('dreamjob.error.noCompany.text')));
$this->render('/Home/error');
return null;
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
}
if (!empty($this->request->params['id'])) {
$load = $this->DreamjobJobOpening->findById($this->request->params['id']);
@ -153,6 +161,10 @@ class JobController extends AppController {
if (!is_array($opening) or count($opening) <= 0) {
$this->set('error', array('title'=>__('dreamjob.error.opening.notFound.title'),'text'=>__('dreamjob.error.opening.notFound.text')));
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
$this->render('/Home/error');
} else {
$this->set('opening', $opening);
@ -167,7 +179,10 @@ class JobController extends AppController {
$self = $this->MiconwareSession->getWorker();
if (!is_array($self) or count($self) <= 0) {
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
$this->render('/Home/error');
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
} else {
$fav_id = array();
foreach ($self['Favority'] as $fav)
@ -189,7 +204,10 @@ class JobController extends AppController {
if (!is_array($self) or count($self) <= 0) {
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
$this->render('/Home/error');
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
} else {
$applications = $this->DreamjobJobApplication->find('all', array('conditions' => array('DreamjobJobApplication.worker_id' => $self['AppUser']['id'])));
$this->set('applications', $applications);
@ -214,7 +232,10 @@ class JobController extends AppController {
if (!is_array($application) or count($application) <= 0) {
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
$this->render('/Home/error');
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
} else {
$this->set('page', null);
$this->set("edit", false);
@ -313,7 +334,10 @@ class JobController extends AppController {
}
if (!is_array($opening) or count($opening) <= 0) {
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
$this->render('/Home/error');
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
} else {
$this->set('opening', $opening);
$this->set('applications', $applications);
@ -364,7 +388,10 @@ class JobController extends AppController {
}
} else {
$this->set('error', array('title'=>__('dreamjob.error.noWorker.title'),'text'=>__('dreamjob.error.noWorker.text')));
$this->render('/Home/error');
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
}
}
public function applicationSendExt() {
@ -445,7 +472,10 @@ class JobController extends AppController {
} else {
$this->set('error', array('title'=>__('dreamjob.error.noWorker.title'),'text'=>__('dreamjob.error.noWorker.text')));
$this->render('/Home/error');
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
}
}

View File

@ -23,7 +23,10 @@ class PdfController extends AppController {
if(!is_array($application) or count($application) <= 0){
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
$this->render('/Home/error');
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
}else{
$this->response->type('application/pdf');
$this->set('application',$application);
@ -44,7 +47,10 @@ class PdfController extends AppController {
if(!is_array($WORKER) or count($WORKER) <= 0){
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
$this->render('/Home/error');
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
}else{
$this->response->type('application/pdf');
$cv = $this->DreamjobCvEntry->find('all',array('conditions' => array('worker_id'=> $WORKER['AppUser']['id'])));

View File

@ -72,7 +72,10 @@ class SearchController extends AppController {
$this->render('/Search/' . $type);
} else {
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
$this->render('/Home/error');
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
}
}
@ -152,7 +155,10 @@ class SearchController extends AppController {
$this->render('/Search/auto');
} else {
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
$this->render('/Home/error');
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
}
}
@ -190,7 +196,10 @@ class SearchController extends AppController {
$this->render('/Search/worker');
}else {
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
$this->render('/Home/error');
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
}
}

View File

@ -98,7 +98,10 @@ class UserController extends AppController {
$hard_error = true;
$this->MiconwareSession->setFlash(__('dreamjob.error.page.notFound'),'flash',array('alert'=>'danger'));
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
$this->render('/Home/error');
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
}
}elseif($profil['AppUser']['id'] == $self['AppUser']['id']){
$this->set('edit', true);
@ -155,7 +158,10 @@ class UserController extends AppController {
$this->render('/User/worker');
}else{
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
$this->render('/Home/error');
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
}
}
/*
@ -201,7 +207,10 @@ class UserController extends AppController {
if(empty($profil) or count($profil) <= 0){
$this->MiconwareSession->setFlash(__('dreamjob.error.page.notFound'),'flash',array('alert'=>'danger'));
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
$this->render('/Home/error');
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
}else{
if(isset($this->request->query['list']) and is_array($this->request->query['list'])){
$i=10;
@ -246,8 +255,11 @@ class UserController extends AppController {
}
if(empty($profil) or count($profil) <= 0){
$this->MiconwareSession->setFlash(__('dreamjob.error.page.notFound'),'flash',array('alert'=>'danger'));
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
$this->MiconwareSession->setFlash(__('dreamjob.error.page.notFound'),'flash',array('alert'=>'danger'));
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
}else{
if ($this->request->is('post')){
@ -322,8 +334,11 @@ class UserController extends AppController {
$profil = $this->MiconwareSession->getCompany();
if(empty($profil) or count($profil) <= 0){
$this->MiconwareSession->setFlash(__('dreamjob.error.page.notFound'),'flash',array('alert'=>'danger'));
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
$this->MiconwareSession->setFlash(__('dreamjob.error.page.notFound'),'flash',array('alert'=>'danger'));
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
}else{
//PAGE BEARBEITEN
@ -438,8 +453,11 @@ class UserController extends AppController {
$profil = $this->MiconwareSession->getWorker();
if(empty($profil) or count($profil) <= 0){
$this->MiconwareSession->setFlash(__('dreamjob.error.page.notFound'),'flash',array('alert'=>'danger'));
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
$this->MiconwareSession->setFlash(__('dreamjob.error.page.notFound'),'flash',array('alert'=>'danger'));
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
}else{
if($this->request->is('post')){
@ -484,8 +502,12 @@ class UserController extends AppController {
}
if(empty($profil) or count($profil) <= 0){
$this->MiconwareSession->setFlash(__('dreamjob.error.page.notFound'),'flash',array('alert'=>'danger'));
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
$this->MiconwareSession->setFlash(__('dreamjob.error.page.notFound'),'flash',array('alert'=>'danger'));
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
}else{
if ($this->request->is('post')){
@ -513,8 +535,11 @@ class UserController extends AppController {
$profil = $this->MiconwareSession->getApplication('AppUser');
if(empty($profil) or count($profil) <= 0){
$this->MiconwareSession->setFlash(__('dreamjob.error.page.notFound'),'flash',array('alert'=>'danger'));
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
$this->MiconwareSession->setFlash(__('dreamjob.error.page.notFound'),'flash',array('alert'=>'danger'));
$this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text')));
if(!$this->MiconwareSession->isLoggedin())
$this->render('/Home/login');
else
$this->render('/Home/error');
}else{
if($this->request->is('put') or $this->request->is('post')){

View File

@ -104,7 +104,7 @@ msgstr "Zugriff verweigert"
#: Controller/SearchController.php:74;154;192
#: Controller/UserController.php:100;157;203;250;326;442;488;517
msgid "dreamjob.error.noPermision.text"
msgstr "überprüfen Sie, ob Sie tatsächlich angemeldet sind"
msgstr "Sie haben hier keine Rechte."
#: Controller/JobController.php:36
msgid "dreamjob.opening.delete.success"
@ -181,7 +181,7 @@ msgstr "Zugriff verweigert"
#: Controller/JobController.php:365
msgid "dreamjob.error.noWorker.text"
msgstr "überprüfen Sie, ob Sie tatsächlich angemedet sind"
msgstr "Sie haben hier keine Rechte."
#: Controller/RegistrationController.php:21;76;134;147;171
msgid "dreamjob.error.loggedin.title"

22
app/View/Home/login.ctp Normal file
View File

@ -0,0 +1,22 @@
<?php
?>
<div class="box 2modal">
<h1 class="modal-title" style="background-color:#9D1C16;color:white;"><?=__('dreamjob.login');?></h1>
<?php
$default_Form['back'] = true;
$default_Form['url'] = array('controller'=>'home','action'=>'login');
$default_Form['class'] = 'modal-body';
echo $this->Form->create(null, $default_Form);
echo $this->Form->input('User.mail',array('placeholder'=>__('dreamjob.mail'),'label'=>array('text'=>__("dreamjob.mail"),"class"=>$default_Form['inputDefaults']['label']['class'])));
echo $this->Form->input('User.password',array('placeholder'=>__('dreamjob.password'),'label'=>array('text'=>__("dreamjob.password"),"class"=>$default_Form['inputDefaults']['label']['class'])));
?>
<div class="form-group">
<div class="modal-footer">
<?=$this->Form->button(__('dreamjob.login'),array('class'=>'btn btn-primary','type'=>'submit'));?>
<?=$this->Html->link(__('dreamjob.registration.to'),array('controller'=>'registration','action'=>'worker'),array('class'=>'btn btn-default'));?>
<?=$this->Html->link(__('dreamjob.password.forget'),array('controller'=>'registration','action'=>'password_reset'),array('style'=>'float:left;'));?>
</div>
</div>
<?=$this->Form->end();?>
</div>

View File

@ -26,6 +26,8 @@ var global_load = null;
$("#popup .modal-title").html($("#container div.box.2modal .modal-title", data).html());
$("#popup .modal-body").html($("#container div.box.2modal .modal-body", data).html());
$("#popup .modal-footer").html($("#container div.box.2modal .modal-footer", data).html());
$("#popup .modal-body .modal-footer").remove();
$("#popup .modal-content").attr("action",$(".2modal form.modal-body",data).attr("action"));
}, error: function(data) {
}});
});