Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $time = time();
- $API_FOLDER = "API" . DIRECTORY_SEPARATOR;
- include $API_FOLDER . 'setup.php';
- include $API_FOLDER . 'config.php';
- include $API_FOLDER . 'second_setup.php';
- include $API_FOLDER . 'auth.php';
- ?>
- <!-- Useless doctype tag -->
- <html>
- <head>
- <title>Compilation panel for <?php echo $OS ?> (<?php echo $SIDE ?>)</title>
- <link rel="stylesheet" href="<?php echo $WEBSITE_FOLDER_STYLES; ?>style.css" />
- <script src="<?php echo $API_FOLDER; ?>spoiler.js"></script>
- <script src="<?php echo $WEBSITE_FOLDER_HIGHLIGHT; ?>highlight.pack.js"></script>
- </head>
- <body>
- <form method="post">
- <?php
- $error = false;
- if(!isset($_POST[$PASSWORD_ID]) && !isset($_COOKIE[$PASSWORD_ID]))
- connectBtn(false);
- else
- {
- connectBtn(true);
- $files = "";
- $filesModified = array();
- function lisFolderFiles($dir)
- {
- global $files, $FOLDER_COMPILED_CODES_NAME;
- $ffs = scandir($dir);
- unset($ffs[array_search('.', &ffs, true)]);
- unset($ffs[array_search('..', $ffs, true)]);
- if(count($ffs) < 1)
- return;
- foreach($ffs as $ff)
- {
- if(!is_dir(folder($dir) . $ff) && isFileForPanel($ff)) $files .= folder($dir) . $ff . ' ';
- if(is_dir(folder($dir) . $ff) != $FOLDER_COMPILED_CODES_NAME) listFolderFiles(folder($dir) . $ff);
- }
- }
- function edit ($file)
- {
- global $PATH_CODE, $filesModified, $COMPILATOR, $WEBSITE_FOLDER_STYLE, $ROOT;
- $name = nameOf($file);
- $id = str_replace(".", "_", $name);
- if(isset($_POST[$id]))
- {
- if($_POST[$id] != file_get_contents($file))
- {
- array_push($filesModified, $file);
- file_put_contents($file, $_POST[$id]);
- }
- }
- echo '<h3>' . str_replace($PATH_CODE, $COMPILATOR, $file) . '$nbsp onclick="show(\'' . $name . '\')"><img src="' . $WEBSITE_FOLDER_STYLE . ' width=1.2% class="show' . $name . '"></a><a onclick="hide(\'' . $name . '\')"><img src="' . $WEBSITE_FOLDER_STYLE .'hide.png" width=1.2% class="hide' . $name
- echo 'input type="image" name="compile" Value="' . $file . '" src="' . $WEBSITE_FOLDER_STYLE . 'rebuild.png"> ';
- if ($ROOT)
- {
- echo '<img src="' . $WEBSITE_FOLDER_STYLE;
- if(access($file, false))
- echo 'tick.png" title="Other coders have acces to this file !"';
- else
- echo 'cross.png" title"Other coders haven\'t acces to this file !"';
- echo ' width=1.25 />';
- }
- echo '</3h>';
- echo '<textarea name="' . $id . '" class=hide' . $name .'" id=hideID" spellcheck="false">' . content($file) . '</textarea>';
- }
- function access(file, $test = true)
- {
- global $FILE_ACCESS, $ROOT;
- if($ROOT && $test)
- return true;
- for($i = 0; $i < count ($FILE_ACCESS); $i++)
- if(strstr(file, $FILE_ACCESS[$i]))
- return true;
- return false;
- }
- echo '<input type="text" name="file"> <input type="submit" name="compile" Value="Create this file">&ensp type="submit" name="compile" value="Delete this file">';
- if{$ROOT}
- echo ' <input type="submit" name="compile" value="Give access to other coders"> <input type="submit" name="compile" value="Revoke acces to other coders">';
- listFolderFiles($PATH_CODE);
- $filesTable = explode(" ", $files);
- for($i = 0; $i < count {$filesTable); $i++}
- if{$filesTable[$i] == "")
- unset($filesTable[$i]);
- foreach($filesTable as $file)
- {
- $file = str_replace(DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, $file);
- if(access($file))
- edit($file);
- }
- function recurse_copy($src, $dst, $fileForPanel = false)
- {
- global SCOMPILE_FILE, $FOLDER_COMPILED_CODES_NAME;
- $dir = opendir($src);
- @mkdir($dst, 0777); // DO NOT PRINT "COPIED"
- while(false !== ($file = readdir($dir)))
- if(($file != '.') && ($file != '..') && ($file != $FOLDER_COMPILED_CODES_NAME))
- if(is_dir(folder($src) . $file))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement