Example #1
0
function installFMModule($module_name, $proto, $compress, $data, $server_location, $url)
{
    global $argv;
    extract($server_location);
    echo fM('  --> Detecting firewall...');
    $app = detectFWVersion(true);
    if ($app === null) {
        echo "failed\n\n";
        echo fM("Cannot find a supported firewall - please check the README document for supported firewalls.  Aborting.\n");
        exit(1);
    }
    extract($app);
    $data['server_type'] = $server['type'];
    if (versionCheck($app_version, $proto . '://' . $hostname . '/' . $path, $compress) == true) {
        echo 'ok (' . $server['type'] . ")\n";
    } else {
        echo "failed\n\n";
        echo $server['type'] . ' ' . $app_version . " is not supported.\n";
        exit(1);
    }
    $data['server_version'] = $app_version;
    $data['server_interfaces'] = implode(';', getInterfaceNames(PHP_OS));
    echo fM("\n  --> Detection complete.  Continuing installation.\n\n");
    /** Handle the update method */
    $data['server_update_method'] = processUpdateMethod($module_name, $update_method, $data, $url);
    $raw_data = getPostData(str_replace('genserial', 'addserial', $url), $data);
    $raw_data = $data['compress'] ? @unserialize(gzuncompress($raw_data)) : @unserialize($raw_data);
    return $data;
}
Example #2
0
function installFMModule($module_name, $proto, $compress, $data, $server_location, $url)
{
    global $argv;
    extract($server_location);
    echo fM('  --> Running version tests...');
    $app = detectDaemonVersion(true);
    if ($app === null) {
        echo "failed\n\n";
        echo fM("Cannot find a supported DNS server - please check the README document for supported DNS servers.  Aborting.\n");
        exit(1);
    }
    extract($app);
    $data['server_type'] = $server['type'];
    if (versionCheck($app_version, $proto . '://' . $hostname . '/' . $path, $compress) == true) {
        echo "ok\n";
    } else {
        echo "failed\n\n";
        echo "{$app_version} is not supported.\n";
        exit(1);
    }
    $data['server_version'] = $app_version;
    echo fM("\n  --> Tests complete.  Continuing installation.\n\n");
    /** Handle the update method */
    $data['server_update_method'] = processUpdateMethod($module_name, $update_method, $data, $url);
    $raw_data = getPostData(str_replace('genserial', 'addserial', $url), $data);
    $raw_data = $data['compress'] ? @unserialize(gzuncompress($raw_data)) : @unserialize($raw_data);
    return $data;
}
Example #3
0
function installFMModule($module_name, $proto, $compress, $data, $server_location, $url)
{
    global $argv;
    extract($server_location);
    echo fM('  --> Detecting firewall...');
    $app = detectFWVersion(true);
    if ($app === null) {
        echo "failed\n\n";
        echo fM("Cannot find a supported firewall - please check the README document for supported firewalls.  Aborting.\n");
        exit(1);
    }
    extract($app);
    $data['server_type'] = $server['type'];
    if (versionCheck($app_version, $proto . '://' . $hostname . '/' . $path, $compress) == true) {
        echo 'ok (' . $server['type'] . ")\n";
    } else {
        echo "failed\n\n";
        echo $server['type'] . ' ' . $app_version . " is not supported.\n";
        exit(1);
    }
    $data['server_version'] = $app_version;
    $data['server_interfaces'] = implode(';', getInterfaceNames(PHP_OS));
    echo fM("\n  --> Detection complete.  Continuing installation.\n\n");
    /** Update via cron or http/s? */
    $update_choices = array('c', 's', 'h');
    while (!isset($update_method)) {
        echo fM('Will ' . $data['server_name'] . ' get updates via cron, ssh, or http(s) [c|s|h]? ');
        $update_method = trim(strtolower(fgets(STDIN)));
        /** Must be a valid option */
        if (!in_array($update_method, $update_choices)) {
            unset($update_method);
        }
    }
    /** Handle the update method */
    $data['server_update_method'] = processUpdateMethod($module_name, $update_method, $data, $url);
    $raw_data = getPostData(str_replace('genserial', 'addserial', $url), $data);
    $raw_data = $data['compress'] ? @unserialize(gzuncompress($raw_data)) : @unserialize($raw_data);
    return $data;
}
Example #4
0
 if ($connection) {
     if (empty($_zp_conf_vars['mysql_database'])) {
         $connection = false;
         $connectDBErr = gettext('No database selected');
     }
 } else {
     $connectDBErr = db_error();
 }
 if ($_zp_DB_connection) {
     // connected to DB software
     $dbsoftware = db_software();
     $dbapp = $dbsoftware['application'];
     $dbversion = $dbsoftware['version'];
     $required = $dbsoftware['required'];
     $desired = $dbsoftware['desired'];
     $sqlv = versionCheck($required, $desired, $dbversion);
     $good = checkMark($sqlv, sprintf(gettext('%1$s version %2$s'), $dbapp, $dbversion), "", sprintf(gettext('%1$s Version %2$s or greater is required. Version %3$s or greater is preferred. Use a lower version at your own risk.'), $dbapp, $required, $desired), false) && $good;
 }
 primeMark(gettext('Database connection'));
 if ($cfg) {
     if ($adminstuff = !extension_loaded(strtolower($selected_database)) || !$connection) {
         if (is_writable(SERVERPATH . '/' . DATA_FOLDER . '/' . CONFIGFILE)) {
             $good = false;
             checkMark(false, '', gettext("Database credentials in configuration file"), sprintf(gettext('<em>%1$s</em> reported: %2$s'), DATABASE_SOFTWARE, $connectDBErr));
             // input form for the information
             include dirname(__FILE__) . '/setup-sqlform.php';
         } else {
             if ($connectDBErr) {
                 $msg = $connectDBErr;
             } else {
                 $msg = gettext("You have not correctly set your <strong>Database</strong> <code>user</code>, <code>password</code>, etc. in your configuration file and <strong>setup</strong> is not able to write to the file.");
Example #5
0
}
$mode = clean($_POST['mode']);
$key = clean($_POST['apikey']);
$ip = $_SERVER['REMOTE_ADDR'];
$version = clean($_POST['version']);
$now = time();
$debug = valid($_POST['debug']);
$online = clean($_POST['onlineMode']);
// Unused
$vars = print_r($_REQUEST, true);
$page = __FILE__;
mysql_query("INSERT INTO `log` (`ip`, `page`, `variables`) VALUES ('{$ip}', '{$page}', '{$vars}')") or die(mysql_error());
if (mysql_num_rows(mysql_query("SELECT id FROM `banned` WHERE `ip`='{$ip}'")) > 0) {
    die(json_encode(array("message" => "IP Ban", "status" => "ERROR", "ip" => $ip)));
}
if (!versionCheck($version)) {
    echo json_encode(array("message" => "Invalid Version", "status" => "ERROR", "sentVersion" => $version));
} else {
    if (!valid($mode)) {
        echo json_encode(array("message" => "Invalid Mode", "status" => "ERROR"));
    } else {
        if ($mode == "IMPORT_KEY") {
            $key = sha1("import" . time());
            if (!$debug) {
                mysql_query("INSERT INTO `import_keys` (`key`, `ip`) VALUES ('{$key}', '{$ip}')") or die(mysql_error());
            }
            die(json_encode(array("message" => $key, "status" => "OK")));
        }
        if ($mode == "SEND") {
            $pid = clean($_POST['pid']);
            $uid = clean($_POST['uid']);
Example #6
0
            }
        } else {
            return false;
        }
    }
    if (file_exists($lockfile) && filemtime($lockfile) < $expire) {
        unlink($lockfile);
    }
    if (file_get_contents($versionfile) != file_get_contents($lastestUrl)) {
        file_put_contents($lockfile, 'NEW');
        return true;
    }
    file_put_contents($lockfile, '.');
    return false;
}
$update_available = ALLOW_CHECK_UPDATE ? versionCheck() : false;
/**
*   RSS Feed
*   
**/
if (!file_exists(RESOURCES_FOLDER . 'rss.json')) {
    file_put_contents(RESOURCES_FOLDER . 'rss.json', '', LOCK_EX);
}
if (isset($_GET['rss'])) {
    displayXML();
    die;
}
/**
 * SVG
 **/
function check($folder)
function adminFuncSwitch()
{
    if (isset($_GET['action'])) {
        switch ($_GET['action']) {
            case "addpage":
                $pageAdded = addPage();
                if ($pageAdded) {
                    performEdit($pageAdded);
                }
                break;
            case "extlink":
                $xLinkAdded = addExtLink();
                if ($xLinkAdded) {
                    performEditLink($xLinkAdded);
                }
                break;
            case "addinfo":
                $pageAdded = addPage();
                if ($pageAdded) {
                    performEdit($pageAdded);
                }
                break;
            case 'delete':
                doDelete();
                break;
            case 'edit':
                performEdit();
                break;
            case 'editinfo':
                performEdit();
                break;
            case 'editextlink':
                performEditLink();
                break;
            case 'showpages':
                manageContent();
                break;
            case 'showcats':
                manageCats();
                break;
            case 'showinfobar':
                manageInfobar();
                break;
            case 'fileman':
                fileManager();
                break;
            case 'filemanview':
                fileManager();
                break;
            case 'backuptool':
                backupTool_settings();
                break;
            case 'reordercat':
                performMove();
                manageCats();
                break;
            case 'reorderinfo':
                performMove();
                manageInfobar();
                break;
            case 'blademan':
                if ($_SESSION['adminType'] != 'user') {
                    showBladePacks('system');
                }
                break;
            case 'bladesystem':
                if ($_SESSION['adminType'] != 'user') {
                    showBladePacks('system');
                }
                break;
            case 'bladetheme':
                if ($_SESSION['adminType'] != 'user') {
                    showBladePacks('theme');
                }
                break;
            case 'bladelanguage':
                if ($_SESSION['adminType'] != 'user') {
                    showBladePacks('language');
                }
                break;
            case 'bladeupgrade':
                if ($_SESSION['adminType'] != 'user') {
                    showBladePacks('upgrade');
                }
                break;
            case 'bladeinstall':
                if ($_SESSION['adminType'] != 'user') {
                    bladepackInstall();
                }
                break;
            case 'coresettings':
                if ($_SESSION['adminType'] != 'user') {
                    coreSettings();
                }
                break;
            case 'settingsman':
                if ($_SESSION['adminType'] != 'user') {
                    bladeSettings();
                }
                break;
            case 'usermanager':
                if ($_SESSION['adminType'] == 'admin') {
                    userManager('admin');
                } else {
                    userManager();
                }
                break;
            case 'userdata':
                userManager();
                break;
            case 'admindata':
                userManager('admin');
                break;
            case 'sadmindata':
                userManager('sadmin');
                break;
            case 'version':
                versionCheck();
                break;
            case 'helpinfo':
                helpAndInfo();
                break;
            case 'maintenance':
                maintenanceMode();
                break;
            default:
                $foundMenu = false;
                BsocketB('admin-page-select', array(&$foundMenu));
                if (!$foundMenu) {
                    versionCheck();
                }
        }
    } else {
        versionCheck();
    }
}
Example #8
0
function about()
{
    global $cfg;
    authenticate('access_always');
    // formattedNavigator
    /* $nav			= array();
    	$nav['name'][]	= 'About O!MPD'; */
    $cfg['menu'] = 'about';
    require_once 'include/header.inc.php';
    ?>
<table cellspacing="0" cellpadding="0" class="border">
<tr class="header header_bigger">
	<td class="space"></td>
	<td colspan="3" style="white-space: normal;">
	O!MPD&nbsp;<?php 
    echo html(NJB_VERSION);
    ?>
,&nbsp;Copyright&nbsp;&copy;&nbsp;2015&nbsp;Artur&nbsp;Sier&#380;ant<br>
	
	</td>
	<td class="space"></td>
</tr>
<tr class="line"><td colspan="5"></td></tr>
<tr class="odd space"><td colspan="5"></td></tr>
<tr class="odd">
	<td></td>
	<td colspan="3">
	<i class="fa fa-globe"></i>&nbsp;&nbsp;<a href="http://www.ompd.pl">http://www.ompd.pl</a><br>
	<i class="fa fa-envelope-o"></i>&nbsp;&nbsp;<a href="mailto:info@ompd.pl">info@ompd.pl</a><br><br>
	This program comes with <a href="about.php?action=license#nowarranty">ABSOLUTELY NO WARRANTY</a>.<br>
	This is free software, and you are welcome to redistribute it<br>
	under certain <a href="about.php?action=license#conditions">conditions</a>.
	<br><br>
	O!MPD is fork of netjukebox&nbsp;Copyright&nbsp;&copy;&nbsp;2001-2012&nbsp;Willem&nbsp;Bartels <a href="http://www.netjukebox.nl/">http://www.netjukebox.nl</a>
	</td>
	<td></td>
</tr>
<tr class="odd space"><td colspan="5"></td></tr>
<?php 
    if (file_exists(NJB_HOME_DIR . 'skin/' . $cfg['skin'] . '/about.txt') && ($skin_message = @file_get_contents(NJB_HOME_DIR . 'skin/' . $cfg['skin'] . '/about.txt'))) {
        ?>
<tr class="line"><td colspan="5"></td></tr>
<tr class="header header_bigger">
	<td></td>
	<td colspan="3">Current skin:</td>
	<td></td>
</tr>
<tr class="line"><td colspan="5"></td></tr>
<tr class="odd space"><td colspan="5"></td></tr>
<tr class="odd">
	<td></td>
	<td colspan="3" valign="top"><?php 
        echo bbcode($skin_message);
        ?>
</td>
	<td></td>
</tr>
<tr class="odd space"><td colspan="5"></td></tr>
<?php 
    }
    if ($cfg['access_admin']) {
        $ttl = get('forceVersionCheck') == '1' ? 0 : 3600;
        ?>
<tr class="line"><td colspan="5"></td></tr>
<tr class="header header_bigger">
	<td></td>
	<td colspan="3">Version check:</td>
	<td></td>
</tr>
<tr class="line"><td colspan="5"></td></tr>
<tr class="<?php 
        echo versionCheck($ttl) ? 'odd_ok' : 'odd_error';
        ?>
">
	<td></td>
	<td>Current version:</td>
	<td></td>
	<td style="color: <?php 
        echo versionCheck($ttl) ? 'Green' : 'Red';
        ?>
"><?php 
        echo html(NJB_VERSION);
        ?>
</td>
	<td></td>
</tr>
<tr class="even">
	<td></td>
	<td>Latest version:</td>
	<td></td>
	<td><a href="about.php?forceVersionCheck=1" onMouseOver="return overlib('Re-Check version');" onMouseOut="return nd();"><?php 
        echo html($cfg['latest_version']);
        ?>
</a></td>
	<td></td>
</tr>
<?php 
    }
    $i = 0;
    ?>
<tr class="line"><td colspan="5"></td></tr>
<tr class="header header_bigger">
	<td></td>
	<td colspan="3">Included scripts, fonts and images:</td>
	<td></td>
</tr>
<tr class="line"><td colspan="5"></td></tr>
<tr class="<?php 
    echo $i++ & 1 ? 'even' : 'odd';
    ?>
">
	<td></td>
	<td>Google fonts</td>
	<td></td>
	<td><a href="http://www.google.com/fonts/" target="_new">http://www.google.com/fonts/</a></td>
	<td></td>
</tr>
<tr class="<?php 
    echo $i++ & 1 ? 'even' : 'odd';
    ?>
">
	<td></td>
	<td>Font Awesome</td>
	<td></td>
	<td><a href="http://fortawesome.github.io/Font-Awesome/" target="_new">http://fortawesome.github.io/Font-Awesome/</a></td>
	<td></td>
</tr>
<tr class="<?php 
    echo $i++ & 1 ? 'even' : 'odd';
    ?>
">
	<td></td>
	<td>Typicons</td>
	<td></td>
	<td><a href="http://typicons.com/" target="_new">http://typicons.com/</a></td>
	<td></td>
</tr>
<tr class="<?php 
    echo $i++ & 1 ? 'even' : 'odd';
    ?>
">
	<td></td>
	<td>jQuery</td>
	<td></td>
	<td><a href="http://jquery.com/" target="_new">http://jquery.com/</a></td>
	<td></td>
</tr>
<tr class="<?php 
    echo $i++ & 1 ? 'even' : 'odd';
    ?>
">
	<td></td>
	<td>spin.js</td>
	<td></td>
	<td><a href="http://fgnass.github.io/spin.js/" target="_new">http://fgnass.github.io/spin.js/</a></td>
	<td></td>
</tr>
<tr class="<?php 
    echo $i++ & 1 ? 'even' : 'odd';
    ?>
">
	<td></td>
	<td>getID3() <?php 
    $getID3 = new getID3();
    echo $getID3->version();
    ?>
</td>
	<td></td>
	<td><a href="http://www.getid3.org" target="_new">http://www.getid3.org</a></td>
	<td></td>
</tr>
<tr class="<?php 
    echo $i++ & 1 ? 'even' : 'odd';
    ?>
">
	<td></td>
	<td>overLIB <script type="text/javascript">
	<!--
		document.write(olInfo.version);
	//-->
	</script></td>
	<td></td>
	<td><a href="http://www.bosrup.com/web/overlib/" target="_new">http://www.bosrup.com/web/overlib/</a></td>
	<td></td>
</tr>
<tr class="<?php 
    echo $i++ & 1 ? 'even' : 'odd';
    ?>
">
	<td></td>
	<td>SHA-1</td>
	<td></td>
	<td><a href="http://www.pajhome.org.uk/crypt/md5/" target="_new">http://www.pajhome.org.uk/crypt/md5/</a></td>
	<td></td>
</tr>
<tr class="<?php 
    echo $i++ & 1 ? 'even' : 'odd';
    ?>
">
	<td></td>
	<td>PHP Paginator Class</td>
	<td></td>
	<td><a href="https://gist.github.com/daslicht/c319e18a1c8761f360ad" target="_new">https://gist.github.com/daslicht/c319e18a1c8761f360ad</a></td>
	<td></td>
</tr>
<tr class="<?php 
    echo $i++ & 1 ? 'even' : 'odd';
    ?>
">
	<td></td>
	<td>TouchSwipe</td>
	<td></td>
	<td><a href="http://labs.rampinteractive.co.uk/touchSwipe/" target="_new">http://labs.rampinteractive.co.uk/touchSwipe/</a></td>
	<td></td>
</tr>




<?php 
    if ($cfg['admin_about_message'] != '') {
        ?>
<tr class="line"><td colspan="5"></td></tr>
<tr class="header header_bigger">
	<td></td>
	<td colspan="3">Admin message:</td>
	<td></td>
</tr>
<tr class="line"><td colspan="5"></td></tr>
<tr class="odd space"><td colspan="5"></td></tr>
<tr class="odd">
	<td></td>
	<td colspan="3" valign="top"><?php 
        echo bbcode($cfg['admin_about_message']);
        ?>
</td>
	<td></td>
</tr>
<tr class="odd space"><td colspan="5"></td></tr>
<?php 
    }
    ?>
</table>
<?php 
    require_once 'include/footer.inc.php';
}
Example #9
0
    $good = checkMark($cfg, " <em>zp-config.php</em> " . gettext("file"), ' ' . gettext("[does not exist]"), gettext("Edit the <code>zp-config.php.source</code> file and rename it to <code>zp-config.php</code>") . ' ' . "<br/><br/>" . gettext("You can find the file in the \"zp-core\" directory.")) && $good;
    if ($sql) {
        if ($connection = @mysql_connect($_zp_conf_vars['mysql_host'], $_zp_conf_vars['mysql_user'], $_zp_conf_vars['mysql_pass'])) {
            $db = $_zp_conf_vars['mysql_database'];
            $db = @mysql_select_db($db);
        }
    }
    if ($connection) {
        $mysqlv = trim(@mysql_get_server_info());
        $i = strpos($mysqlv, "-");
        if ($i !== false) {
            $mysqlv = substr($mysqlv, 0, $i);
        }
        $required = '3.23.36';
        $desired = '4.1.1';
        $sqlv = versionCheck($required, $desired, $mysqlv);
    }
    if ($cfg) {
        @chmod('zp-config.php', 0666 & CHMOD_VALUE);
        if ($adminstuff = (!$sql || !$connection || !$db) && is_writable('zp-config.php')) {
            $good = checkMark(false, ' ' . gettext("MySQL setup in") . ' zp-config.php', '', '') && $good;
            // input form for the information
            ?>

<div class="error">
<p>
<?php 
            echo gettext("Fill in the information below and <strong>setup</strong> will attempt to update your <code>zp-config.php</code> file.");
            ?>
<br />
</p>
Example #10
0
<?php

/**
* CustomToolbox plugin for the GroupPermissionsManager extension
* This requires the GroupPermissionsManager extension to function, as well as MediaWiki version 1.13+
* Licensed under the GPL
*/
if (!defined('MEDIAWIKI')) {
    echo "This file is an extension to the MediaWiki software and is not a valid access point";
    die(1);
}
//MediaWiki version incompatibility check
if (!versionCheck('1.13')) {
    return;
}
$wgExtensionCredits['other'][] = array('name' => 'Custom Toolbox', 'author' => 'Ryan Schmidt', 'url' => 'http://www.mediawiki.org/wiki/Extension:GroupPermissionsManager', 'version' => '1.1', 'description' => 'Allows adding additional items to the Toolbox', 'descriptionmsg' => 'grouppermissions-desc4');
$wgHooks['SkinTemplateToolboxEnd'][] = 'efGPManagerCustomToolboxAppend';
function efGPManagerCustomToolboxAppend(&$skin)
{
    global $wgOut, $wgUser;
    $tb = explode("\n", wfMsg('toolbox_append'));
    $new = array();
    foreach ($tb as &$nt) {
        if (strpos($nt, '*') === 0) {
            $nt = trim($nt, '*');
            $parts = explode('|', $nt);
            foreach ($parts as &$part) {
                $part = trim($part);
            }
            $href = wfMsgForContent($parts[0]);
            $text = wfMsgForContent($parts[1]);
Example #11
0
function upgrade($version, $latestversion, $sql)
{
    if (versionCheck($version, $latestversion)) {
        echo __("Upgrading to") . " " . $latestversion;
        $sql2 = explode(";", $sql);
        foreach ($sql2 as $sql3) {
            if ($sql3 != "") {
                echo ".";
                $result = mysql_query($sql3 . ";") or die('Query failed: ' . $sql3 . '<br />' . mysql_error());
            }
        }
        modify_config("version", $latestversion);
        echo "<br />";
    }
}