#12 stop auto redirect and add settings to admin gui

This commit is contained in:
Kekskurse 2019-04-30 15:14:54 +02:00
parent 1e604ae8a3
commit 6283a205e6
3 changed files with 16 additions and 6 deletions

View File

@ -102,6 +102,7 @@ class AdminController extends Controller
$app->show_on_webpage = (bool)$request->input("show_on_webpage", false);
$app->hidden_in_app_list = (bool)$request->input("hidden_in_app_list", false);
$app->user_cant_remove_app = (bool)$request->input("user_cant_remove_app", false);
$app->stop_auto_redirect = (bool)$request->input("stop_auto_redirect", false);
$app->saveOrFail();
$app = App::query()->where("id", "=", $id)->first("*");

View File

@ -31,16 +31,18 @@ class oAuthController extends Controller
$user = Auth::user();
$redirect = false;
if($user != null) {
if($app->auto_accept == true) {
$access->status = "allowed";
$access->saveOrFail();
}
$access = AppAccess::getOrCreate($user->id, $app->id);
if($access->status == "allowed") {
$redirect = true;
}
if($app->auto_accept == true) {
$access->status = "allowed";
$access->saveOrFail();
$redirect = true;
}
// @ToDo: if access is already granted redirect direct without ask user again
}
if($app->stop_auto_redirect) {
$redirect = false;
}
if($redirect) {

View File

@ -55,6 +55,13 @@
<input name="user_cant_remove_app" type="checkbox" <?php if($app->user_cant_remove_app) { echo 'checked="checked"'; } ?>>
</td>
</tr>
<tr>
<td>Disable auto redirect</td>
<td>User always have to click a button to go to the App</td>
<td>
<input name="stop_auto_redirect" type="checkbox" <?php if($app->stop_auto_redirect) { echo 'checked="checked"'; } ?>>
</td>
</tr>
</table>
<input type="submit" class="btn btn-warning" value="Save">
</form>