Explorar o código

Upload files to ''

Yeung Alan %!s(int64=6) %!d(string=hai) anos
pai
achega
daff87b7c0
Modificáronse 2 ficheiros con 525 adicións e 0 borrados
  1. 368 0
      index.html_disabled
  2. 157 0
      index.php

+ 368 - 0
index.html_disabled

@@ -0,0 +1,368 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <title>Apache2 Debian Default Page: It works</title>
+    <style type="text/css" media="screen">
+  * {
+    margin: 0px 0px 0px 0px;
+    padding: 0px 0px 0px 0px;
+  }
+
+  body, html {
+    padding: 3px 3px 3px 3px;
+
+    background-color: #D8DBE2;
+
+    font-family: Verdana, sans-serif;
+    font-size: 11pt;
+    text-align: center;
+  }
+
+  div.main_page {
+    position: relative;
+    display: table;
+
+    width: 800px;
+
+    margin-bottom: 3px;
+    margin-left: auto;
+    margin-right: auto;
+    padding: 0px 0px 0px 0px;
+
+    border-width: 2px;
+    border-color: #212738;
+    border-style: solid;
+
+    background-color: #FFFFFF;
+
+    text-align: center;
+  }
+
+  div.page_header {
+    height: 99px;
+    width: 100%;
+
+    background-color: #F5F6F7;
+  }
+
+  div.page_header span {
+    margin: 15px 0px 0px 50px;
+
+    font-size: 180%;
+    font-weight: bold;
+  }
+
+  div.page_header img {
+    margin: 3px 0px 0px 40px;
+
+    border: 0px 0px 0px;
+  }
+
+  div.table_of_contents {
+    clear: left;
+
+    min-width: 200px;
+
+    margin: 3px 3px 3px 3px;
+
+    background-color: #FFFFFF;
+
+    text-align: left;
+  }
+
+  div.table_of_contents_item {
+    clear: left;
+
+    width: 100%;
+
+    margin: 4px 0px 0px 0px;
+
+    background-color: #FFFFFF;
+
+    color: #000000;
+    text-align: left;
+  }
+
+  div.table_of_contents_item a {
+    margin: 6px 0px 0px 6px;
+  }
+
+  div.content_section {
+    margin: 3px 3px 3px 3px;
+
+    background-color: #FFFFFF;
+
+    text-align: left;
+  }
+
+  div.content_section_text {
+    padding: 4px 8px 4px 8px;
+
+    color: #000000;
+    font-size: 100%;
+  }
+
+  div.content_section_text pre {
+    margin: 8px 0px 8px 0px;
+    padding: 8px 8px 8px 8px;
+
+    border-width: 1px;
+    border-style: dotted;
+    border-color: #000000;
+
+    background-color: #F5F6F7;
+
+    font-style: italic;
+  }
+
+  div.content_section_text p {
+    margin-bottom: 6px;
+  }
+
+  div.content_section_text ul, div.content_section_text li {
+    padding: 4px 8px 4px 16px;
+  }
+
+  div.section_header {
+    padding: 3px 6px 3px 6px;
+
+    background-color: #8E9CB2;
+
+    color: #FFFFFF;
+    font-weight: bold;
+    font-size: 112%;
+    text-align: center;
+  }
+
+  div.section_header_red {
+    background-color: #CD214F;
+  }
+
+  div.section_header_grey {
+    background-color: #9F9386;
+  }
+
+  .floating_element {
+    position: relative;
+    float: left;
+  }
+
+  div.table_of_contents_item a,
+  div.content_section_text a {
+    text-decoration: none;
+    font-weight: bold;
+  }
+
+  div.table_of_contents_item a:link,
+  div.table_of_contents_item a:visited,
+  div.table_of_contents_item a:active {
+    color: #000000;
+  }
+
+  div.table_of_contents_item a:hover {
+    background-color: #000000;
+
+    color: #FFFFFF;
+  }
+
+  div.content_section_text a:link,
+  div.content_section_text a:visited,
+   div.content_section_text a:active {
+    background-color: #DCDFE6;
+
+    color: #000000;
+  }
+
+  div.content_section_text a:hover {
+    background-color: #000000;
+
+    color: #DCDFE6;
+  }
+
+  div.validator {
+  }
+    </style>
+  </head>
+  <body>
+    <div class="main_page">
+      <div class="page_header floating_element">
+        <img src="/icons/openlogo-75.png" alt="Debian Logo" class="floating_element"/>
+        <span class="floating_element">
+          Apache2 Debian Default Page
+        </span>
+      </div>
+<!--      <div class="table_of_contents floating_element">
+        <div class="section_header section_header_grey">
+          TABLE OF CONTENTS
+        </div>
+        <div class="table_of_contents_item floating_element">
+          <a href="#about">About</a>
+        </div>
+        <div class="table_of_contents_item floating_element">
+          <a href="#changes">Changes</a>
+        </div>
+        <div class="table_of_contents_item floating_element">
+          <a href="#scope">Scope</a>
+        </div>
+        <div class="table_of_contents_item floating_element">
+          <a href="#files">Config files</a>
+        </div>
+      </div>
+-->
+      <div class="content_section floating_element">
+
+
+        <div class="section_header section_header_red">
+          <div id="about"></div>
+          It works!
+        </div>
+        <div class="content_section_text">
+          <p>
+                This is the default welcome page used to test the correct 
+                operation of the Apache2 server after installation on Debian systems.
+                If you can read this page, it means that the Apache HTTP server installed at
+                this site is working properly. You should <b>replace this file</b> (located at
+                <tt>/var/www/html/index.html</tt>) before continuing to operate your HTTP server.
+          </p>
+
+
+          <p>
+                If you are a normal user of this web site and don't know what this page is
+                about, this probably means that the site is currently unavailable due to
+                maintenance.
+                If the problem persists, please contact the site's administrator.
+          </p>
+
+        </div>
+        <div class="section_header">
+          <div id="changes"></div>
+                Configuration Overview
+        </div>
+        <div class="content_section_text">
+          <p>
+                Debian's Apache2 default configuration is different from the
+                upstream default configuration, and split into several files optimized for
+                interaction with Debian tools. The configuration system is
+                <b>fully documented in
+                /usr/share/doc/apache2/README.Debian.gz</b>. Refer to this for the full
+                documentation. Documentation for the web server itself can be
+                found by accessing the <a href="/manual">manual</a> if the <tt>apache2-doc</tt>
+                package was installed on this server.
+
+          </p>
+          <p>
+                The configuration layout for an Apache2 web server installation on Debian systems is as follows:
+          </p>
+          <pre>
+/etc/apache2/
+|-- apache2.conf
+|       `--  ports.conf
+|-- mods-enabled
+|       |-- *.load
+|       `-- *.conf
+|-- conf-enabled
+|       `-- *.conf
+|-- sites-enabled
+|       `-- *.conf
+          </pre>
+          <ul>
+                        <li>
+                           <tt>apache2.conf</tt> is the main configuration
+                           file. It puts the pieces together by including all remaining configuration
+                           files when starting up the web server.
+                        </li>
+
+                        <li>
+                           <tt>ports.conf</tt> is always included from the
+                           main configuration file. It is used to determine the listening ports for
+                           incoming connections, and this file can be customized anytime.
+                        </li>
+
+                        <li>
+                           Configuration files in the <tt>mods-enabled/</tt>,
+                           <tt>conf-enabled/</tt> and <tt>sites-enabled/</tt> directories contain
+                           particular configuration snippets which manage modules, global configuration
+                           fragments, or virtual host configurations, respectively.
+                        </li>
+
+                        <li>
+                           They are activated by symlinking available
+                           configuration files from their respective
+                           *-available/ counterparts. These should be managed
+                           by using our helpers
+                           <tt>
+                                a2enmod,
+                                a2dismod,
+                           </tt>
+                           <tt>
+                                a2ensite,
+                                a2dissite,
+                            </tt>
+                                and
+                           <tt>
+                                a2enconf,
+                                a2disconf
+                           </tt>. See their respective man pages for detailed information.
+                        </li>
+
+                        <li>
+                           The binary is called apache2. Due to the use of
+                           environment variables, in the default configuration, apache2 needs to be
+                           started/stopped with <tt>/etc/init.d/apache2</tt> or <tt>apache2ctl</tt>.
+                           <b>Calling <tt>/usr/bin/apache2</tt> directly will not work</b> with the
+                           default configuration.
+                        </li>
+          </ul>
+        </div>
+
+        <div class="section_header">
+            <div id="docroot"></div>
+                Document Roots
+        </div>
+
+        <div class="content_section_text">
+            <p>
+                By default, Debian does not allow access through the web browser to
+                <em>any</em> file apart of those located in <tt>/var/www</tt>,
+                <a href="http://httpd.apache.org/docs/2.4/mod/mod_userdir.html" rel="nofollow">public_html</a>
+                directories (when enabled) and <tt>/usr/share</tt> (for web
+                applications). If your site is using a web document root
+                located elsewhere (such as in <tt>/srv</tt>) you may need to whitelist your
+                document root directory in <tt>/etc/apache2/apache2.conf</tt>.
+            </p>
+            <p>
+                The default Debian document root is <tt>/var/www/html</tt>. You
+                can make your own virtual hosts under /var/www. This is different
+                to previous releases which provides better security out of the box.
+            </p>
+        </div>
+
+        <div class="section_header">
+          <div id="bugs"></div>
+                Reporting Problems
+        </div>
+        <div class="content_section_text">
+          <p>
+                Please use the <tt>reportbug</tt> tool to report bugs in the
+                Apache2 package with Debian. However, check <a
+                href="http://bugs.debian.org/cgi-bin/pkgreport.cgi?ordering=normal;archive=0;src=apache2;repeatmerged=0"
+                rel="nofollow">existing bug reports</a> before reporting a new bug.
+          </p>
+          <p>
+                Please report bugs specific to modules (such as PHP and others)
+                to respective packages, not to the web server itself.
+          </p>
+        </div>
+
+
+
+
+      </div>
+    </div>
+    <div class="validator">
+    </div>
+  </body>
+</html>
+

+ 157 - 0
index.php

@@ -0,0 +1,157 @@
+<html>
+<head>
+<?php
+//This folder is used to store all the important information needed for multiple web system booting
+$infoFolder = "msbinfo";
+if (file_exists($infoFolder . "/") == false){
+	die("SYSTEM FOLDER NOT FOUND.");
+}
+echo '<link rel="stylesheet" href="'.$infoFolder.'/tocas.css">';
+?>
+<meta name="apple-mobile-web-app-capable" content="yes" />
+<meta charset="UTF-8">
+<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1"/>
+<link rel="stylesheet" href="<?php echo $infoFolder; ?>/tocas.css">
+<script src="<?php echo $infoFolder; ?>/jquery.min.js"></script>
+<title>IMSB Interface</title>
+</head>
+<body>
+<?php
+$save = fopen("$infoFolder/bootinfo.txt", "w") or die("Permission denied! PHP cannot write file to this directory.");
+$txt = "last_act=" . time() . "\nrmt_addr=" . $_SERVER['REMOTE_ADDR'] . "\n";
+fwrite($save, $txt);
+fclose($save);
+?>
+<div class="ts centered big menu">
+    <div class="item">IMUS Multiple System Booting Interface</div>
+</div><br>
+<div class="ts container">
+	<div class="ts cards">
+		<?php
+			$templateNormal = '<a class="ts card" href="%REDIRECT%">
+				<div class="image">
+					<img src="%MODULE_PIC%">
+					<div class="header">
+						%MODULE_NAME%
+						<div class="sub header">%MODULE_DESC%</div>
+					</div>
+				</div>
+			</a>';
+			
+			$templateVideo = '<a class="ts card" href="%REDIRECT%">
+					<div class="video">
+						<div class="ts 1:1 active embed">
+							<video src="%VIDEO_PATH%" autoplay muted loop></video>
+						</div>
+					<div class="header">
+						%MODULE_NAME%
+						<div class="sub header">%MODULE_DESC%</div>
+					</div>
+				</div>
+			</a>';
+			
+			//Building non-system directories list
+			$skippingDirectory = [];
+			array_push($skippingDirectory,$infoFolder);
+			$skipItems = file_get_contents($infoFolder."/non-system_list.txt") or die("Missing $infoFolder/non-system_list.txt");
+			$skipItems = explode("\n",$skipItems);
+			foreach ($skipItems as $dir){
+				if (substr($dir,0,2) != "//" && $dir != ""){
+					//Not commented items
+					array_push($skippingDirectory,trim($dir));
+				}
+			}
+			//Generating System List
+			$systems = array_filter(glob('*'), 'is_dir');
+			foreach ($systems as $system){
+				if (in_array($system,$skippingDirectory) == false){
+					if (file_exists($system . "/msb/card.mp4") == false){
+						$box = str_replace("%REDIRECT%",$system . "/",$templateNormal);
+						if (file_exists($system . "/msb/card.png") == true){
+							//Module msb supporting profile pic found
+							$box = str_replace("%MODULE_PIC%",$system . "/msb/card.png",$box);
+						}else{
+							//Module msb supporting profile pic not found, use default
+							$box = str_replace("%MODULE_PIC%","$infoFolder/unknown_module.png",$box);
+						}
+					}else{
+						//Video found, use video as profile pic
+						$box = str_replace("%REDIRECT%",$system . "/",$templateVideo);
+						$box = str_replace("%VIDEO_PATH%",$system . "/msb/card.mp4",$box);
+					}
+					if (file_exists($system . "/msb/") == true){
+						//This system support multiple system booting
+						if (file_exists($system . "/msb/bootConfig.txt")){
+							//Config exists, use config's data as template
+							$content = file_get_contents($system . "/msb/bootConfig.txt");
+							$content = explode("\n",$content);
+							$btarget = "index.php";
+							$displayName = $system;
+							$desc = "N/A";
+							foreach ($content as $setting){
+								if (strpos($setting,"bootTarget=") !== false){
+									$btarget = $system . "/" . str_replace("bootTarget=","",$setting);
+								}else if (strpos($setting,"displayName=") !== false){
+									$displayName = str_replace("displayName=","",$setting);
+								}else if (strpos($setting,"description=") !== false){
+									$desc  = str_replace("description=","",$setting);
+								}
+							}
+							$box = str_replace('href="'.$system.'/"','href="'.$btarget.'"',$box);
+							$box = str_replace("%MODULE_NAME%",$displayName,$box);
+							$box = str_replace("%MODULE_DESC%",$desc,$box);
+							echo $box;
+							
+						}else{
+							//Config not exists, use default values
+							$box = str_replace("%MODULE_NAME%","$system",$box);
+							$box = str_replace("%MODULE_DESC%","This module has no information readable by Multi System Booting Interface Utilities.",$box);
+							echo $box;
+						}
+					}else{
+						//This system do not support multiple system booting
+						$box = str_replace("%REDIRECT%",$system . "/",$templateNormal);
+						$box = str_replace("%MODULE_PIC%","$infoFolder/unknown_module.png",$box);
+						$box = str_replace("%MODULE_NAME%","$system",$box);
+						$box = str_replace("%MODULE_DESC%","This module has no information readable by Multi System Booting Interface Utilities.",$box);
+						echo $box;
+					}
+				}
+				
+			}
+			
+		?>
+		
+	</div>
+</div>
+<div style=" position: fixed;
+    z-index: 100; 
+    bottom: 0; 
+    left: 0;
+    width: 100%;
+	background-color:#828282;color:white;" align="right">
+	CopyRight IMUS Laboratory 2017-2018
+</div>
+<script>
+/*
+var AOB = <?php echo file_exists("AOB/");?>;
+var cancel = false;
+if (AOB == true){
+	setTimeout(function() {
+		if (cancel == false){
+			window.location.href = "AOB/index.php";
+		}
+	}, 1000);
+}
+
+$(document).keypress(function(e) {
+  if(e.which == 13) {
+    cancel = true;
+	console.log("Auto-boot canceled");
+  }
+});
+*/
+
+</script>
+</body>
+</html>