mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -08:00
Find first record, instead of hardcoded id 1
This commit is contained in:
parent
9c4cd9c3ce
commit
cffa76e627
|
@ -185,7 +185,7 @@ class SettingsController extends Controller
|
||||||
if ((!$user->isValid()) || (!$settings->isValid())) {
|
if ((!$user->isValid()) || (!$settings->isValid())) {
|
||||||
return redirect()->back()->withInput()->withErrors($user->getErrors())->withErrors($settings->getErrors());
|
return redirect()->back()->withInput()->withErrors($user->getErrors())->withErrors($settings->getErrors());
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (Input::get('email_creds')=='1') {
|
if (Input::get('email_creds')=='1') {
|
||||||
Mail::send(['text' => 'emails.firstadmin'], $data, function ($m) use ($data) {
|
Mail::send(['text' => 'emails.firstadmin'], $data, function ($m) use ($data) {
|
||||||
$m->to($data['email'], $data['first_name']);
|
$m->to($data['email'], $data['first_name']);
|
||||||
|
@ -294,7 +294,7 @@ class SettingsController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
// Check if the asset exists
|
// Check if the asset exists
|
||||||
if (is_null($setting = Setting::find(1))) {
|
if (is_null($setting = Setting::first())) {
|
||||||
// Redirect to the asset management page with error
|
// Redirect to the asset management page with error
|
||||||
return redirect()->to('admin')->with('error', trans('admin/settings/message.update.error'));
|
return redirect()->to('admin')->with('error', trans('admin/settings/message.update.error'));
|
||||||
}
|
}
|
||||||
|
@ -313,8 +313,7 @@ class SettingsController extends Controller
|
||||||
$setting->logo = $file_name;
|
$setting->logo = $file_name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$setting->id = '1';
|
|
||||||
|
|
||||||
if (config('app.lock_passwords')==false) {
|
if (config('app.lock_passwords')==false) {
|
||||||
$setting->site_name = e(Input::get('site_name'));
|
$setting->site_name = e(Input::get('site_name'));
|
||||||
|
|
Loading…
Reference in a new issue