Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
casanova94 committed Jan 11, 2017
2 parents b48aa79 + 8c1fa70 commit 59df413
Show file tree
Hide file tree
Showing 18 changed files with 256 additions and 2 deletions.
3 changes: 2 additions & 1 deletion controllers/ClassesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class ClassesController extends Controller
*/
public function behaviors()
{
return [ 'access' => [
return [
'access' => [
'class' => \yii\filters\AccessControl::className(),
'only' => ['create','update','delete'],
'rules' => [
Expand Down
23 changes: 23 additions & 0 deletions controllers/ImportFileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,29 @@

class ImportFileController extends \yii\web\Controller
{
public function behaviors()
{
return [
'access' => [
'class' => \yii\filters\AccessControl::className(),
'only' => ['create','update','delete'],
'rules' => [
// allow authenticated users
[
'allow' => true,
'roles' => ['@'],
],
// everything else is denied
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
];
}

public function actionIndex()
{
Expand Down
12 changes: 12 additions & 0 deletions controllers/InstructorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ class InstructorController extends Controller
public function behaviors()
{
return [
'access' => [
'class' => \yii\filters\AccessControl::className(),
'only' => ['create','update','delete'],
'rules' => [
// allow authenticated users
[
'allow' => true,
'roles' => ['@'],
],
// everything else is denied
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
Expand Down
12 changes: 12 additions & 0 deletions controllers/InstructorSubjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ class InstructorSubjectController extends Controller
public function behaviors()
{
return [
'access' => [
'class' => \yii\filters\AccessControl::className(),
'only' => ['create','update','delete'],
'rules' => [
// allow authenticated users
[
'allow' => true,
'roles' => ['@'],
],
// everything else is denied
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
Expand Down
25 changes: 25 additions & 0 deletions controllers/InstructorscheduleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,31 @@ class InstructorscheduleController extends Controller
// $section = "profesores";
// return $this->render("index",["model"=>$model,'section'=>$section,"materias"=>$materias,"clases"=>$clases]);
// }

public function behaviors()
{
return [
'access' => [
'class' => \yii\filters\AccessControl::className(),
'only' => ['create','update','delete'],
'rules' => [
// allow authenticated users
[
'allow' => true,
'roles' => ['@'],
],
// everything else is denied
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
];
}

public function actionIndex(){
\Yii::$app->session->set('returnUrl', Url::to(['instructorschedule/index']));

Expand Down
12 changes: 12 additions & 0 deletions controllers/ProgramSubjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ class ProgramSubjectController extends Controller
public function behaviors()
{
return [
'access' => [
'class' => \yii\filters\AccessControl::className(),
'only' => ['create','update','delete'],
'rules' => [
// allow authenticated users
[
'allow' => true,
'roles' => ['@'],
],
// everything else is denied
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
Expand Down
12 changes: 12 additions & 0 deletions controllers/RoomController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ class RoomController extends Controller
public function behaviors()
{
return [
'access' => [
'class' => \yii\filters\AccessControl::className(),
'only' => ['create','update','delete'],
'rules' => [
// allow authenticated users
[
'allow' => true,
'roles' => ['@'],
],
// everything else is denied
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
Expand Down
24 changes: 23 additions & 1 deletion controllers/RoomscheduleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,29 @@

class RoomscheduleController extends Controller
{

public function behaviors()
{
return [
'access' => [
'class' => \yii\filters\AccessControl::className(),
'only' => ['create','update','delete'],
'rules' => [
// allow authenticated users
[
'allow' => true,
'roles' => ['@'],
],
// everything else is denied
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
];
}
public function actionRoom($id){
echo $id;
\Yii::$app->session->set('returnUrl', Url::to(['roomschedule/room', 'id'=>$id]));
Expand Down
12 changes: 12 additions & 0 deletions controllers/ScheduleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ class ScheduleController extends Controller
public function behaviors()
{
return [
'access' => [
'class' => \yii\filters\AccessControl::className(),
'only' => ['create','update','delete'],
'rules' => [
// allow authenticated users
[
'allow' => true,
'roles' => ['@'],
],
// everything else is denied
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
Expand Down
12 changes: 12 additions & 0 deletions controllers/SchoolroomController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ class SchoolroomController extends Controller
public function behaviors()
{
return [
'access' => [
'class' => \yii\filters\AccessControl::className(),
'only' => ['create','update','delete'],
'rules' => [
// allow authenticated users
[
'allow' => true,
'roles' => ['@'],
],
// everything else is denied
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
Expand Down
12 changes: 12 additions & 0 deletions controllers/SemesterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ class SemesterController extends Controller
public function behaviors()
{
return [
'access' => [
'class' => \yii\filters\AccessControl::className(),
'only' => ['create','update','delete'],
'rules' => [
// allow authenticated users
[
'allow' => true,
'roles' => ['@'],
],
// everything else is denied
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
Expand Down
23 changes: 23 additions & 0 deletions controllers/SemesterscheduleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,29 @@

class SemesterscheduleController extends Controller
{
public function behaviors()
{
return [
'access' => [
'class' => \yii\filters\AccessControl::className(),
'only' => ['create','update','delete'],
'rules' => [
// allow authenticated users
[
'allow' => true,
'roles' => ['@'],
],
// everything else is denied
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
];
}

public function actionSemester($id){
echo $id;
Expand Down
12 changes: 12 additions & 0 deletions controllers/StudyProgramController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ class StudyProgramController extends Controller
public function behaviors()
{
return [
'access' => [
'class' => \yii\filters\AccessControl::className(),
'only' => ['create','update','delete'],
'rules' => [
// allow authenticated users
[
'allow' => true,
'roles' => ['@'],
],
// everything else is denied
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
Expand Down
12 changes: 12 additions & 0 deletions controllers/SubjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ class SubjectController extends Controller
public function behaviors()
{
return [
'access' => [
'class' => \yii\filters\AccessControl::className(),
'only' => ['create','update','delete'],
'rules' => [
// allow authenticated users
[
'allow' => true,
'roles' => ['@'],
],
// everything else is denied
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
Expand Down
12 changes: 12 additions & 0 deletions controllers/SubjectSemesterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ class SubjectSemesterController extends Controller
public function behaviors()
{
return [
'access' => [
'class' => \yii\filters\AccessControl::className(),
'only' => ['create','update','delete'],
'rules' => [
// allow authenticated users
[
'allow' => true,
'roles' => ['@'],
],
// everything else is denied
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
Expand Down
23 changes: 23 additions & 0 deletions controllers/SubjectscheduleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,29 @@

class SubjectscheduleController extends Controller
{
public function behaviors()
{
return [
'access' => [
'class' => \yii\filters\AccessControl::className(),
'only' => ['create','update','delete'],
'rules' => [
// allow authenticated users
[
'allow' => true,
'roles' => ['@'],
],
// everything else is denied
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
];
}

public function actionSubject($id){
echo $id;
Expand Down
12 changes: 12 additions & 0 deletions controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ class UserController extends Controller
public function behaviors()
{
return [
/*'access' => [
'class' => \yii\filters\AccessControl::className(),
'only' => ['create','update','delete'],
'rules' => [
// allow authenticated users
[
'allow' => true,
'roles' => ['@'],
],
// everything else is denied
],
],*/
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
Expand Down
5 changes: 5 additions & 0 deletions migrations/m161115_020936_create_subject_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public function up()
'model' => $this->boolean(1),
'type' => $this->string(15)->notNull(),
'modality' => $this->string(15),
'number'=> $this->string(15),
'hour_pre'=> $this->string(15),
'nr_np'=> $this->string(15),
'max_capacity'=>$this->string(15)

],'ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci');
}

Expand Down

0 comments on commit 59df413

Please sign in to comment.