function outputVideoStream($id, $src, $width, $height, $format, $title = "") { if (file_exists($src)) { $mimeType = getMimeType($src); } else { switch ($format) { case 'asf': $mimeType = "video/x-ms-asf"; break; case 'avi': case 'wmv': $mimeType = "video/x-msvideo"; break; case 'mov': $mimeType = "video/quicktime"; break; case 'mpg': case 'mpeg': $mimeType = "video/mpeg"; break; case 'swf': $mimeType = "application/x-shockwave-flash"; break; case '3gp': $mimeType = "video/3gpp"; break; default: $mimeType = "video/{$format}"; break; } } if (!$mimeType || $mimeType == 'application/octet-stream') { $mimeType = 'video/' . $format; } $objectTag = false; if (ZM_WEB_USE_OBJECT_TAGS) { switch ($mimeType) { case "video/x-ms-asf": case "video/x-msvideo": case "video/mp4": if (isWindows()) { ?> <object id="<?php echo $id; ?> " width="<?php echo validNum($width); ?> " height="<?php echo validNum($height); ?> " classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902" standby="Loading Microsoft Windows Media Player components..." type="<?php echo $mimeType; ?> "> <param name="FileName" value="<?php echo $src; ?> "/> <param name="autoStart" value="1"/> <param name="showControls" value="0"/> <embed type="<?php echo $mimeType; ?> " pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="<?php echo $src; ?> " name="<?php echo validHtmlStr($title); ?> " width="<?php echo validNum($width); ?> " height="<?php echo validInt($height); ?> " autostart="1" showcontrols="0"> </embed> </object> <?php $objectTag = true; } break; case "video/quicktime": ?> <object id="<?php echo $id; ?> " width="<?php echo $width; ?> " height="<?php echo $height; ?> " classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" type="<?php echo $mimeType; ?> "> <param name="src" value="<?php echo $src; ?> "/> <param name="autoplay" VALUE="true"/> <param name="controller" VALUE="false"/> <embed type="<?php echo $mimeType; ?> " src="<?php echo $src; ?> " pluginspage="http://www.apple.com/quicktime/download/" name="<?php echo validHtmlStr($title); ?> " width="<?php echo validInt($width); ?> " height="<?php echo validInt($height); ?> " autoplay="true" controller="true"> </embed> </object> <?php $objectTag = true; break; case "application/x-shockwave-flash": ?> <object id="<?php echo $id; ?> " width="<?php echo $width; ?> " height="<?php echo $height; ?> " classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" type="<?php echo $mimeType; ?> "> <param name="movie" value="<?php echo $src; ?> "/> <param name="quality" value="high"/> <param name="bgcolor" value="#ffffff"/> <embed type="<?php echo $mimeType; ?> " pluginspage="http://www.macromedia.com/go/getflashplayer" src="<?php echo $src; ?> " name="<?php echo validHtmlStr($title); ?> " width="<?php echo validInt($width); ?> " height="<?php echo validInt($height); ?> " quality="high" bgcolor="#ffffff"> </embed> </object> <?php $objectTag = true; break; } } if (!$objectTag) { ?> <embed<?php echo isset($mimeType) ? ' type="' . $mimeType . '"' : ""; ?> src="<?php echo $src; ?> " name="<?php echo validHtmlStr($title); ?> " width="<?php echo validInt($width); ?> " height="<?php echo validInt($height); ?> " autostart="1" autoplay="1" showcontrols="0" controller="0"> </embed> <?php } }
<body> <div id="page"> <div id="header"> <h2><?php echo translate('MonitorProbe'); ?> </h2> </div> <div id="content"> <form name="contentForm" id="contentForm" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?> "> <input type="hidden" name="view" value="none"/> <input type="hidden" name="mid" value="<?php echo validNum($_REQUEST['mid']); ?> "/> <p> <?php echo translate('MonitorProbeIntro'); ?> </p> <p> <label for="probe"><?php echo translate('DetectedCameras'); ?> </label><?php echo buildSelect("probe", $cameras, 'configureButtons( this )'); ?> </p>
// Delete ./ and ../ from the list foreach ($trash as $key) { @unlink($key); } rmdir($CANDIR); if (is_dir($CANDIR)) { Print_Message("Permission Error:", "<code>{$user}</code> does not have permission to delete <code>{$CANDIR}</code>.<br/>" . "This can be easly fixed by running the following command at the Scanner Server.<br/><code>rm -r {$CANDIR}</code><br/>" . "Once you have done that you can press F5 (Refresh) to try again with your prevously entered settings.", 'center'); quit(); } } if (!@mkdir("{$CANDIR}")) { Print_Message('Error', "Unable to create directory {$CANDIR}.<br>Why does <code>{$user}</code> not have permission?", 'center'); quit(); } $sizes = explode('-', $SIZE); if (!validNum(array($SCANNER, $WIDTH, $HEIGHT, $X_1, $Y_1, $BRIGHT, $CONTRAST, $SCALE, $ROTATE)) || count($sizes) != 2 && $SIZE !== 'full' || !in_array($MODE, explode('|', $CANNERS[$SCANNER]->{"MODE-{$SOURCE}"})) || !in_array($SOURCE, explode('|', $CANNERS[$SCANNER]->{"SOURCE"})) || !in_array($DUPLEX, is_bool($CANNERS[$SCANNER]->{"DUPLEX-{$SOURCE}"}) ? array(true, false) : explode('|', $CANNERS[$SCANNER]->{"DUPLEX-{$SOURCE}"})) || $FILETYPE !== "txt" && $FILETYPE !== "png" && $FILETYPE !== "tiff" && $FILETYPE !== "jpg") { Print_Message("No, you can not do that", "Input data is invalid and most likely an attempt to run malicious code on the server. <i>Denied</i>", 'center'); quit(); } else { if ((!is_numeric($sizes[0]) || !is_numeric($sizes[1])) && $SIZE !== 'full') { Print_Message("No, you can not do that", "Input data is invalid and most likely an attempt to run malicious code on the server. <i>Denied</i>", 'center'); quit(); } } # Scanner in Use $CANNERS[$SCANNER]->{"INUSE"} = 1; if (!SaveFile("config/scanners.json", json_encode($CANNERS))) { Print_Message("Permission Error:", "<code>{$user}</code> does not have permission to write files to the <code>" . getcwd() . "/config</code> folder.<br/>{$notes}", 'center'); quit(); } $X = 0;