Skip to content

Commit

Permalink
Implement public interface settings
Browse files Browse the repository at this point in the history
  • Loading branch information
cydrobolt committed Feb 13, 2016
1 parent 99b2d88 commit a36122a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions app/Http/Controllers/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ public function showIndexPage(Request $request) {
if (env('POLR_SETUP_RAN') != true) {
return redirect(route('setup'));
}

if (!env('SETTING_PUBLIC_INTERFACE') && !self::isLoggedIn()) {
return redirect()->to(env('SETTING_INDEX_REDIRECT'));
}

return view('index', ['large' => true]);
}
}
4 changes: 2 additions & 2 deletions resources/views/setup.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@

<p>Show Public Interface:</p>
<select name='setting:public_interface' class='form-control'>
<option value='false' selected='selected'>Show public interface (default)</option>
<option value='true'>Hide public interface (for private shorteners)</option>
<option value='true' selected='selected'>Show public interface (default)</option>
<option value='false'>Hide public interface (for private shorteners)</option>
</select>

<p>If public interface is hidden, redirect index page to:</p>
Expand Down

0 comments on commit a36122a

Please sign in to comment.