Esempio n. 1
0
function get_languages()
{
    $langdata = array();
    $langs = dirList(dirname(__FILE__) . "/languages/", 'php');
    if (is_array($langs[1])) {
        foreach ($langs[1] as $row) {
            $langdata[] = str_replace(array(".php", "lang_"), array("", ""), $row[0]);
        }
    }
    return $langdata;
}
Esempio n. 2
0
function renderWebsiteLinks($dirNames, $currentDir = null)
{
    $html = '';
    if (empty($currentDir)) {
        $currentDir = ROOT_DIR;
    }
    foreach ($dirNames as $dirName) {
        $dir = $currentDir . DS . $dirName;
        if (preg_match("/.*\\.com\$/", $dir) && is_dir($dir)) {
            $html .= '<li><a href="http://' . $dirName . '" target="_blank">' . $dirName . '[<a href="http://' . $dirName . '/admin" target="_blank">admin</a>]</li>';
        } else {
            if (is_dir($dirName)) {
                $html .= '<li><h4><a href="http://localhost/' . $dirName . '"</a>' . $dirName . '</h4></li>';
                $subDir = renderWebsiteLinks(dirList($dir), $dir);
                $html = !empty($subDir) ? $html . '<li>' . $subDir . '</li>' : $html;
            }
        }
    }
    $html = !empty($html) ? '<ul>' . $html . '</ul>' : $html;
    return $html;
}
Esempio n. 3
0
                         </td>
                 </tr>
                 <tr>
                         <td>&nbsp;</td>
                         <td>&nbsp;</td>
                 </tr>
         </table>
 </td>
 <td>&nbsp;</td>
 <td>
         <table>
                 <tr>
                         <td><input tabindex="99" type="submit" value="WSDL" name="wsdl-download"/></td>
                         <td><select tabindex="4" name="wsdl" onchange="document.main.service_url.value=''">
                                 <?php
                                 $wsdl_files = dirList('.');
                                 function cmp($a, $b) {
                                     $prefix = '\-';
                                     $av = substrpos($a, $prefix, '.') * -1;
                                     $bv = substrpos($b, $prefix, '.') * -1;
                                         if ($av == $bv) {
                                                 if ($a == $b) {
                                                         return 0;
                                                 }
                                         return ($a < $b) ? -1 : 1;
                                     }
                                     // Reverse sort.
                                     return ($av > $bv) ? -1 : 1;
                                 }
                                 usort($wsdl_files, 'cmp');
                                 foreach ($wsdl_files as $wsdl_filename) {
Esempio n. 4
0
function removeOldFiles($directory, $period)
{
    $list = dirList($directory);
    $today = gettimeofday();
    for ($i = 0; $i < count($list); $i++) {
        $fname = $directory . '/' . $list[$i];
        if (time() - filemtime($fname) > $period * 60) {
            unlink($fname);
        }
    }
}
Esempio n. 5
0
if (isset($_REQUEST['numInvoice'])) {
    jCnn();
    $strsql = "update invoiceSeries set number=number+1 where serie='" . $_REQUEST['serie'] . "'";
    $results = $GLOBALS['db']->exec($strsql);
    $strsql = "select number from invoiceSeries where serie='" . $_REQUEST['serie'] . "'";
    $results = $GLOBALS['db']->query($strsql);
    if ($results) {
        $results = $results->fetch();
        echo $results['number'];
    }
    exit;
}
// DIRLIST
//**********************************************
if (isset($_REQUEST['dirList'])) {
    $dirList = dirList($_REQUEST['dirList']);
    //print_r($dirList);
    if (count($dirList) > 0) {
        echo putOptions($dirList, '-');
    }
    exit;
}
// TOXLS
//**********************************************
if (isset($_REQUEST['toXls'])) {
    jCnn();
    $strsql = base64_decode($_REQUEST['toXls']);
    $results = $GLOBALS['db']->query($strsql);
    //header
    $valRet = '<table border=1><tr>';
    for ($col = 0; $col < $results->columnCount(); $col++) {
Esempio n. 6
0
                                        <?php 
echo "<b><center>links panel</center></b>";
?>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr><!-- row 3 contact information-->
                <td colspan="2" bgcolor="lightblue" txtcolor="white" border="1">
                    <?php 
echo "<center><b>CONTACT INFO</b></center>";
?>
                </td>
            </tr>
        </table>
        <br>
<?php 
$results = dirList("C:/xampp/htdocs/workspace/ZivNeurim/Code");
echo "<ul>";
foreach ($results as $key => $val) {
    echo "<li><a href=\"{$val}\">{$val}</a> <br>";
}
echo "<ul>";
//phpinfo();
//	echo "$val<br>";
?>

</body>
Esempio n. 7
0
function wpcf7_plugin_include($include_file_name)
{
    $plugins_path = path_join(WPCF7_PLUGIN_DIR, 'plugins');
    if (file_exists($plugins_path) && is_dir($plugins_path)) {
        $plugins = dirList($plugins_path);
        foreach ($plugins as $plugin_name) {
            $plugin_path = path_join($plugins_path, $plugin_name);
            $include_file = path_join($plugin_path, $include_file_name);
            if (file_exists($include_file)) {
                include $include_file;
            }
        }
    }
}
Esempio n. 8
0
<?php

define("IN_XSS_PLATFORM", true);
require 'auth.php';
require_once "functions.php";
require_once "config.php";
require_once "dio.php";
header('Content-Type: application/json');
if (isset($_GET['cmd'])) {
    switch ($_GET['cmd']) {
        //所有记录包括详细信息
        case 'list':
            echo json_encode(dirList());
            break;
            //只列出时间戳(索引id)
        //只列出时间戳(索引id)
        case 'simplelist':
            echo json_encode(dirSimpleList());
            break;
            //根据时间戳(索引id)获得单条信息
        //根据时间戳(索引id)获得单条信息
        case 'get':
            if (isset($_GET['id']) && preg_match('/^[0-9]{10}$/', $_GET['id'])) {
                echo json_encode(loadInfo($_GET['id']));
            } else {
                echo json_encode(false);
            }
            break;
            //根据时间戳(索引id)删除单条信息
        //根据时间戳(索引id)删除单条信息
        case 'del':
Esempio n. 9
0
?>

<html>
 <head>
  <title>Z-Loader Utility</title>
 </head>
 <body>
  <p><b>Function:</b> This utility allows mass API operations (Create, Update, Delete) driven from a CSV file. Each row of the CSV file represents an object and the column headers should match the API object fields exactly (the match is case sensitive). Empty cells will not be submitted. List of object fields can be found in the <a href="http://apidocs.developer.zuora.com/index.php/Main_Page">API documentation</a>.</p>
  <form name="main" enctype="multipart/form-data" method="POST" action=".">
   <input type="hidden" name="_submit_check" value="1"/>

<table>
<tr>
<td>WSDL:</td><td><select name="wsdl" onchange="document.main.service_url.value=''">
<?php 
$wsdl_files = dirList($baseDir);
function cmp($a, $b)
{
    $prefix = '\\-';
    $av = substrpos($a, $prefix, '.') * -1;
    $bv = substrpos($b, $prefix, '.') * -1;
    if ($av == $bv) {
        if ($a == $b) {
            return 0;
        }
        return $a < $b ? -1 : 1;
    }
    // Reverse sort.
    return $av > $bv ? -1 : 1;
}
usort($wsdl_files, 'cmp');
Esempio n. 10
0
#!/usr/bin/env php
<?php 
/*
 * This script rebuilds this package's composer.json file by merging relevant sections from the bundled subsystems.
 * Whenever you modify the composer.json of a subsystem, you should run this and then commit the changes to Git.
 */
define('DIR_LIST_DIRECTORIES', 2);
chdir(dirname(__DIR__));
$targetConfig = json_load('composer.template', true);
$requires = $psr4s = $bins = $files = [];
$packages = dirList(getcwd() . '/subsystems', DIR_LIST_DIRECTORIES);
foreach ($packages as $package) {
    $config = json_load("subsystems/{$package}/composer.json", true);
    // Merge 'require' section
    if (isset($config['require'])) {
        $require = $config['require'];
        foreach ($require as $name => $version) {
            if (substr($name, 0, 11) != 'subsystems/') {
                // exclude subsystems
                if (!isset($requires[$name])) {
                    $requires[$name] = $version;
                } else {
                    if ($requires[$name] != $version) {
                        fail("subsystem/{$package}'s version of package '{$name}' conflicts with another subsystem's version of the same package\n");
                    }
                }
            }
        }
    }
    if (isset($config['autoload'])) {
        $autoload = $config['autoload'];
Esempio n. 11
0
function listing($dir, $pointer = '1')
{
    $pliki = dirList('content/', 'newestFirst');
    if ($pliki !== 0) {
        for ($i = 1; $i <= 10; $i++) {
            if (isset($pliki[$pointer])) {
                $setList[$i] = $pliki[$pointer];
            }
            $pointer++;
        }
        $ile = count($setList);
        $sumaPlikow = count($pliki);
        $mid_table = '';
        $pre_table = '
      <table border="0" cellpadding="5" width="100%">
        <tr class="head">
          <td><img src="yellow.gif" width="8" height="8"> ID</td>
          <td>Url</td>
          <td style="text-align: center;">Created</td>
          <td style="text-align: center;">Click count</td>
          <td style="text-align: center;">Last click</td>
          <td colspan="2" class="head">&nbsp;</td>
        </tr>
        ';
        for ($i = 1; $i <= $ile; $i++) {
            $array = getData($setList[$i]);
            if ($array) {
                $urllong = trim($array['url']);
                if (strlen($urllong) > 55) {
                    $urllong = substr($urllong, 0, 52) . "...";
                }
            } else {
                $urllong = "Can not access data file!";
            }
            $mid_table = $mid_table . '
        <tr>
          <td bgcolor="#FFFFA4"><a href="' . curPageURL() . $setList[$i] . '" target="_blank">' . $setList[$i] . '</a></td>
          <td bgcolor="#FFFFA4"><a href="' . $array['url'] . '">' . $urllong . '</a></td>
          <td bgcolor="#FFFFA4" style="text-align: center;">' . $array['date'] . '</td>
          <td bgcolor="#FFFFA4" style="text-align: center;">' . $array['count'] . '</td>
          <td bgcolor="#FFFFA4" style="text-align: center;">' . $array['last'] . '</td>
          <form method="post">
          <td align="center" width="5%">
            <div class="submit">
              <input type="hidden" name="id" value="' . $setList[$i] . '" />
              <input type="submit" name="edit" value="Edit" />
            </div>
          </td>
          </form>
          <form method="post">
          <td align="center" width="5%">
            <div class="submit">
              <input type="hidden" name="id" value="' . $setList[$i] . '" />
              <input type="submit" name="delete" value="Delete" />
            </div>
          </td>
          </form>
        </tr>
        ';
        }
        $post_table = '</table>';
        if ($sumaPlikow > '10') {
            $subPagesCount = $sumaPlikow / 10 + 1;
            $subPages = '<div style="font-size: 18px; width: 750px; margin-top: 4px;">Subpage: ';
            $lamanie = 1;
            $page = isset($_GET['start']) ? ($_GET['start'] + 9) / 10 : 1;
            for ($i = 1; $i < $subPagesCount; $i++) {
                if ($i == $page) {
                    $subPages .= "<span style=\"font-size: 20px; font-weight: bold;\"";
                }
                $subPages .= "<a href=\"./admin.php?start={$lamanie}\">{$i}</a> ";
                if ($i == $page) {
                    $subPages .= "</span>";
                }
                $lamanie = $lamanie + 10;
            }
            $subPages .= '</div>';
        } else {
            $subPages = '<P>';
        }
        $table = $pre_table . $mid_table . $post_table . $subPages;
    } else {
        $table = "<center>No shortcuts set!</center>";
    }
    return $table;
}
Esempio n. 12
0
/**
 * 删除目录下文件
 * @param unknown $dir
 */
function delDirFile($dir)
{
    $arrFiles = dirList($dir, 'files');
    foreach ($arrFiles as $item) {
        unlink($dir . '/' . $item);
    }
}
Esempio n. 13
0
function deleteCompleteCache()
{
    $files = dirList(getcwd() . '/cache/');
    foreach ($files as $key => $value) {
        unlink($value);
        // file deleted!
    }
}
Esempio n. 14
0
<?php

//**********************************************
// Establece la Conexion con la Base de Datos
//**********************************************
$_SESSION['domain'] = 'update';
require "../../../cgi_bin/phpFun.php";
$dbDomains = dirList('../db/domains/*.db3');
foreach ($dbDomains as $db) {
    echo $db . '<br>' . realpath('../db/bak/') . '/' . $db . '<hr>';
    rename(realpath('../db/domains/') . '/' . $db, realpath('../../db/bak/') . '/' . $db);
    copy(realpath('master.db3'), realpath('../db/domains/') . '/' . $db);
    $path = 'sqlite:' . realpath('../db/bak/' . $db);
    $origen = new PDO($path);
    $origen->exec("ATTACH '../db/domains/{$db}' as destino");
    $strsql = "select name from main.sqlite_master where type='table'";
    $tables = $origen->query($strsql);
    while ($table = $tables->fetch()) {
        $fields = getFields($origen, $table['name']);
        if ($fields > '0') {
            $strsql = 'INSERT INTO destino.' . $table['name'] . ' (' . $fields . ') SELECT ' . $fields . ' FROM main.' . $table['name'];
            $result = $origen->exec($strsql);
            echo $table['name'] . '<br>' . $strsql . '<br>';
            var_dump($result);
            echo '<br>';
        }
    }
}
function getFields($db, $table)
{
    $fieldsOrigen = getColumnNames($db, $table, 'main');
Esempio n. 15
0
<?php

$images = "./";
$graph_count = 0;
$columnCount = 3;
$graphs_arr[$graph_count++] = array("protocol-daily", "graph_protocol_daily", 'Most Attacked Protocol (Daily)');
$graphs_arr[$graph_count++] = array("srcip-daily", "graph_srcip_daily", 'Most Attacked Source IP address (Daily)');
$graphs_arr[$graph_count++] = array("destip-daily", "graph_destip_daily", 'Most Attacked Destination IP address (Daily)');
$graphs_arr[$graph_count++] = array("destport-daily", "graph_destport_daily", 'Most Attacked Destination Port (Daily)');
$graphs_arr[$graph_count++] = array("service-daily", "graph_service_daily", 'Most Attacked Service IP address (Daily)');
$graphs_arr[$graph_count++] = array("protocol-hourly", "graph_protocol_hourly", 'Most Attacked Protocol (Hourly)');
$graphs_arr[$graph_count++] = array("srcip-hourly", "graph_srcip_hourly", 'Most Attacked Source IP address (Hourly)');
$graphs_arr[$graph_count++] = array("destip-hourly", "graph_destip_hourly", 'Most Attacked Destination IP address (Hourly)');
$graphs_arr[$graph_count++] = array("destport-hourly", "graph_destport_hourly", 'Most Attacked Destination Port (Hourly)');
$graphs_arr[$graph_count++] = array("service-hourly", "graph_service_hourly", 'Most Attacked Service IP address (Hourly)');
$files_orig = dirList($images);
$files = array_reverse($files_orig);
$selectBoxes = "";
for ($i = 0; $i < $graph_count; $i++) {
    $selectBoxes[$i] = createSelectBox($files, $graphs_arr[$i][0], $graphs_arr[$i][1]);
}
$html_code = '<html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9"/></head><title>KOVAN Stats</title><body>';
$html_code .= '<div class="title">KOVAN Stats</div>';
$html_code .= '<table BORDER=1>';
for ($i = 0; $i < $graph_count; $i++) {
    if ($i % $columnCount == 0) {
        $html_code .= '<tr>';
    }
    $definition = $graphs_arr[$i][2];
    $html_code .= "<td>{$definition} {$selectBoxes[$i]}</td>";
    if ($i + 1 % $columnCount == 0) {
Esempio n. 16
0
<?php

require "../../cgi_bin/phpFun.php";
require "../ap/languages/language.php";
if ($_SESSION['domain'] != 'admin') {
    header('Location: destroy.php');
}
if (isset($_REQUEST['info'])) {
    phpinfo();
    exit;
}
$dbDomains = dirList('../db/domains/*.db3');
asort($dbDomains);
$dbTemplates = dirList('../db/templates/*.db3');
$resultsShow = '';
//-------------------------------------------------
// Main
//-------------------------------------------------
if (isset($_POST['dbName']) && isset($_POST['dbTemplate'])) {
    if ($_POST['dbName'] > '0' && $_POST['dbTemplate'] > '0' && strtolower($_POST['dbName']) != 'admin') {
        if (!file_exists('../db/domains/' . $_POST['dbName'] . '.db3')) {
            copy('../db/templates/' . $_POST['dbTemplate'], '../db/domains/' . $_POST['dbName'] . '.db3');
            header('Location: login.php?user='******'dbName'] . '\\admin&pass=admin');
            exit;
        }
    }
}
if (isset($_POST['Update'])) {
}
if (isset($_POST['Go']) && $_POST['sqlQuery']) {
    $strsql = $_POST['sqlQuery'];
Esempio n. 17
0
function dirList($path)
{
    $arr = scandir($path);
    foreach ($arr as $file) {
        if ($file != '.' && $file != '..') {
            $pathNext = $path . '/' . $file;
            echo $pathNext;
            if (is_dir($pathNext)) {
                dirList($pathNext);
            } else {
                echo '<p>' . $pathNext . '</p>';
            }
        }
    }
}
Esempio n. 18
0
<?php

$baseurl = substr($_SERVER["SCRIPT_URI"], 0, strripos($_SERVER["SCRIPT_URI"], "/") + 1);
$basedir = substr($_SERVER["SCRIPT_FILENAME"], 0, strripos($_SERVER["SCRIPT_FILENAME"], "/") + 1);
$tracks = dirList($basedir . ".");
/* We very strongly recommend using the central GenomeView release. 
 * This version is always up to date and is distributed through the
 * global Sourceforge download mirror network */
$starturl = 'http://genomeview.org/start/snapshot.jnlp?--config ' . $baseurl . 'genomeview.txt';
$all = "";
foreach ($tracks as $track) {
    $all .= " " . $baseurl . $track;
}
echo $all;
$starturl .= $all;
header("Location: {$starturl}");
function endsWith($str, $sub)
{
    return substr($str, strlen($str) - strlen($sub)) == $sub;
}
function dirList($directory)
{
    // create an array to hold directory list
    $results = array();
    // create a handler for the directory
    $handler = opendir($directory);
    // keep going until all files in directory have been read
    while ($file = readdir($handler)) {
        /* 
         * Files that will be excluded:
         * this directory (.) and the parent (..) 
Esempio n. 19
0
function dirList($dir, $exc = NULL)
{
    static $alldirs;
    $dirs = glob($dir . '*', GLOB_ONLYDIR);
    foreach ($dirs as $dirname) {
        // Проверка на исключения
        $match = false;
        $arrdir = explode('/', $dirname);
        foreach ($exc as $exception) {
            if ($arrdir[0] == $exception) {
                $match = 1;
            }
        }
        if (!$match) {
            $dirname = $dirname . '/';
            $alldirs[] = $dirname;
            dirList($dirname, $exc);
        }
    }
    return $alldirs;
}