diff --git a/app/Controller/HomeController.php b/app/Controller/HomeController.php index 65ee90e..268f98d 100755 --- a/app/Controller/HomeController.php +++ b/app/Controller/HomeController.php @@ -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(){ diff --git a/app/Controller/JobController.php b/app/Controller/JobController.php index 1918112..ca7a346 100644 --- a/app/Controller/JobController.php +++ b/app/Controller/JobController.php @@ -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']); @@ -110,7 +118,7 @@ class JobController extends AppController { $this->set('error', array('title'=>__('dreamjob.error.opening.notFound.title'),'text'=>__('dreamjob.error.opening.notFound.text'))); $this->render('/Home/error'); } elseif ($this->request->data['DreamjobJobOpening']['company_id'] != $a['AppUser']['id']) { - $this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text'))); + $this->set('error', array('title'=>__('dreamjob.error.noPermision.title'),'text'=>__('dreamjob.error.noPermision.text'))); $this->render('/Home/error'); } else { $this->render('/Job/opening_edit'); @@ -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'); } } diff --git a/app/Controller/PdfController.php b/app/Controller/PdfController.php index 2d95dc8..3257a1b 100644 --- a/app/Controller/PdfController.php +++ b/app/Controller/PdfController.php @@ -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']))); diff --git a/app/Controller/SearchController.php b/app/Controller/SearchController.php index e36f75e..fb4ab31 100644 --- a/app/Controller/SearchController.php +++ b/app/Controller/SearchController.php @@ -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'); } } diff --git a/app/Controller/UserController.php b/app/Controller/UserController.php index 25ae989..6936cb9 100755 --- a/app/Controller/UserController.php +++ b/app/Controller/UserController.php @@ -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,9 +255,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->render('/Home/error'); + $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')){ if($this->request->data['User']['password1'] == $this->request->data['User']['password2']) { @@ -322,9 +334,12 @@ 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->render('/Home/error'); + $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 if(!empty($this->request->params['page'])){ @@ -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,9 +502,13 @@ 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'); + $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')){ $key = $this->MiconwareSession->generateKey(); @@ -513,9 +535,12 @@ 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->render('/Home/error'); + $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')){ $data['AppUser']['id'] = $profil['AppUser']['id']; diff --git a/app/Locale/deu/LC_MESSAGES/default.mo b/app/Locale/deu/LC_MESSAGES/default.mo index 92c231c..efe4f26 100644 Binary files a/app/Locale/deu/LC_MESSAGES/default.mo and b/app/Locale/deu/LC_MESSAGES/default.mo differ diff --git a/app/Locale/deu/LC_MESSAGES/default.po b/app/Locale/deu/LC_MESSAGES/default.po index 82bc67e..aa6f0d6 100644 --- a/app/Locale/deu/LC_MESSAGES/default.po +++ b/app/Locale/deu/LC_MESSAGES/default.po @@ -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" diff --git a/app/View/Home/login.ctp b/app/View/Home/login.ctp new file mode 100644 index 0000000..fc993d7 --- /dev/null +++ b/app/View/Home/login.ctp @@ -0,0 +1,22 @@ + +
+

+ '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']))); + ?> +
+ +
+ Form->end();?> +
diff --git a/app/webroot/js/dreamjob.js b/app/webroot/js/dreamjob.js index 1fab3d0..3e24b0b 100755 --- a/app/webroot/js/dreamjob.js +++ b/app/webroot/js/dreamjob.js @@ -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) { }}); });