Skip to content

Commit

Permalink
Merge pull request #266 from cydrobolt/fix/compat-5.5.9
Browse files Browse the repository at this point in the history
Compatibility patch for 2.1.0
  • Loading branch information
cydrobolt authored Dec 9, 2016
2 parents 8072559 + 2c00105 commit 94bc77c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .env.setup
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
6 changes: 5 additions & 1 deletion app/Factories/UserFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion app/Helpers/UserHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Hash;

class UserHelper {
const USER_ROLES = [
public static $USER_ROLES = [
'admin' => 'admin',
'default' => '',
];
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/AdminPaginationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 .= '<option value="' . e($role_val) . '"';

Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/SetupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static function performSetup(Request $request) {
$acct_username = $request->input('acct:username');
$acct_email = $request->input('acct:email');
$acct_password = $request->input('acct:password');
$acct_group = UserHelper::USER_ROLES['admin'];
$acct_group = UserHelper::$USER_ROLES['admin'];

// if true, only logged in users can shorten
$st_shorten_permission = $request->input('setting:shorten_permission');
Expand Down Expand Up @@ -215,7 +215,7 @@ public static function finishSetup(Request $request) {
return redirect(route('setup'))->with('error', 'Could not create database. Perhaps some credentials were incorrect?');
}

$user = UserFactory::createUser($setup_finish_args->acct_username, $setup_finish_args->acct_email, $setup_finish_args->acct_password, 1, $request->ip(), false, 0, UserHelper::USER_ROLES['admin']);
$user = UserFactory::createUser($setup_finish_args->acct_username, $setup_finish_args->acct_email, $setup_finish_args->acct_password, 1, $request->ip(), false, 0, UserHelper::$USER_ROLES['admin']);

return view('setup_thanks')->with('success', 'Set up completed! Thanks for using Polr!');
}
Expand Down
2 changes: 1 addition & 1 deletion public/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ input.api-quota {
}

a.new-user-add {
padding-left: 0.5em
margin-left: 0.5em
}
Binary file modified public/img/setup.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 94bc77c

Please sign in to comment.