Skip to content

A free open source IT asset/license management system

Added methods for google settings

snipeaefd330e4eb2
diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php
index c626203cfc..7a09dd41a8 100755
--- a/app/Http/Controllers/SettingsController.php
+++ b/app/Http/Controllers/SettingsController.php
@@ -1039,6 +1039,46 @@ class SettingsController extends Controller
return $pdf_branding;
}
+
+ /**
+ * Show Google login settings form
+ *
+ * @author [A. Gianotto] [<[email protected]>]
+ * @since [v6.1.1]
+ * @return View
+ */
+ public function getGoogleLoginSettings()
+ {
+ $setting = Setting::getSettings();
+ return view('settings.google', compact('setting'));
+ }
+
+ /**
+ * ShSaveow Google login settings form
+ *
+ * @author [A. Gianotto] [<[email protected]>]
+ * @since [v6.1.1]
+ * @return View
+ */
+ public function postGoogleLoginSettings(Request $request)
+ {
+ if (!$setting = Setting::getSettings()) {
+ return redirect()->to('admin')->with('error', trans('admin/settings/message.update.error'));
+ }
+
+ $setting->google_login = $request->input('google_login', 0);
+ $setting->google_client_id = $request->input('google_client_id');
+ $setting->google_client_secret = $request->input('google_client_secret');
+
+ if ($setting->save()) {
+ return redirect()->route('settings.index')
+ ->with('success', trans('admin/settings/message.update.success'));
+ }
+
+ return redirect()->back()->withInput()->withErrors($setting->getErrors());
+ }
+
+
/**
* Show the listing of backups.
*