diff options
| author | ccwn <tzur@ccwn.org> | 2012-04-24 18:49:57 +0200 |
|---|---|---|
| committer | ccwn <tzur@ccwn.org> | 2012-04-24 18:49:57 +0200 |
| commit | c98745edd2c7b2f48bc3493c4dd9a061376c4720 (patch) | |
| tree | ca1b559f220ec28c3f263d02a8b832613493471f /protected/controllers | |
| parent | 314328f527e8cae759d496f528a1472d7970c137 (diff) | |
- Database setup
- Database schema
- Database dev data
- config for new database setup
- Update in AngebotVerein
- Update in Speis&Trank
- Update in Verein
- Update in Kategorie
Diffstat (limited to 'protected/controllers')
| -rw-r--r-- | protected/controllers/MyAngebotController.php | 73 | ||||
| -rw-r--r-- | protected/controllers/SiteController.php | 2 | ||||
| -rw-r--r-- | protected/controllers/SpeisTrankController.php | 6 | ||||
| -rw-r--r-- | protected/controllers/VereinController.php | 4 |
4 files changed, 77 insertions, 8 deletions
diff --git a/protected/controllers/MyAngebotController.php b/protected/controllers/MyAngebotController.php new file mode 100644 index 0000000..c53da98 --- /dev/null +++ b/protected/controllers/MyAngebotController.php @@ -0,0 +1,73 @@ +<?php + +class MyAngebotController extends Controller +{ + + /** + * @return array action filters + */ + public function filters() + { + return array( + 'accessControl', // perform access control for CRUD operations + ); + } + + /** + * Specifies the access control rules. + * This method is used by the 'accessControl' filter. + * @return array access control rules + */ + public function accessRules() + { + return array( + array('allow', // // allow authenticated user + 'actions'=>array('create','index','delete','update','view'), + 'users'=>array('@'), + ), + array('deny', // deny all users + 'users'=>array('*'), + ), + ); + } + public function actionIndex() + { + $model=new AngebotVerein('search'); + $model->unsetAttributes(); // clear any default values + if (isset($_GET['AngebotVerein'])) { + $model->attributes = $_GET['AngebotVerein']; + } + $model->verein_id = Yii::app()->user->vereinId; + + $this->render('index',array( + 'model'=>$model, + )); + } + + // Uncomment the following methods and override them if needed + /* + public function filters() + { + // return the filter configuration for this controller, e.g.: + return array( + 'inlineFilterName', + array( + 'class'=>'path.to.FilterClass', + 'propertyName'=>'propertyValue', + ), + ); + } + + public function actions() + { + // return external action classes, e.g.: + return array( + 'action1'=>'path.to.ActionClass', + 'action2'=>array( + 'class'=>'path.to.AnotherActionClass', + 'propertyName'=>'propertyValue', + ), + ); + } + */ +}
\ No newline at end of file diff --git a/protected/controllers/SiteController.php b/protected/controllers/SiteController.php index 961a968..2ee57b9 100644 --- a/protected/controllers/SiteController.php +++ b/protected/controllers/SiteController.php @@ -28,7 +28,7 @@ class SiteController extends Controller public function actionIndex() { if (!Yii::app()->user->isGuest && Yii::app()->user->isAdmin) { - $this->redirect(array("/verein/")); + $this->redirect(array("/verein/index")); } $this->redirect(array("/myverein/")); } diff --git a/protected/controllers/SpeisTrankController.php b/protected/controllers/SpeisTrankController.php index 6f0931e..1da7883 100644 --- a/protected/controllers/SpeisTrankController.php +++ b/protected/controllers/SpeisTrankController.php @@ -26,12 +26,8 @@ class SpeisTrankController extends Controller public function accessRules() { return array( - array('allow', // allow authenticated user to perform 'create' and 'update' actions - 'actions'=>array('update','view'), - 'users'=>array('@'), - ), array('allow', // allow admin user to perform 'admin' and 'delete' actions - 'actions'=>array('create','index','delete'), + 'actions'=>array('create','index','delete','update','view'), 'users'=>array('admin'), ), array('deny', // deny all users diff --git a/protected/controllers/VereinController.php b/protected/controllers/VereinController.php index 30c05bc..7648a3e 100644 --- a/protected/controllers/VereinController.php +++ b/protected/controllers/VereinController.php @@ -65,7 +65,7 @@ class VereinController extends Controller $this->redirect(array('view','id'=>$model->id)); } - $standorte = Standort::model()->findAll(array("condition"=>"published=1")); + $standorte = Standort::model()->findAll(array("condition"=>"published=1 and type='Stand'")); $this->render('create',array( 'model'=>$model, 'standorte'=>$standorte @@ -91,7 +91,7 @@ class VereinController extends Controller $this->redirect(array('view','id'=>$model->id)); } - $standorte = Standort::model()->findAll(array("condition"=>"published=1")); + $standorte = Standort::model()->findAll(array("condition"=>"published=1 and type='Stand'")); $this->render('update',array( 'model'=>$model, 'standorte'=>$standorte |
