Skip to content

Commit 5819738

Browse files
committed
dashboard: only accept post from dashboard
Login form resubmit would not login but rather post to dashboard which leaves all settings empty. PR: https://forum.opnsense.org/index.php?topic=12328.0 (cherry picked from commit cedd877) (cherry picked from commit 8bc683d)
1 parent a2ba4f6 commit 5819738

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/www/index.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
usort($widgetCollection, function ($item1, $item2) {
7171
return strcmp(strtolower($item1['sortKey']), strtolower($item2['sortKey']));
7272
});
73-
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
73+
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_POST['origin']) && $_POST['origin'] == 'dashboard') {
7474
if (!empty($_POST['sequence'])) {
7575
$config['widgets']['sequence'] = $_POST['sequence'];
7676
} elseif (isset($config['widgets']['sequence'])) {
@@ -322,6 +322,7 @@ function process_widget_data()
322322

323323
<section class="page-content-main">
324324
<form method="post" id="iform">
325+
<input type="hidden" value="dashboard" name="origin" id="origin" />
325326
<input type="hidden" value="" name="sequence" id="sequence" />
326327
<input type="hidden" value="<?= $pconfig['column_count'];?>" name="column_count" id="column_count_input" />
327328
</form>

0 commit comments

Comments
 (0)