mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 08:34:39 +00:00
csrf: tweak previous
This commit is contained in:
parent
d6411ae007
commit
b78720b894
@ -963,6 +963,7 @@ function system_webgui_start()
|
||||
global $config;
|
||||
|
||||
chdir('/usr/local/www');
|
||||
@unlink('/usr/local/www/csrf/csrf-secret.php');
|
||||
|
||||
/* defaults */
|
||||
$portarg = "80";
|
||||
|
||||
@ -183,7 +183,7 @@ echo "done."
|
||||
|
||||
# let the PHP-based configuration subsystem set up the system now
|
||||
echo -n "Launching the init system..."
|
||||
rm -f /usr/local/www/csrf/csrf-secret.php /root/lighttpd*
|
||||
rm -f /root/lighttpd*
|
||||
touch /var/run/booting
|
||||
/usr/local/etc/rc.bootup
|
||||
rm /var/run/booting
|
||||
|
||||
@ -425,6 +425,8 @@ function csrf_get_secret()
|
||||
}
|
||||
if (is_writable($dir)) {
|
||||
$secret = csrf_generate_secret();
|
||||
touch($file);
|
||||
chmod($file, 0600);
|
||||
$fh = fopen($file, 'w');
|
||||
fwrite($fh, '<?php $secret = "'.$secret.'";' . PHP_EOL);
|
||||
fclose($fh);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user