diff --git a/backend/controllers/AccountController.php b/backend/controllers/AccountController.php index eae1482..3a9d660 100644 --- a/backend/controllers/AccountController.php +++ b/backend/controllers/AccountController.php @@ -23,6 +23,18 @@ class AccountController extends Controller 'delete' => ['post'], ], ], + 'access' => [ + 'class' => \yii\filters\AccessControl::className(), + 'only' => [ 'index','view','create','update'], + 'rules' => [ + // allow authenticated users + [ + 'allow' => true, + 'roles' => ['@'], + ], + // everything else is denied + ], + ], ]; } diff --git a/backend/controllers/DiscountController.php b/backend/controllers/DiscountController.php index 62aae81..da298d8 100644 --- a/backend/controllers/DiscountController.php +++ b/backend/controllers/DiscountController.php @@ -23,6 +23,18 @@ class DiscountController extends Controller 'delete' => ['post'], ], ], + 'access' => [ + 'class' => \yii\filters\AccessControl::className(), + 'only' => [ 'index','view','create','update'], + 'rules' => [ + // allow authenticated users + [ + 'allow' => true, + 'roles' => ['@'], + ], + // everything else is denied + ], + ], ]; } diff --git a/backend/controllers/ProcurementController.php b/backend/controllers/ProcurementController.php index dc86e98..e73b687 100644 --- a/backend/controllers/ProcurementController.php +++ b/backend/controllers/ProcurementController.php @@ -26,6 +26,18 @@ class ProcurementController extends Controller 'delete' => ['post'], ], ], + 'access' => [ + 'class' => \yii\filters\AccessControl::className(), + 'only' => [ 'index','view','create','update'], + 'rules' => [ + // allow authenticated users + [ + 'allow' => true, + 'roles' => ['@'], + ], + // everything else is denied + ], + ], ]; } diff --git a/backend/controllers/ProductCategoryController.php b/backend/controllers/ProductCategoryController.php index 5bf3544..bde97af 100644 --- a/backend/controllers/ProductCategoryController.php +++ b/backend/controllers/ProductCategoryController.php @@ -23,6 +23,19 @@ class ProductCategoryController extends Controller 'delete' => ['post'], ], ], + 'access' => [ + 'class' => \yii\filters\AccessControl::className(), + 'only' => [ 'index','view','create','update'], + 'rules' => [ + // allow authenticated users + [ + 'allow' => true, + 'roles' => ['@'], + ], + // everything else is denied + ], + ], + ]; } diff --git a/backend/controllers/ProductController.php b/backend/controllers/ProductController.php index 24da95f..736c907 100644 --- a/backend/controllers/ProductController.php +++ b/backend/controllers/ProductController.php @@ -25,9 +25,22 @@ class ProductController extends Controller 'delete' => ['post'], ], ], + 'access' => [ + 'class' => \yii\filters\AccessControl::className(), + 'only' => [ 'index','view','create','update'], + 'rules' => [ + // allow authenticated users + [ + 'allow' => true, + 'roles' => ['@'], + ], + // everything else is denied + ], + ], ]; } + /** * Lists all Product models. * @return mixed diff --git a/backend/controllers/TicketTypeController.php b/backend/controllers/TicketTypeController.php index 4f98888..01009c3 100644 --- a/backend/controllers/TicketTypeController.php +++ b/backend/controllers/TicketTypeController.php @@ -24,6 +24,18 @@ class TicketTypeController extends Controller 'delete' => ['post'], ], ], + 'access' => [ + 'class' => \yii\filters\AccessControl::className(), + 'only' => [ 'index','view','create','update'], + 'rules' => [ + // allow authenticated users + [ + 'allow' => true, + 'roles' => ['@'], + ], + // everything else is denied + ], + ], ]; } diff --git a/backend/controllers/UserController.php b/backend/controllers/UserController.php index cca3c77..19aa76e 100644 --- a/backend/controllers/UserController.php +++ b/backend/controllers/UserController.php @@ -29,6 +29,18 @@ class UserController extends Controller 'delete' => ['post'], ], ], + 'access' => [ + 'class' => \yii\filters\AccessControl::className(), + 'only' => [ 'index', 'create','update','view'], + 'rules' => [ + // allow authenticated users + [ + 'allow' => true, + 'roles' => ['@'], + ], + // everything else is denied + ], + ], ]; } diff --git a/backend/controllers/WarehouseController.php b/backend/controllers/WarehouseController.php index 325c8fc..fe34b2d 100644 --- a/backend/controllers/WarehouseController.php +++ b/backend/controllers/WarehouseController.php @@ -24,6 +24,18 @@ class WarehouseController extends Controller 'delete' => ['post'], ], ], + 'access' => [ + 'class' => \yii\filters\AccessControl::className(), + 'only' => [ 'create','update','view','index'], + 'rules' => [ + // allow authenticated users + [ + 'allow' => true, + 'roles' => ['@'], + ], + // everything else is denied + ], + ], ]; } diff --git a/backend/views/user/index.php b/backend/views/user/index.php index 30e1329..591af23 100644 --- a/backend/views/user/index.php +++ b/backend/views/user/index.php @@ -28,7 +28,9 @@ $this->params['breadcrumbs'][] = $this->title; 'email:email', 'created_at:datetime', - ['class' => 'yii\grid\ActionColumn'], + ['class' => 'yii\grid\ActionColumn', + 'template' => '{view} {update}' + ], ], ]); ?> diff --git a/backend/views/user/view.php b/backend/views/user/view.php index f5494f3..f681530 100644 --- a/backend/views/user/view.php +++ b/backend/views/user/view.php @@ -16,13 +16,6 @@ $this->params['breadcrumbs'][] = $this->title;
= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?> - = Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], [ - 'class' => 'btn btn-danger', - 'data' => [ - 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), - 'method' => 'post', - ], - ]) ?>
= DetailView::widget([ diff --git a/common/messages/hu/common/account.php b/common/messages/hu/common/account.php index ada5708..7d92753 100644 --- a/common/messages/hu/common/account.php +++ b/common/messages/hu/common/account.php @@ -20,7 +20,7 @@ return [ 'Accounts' => 'Kasszák', 'Account' => 'Kassza', 'Active' => 'Aktív', - 'Create' => 'Inaktív', + 'Create' => 'Mentés', 'Create Account' => 'Új kassza', 'Created At' => 'Létrehozás ideje', 'Id Account' => 'Azonosító', diff --git a/common/models/User.php b/common/models/User.php index 1ea992d..44880f5 100644 --- a/common/models/User.php +++ b/common/models/User.php @@ -209,7 +209,9 @@ class User extends ActiveRecord implements IdentityInterface public function attributeLabels(){ return [ - + 'username' => Yii::t('backend/user', 'Username'), + 'email' => Yii::t('backend/user', 'E-Mail'), + 'created_at' => Yii::t('backend/user', 'Created at'), ]; } diff --git a/composer.json b/composer.json index 5b626c0..48af075 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "minimum-stability": "stable", "require": { "php": ">=5.4.0", - "yiisoft/yii2": ">=2.0.6", + "yiisoft/yii2": "2.0.6", "yiisoft/yii2-bootstrap": "*", "yiisoft/yii2-swiftmailer": "*", "kartik-v/yii2-widgets": "^3.4",