Ejemplo n.º 1
0
function getDirList($dirName)
{
    global $directory_array, $sub_dir_files;
    // add directory name to the sub_dir_files list;
    $sub_dir_files[] = $dirName;
    $d = @dir($dirName);
    $file_extension = '.php';
    if ($d) {
        while ($entry = $d->read()) {
            if ($entry != "." && $entry != "..") {
                if (is_dir($dirName . "/" . $entry)) {
                    if ($entry == 'CVS' || $entry == '.svn') {
                        // skip
                    } else {
                        getDirList($dirName . "/" . $entry);
                    }
                } else {
                    if (substr($entry, strrpos($entry, '.')) == $file_extension) {
                        //echo 'I AM HERE 2 ' . $dirName."/".$entry . '<br>';
                        //            $directory_array[] .= $dirName."/".$entry;
                    } else {
                        //echo 'I AM HERE 3 ' . $dirName."/".$entry . '<br>';
                    }
                }
            }
        }
        $d->close();
    }
    return $sub_dir_files;
}
Ejemplo n.º 2
0
function getDirList($dirName, $filetypes = 1)
{
    global $directory_array, $sub_dir_files;
    // add directory name to the sub_dir_files list;
    $sub_dir_files[] = $dirName;
    $d = @dir($dirName);
    $file_extension = '.php';
    if ($d) {
        while ($entry = $d->read()) {
            if ($entry != "." && $entry != "..") {
                if (is_dir($dirName . "/" . $entry)) {
                    if ($entry == 'CVS') {
                        // skip
                    } else {
                        getDirList($dirName . "/" . $entry);
                    }
                } else {
                    if (preg_match('/\\' . $file_extension . '$/', $entry) > 0) {
                        //echo 'I AM HERE 2 ' . $dirName."/".$entry . '<br>';
                        //            $directory_array[] .= $dirName."/".$entry;
                    } else {
                        //echo 'I AM HERE 3 ' . $dirName."/".$entry . '<br>';
                    }
                }
            }
        }
        $d->close();
        unset($d);
    }
    return $sub_dir_files;
}
function getDirList($dirName)
{
    global $i;
    $d = dir($dirName);
    while ($entry = $d->read()) {
        if ($entry != "." && $entry != "..") {
            if (is_dir($dirName . "/" . $entry)) {
                getDirList($dirName . "/" . $entry);
            } elseif (substr($entry, -9) == '.lang.php') {
                include $dirName . "/" . $entry;
                if (isset($mod_strings)) {
                    update_override($dirName . '/' . $entry, $mod_strings, 'mod_strings');
                }
            }
        }
    }
    $d->close();
}
Ejemplo n.º 4
0
function printTorrents()
{
    echo "\n";
    echo "----------------------------------------\n";
    echo "          TorrentFlux-Torrents          \n";
    echo "----------------------------------------\n";
    echo "\n";
    global $cfg;
    $torrents = getTorrentListFromFS();
    foreach ($torrents as $torrent) {
        echo ' - ' . $torrent;
        if (isTorrentRunning($torrent)) {
            echo " (running)";
        }
        echo "\n";
    }
    echo "\n";
    define("_DOWNLOADSPEED", "Download Speed");
    define("_UPLOADSPEED", "Upload Speed");
    $dirList = @getDirList($cfg["torrent_file_path"]);
    if (!array_key_exists("total_download", $cfg)) {
        $cfg["total_download"] = 0;
    }
    if (!array_key_exists("total_upload", $cfg)) {
        $cfg["total_upload"] = 0;
    }
    $sumMaxUpRate = getSumMaxUpRate();
    $sumMaxDownRate = getSumMaxDownRate();
    $sumMaxRate = $sumMaxUpRate + $sumMaxDownRate;
    echo _DOWNLOADSPEED . "\t" . ': ' . number_format($cfg["total_download"], 2) . ' (' . number_format($sumMaxDownRate, 2) . ') kB/s' . "\n";
    echo _UPLOADSPEED . "\t" . ': ' . number_format($cfg["total_upload"], 2) . ' (' . number_format($sumMaxUpRate, 2) . ') kB/s' . "\n";
    echo _TOTALSPEED . "\t" . ': ' . number_format($cfg["total_download"] + $cfg["total_upload"], 2) . ' (' . number_format($sumMaxRate, 2) . ') kB/s' . "\n";
    echo _ID_CONNECTIONS . "\t" . ': ' . netstatConnectionsSum() . ' (' . getSumMaxCons() . ')' . "\n";
    echo "\n";
}
Ejemplo n.º 5
0
function getModuleNameList()
{
    $ignoreList = array("Common", "Runtime", "TPH");
    $allFileList = getDirList(APP_PATH);
    return array_diff($allFileList, $ignoreList);
}
Ejemplo n.º 6
0
     $min = getRequestVar('min');
     if (empty($min)) {
         $min = 0;
     }
     $user_id = getRequestVar('user_id');
     $srchFile = getRequestVar('srchFile');
     $srchAction = getRequestVar('srchAction');
     showUserActivity($min, $user_id, $srchFile, $srchAction);
     break;
     //XFER
 //XFER
 case "xfer":
     DisplayHead(_XFER);
     displayMenu();
     if ($cfg['enable_xfer'] == 1) {
         getDirList($cfg["torrent_file_path"], 0);
         displayXfer();
     }
     DisplayFoot(true, true);
     break;
 case "backupDatabase":
     backupDatabase();
     break;
 case "editRSS":
     editRSS();
     break;
 case "addRSS":
     $newRSS = getRequestVar('newRSS');
     addRSS($newRSS);
     break;
 case "deleteRSS":
Ejemplo n.º 7
0
 * @author      Haruki Setoyama  <*****@*****.**>
 * @author      Kazumi Ono <*****@*****.**>
 * @author      Skalpa Keo <*****@*****.**>
 * @author      Taiwen Jiang <*****@*****.**>
 * @author      DuGris <*****@*****.**>
 * @author      DuGris (aka L. JEN) <*****@*****.**>
 * @version     $Id: page_langselect.php 2822 2009-02-20 08:50:48Z phppp $
**/
require_once './include/common.inc.php';
if (!defined('XOOPS_INSTALL')) {
    die('XOOPS Installation wizard die');
}
setcookie('xo_install_lang', 'english', null, null, null);
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_REQUEST['lang'])) {
    $lang = $_REQUEST['lang'];
    setcookie('xo_install_lang', $lang, null, null, null);
    $wizard->redirectToPage('+1');
    exit;
}
$_SESSION['settings'] = array();
setcookie('xo_install_user', '', null, null, null);
$pageHasForm = true;
$title = LANGUAGE_SELECTION;
$content = '<select name="lang" size="10" style="min-width: 10em">';
$languages = getDirList("./language/");
foreach ($languages as $lang) {
    $sel = $lang == $wizard->language ? ' selected="selected"' : '';
    $content .= "<option value=\"{$lang}\"{$sel}>{$lang}</option>\n";
}
$content .= "</select>";
include './include/install_tpl.php';
Ejemplo n.º 8
0
}
function getDirList()
{
    $output = trim(shell_exec("ls -rs /data/doxygen | grep CMSSW | awk -F \" \" '{print \$2}'"));
    $arr = explode("\n", $output);
    foreach ($arr as $file) {
        if (strpos($file, "CMSSW") === 0) {
            $version = explode("_", $file);
            $version_list[$version[1]][$version[2]][$version[3]][] = $file;
        }
    }
    return $version_list;
}
$BASE = "http://cmssdt.cern.ch/SDT/doxygen/";
//$level1 = getDirectoryList("/data/sdt/SDT/doxygen");
$level1 = getDirList();
krsort($level1);
while (list($key1, $level2) = each($level1)) {
    krsort($level2);
    while (list($key2, $level3) = each($level2)) {
        krsort($level3);
        echo "<hr><div class=\"roundbox\"><b>CMSSW_" . $key1 . "_" . $key2 . "_* </b></div>";
        while (list($key3, $values) = each($level3)) {
            echo "<div class=\"tabs\" style=\"margin-left:150px; width:auto\"><ul class=\"tablist\" style=\"margin:0px;\">";
            sort($values);
            while (list($key, $value) = each($values)) {
                echo "<li><a target=\"_blank\" href=" . $BASE . $value . "/doc/html>" . $value . "</a></li> ";
            }
            echo "</ul></div>";
        }
    }
Ejemplo n.º 9
0
    $op = $_POST['op'];
} elseif (!empty($_GET['op'])) {
    $op = $_GET['op'];
} else {
    $op = '';
}
///// main
switch ($op) {
    default:
    case "langselect":
        $title = _INSTALL_L0;
        if (!defined('_INSTALL_L128')) {
            define('_INSTALL_L128', 'Choose language to be used for the installation process');
        }
        $content = "<p>" . _INSTALL_L128 . "</p>" . "<select name='lang'>";
        $langarr = getDirList("./language/");
        foreach ($langarr as $lang) {
            $content .= "<option value='" . $lang . "'";
            if (strtolower($lang) == $language) {
                $content .= ' selected="selected"';
            }
            $content .= ">" . $lang . "</option>";
        }
        $content .= "</select>";
        $b_next = array('start', _INSTALL_L80);
        include 'install_tpl.php';
        break;
    case "start":
        $title = _INSTALL_L0;
        $content = "<table width='80%' align='center'><tr><td align='left'>\n";
        include './language/' . $language . '/welcome.php';
Ejemplo n.º 10
0
function buildBinary($app, $crypt, $clearMz, $randBin)
{
    $platforms = @explode(',', $GLOBALS['config'][$app . '_platforms']);
    if (!is_array($platforms) || count($platforms) == 0) {
        fatalError('Platforms not defined.');
    }
    $r = 0;
    foreach ($platforms as $pf) {
        $pf = strtolower(trim($pf));
        if (!isset($GLOBALS['commandLineOptions'][$app][$pf])) {
            fatalError('Platform "' . $pf . '" not supported.');
        }
        $opts = $GLOBALS['commandLineOptions'][$app][$pf];
        $dirTmp = $GLOBALS['dir']['temp'] . '\\' . $app . '\\' . $pf;
        $dirOutput = $GLOBALS['dir']['output'][$app];
        $dirSource = $GLOBALS['dir']['source'][$app];
        //Сборка PHP.
        if ($pf == 'php') {
            createSubDir($dirTmp);
            $dirSource .= '[php]';
            $dirOutput .= '[php]';
            $list = getDirList($dirSource, $opts['include_files'], false);
            if (count($list) == 0) {
                fatalError('Failed to find source files.');
            }
            foreach ($list as $f) {
                if (!fileInList($opts['exclude_files'], $f = substr($f, strlen($dirSource) + 1))) {
                    $allowPP = !fileInList($opts['exclude_pp_files'], $f);
                    $fileSource = $dirSource . '\\' . $f;
                    $fileOutput = $dirOutput . '\\' . $f;
                    createSubDir(dirname($fileOutput));
                    if (fileInList($opts['php_files'], $f)) {
                        $fileTmp = $dirTmp . '\\' . basename($f);
                        evalPhpTemplate($fileSource, $fileTmp);
                        if ($allowPP && $crypt > 0 && filesize($fileTmp) > 0) {
                            writeLn("......encrypting - {$fileTmp} => {$fileOutput}");
                            passthru(replaceVarables(array('%OUTPUT%' => $fileOutput, '%SOURCE%' => $fileTmp), $GLOBALS['commandLine']['protect']['php']), $r);
                            if ($r != 0) {
                                die(1);
                            }
                        } else {
                            copyFile($fileTmp, $fileOutput);
                        }
                    } else {
                        copyFile($fileSource, $fileOutput);
                    }
                }
            }
        } else {
            createSubDir($dirTmp);
            createSubDir($dirOutput);
            $listCpp = array('*.cpp', '*.c');
            $listRc = array('*.rc');
            $listObj = array('*.obj', '*.res', '*.o');
            //Сборка objects.
            writeLn('[' . $pf . "] Compiling...\r\n");
            $list = getDirList($dirSource, $listCpp, true);
            if (count($list) == 0) {
                fatalError('Failed to find source files.');
            }
            if (!isset($opts['cpp_options'])) {
                fatalError('cpp_options no defined.');
            }
            passthru(replaceVarables(array('%TEMP%' => $dirTmp, '%OPTIONS%' => $opts['cpp_options'], '%SOURCE%' => implode(' ', $list)), $GLOBALS['commandLine']['cpp'][$pf]), $r);
            if ($r != 0) {
                die(1);
            }
            writeLn('');
            //Сборка ресурсов.
            $list = getDirList($dirSource, $listRc, false);
            if (count($list) != 0) {
                foreach ($list as $k => $v) {
                    if (!isset($opts['res_options'])) {
                        fatalError('res_options no defined.');
                    }
                    passthru(replaceVarables(array('%OUTPUT%' => $dirTmp . '\\' . $k . '.res', '%OPTIONS%' => $opts['res_options'], '%SOURCE%' => $v), $GLOBALS['commandLine']['res'][$pf]), $r);
                    if ($r != 0) {
                        die(1);
                    }
                    writeLn('');
                }
            }
            //Сборка bin
            writeLn('[' . $pf . "] Linking...\r\n");
            $list = getDirList($dirTmp, $listObj, true);
            if (count($list) == 0) {
                fatalError('Failed to find object files.');
            }
            if ($randBin) {
                shuffle($list);
            }
            if (!isset($opts['lnk_options'])) {
                fatalError('cpp_options no defined.');
            }
            $fileBin = $dirOutput . '\\' . $opts['name'];
            $fileMap = $dirTmp . '\\' . $app . '.map';
            $fileDef = $dirSource . '\\' . $app . '.def';
            passthru(replaceVarables(array('%TEMP%' => $dirTmp, '%OPTIONS%' => (file_exists($fileDef) ? "/DEF:\"{$fileDef}\" " : "") . $opts['lnk_options'], '%MAPFILE%' => $fileMap, '%OUTPUT%' => $fileBin, '%SUBSYS%' => $opts['subsys'], '%SOURCE%' => implode(' ', $list)), $GLOBALS['commandLine']['link'][$pf]), $r);
            if ($r != 0) {
                die(1);
            }
            writeLn('');
            //Вызов функции предварительной обработки.
            if ($crypt > 0) {
                $functionName = "{$app}BeforeCrypt";
                if (@function_exists($functionName)) {
                    call_user_func($functionName, $fileBin, $app, $pf);
                }
            }
            if ($crypt == 1 && isset($GLOBALS['commandLine']['pack'][$pf])) {
                writeLn("\r\n[" . $pf . "] Compressing...\r\n");
                passthru(replaceVarables(array('%SOURCE%' => $dirOutput . '\\' . $opts['name']), $GLOBALS['commandLine']['pack'][$pf]), $r);
                if ($r != 0) {
                    die(1);
                }
                writeLn('');
            }
            if ($clearMz > 0) {
                writeLn('[' . $pf . "] Clearing DOS Header...\r\n");
                if (($fc = @file_get_contents($fileBin)) === false || strlen($fc) < 1024 || count($v = unpack('L', substr($fc, 0x3c, 4))) !== 1 || $v[1] === 0) {
                    fatalError('Failed to clear DOS Header in PE file "' . $fc . '".');
                }
                $v = $v[1];
                for ($i = 2; $i < 0x3c; $i++) {
                    $fc[$i] = "";
                }
                for ($i = 0x40; $i < $v; $i++) {
                    $fc[$i] = "";
                }
                writeFile($fileBin, $fc);
            }
        }
    }
    return $platforms;
}
Ejemplo n.º 11
0
/*************************************************************
*  TorrentFlux xfer Statistics hack
*  blackwidow - matt@mattjanssen.net
**************************************************************/
/*
    TorrentFlux xfer Statistics hack is free code; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
*/
include_once 'config.php';
include_once 'functions.php';
DisplayHead(_XFER);
if ($cfg['enable_xfer'] == 1) {
    $cfg['xfer_realtime'] = 1;
    getDirList($cfg['torrent_file_path']);
    echo '<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>';
    if ($cfg['xfer_day']) {
        echo displayXferBar($cfg['xfer_day'], $xfer_total['day']['total'], _XFERTHRU . ' Today:');
    }
    if ($cfg['xfer_week']) {
        echo displayXferBar($cfg['xfer_week'], $xfer_total['week']['total'], _XFERTHRU . ' ' . $cfg['week_start'] . ':');
    }
    $monthStart = strtotime(date('Y-m-') . $cfg['month_start']);
    $monthText = date('j') < $cfg['month_start'] ? date('M�j', strtotime('-1 Day', $monthStart)) : date('M�j', strtotime('+1 Month -1 Day', $monthStart));
    if ($cfg['xfer_month']) {
        echo displayXferBar($cfg['xfer_month'], $xfer_total['month']['total'], _XFERTHRU . ' ' . $monthText . ':');
    }
    if ($cfg['xfer_total']) {
        echo displayXferBar($cfg['xfer_total'], $xfer_total['total']['total'], _TOTALXFER . ':');
    }
 of the License, or (at your option) any later version.

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

 To read the license please visit http://www.gnu.org/copyleft/gpl.html

*******************************************************************************/
if (!isset($_SESSION['user'])) {
    header('location: login.php');
    exit;
}
// =============================================================================
$transferList = getDirList($cfg["torrent_file_path"]);
// =============================================================================
// OUTPUT
// =============================================================================
?>
<html>
<head>
	<title><?php 
echo $cfg["pagetitle"];
?>
</title>
	<link rel="icon" href="images/favicon.ico" type="image/x-icon" />
	<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
	<LINK REL="StyleSheet" HREF="themes/<?php 
echo $cfg["theme"];
?>
Ejemplo n.º 13
0
<?php

// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(__FILE__);
_setTitle($langArray['template']);
$arr = getDirList(ROOT_PATH . "/templates/home");
abr("templates", $arr);
$template = $meta["template"];
abr("template", $template);
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
Ejemplo n.º 14
0
function dirlist($dir)
{
    getDirList($dir);
}
Ejemplo n.º 15
0
echo $htmlpath;
?>
</td>
                      <td><b>
                        <?php 
echo $command;
?>
                      </b></td>
                    </tr>
					<tr align="left">
					   <td colspan="2"  height="1"></td>
					</tr>
					<?php 
if (is_dir("../admin/purgedtickets/attachments")) {
    $htmlpath = htmlpath("../admin/purgedtickets/attachments");
    $wr = getDirList("../admin/purgedtickets/attachments", 0);
    if ($wr == TEXT_WRITE_PERMISSION_AVAILABLE) {
        $style = "listingmaintext";
        $command = TEXT_NO_ACTION;
        $num++;
    } else {
        $style = "redlistingmaintext";
        $command = TEXT_ENABLE_WRITE_PERMISSION;
    }
} else {
    $command = "";
    $style = "redlistingmaintext";
    $htmlpath = "yourinstalldirectory/admin/purgedtickets/attachments missing";
}
?>
						<tr class="<?php 
Ejemplo n.º 16
0
								 <td width="26%" ><?php 
echo htmlpath("./purgedtickets");
?>
</td>
								 <td width="27%" ><?php 
echo $current;
?>
</td>
								 <td width="25%" ><?php 
echo $recom;
?>
</td>							 
							   </tr>	
   							   <tr class="listingmaintext">
							    <?php 
$wr = getDirList("./purgedtickets/attachments");
if ($wr == TEXT_WRITE_PERMISSION_AVAILABLE) {
    $current = $wr;
    $recom = "&nbsp;";
} else {
    $current = TEXT_WRITE_PERMISSION_UNAVAILABLE;
    $recom = $wr;
}
?>
							     <td width="22%" ><?php 
echo TEXT_PURGED_ATTACHMENTS;
?>
</td>
								 <td width="26%" ><?php 
echo htmlpath("./purgedtickets/attachments");
?>
Ejemplo n.º 17
0
 * @author      Skalpa Keo <*****@*****.**>
 * @author      Taiwen Jiang <*****@*****.**>
 * @author      DuGris <*****@*****.**>
 * @author      DuGris (aka L. JEN) <*****@*****.**>
 * @version     $Id$
 */
require_once __DIR__ . '/include/common.inc.php';
/* @var $wizard XoopsInstallWizard */
$wizard = $_SESSION['wizard'];
$_SESSION['settings'] = array();
setcookie('xo_install_lang', 'en_US', null, null, null);
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_REQUEST['lang'])) {
    $lang = $_REQUEST['lang'];
    setcookie('xo_install_lang', $lang, null, null, null);
    $wizard->redirectToPage('+1');
    exit;
}
$_SESSION['settings'] = array();
setcookie('xo_install_user', '', null, null, null);
//$title = LANGUAGE_SELECTION;
$content = '<div class="languages">';
$languages = getDirList("./locale/");
foreach ($languages as $lang) {
    $sel = $lang == $wizard->language ? ' checked="checked"' : '';
    $content .= "<label><input type=\"radio\" name=\"lang\" value=\"{$lang}\"{$sel} />{$lang}</label>\n";
}
$content .= "</div>";
$_SESSION['pageHasHelp'] = false;
$_SESSION['pageHasForm'] = true;
$_SESSION['content'] = $content;
include XOOPS_INSTALL_PATH . '/include/install_tpl.php';
Ejemplo n.º 18
0
<?php

// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(__FILE__);
_setTitle($langArray['template']);
$arr = getDirList(ROOT_PATH . "/templates/admin");
abr("templates", $arr);
$template = $meta["admin_template"];
abr("template", $template);
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
Ejemplo n.º 19
0
<?php

/**
 *
 * @package Legacy
 * @version $Id: install_langselect.inc.php,v 1.3 2008/09/25 15:12:33 kilica Exp $
 * @copyright Copyright 2005-2007 XOOPS Cube Project  <https://github.com/xoopscube/legacy>
 * @license https://github.com/xoopscube/legacy/blob/master/docs/GPL_V2.txt GNU GENERAL PUBLIC LICENSE Version 2
 *
 */
if (!defined('_INSTALL_L128')) {
    define('_INSTALL_L128', 'Choose language to be used for the installation process');
}
$langarr = getDirList('./language/');
$php54 = version_compare(PHP_VERSION, '5.4.0') >= 0;
foreach ($langarr as $lang) {
    if ($php54 && $lang !== 'english' && substr($lang, -5) !== '_utf8') {
        continue;
    }
    $wizard->addArray('languages', $lang);
    if (strtolower($lang) == $language) {
        $wizard->addArray('selected', 'selected="selected"');
    } else {
        $wizard->addArray('selected', '');
    }
}
$wizard->render('install_langselect.tpl.php');
Ejemplo n.º 20
0
/**
 * Upgrader check version file
 *
 * See the enclosed file license.txt for licensing information.
 * If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html
 *
 * @copyright   The XOOPS project http://www.xoops.org/
 * @license     http://www.fsf.org/copyleft/gpl.html GNU General Public License (GPL)
 * @package     upgrader
 * @since       2.0.13
 * @author      Skalpa Keo <*****@*****.**>
 * @author      Taiwen Jiang <*****@*****.**>
 * @version     $Id$
 */
defined('XOOPS_ROOT_PATH') or die;
$dirs = getDirList(".");
$results = array();
$files = array();
$needUpgrade = false;
$_SESSION['xoops_upgrade'] = array();
foreach ($dirs as $dir) {
    if (strpos($dir, "-to-")) {
        $upgrader = (include_once "{$dir}/index.php");
        if (is_object($upgrader)) {
            if (!($results[$dir] = $upgrader->isApplied())) {
                $_SESSION['xoops_upgrade']['steps'][] = $dir;
                $needUpgrade = true;
                if (!empty($upgrader->usedFiles)) {
                    $files = array_merge($files, $upgrader->usedFiles);
                }
            }
Ejemplo n.º 21
0
function DirSelectOption($workdir, $selected, $path)
{
    global $xoopsConfig, $wfsConfig, $xoopsModule, $PHP_SELF, $workd;
    $filearray =& getDirList($workdir);
    echo "<select size='1' name='workd' onchange='location.href=\"" . $path . "?rootpath=\"+this.options[this.selectedIndex].value'>";
    echo "<option value=' '>------</option>";
    foreach ($filearray as $workd) {
        if ($workd === $selected) {
            $opt_selected = "selected";
        } else {
            $opt_selected = "";
        }
        echo "<option value='" . $workd . "' {$opt_selected}>" . basename($workd) . "</option>";
    }
    echo "</select>";
}
Ejemplo n.º 22
0
/**
 * Upgrader check version file
 *
 * See the enclosed file license.txt for licensing information.
 * If you did not receive this file, get it at http://www.gnu.org/licenses/gpl-2.0.html
 *
 * @copyright    (c) 2000-2016 XOOPS Project (www.xoops.org)
 * @license          GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package          upgrader
 * @since            2.0.13
 * @author           Skalpa Keo <*****@*****.**>
 * @author           Taiwen Jiang <*****@*****.**>
 * @version          $Id: check_version.php 13082 2015-06-06 21:59:41Z beckmi $
 */
defined('XOOPS_ROOT_PATH') or die;
$dirs = getDirList('.');
$results = array();
$files = array();
$needUpgrade = false;
$_SESSION['xoops_upgrade'] = array();
foreach ($dirs as $dir) {
    if (strpos($dir, '-to-')) {
        $upgrader = (include_once "{$dir}/index.php");
        if (is_object($upgrader)) {
            if (!($results[$dir] = $upgrader->isApplied())) {
                $_SESSION['xoops_upgrade']['steps'][] = $dir;
                $needUpgrade = true;
                if (!empty($upgrader->usedFiles)) {
                    $files = array_merge($files, $upgrader->usedFiles);
                }
            }
Ejemplo n.º 23
0
 if (file_exists(XOOPS_ROOT_PATH . "/language/" . $xoopsConfig['language'] . "/global.php")) {
     include_once XOOPS_ROOT_PATH . "/language/" . $xoopsConfig['language'] . "/global.php";
 } else {
     include_once XOOPS_ROOT_PATH . "/language/english/global.php";
 }
 if (file_exists("../modules/system/language/" . $xoopsConfig['language'] . "/admin/modulesadmin.php")) {
     include_once "../modules/system/language/" . $xoopsConfig['language'] . "/admin/modulesadmin.php";
 } else {
     include_once "../modules/system/language/english/admin/modulesadmin.php";
 }
 $module_handler =& xoops_gethandler('module');
 $title = _INSTALL_L49;
 $content = "<table width='80%' align='center'>\n";
 $modules_dir = XOOPS_ROOT_PATH . "/modules/";
 $count = 0;
 $modlist = getDirList($modules_dir);
 foreach ($modlist as $file) {
     if ($file != "system") {
         $module =& $module_handler->create();
         $module->loadInfo($file);
         if ($count % 2 == 0) {
             $class = 'even';
         } else {
             $class = 'odd';
         }
         $content .= '<tr class="' . $class . '">
         <td><input type="checkbox" name="modules[]" value="' . $module->getInfo('dirname') . '" /></td>
         <td align="center" valign="bottom"><img src="' . XOOPS_URL . '/modules/' . $module->getInfo('dirname') . '/' . $module->getInfo('image') . '" alt="' . htmlspecialchars($module->getInfo('name')) . '" border="0" /></td>
         <td>' . $module->getInfo('name') . '</td>
         <td align="center">' . round($module->getInfo('version'), 2) . '</td>';
         $content .= "</td><td>";
Ejemplo n.º 24
0
 * @license          GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package          installer
 * @since            2.3.0
 * @author           Haruki Setoyama  <*****@*****.**>
 * @author           Kazumi Ono <*****@*****.**>
 * @author           Skalpa Keo <*****@*****.**>
 * @author           Taiwen Jiang <*****@*****.**>
 * @author           DuGris <*****@*****.**>
 * @author           DuGris (aka L. JEN) <*****@*****.**>
 **/
require_once './include/common.inc.php';
defined('XOOPS_INSTALL') || die('XOOPS Installation wizard die');
setcookie('xo_install_lang', 'english', null, null, null);
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_REQUEST['lang'])) {
    $lang = $_REQUEST['lang'];
    setcookie('xo_install_lang', $lang, null, null, null);
    $wizard->redirectToPage('+1');
    exit;
}
$_SESSION['settings'] = array();
setcookie('xo_install_user', '', null, null, null);
$pageHasForm = true;
$title = LANGUAGE_SELECTION;
$content = '<select name="lang" size="10" style="min-width: 10em;">';
$languages = getDirList('./language/');
foreach ($languages as $lang) {
    $sel = $lang == $wizard->language ? ' selected' : '';
    $content .= "<option value=\"{$lang}\"{$sel}>{$lang}</option>\n";
}
$content .= '</select>';
include './include/install_tpl.php';
Ejemplo n.º 25
0
/*
 * parser Language
 */
$parser_flag = 0;
$wr = getDirList("../parser/languages/");
if ($wr == TEXT_WRITE_PERMISSION_AVAILABLE) {
    $current = $wr;
    $recom = "&nbsp;";
} else {
    $parser_flag = 1;
    $current = TEXT_WRITE_PERMISSION_UNAVAILABLE;
    $recom = $wr;
}
//-------------------
$user_flag = 0;
$wr = getDirList("../languages/");
if ($wr == TEXT_WRITE_PERMISSION_AVAILABLE) {
    $current = $wr;
    $recom = "&nbsp;";
} else {
    $user_flag = 1;
    $current = TEXT_WRITE_PERMISSION_UNAVAILABLE;
    $recom = $wr;
}
$addOredit = 'Add Language';
if ($_GET["id"] != "") {
    $var_id = $_GET["id"];
    $addOredit = 'Edit Language';
} elseif ($_POST["id"] != "") {
    $var_id = $_POST["id"];
    $addOredit = 'Edit Language';
Ejemplo n.º 26
0
function download($path = "")
{
    global $TmpUid;
    global $TmpCurrentDir;
    $files = getDirList($path);
    if (!$TmpUid) {
        $TmpUid = md5(uniqid() . date("H:i:s"));
    }
    if (!$TmpCurrentDir) {
        $TmpCurrentDir = "";
    }
    if (!file_exists(get('TmpPath'))) {
        echo 'TmpPath does not exist';
        exit;
    }
    $dirPath = get('TmpPath') . '/' . $TmpUid . '/';
    if (!file_exists($dirPath)) {
        mkdir($dirPath, 0777);
    }
    foreach ($files as $key => $value) {
        switch ($value['attrib']['kind']) {
            case 'dir':
                $TmpCurrentDir .= "/" . $value['name'];
                if (!file_exists($dirPath . ltrim($TmpCurrentDir, '/') . '/')) {
                    mkdir($dirPath . ltrim($TmpCurrentDir, '/') . '/', 0777);
                }
                download(getPath() . $TmpCurrentDir);
                $TmpCurrentDir = dirname($TmpCurrentDir);
                break;
            case 'file':
                $old_path = $_GET['path'];
                if (basename(getPath()) == $value['name']) {
                    setPath(getPath() . $TmpCurrentDir);
                } else {
                    setPath(getPath() . $TmpCurrentDir . "/" . $value['name']);
                }
                $file_content = getFile(true);
                if (!empty($file_content)) {
                    file_put_contents($dirPath . ltrim($TmpCurrentDir, '/') . '/' . $value['name'], $file_content);
                }
                revertPath();
                break;
            default:
                echo 'error';
                break;
        }
    }
    Zip($dirPath, get('TmpPath') . '/' . $TmpUid . '.zip');
    //rrmdir($dirPath);
    return $TmpUid;
}