diff --git a/app/Http/Controllers/SystemController.php b/app/Http/Controllers/SystemController.php index 3ede122e..a1da99e6 100644 --- a/app/Http/Controllers/SystemController.php +++ b/app/Http/Controllers/SystemController.php @@ -5,6 +5,7 @@ use App\Facades\Settings; use App\Services\ReleaseRadarService; use Illuminate\Http\Request; +use Illuminate\Support\Carbon; use Illuminate\Support\Facades\DB; class SystemController extends Controller @@ -17,33 +18,42 @@ class SystemController extends Controller public function infos(Request $request) { $infos = []; - $infos['Date'] = date(DATE_RFC2822); - $infos['userAgent'] = $request->header('user-agent'); + $infos['common']['Date'] = date(DATE_RFC2822); + $infos['common']['userAgent'] = $request->header('user-agent'); // App info - $infos['Version'] = config('2fauth.version'); - $infos['Environment'] = config('app.env'); - $infos['Debug'] = var_export(config('app.debug'), true); - $infos['Cache driver'] = config('cache.default'); - $infos['Log channel'] = config('logging.default'); - $infos['Log level'] = env('LOG_LEVEL'); - $infos['DB driver'] = DB::getDriverName(); + $infos['common']['Version'] = config('2fauth.version'); + $infos['common']['Environment'] = config('app.env'); + $infos['common']['Install path'] = '/' . config('2fauth.config.appSubdirectory'); + $infos['common']['Debug'] = var_export(config('app.debug'), true); + $infos['common']['Cache driver'] = config('cache.default'); + $infos['common']['Log channel'] = config('logging.default'); + $infos['common']['Log level'] = env('LOG_LEVEL'); + $infos['common']['DB driver'] = DB::getDriverName(); // PHP info - $infos['PHP version'] = PHP_VERSION; - $infos['Operating system'] = PHP_OS; - $infos['interface'] = PHP_SAPI; - // Auth info - if ($request->user()) { - $infos['Auth guard'] = config('auth.defaults.guard'); - if ($infos['Auth guard'] === 'reverse-proxy-guard') { - $infos['Auth proxy header for user'] = config('auth.auth_proxy_headers.user'); - $infos['Auth proxy header for email'] = config('auth.auth_proxy_headers.email'); + $infos['common']['PHP version'] = PHP_VERSION; + $infos['common']['Operating system'] = PHP_OS; + $infos['common']['interface'] = PHP_SAPI; + // Auth & Security infos + if (! is_null($request->user())) { + $infos['common']['Auth guard'] = config('auth.defaults.guard'); + if ($infos['common']['Auth guard'] === 'reverse-proxy-guard') { + $infos['common']['Auth proxy logout url'] = config('2fauth.config.proxyLogoutUrl'); + $infos['common']['Auth proxy header for user'] = config('auth.auth_proxy_headers.user'); + $infos['common']['Auth proxy header for email'] = config('auth.auth_proxy_headers.email'); + } + $infos['common']['webauthn user verification'] = config('webauthn.user_verification'); + $infos['common']['Trusted proxies'] = config('2fauth.config.trustedProxies') ?: 'none'; + + // Admin settings + if ($request->user()->is_admin == true) { + $infos['admin_settings']['useEncryption'] = Settings::get('useEncryption'); + $infos['admin_settings']['lastRadarScan'] = Carbon::parse(Settings::get('lastRadarScan'))->format('Y-m-d H:i:s'); + $infos['admin_settings']['checkForUpdate'] = Settings::get('CheckForUpdate'); } - $infos['webauthn user verification'] = config('larapass.login_verify'); - $infos['Trusted proxies'] = config('2fauth.trustedProxies') ?: 'none'; } // User info if ($request->user()) { - $infos['options'] = Settings::all()->toArray(); + $infos['user_preferences'] = $request->user()->preferences->toArray(); } return response()->json($infos); diff --git a/resources/js/views/About.vue b/resources/js/views/About.vue index 837f8857..a9949295 100644 --- a/resources/js/views/About.vue +++ b/resources/js/views/About.vue @@ -6,7 +6,7 @@ {{ $t('commons.2fauth_teaser')}}

-

+

©Bubka AGPL-3.0 license

@@ -59,18 +59,27 @@
  • {{key}}: {{value}}
  • -
    -

    - {{ $t('settings.user_options') }} -

    -
    - -
      -
    • {{option}}: {{value}}
    • -
    -
    +

    + {{ $t('settings.admin_settings') }} +

    +
    + +
      +
    • {{setting}}: {{value}}
    • +
    +
    +

    + {{ $t('settings.user_preferences') }} +

    +
    + +
      +
    • {{preference}}: {{value}}
    • +
    @@ -88,19 +97,25 @@ return { pagetitle: this.$t('commons.about'), infos : null, - options : null, - showUserOptions: false, + adminSettings : null, + userPreferences : null, + showUserPreferences: false, + showAdminSettings: false, } }, async mounted() { await this.axios.get('infos').then(response => { - this.infos = response.data + this.infos = response.data.common - if (response.data.options) { - this.options = response.data.options - delete this.infos.options - this.showUserOptions = true + if (response.data.admin_settings) { + this.adminSettings = response.data.admin_settings + this.showAdminSettings = true + } + + if (response.data.user_preferences) { + this.userPreferences = response.data.user_preferences + this.showUserPreferences = true } }) }, diff --git a/resources/lang/en/settings.php b/resources/lang/en/settings.php index 29cfe90f..f9961717 100644 --- a/resources/lang/en/settings.php +++ b/resources/lang/en/settings.php @@ -20,7 +20,8 @@ 'webauthn' => 'WebAuthn', 'tokens' => 'Tokens', 'options' => 'Options', - 'user_options' => 'User options', + 'user_preferences' => 'User preferences', + 'admin_settings' => 'Admin settings', 'confirm' => [ ],