Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = "admin";
- $password = "topk3kr3kt";
- $salt= "sup3rcalifr4gilisticexpialid0ci0us";
- if(!isset($_COOKIE['PrivatePageLogin']) && !isset($_GET["p"])) {
- echo '<form action="'; echo $_SERVER['PHP_SELF']; echo '?p=login" method="post">';
- echo '<label>Squoof Location System</label><br>';
- echo '<input type="text" name="user" id="user" /><br>';
- echo '<label><input type="password" name="keypass" id="keypass" /> Password</label><br>';
- echo '<input type="submit" id="submit" value="Login" />';
- echo '</form>';
- }
- if(isset($_COOKIE['PrivatePageLogin'])) {
- if($_COOKIE['PrivatePageLogin'] == hash('sha512', $password.$salt)) {
- echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
- echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n";
- echo "<head>\n";
- echo " <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n";
- echo " <meta name=\"robots\" content=\"all\" />\n";
- echo " <title>webcam 7</title>\n";
- echo " <link rel=\"stylesheet\" href=\"css_styles/default.css\" media=\"screen\" />\n";
- echo " <script type=\"text/javascript\">\n";
- echo " </script>\n";
- echo "</head>\n";
- echo "<body id=\"webcamXP-body\">\n";
- echo "<img src=\"loading.jpg\" class=\"webcam\" id=\"webcam1\" onmousedown=\"PTZMouseDown1(event)\" width=\"706\" height=\"435\" alt=\"Live Stream\" />\n";
- echo "<script type=\"text/javascript\">\n";
- echo "<!--\n";
- echo "currentCamera1= 1;\n";
- echo "errorimg1= 0;\n";
- echo "DoIt1();\n";
- echo "document.images.webcam1.onload = DoIt1();\n";
- echo "document.images.webcam1.onerror = ErrorImage1();\n";
- echo "function LoadImage1()\n";
- echo "{\n";
- echo " uniq1 = Math.random();\n";
- echo " document.images.webcam1.src = \"cam_\" + currentCamera1 + \".jpg?uniq=\"+uniq1;\n";
- echo " document.images.webcam1.onload = DoIt1;\n";
- echo "}\n";
- echo "function PTZMouseDown1(e)\n";
- echo "{\n";
- echo " var IE = document.all?true:false;\n";
- echo " var x,y;\n";
- echo " var myx,myy;\n";
- echo " var myifr = document.getElementById(\"_iframe-ptz\");\n";
- echo " tp = getElPos1();\n";
- echo " myx = tp[0];\n";
- echo " myy = tp[1];\n";
- echo " if(IE){\n";
- echo " var scrollX = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft;\n";
- echo " var scrollY = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;\n";
- echo " x = event.clientX - myx + scrollX;\n";
- echo " y = event.clientY - myy + scrollY;\n";
- echo " } else {\n";
- echo " x = e.pageX - myx;\n";
- echo " y = e.pageY - myy;\n";
- echo " }\n";
- echo " if ((width_array[currentCamera1] != null) && (width_array[currentCamera1] > 0)) x = Math.round((x * 400) / width_array[currentCamera1]);\n";
- echo " if ((height_array[currentCamera1] != null) && (height_array[currentCamera1] > 0)) y = Math.round((y * 300) / height_array[currentCamera1]);\n";
- echo " if (x > 400) x = 400;\n";
- echo " if (y > 300) y = 300;\n";
- echo " if (myifr != null) myifr.src = \"ptz?src=\" + currentCamera1 + \"&moveto_x=\" + x + \"&moveto_y=\" + y +\"\";\n";
- echo " return true;\n";
- echo "}\n";
- echo "function getElPos1()\n";
- echo "{\n";
- echo " el = document.images.webcam1;\n";
- echo " x = el.offsetLeft;\n";
- echo " y = el.offsetTop;\n";
- echo " elp = el.offsetParent;\n";
- echo " while(elp!=null)\n";
- echo " { x+=elp.offsetLeft;\n";
- echo " y+=elp.offsetTop;\n";
- echo " elp=elp.offsetParent;\n";
- echo " }\n";
- echo " return new Array(x,y);\n";
- echo "}\n";
- echo "function ErrorImage1()\n";
- echo "{\n";
- echo " errorimg1++;\n";
- echo " if (errorimg1>3){\n";
- echo " document.images.webcam1.onload = \"\";\n";
- echo " document.images.webcam1.onerror = \"\";\n";
- echo " document.images.webcam1.src = \"offline.jpg\";\n";
- echo " }else{\n";
- echo " uniq1 = Math.random();\n";
- echo " document.images.webcam1.src = \"cam_\" + currentCamera1 + \".jpg?uniq=\"+uniq1;\n";
- echo " }\n";
- echo "}\n";
- echo "function DoIt1()\n";
- echo "{\n";
- echo " errorimg1=0;\n";
- echo " window.setTimeout(\"LoadImage1();\", 40);\n";
- echo "}\n";
- echo "//-->\n";
- echo "</script>\n";
- echo "\n";
- echo "</body>\n";
- echo "</html>\n";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement