ob_end_clean(); } // Generate the animated gif and output to screen. $gif = new GIFEncoder($frames, $framed, 0, 2, 0, 0, 0, 'bin'); echo $gif->GetAnimation(); } else { if ($_GET['lvl'] === "CAPTCHA_3D_image" and !empty($_GET['text'])) { header("Pragma: "); header("Cache-Control: "); header('Content-type: image/png'); header("Content-Disposition: inline; filename=\"" . basename($name) . "\""); // Name the picture $image = imagecreatetruecolor($image_width, $image_height); // Create the image //background background($image, $fromr, $tor, $fromg, $tog, $fromb, $tob, $image_height, $image_width); $parts = str_split($text, 1); // Divide the text into one character array foreach ($parts as $key => $value) { $bbox = imagettfbbox($font_size, 0, $font, $parts[$key - 1]); //Measuring the width of the previous character to position the current character $angle = 0; $x = $x + ($bbox[2] - $bbox[0] - $overlapping); // Horizontal position of the current value $y = abs($image_height / 1.5); // Vertical position of the current value $text_color = imagecolorallocatealpha($image, $text_colorr, $text_colorg, $text_colorb, 0); imagettftext($image, $font_size, $angle, $x, $y, $text_color, $font, $value); // Create the text $text_color2 = imagecolorallocatealpha($image, $text_colorr, $text_colorg, $text_colorb, 127); $randomvalue = randomname(1);
if (strcmp($extract, "breakline") == 0) { fwrite($f, chr(13) . chr(10)); } else { $asciiCode = substr($extract, 0, 3); $foreground = substr($extract, 3, 3); $background = substr($extract, 6, 3); while (strcmp(substr($foreground, 0, 1), "0") == 0 && strlen($foreground) > 1) { $foreground = substr($foreground, 1); } while (strcmp(substr($background, 0, 1), "0") == 0 && strlen($background) > 1) { $background = substr($background, 1); } if ($currentBackground == 0 && $asciiCode == 32) { fwrite($f, foreground(0)); $currentForeground = 0; } else { if ($foreground != $currentForeground) { fwrite($f, foreground($foreground)); } # $currentForeground = $foreground; } if ($background != $currentBackground) { fwrite($f, background($background)); } fwrite($f, chr($asciiCode)); $currentBackground = $background; } $pos = $pos + 9; } fclose($f);
} print "ok"; return 0; } if (isset($_REQUEST['stats'])) { foreach ($conf_nodes as $node) { print $node['name'] . " "; if (is_local($node['address'])) { print background("server-stats", "server-stats"); } else { //$code = "sudo $conf_base_path/bin/webidectl server-stats " . $node['name']; //print shell_exec($code) . "\n"; $result = background("server-stats " . $node['name'], "server-stats-" . $node['name']); print $result . "\n"; } } return 0; } if (file_exists($login_watch_path) || file_exists($verify_watch_path)) { print "starting"; unlink("/tmp/web-background/is-node-up-{$login}"); return 0; } //$result = `sudo $conf_base_path/bin/webidectl is-node-up $login`; $result = background("is-node-up {$login}", "is-node-up-{$login}"); //$idle = `ls -l $conf_base_path/watch`; if (trim($result) == "true") { print "ok"; } else { print "idle"; }