tiny-slitaz rev 19

100 uers max
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Feb 12 12:16:10 2017 +0100 (2017-02-12)
parents b58beb683c22
children 694b6eb6f4f9
files step1.php
line diff
     1.1 --- a/step1.php	Fri Jul 22 09:09:36 2016 +0200
     1.2 +++ b/step1.php	Sun Feb 12 12:16:10 2017 +0100
     1.3 @@ -7,10 +7,16 @@
     1.4  function set_tmp_dir()
     1.5  {
     1.6  	$dir = opendir("/tmp");
     1.7 +	$i = 0;
     1.8  	while (($name = readdir($dir)) !== false) {
     1.9  		if (preg_match('/^tiny_webgen/',$name) == 0) continue;
    1.10 +		if ($i++ > 100) {
    1.11 +			echo "<h1>Too may users, retry later</h1>";
    1.12 +			exit;
    1.13 +		}
    1.14  		if (filemtime("/tmp/$name") > strtotime("-1 hour")) continue;
    1.15  		shell_exec("sudo ./helper --remove /tmp/$name"); 
    1.16 +		$i--;
    1.17  	}
    1.18  	closedir($dir);
    1.19  	if (isset($_POST["tmp_dir"])) return;
    1.20 @@ -120,7 +126,7 @@
    1.21  <div>
    1.22  	<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post" name="kernels">
    1.23  		<input type="hidden" name="kernel" value="linux" />
    1.24 -
    1.25 +		<?php post_hidden(); ?>
    1.26  		<div align="center">
    1.27  			<input name="continue" value="Continue" type="submit" />
    1.28  		</div>