' . print_r($v, true) . ''; if ($czyscHtmlIExit) exit; } function vv($v, $czyscHtmlIExit = false) { if ($czyscHtmlIExit) ob_end_clean(); echo '
'; var_dump($v); echo ''; if ($czyscHtmlIExit) exit; } function vvv($var, & $result = null, $is_view = true) { if (is_array($var) || is_object($var)) foreach ($var as $key=> $value) vvv($value, $result[$key], false); else $result = $var; if ($is_view) v($result); } function getarr($arr,$key,$default) { return isset($arr[$key]) ? $arr[$key] : $default; } function deleteOldHistory() { $expireDate = date('Y-m-d', strtotime("-1 day")); foreach (glob('./history/*') as $f) { if (substr(basename($f),-10) < $expireDate) { unlink($f); } } } //------------------------- // init setup.ini parms $ini = parse_ini_file('conf/setup.ini'); $interval= getarr($ini,'interval',2500); $delay= $interval+getarr($ini,'cache',60000); $auth= explode(',',getarr($ini,'auth','')); // read args $name=""; if (isset($_REQUEST['name'])) { $name = stripslashes(htmlspecialchars($_REQUEST['name'])); } $room=""; if (isset($_REQUEST['room'])) { $room = stripslashes(htmlspecialchars($_REQUEST['room'])); } // check args if ($name.$room=="") { // no args $prompt = "Please fill in the form to continue:"; } else { if ($name=="") {$prompt = "User name missing.";} else if ($room=="") {$prompt="Room missing.";} else if (in_array($name.":".$room,$auth)) {$prompt="";} else if (in_array(":".$room,$auth)) {$prompt="";} else if (in_array($name.":",$auth)) {$prompt="";} else {$prompt="User not authorized to this room.";} } ?>
'; echo $err; echo $prompt; echo '
'; } else { deleteOldHistory(); // Enter the room ?>