mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-11-19 23:02:40 +09:00
feat: Keep stored password when Enhanced App is updated
This commit is contained in:
committed by
Attila Jozsef Kerekes
parent
7b0ae66101
commit
54679ff9eb
@@ -180,7 +180,12 @@ class ItemController extends Controller
|
|||||||
return view('items.edit', $data);
|
return view('items.edit', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function storelogic($request, $id = null)
|
/**
|
||||||
|
* @param Request $request
|
||||||
|
* @param $id
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function storelogic(Request $request, $id = null)
|
||||||
{
|
{
|
||||||
$application = Application::single($request->input('appid'));
|
$application = Application::single($request->input('appid'));
|
||||||
$validatedData = $request->validate([
|
$validatedData = $request->validate([
|
||||||
@@ -225,6 +230,18 @@ class ItemController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$config = Item::checkConfig($request->input('config'));
|
$config = Item::checkConfig($request->input('config'));
|
||||||
|
|
||||||
|
// Don't overwrite the stored password if it wasn't submitted when updating the item
|
||||||
|
if ($id !== null && strpos($config, '"password":null') !== false) {
|
||||||
|
$storedItem = Item::find($id);
|
||||||
|
$storedConfigObject = json_decode($storedItem->getAttribute('description'));
|
||||||
|
|
||||||
|
$configObject = json_decode($config);
|
||||||
|
$configObject->password = $storedConfigObject->password;
|
||||||
|
|
||||||
|
$config = json_encode($configObject);
|
||||||
|
}
|
||||||
|
|
||||||
$current_user = User::currentUser();
|
$current_user = User::currentUser();
|
||||||
$request->merge([
|
$request->merge([
|
||||||
'description' => $config,
|
'description' => $config,
|
||||||
|
|||||||
Reference in New Issue
Block a user