diff --git a/.env.setup b/.env.setup index 0ec450d6d..7e7ac0e24 100644 --- a/.env.setup +++ b/.env.setup @@ -1,6 +1,6 @@ APP_ENV=local APP_DEBUG=true -APP_KEY=@,c"VPx[@KuTgVd}FUxovZua/e-fqz]= +APP_KEY=,faO^ofvGeJ8|Z.q{mWp=^i}Cmzj+k&K APP_LOCALE=en APP_FALLBACK_LOCALE=en @@ -16,7 +16,7 @@ CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=file -VERSION=2.1.0 +VERSION=2.1.1 VERSION_RELMONTH=December -VERSION_RELDAY=6 +VERSION_RELDAY=9 VERSION_RELYEAR=2016 diff --git a/app/Factories/UserFactory.php b/app/Factories/UserFactory.php index 59c9ffd21..e3977b351 100644 --- a/app/Factories/UserFactory.php +++ b/app/Factories/UserFactory.php @@ -7,7 +7,11 @@ use App\Helpers\UserHelper; class UserFactory { - public static function createUser($username, $email, $password, $active=0, $ip='127.0.0.1', $api_key=false, $api_active=0, $role=UserHelper::USER_ROLES['default']) { + public static function createUser($username, $email, $password, $active=0, $ip='127.0.0.1', $api_key=false, $api_active=0, $role=false) { + if (!$role) { + $role = UserHelper::$USER_ROLES['default']; + } + $hashed_password = Hash::make($password); $recovery_key = CryptoHelper::generateRandomHex(50); diff --git a/app/Helpers/UserHelper.php b/app/Helpers/UserHelper.php index 1be5ab198..70efe1b8c 100644 --- a/app/Helpers/UserHelper.php +++ b/app/Helpers/UserHelper.php @@ -6,7 +6,7 @@ use Hash; class UserHelper { - const USER_ROLES = [ + public static $USER_ROLES = [ 'admin' => 'admin', 'default' => '', ]; diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index 687dfd543..1902bab74 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -31,8 +31,8 @@ public function displayAdminPage(Request $request) { return view('admin', [ 'role' => $role, - 'admin_role' => UserHelper::USER_ROLES['admin'], - 'user_roles' => UserHelper::USER_ROLES, + 'admin_role' => UserHelper::$USER_ROLES['admin'], + 'user_roles' => UserHelper::$USER_ROLES, 'api_key' => $user->api_key, 'api_active' => $user->api_active, 'api_quota' => $user->api_quota, diff --git a/app/Http/Controllers/AdminPaginationController.php b/app/Http/Controllers/AdminPaginationController.php index 59723637b..9add38df8 100644 --- a/app/Http/Controllers/AdminPaginationController.php +++ b/app/Http/Controllers/AdminPaginationController.php @@ -59,7 +59,7 @@ class="form-control"'; } $select_role .= '>'; - foreach (UserHelper::USER_ROLES as $role_text => $role_val) { + foreach (UserHelper::$USER_ROLES as $role_text => $role_val) { // Iterate over each available role and output option $select_role .= '