This commit is contained in:
Martin Müller 2014-04-16 15:34:02 +02:00
parent f82ce2957c
commit 9a359b265c
3 changed files with 24 additions and 8 deletions

View File

@ -22,6 +22,10 @@ class SearchController extends AppController {
* @throws NotFoundException When the view file could not be found
* or MissingViewException in debug mode.
*/
public function beforeFilter(){
$this->Security->unlockedActions[]="openings";
parent::beforeFilter();
}
public function openings() {
$this->MiconwareSession->init($this);

View File

@ -159,7 +159,7 @@ class UserController extends AppController {
$this->render('/Home/error');
}
}
/*
public function savePageDeleteJson(){
$this->MiconwareSession->init($this);
@ -182,7 +182,7 @@ class UserController extends AppController {
$this->set('error', true);
}
$this->set('_serialize', array('error'));
}
}*/
public function savePageOrder(){
$this->MiconwareSession->init($this);
@ -371,16 +371,12 @@ class UserController extends AppController {
if(!empty($page) and count($page)> 0){
$path = null;
if($image){
$path = WWW_ROOT.$page['DreamjobPageImage']['image'];
$result = $this->DreamjobPageImage->delete($page['DreamjobPageInh']['id'],false);
$result = $this->DreamjobPageImage->delete($page,false);
}else
$result = $this->DreamjobPageText->delete($page['DreamjobPageInh']['id'],false);
if($result){
$result = $this->DreamjobPageInh->delete($page['DreamjobPageInh']['id'],false);
}
if($path!=null and $result){
$result = unlink($path);
}
if($result){
$this->MiconwareSession->refreshCache();
$profil = $this->MiconwareSession->getWorker();

View File

@ -124,7 +124,23 @@ public function processUpload($check=array()) {
return TRUE;
}
public function delete($id = NULL, $cascade = true){
$dataSource = $this->getDataSource();
$dataSource->begin();
$result = $this->delete($id['DreamjobPageInh']['id'],false);
if($result){
$filename = WWW_ROOT . $this->uploadDir . DS .$id['DreamjobPageImage']['image'];
chmod($filename,0755);
$result = unlink($filename);
}
if ($result) {
$dataSource->commit();
return true;
} else {
$dataSource->rollback();
}
return false;
}
public function saveAndUpload($data){
$dataSource = $this->getDataSource();
$dataSource->begin();