From 5ec9887d6bcef6f7f11955d50da795d399c6dc59 Mon Sep 17 00:00:00 2001 From: Panique Date: Sun, 15 Feb 2015 11:39:11 +0100 Subject: [PATCH 01/68] (v3.1) AccountType renamed to UserRole --- CHANGELOG.md | 8 ++++++- application/controller/LoginController.php | 13 ++++++----- ...AccountTypeModel.php => UserRoleModel.php} | 16 +++++++++---- application/view/_templates/header.php | 2 +- ...angeAccountType.php => changeUserRole.php} | 23 +++++++++---------- 5 files changed, 37 insertions(+), 25 deletions(-) rename application/model/{AccountTypeModel.php => UserRoleModel.php} (76%) rename application/view/login/{changeAccountType.php => changeUserRole.php} (55%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f7eb6b36..2264fb5db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,16 @@ # CHANGE LOG +## 3.1 (currently in develop branch) + +**February 2015** + +- [panique] renamed AccountType stuff to UserRole, minor changes + ## 3.0 **February 2015** -- [panique] AccountTypeModel reduced to one method (removed duplicate code) +- [panique] removed duplicate code in AccountTypeModel - [PR](https://github.com/panique/huge/pull/587) [upperwood] Facebook stuff completely removed from SQL - [panique] tiny text changes diff --git a/application/controller/LoginController.php b/application/controller/LoginController.php index bd798716c..25e15362a 100644 --- a/application/controller/LoginController.php +++ b/application/controller/LoginController.php @@ -162,10 +162,10 @@ public function uploadAvatar_action() * Show the change-account-type page * Auth::checkAuthentication() makes sure that only logged in users can use this action and see this page */ - public function changeAccountType() + public function changeUserRole() { Auth::checkAuthentication(); - $this->View->render('login/changeAccountType'); + $this->View->render('login/changeUserRole'); } /** @@ -173,20 +173,21 @@ public function changeAccountType() * Auth::checkAuthentication() makes sure that only logged in users can use this action * POST-request */ - public function changeAccountType_action() + public function changeUserRole_action() { Auth::checkAuthentication(); if (Request::post('user_account_upgrade')) { // "2" is quick & dirty account type 2, something like "premium user" maybe. you got the idea :) - AccountTypeModel::changeAccountType(2); + UserRoleModel::changeUserRole(2); } + if (Request::post('user_account_downgrade')) { // "1" is quick & dirty account type 1, something like "basic user" maybe. - AccountTypeModel::changeAccountType(1); + UserRoleModel::changeUserRole(1); } - Redirect::to('login/changeAccountType'); + Redirect::to('login/changeUserRole'); } /** diff --git a/application/model/AccountTypeModel.php b/application/model/UserRoleModel.php similarity index 76% rename from application/model/AccountTypeModel.php rename to application/model/UserRoleModel.php index b777e51b6..2801c1ad0 100644 --- a/application/model/AccountTypeModel.php +++ b/application/model/UserRoleModel.php @@ -1,11 +1,11 @@ getConnection(); $query = $database->prepare("UPDATE users SET user_account_type = :new_type WHERE user_id = :user_id LIMIT 1"); diff --git a/application/view/_templates/header.php b/application/view/_templates/header.php index e3850e6ff..d2ade08b0 100644 --- a/application/view/_templates/header.php +++ b/application/view/_templates/header.php @@ -65,7 +65,7 @@ My Account - -