Fix: setup.php now add a key in existing setup post update.
This commit is contained in:
@@ -14,6 +14,11 @@ if (file_exists($config_path)) {
|
|||||||
unset($existing['epg_url'], $existing['m3u_url']);
|
unset($existing['epg_url'], $existing['m3u_url']);
|
||||||
file_put_contents($config_path, json_encode($existing, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
|
file_put_contents($config_path, json_encode($existing, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
|
||||||
}
|
}
|
||||||
|
// Bootstrap : config existante sans cle admin -> on en genere une maintenant
|
||||||
|
if (empty($existing['admin_key'])) {
|
||||||
|
$existing['admin_key'] = bin2hex(random_bytes(16));
|
||||||
|
file_put_contents($config_path, json_encode($existing, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$is_first_setup = !file_exists($config_path);
|
$is_first_setup = !file_exists($config_path);
|
||||||
|
|||||||
Reference in New Issue
Block a user