mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Added methods for google settings
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
b7e8ce3064
commit
aefd330e4e
|
@ -1039,6 +1039,46 @@ class SettingsController extends Controller
|
|||
return $pdf_branding;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show Google login settings form
|
||||
*
|
||||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @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] [<snipe@snipe.net>]
|
||||
* @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.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue