mirror of
https://github.com/unraid/webgui.git
synced 2026-02-18 06:58:47 -06:00
Nchan processes: only publish on changes
This commit is contained in:
@@ -18,9 +18,13 @@ $varroot = '/var/local/emhttp';
|
||||
require_once "$docroot/webGui/include/publish.php";
|
||||
require_once "$docroot/webGui/include/Wrappers.php";
|
||||
|
||||
$csrf_old = '';
|
||||
while (true) {
|
||||
$var = (array)@parse_ini_file("$varroot/var.ini");
|
||||
publish('session',_var($var,'csrf_token'),0);
|
||||
$csrf_new = @parse_ini_file("$varroot/var.ini")['csrf_token'];
|
||||
if ($csrf_new !== $csrf_old) {
|
||||
publish('session', $csrf_new);
|
||||
$csrf_old = $csrf_new;
|
||||
}
|
||||
sleep(10);
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user