function unhtmlentities($string)
{
    if (check_version(PHP_VERSION, "4.3.0")) {
        return html_entity_decode($string);
    } else {
        // replace numeric entities
        $string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string);
        $string = preg_replace('~&#([0-9]+);~e', 'chr(\\1)', $string);
        // replace literal entities
        $trans_tbl = get_html_translation_table(HTML_ENTITIES);
        $trans_tbl = array_flip($trans_tbl);
        return strtr($string, $trans_tbl);
    }
}
Example #2
0
<?php 
} else {
    ?>
        <script type="text/javascript">
          //<![CDATA[
          $(document).ready(function()
          {
            $('#php_ini_list, #php_ini_header').hide();
          });
          //--]]>
        </script>
<?php 
}
if ($this->startup->site_config->allow_version_check) {
    $this->load->helper('admin/version');
    $latest_version = check_version();
    if (strcmp($latest_version, "Unknown") === 0) {
        $msg = lang("Unknown Version.");
    } else {
        $msg = $this->functions->parse_version($latest_version);
    }
    if ($this->functions->compare_version(XU_VERSION, $latest_version)) {
        ?>
        <h3><?php 
        echo lang('Upgrade Available');
        ?>
</h3>
        <span class="alert">
          <?php 
        echo lang('Important Upgrade Available');
        ?>
Example #3
0
function print_header($ctrl)
{
    check_version();
    //Check to make sure the browser is supported
    /* * * MOBILE FORMATTING AND FAVICON * * */
    $additional = "";
    //Additional things we'll be adding to the header
    //If the device is mobile...
    if (is_mobile()) {
        //...use a mobile stylesheet
        $additional .= "<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"/scripts/css/mob/mobile.css\">";
    }
    //Changes favicon URL based on browser
    if (strpos(strtolower($_SERVER["HTTP_USER_AGENT"]), "safari")) {
        $additional .= "<link rel=\"SHORTCUT ICON\" href=\"/favicon.ico?v=2\" />";
    } else {
        $additional .= "<link rel=\"SHORTCUT ICON\" href=\"/favicon.ico\" />";
    }
    /* * * MAIN BANNER CONTENTS * * */
    $banner_contents = "";
    //If we aren't on the homepage..
    if (getcwd() !== $_SERVER["DOC_ROOT"]) {
        //Create a 'return home' or 'return to feed' button
        $text = "Return Home";
        //If we're logged in...
        if (isset($_SESSION["userid"])) {
            //...it'll be 'return to feed'
            $text = "Return to Feed";
        }
        //Add this to our banner
        $banner_contents .= "<div onclick=\"window.location='/';\" class=\"backbtn\">{$text}</div>";
    } else {
        //Make it the logo
        $banner_contents .= "<div id=\"logo\"><a href=\"/\"><img src=\"/img/logo.png\"></a></div>";
        //If we aren't logged in...
        if (!isset($_SESSION["userid"])) {
            //Display that text that shows how many members we have
            //Connect to MySQL
            $con = mysqli_connect(host(), username(), password(), mainDb());
            //Get the user count (not possible through API)
            $query = mysqli_query($con, "SELECT COUNT(*) AS count FROM `usr`");
            //Get the number of users
            $user_count = mysqli_fetch_array($query);
            $user_count = $user_count[0];
            $all_items = new Item(array("action" => "get"));
            $items_array = $all_items->run(true);
            $item_count = count($items_array);
            //...add it to the banner
            $banner_contents .= "<div id=\"subtxt\">Now with {$user_count} members worldwide.</div>";
            //Close the connection
            mysqli_close($con);
        }
    }
    $add_box = "";
    //If we are going to show the login/profile panel...
    if ($ctrl) {
        //If the user is logged in
        if (isset($_SESSION["userid"])) {
            //Print their control panel and search box
            $banner_contents .= get_search_box();
            $banner_contents .= get_profile_box($_SESSION["userid"]);
            //$add_box 		 .= get_add_box();
        } else {
            //Print the login box
            $banner_contents .= get_login_box();
        }
    }
    $user_menu = get_user_menu();
    /* * * MAIN HEADER * * */
    $header = <<<HEAD
\t\t\t\t\t<meta http-equiv="X-UA-Compatible" content="IE=edge" />
\t\t\t\t\t<meta name="viewport" content="width=device-width, initial-scale=1.0" />
\t\t\t\t\t<meta name="description" content="eDart is a first-of-its-kind, completely web-based, universal trading application for WPI students." /> 
\t\t\t\t\t<meta name="keywords" content="edart,beta,bartering,tradegrouper,trade,trading,tradby,college,worcester,polytechnic,institute,wpi,2013,free,online,database" /> 
\t\t\t\t\t<meta name="robots" content="index, follow" /> 
\t\t\t\t\t<meta name="Headline" content="Welcome to eDart!">
\t\t\t\t\t<meta name="CPS_SITE_NAME" content="Welcome to eDart!">
\t\t\t\t\t<meta property="og:title" content="eDart is a first-of-its-kind, completely web-based, universal trading application for WPI students."> 
\t\t\t\t\t<meta property="og:type" content="website"> 
\t\t\t\t\t<meta property="og:description" content="eDart is a first-of-its-kind, completely web-based, universal trading application for WPI students.">
\t\t\t\t\t<meta property="og:site_name" content="eDart">
\t\t\t\t\t<meta charset="UTF-8">

\t\t\t\t\t<noscript>
\t\t\t\t\t\t<meta http-equiv="refresh" content="0;URL=/noscript.php">
\t\t\t\t\t</noscript>

\t\t\t\t\t<link rel="stylesheet" type="text/css" media="screen" href="/files/fonts/Vegur/stylesheet.css">
\t\t\t\t\t<link rel="stylesheet" type="text/css" media="screen" href="/files/fonts/Titillium/stylesheet.css">
\t\t\t\t\t<link rel="stylesheet" type="text/css" media="screen" href="/lib/min/?g=css">

\t\t\t\t\t<script>
\t\t\t\t\t\tdocument.cookie='';

\t\t\t\t\t\t(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
\t\t\t\t\t\t(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
\t\t\t\t\t\tm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
\t\t\t\t\t\t})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

\t\t\t\t\t\tga('create', 'UA-44057002-1', 'wewanttotrade.com');
\t\t\t\t\t\tga('send', 'pageview');
\t\t\t\t\t</script>

\t\t\t\t\t{$additional}
\t\t\t\t\t{$add_box}
\t\t\t\t\t{$user_menu}

\t\t\t\t\t<div id="bpho" style="height:60px;width:100%;">
\t\t\t\t\t\t<div id="banner">
\t\t\t\t\t\t\t{$banner_contents}
\t\t\t\t\t\t</div>
\t\t\t\t\t</div>
HEAD;
    echo $header;
    //Print the header
}
Example #4
0
/**
 * Get new version notification
 *
 * @return null|array
 */
function getVersionNotification()
{
    $message = null;
    $firstTimeVersionCheck = false;
    if (isset($_SESSION['first_version_check'])) {
        $firstTimeVersionCheck = true;
        unset($_SESSION['first_version_check']);
    }
    // only notify the user every 30 day.
    $data = check_version($firstTimeVersionCheck);
    $session_key = 'version_last_check';
    $lastCheckTime = isset($_SESSION[$session_key]) ? $_SESSION[$session_key] : false;
    if ($lastCheckTime && $lastCheckTime + 30 * DAY_IN_SECONDS > gmdate('U')) {
        return $message;
    }
    $_SESSION[$session_key] = gmdate('U');
    if ($data['outdated'] == true) {
        $message = ['title' => __t('version_outdated_title'), 'text' => __t('version_outdated_text_x', ['installed_version' => DIRECTUS_VERSION, 'current_version' => $data['current_version']])];
    }
    return $message;
}
Example #5
0
    include 'sql/updatedump.inc.php';
    for ($i = 0; $i < @count($query); $i++) {
        $db->direct_query($query[$i]);
        echo '<b>' . $query[$i] . '</b><br>';
    }
    if ($myversion == $thisversion) {
        echo 'Complete, now to <b><a href="?step=3">step 3</a></b>';
    } else {
        echo '<script type="text/javascript">window.location = "?step=2";</script>';
        echo '<noscript>Javascript is disabled please <a href="?step=2">refresh the page</a></noscript>';
    }
}
if ($step == 3) {
    $check = check_installation();
    $thisversion = this_version();
    $myversion = check_version();
    if (!$check) {
        echo print_header(true);
        echo '<p>It seems you don\'t currently have a version of WeBid installed we recommend you do a <b><a href="install.php">fresh install</a></b></p>';
        exit;
    }
    include $main_path . 'common.php';
    echo print_header(true);
    include $include_path . 'functions_rebuild.inc.php';
    echo '<p>Rebuilding membertypes...</p>';
    rebuild_table_file('membertypes');
    echo '<p>Rebuilding countries...</p>';
    rebuild_html_file('countries');
    echo '<p>Rebuilding categories...</p>';
    $catscontrol = new MPTTcategories();
    rebuild_cat_file();
Example #6
0
/**
 * Get new version notification
 *
 * @return null|array
 */
function getVersionNotification()
{
    $message = null;
    $data = check_version(isset($_SESSION['first_version_check']));
    unset($_SESSION['first_version_check']);
    if ($data['outdated'] == true) {
        $message = ['title' => __t('version_outdated_title'), 'text' => __t('version_outdated_text_x', ['installed_version' => DIRECTUS_VERSION, 'current_version' => $data['current_version']])];
    }
    return $message;
}
Example #7
0
    $pivot_path = dirname(realpath(__FILE__)) . "/";
}
$pivot_path = str_replace("\\", "/", $pivot_path);
// Include some other files
require_once $pivot_path . 'pvlib.php';
require_once $pivot_path . 'pvdisp.php';
require_once $pivot_path . 'modules/module_db.php';
require_once $pivot_path . 'modules/module_i18n.php';
require_once $pivot_path . 'modules/module_lang.php';
require_once $pivot_path . 'modules/module_parser.php';
require_once $pivot_path . 'modules/module_ipblock.php';
require_once $pivot_path . 'modules/module_spamkiller.php';
require_once $pivot_path . 'modules/module_snippets.php';
require_once $pivot_path . 'modules/module_tags.php';
// Check if the current php version is at least 4.1.0..
if (!check_version(PHP_VERSION, "4.1.0")) {
    echo "<p>Your PHP version is: " . PHP_VERSION . ".<br /> Pivot requires at least PHP version 4.1.0 to run properly!</p>\n\n";
    die;
}
// Start the timer:
$starttime = getmicrotime();
GetSettings();
/**
 * If debug is set, include the file..
 */
if ($Cfg['debug'] == 1) {
    require_once $pivot_path . 'modules/module_debug.php';
} else {
    error_reporting(E_ERROR);
    function debug()
    {
Example #8
0
function define_user()
{
    global $conn;
    if (isset($_SESSION['cmt_login']) && $_SESSION['cmt_login'] === true) {
        check_version();
        $sql = "SELECT * FROM " . $_SESSION['TABLE_PREFIX'] . "cmt_accounts WHERE id = '" . $_SESSION['cmt_id'] . "' AND c_active='1'";
        $result = db_mysql_query($sql, $conn);
        if (db_mysql_num_rows($result)) {
            $arr = db_mysql_fetch_array($result);
            define('CMT_USER_ID', $arr['id']);
            define('CMT_USER_FIRST_NAME', $arr['first_name']);
            define('CMT_USER_LAST_NAME', $arr['last_name']);
            define('CMT_USER_LANGUAGE', $arr['language']);
            $sql_sub = "SELECT value FROM " . $_SESSION['TABLE_PREFIX'] . "cmt_settings WHERE title = 'default_modul' AND c_active = '1'";
            $result_sub = db_mysql_query($sql_sub, $conn);
            if (db_mysql_num_rows($result_sub)) {
                $arr_sub = db_mysql_fetch_array($result_sub);
                define('CMT_DEFAULT_MODUL', $arr_sub['value']);
            }
        } else {
            $_SESSION['cmt_login'] = false;
        }
    }
    if (!defined('CMT_USER_LANGUAGE')) {
        define('CMT_USER_LANGUAGE', 'en');
    }
}
Example #9
0
<?php

require 'config.php';
require 'language/' . DEFAULT_LANGUAGE . '/language.php';
require 'includes/functions.php';
require 'includes/db/' . DB_TYPE . '/query_factory.php';
$context_ref = isset($_GET['idx']) ? $_GET['idx'] : '';
// Load db class
$db = new queryFactory();
if (!$db->connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE)) {
    echo $db->show_error() . '<br />';
    die(NO_CONNECT_DB);
}
$current = check_version();
// make sure db is current with latest information files
$result = false;
if ($context_ref) {
    $result = $db->Execute("select doc_url from " . DB_PREFIX . "zh_search where doc_pos = '" . $context_ref . "'");
}
$start_page = !$result ? DOC_ROOT_URL . '/' . DOC_HOME_PAGE : $result->fields['doc_url'];
//$start_page = DOC_ROOT_URL . '/' . DOC_HOME_PAGE;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title><?php 
echo HEADING_TITLE;
?>
</title>
<link rel="stylesheet" href="css/phreehelp.css">
Example #10
0
              <?php 
        echo anchor('admin/extend/turn_off/' . $name, '<img src="' . base_url() . 'assets/images/icons/on_16.png" alt="" class="">');
        ?>
 
<?php 
    } else {
        ?>
              <?php 
        echo anchor('admin/extend/turn_on/' . $name, '<img src="' . base_url() . 'assets/images/icons/off_16.png" alt="" class="">');
        ?>
 
<?php 
    }
    if ($this->startup->site_config->allow_version_check && isset($plugin->version->latest_link)) {
        $this->load->helper('admin/version');
        $latest_version = check_version($plugin->version->latest_link);
        if ($plugin->version->local < $latest_version && $latest_version != false) {
            $imgsrc = '<img src="' . base_url() . 'assets/images/icons/certificate_16.png" alt="" class="nb" title="' . sprintf(lang('New Version Available: v%s'), $this->functions->parse_version($latest_version, false)) . '">';
            ?>
              <?php 
            echo anchor($plugin->version->download_link, $imgsrc, array('rel' => 'external'));
        }
    }
    ?>
              <?php 
    echo anchor('admin/extend/remove/' . $name, '<img src="' . base_url() . 'assets/images/icons/trash_16.png" alt="" class="nb">');
    ?>
            </td>
          </tr>
<?php 
}
Example #11
0
        }
        // same major - check ninor
        if ($minorC > $minorR) {
            return true;
        }
        if ($minorC < $minorR) {
            return false;
        }
        // and same minor
        if ($editC >= $editR) {
            return true;
        }
        return false;
    }
}
$___php5 = check_version(phpversion(), "5.0.0");
# -===============================================-
#           NEW MYSQLI CLIENT LIBRARY
# -===============================================-
if (function_exists('mysqli_get_client_info')) {
    if (file_exists("mysql.class.4.php")) {
        rename("mysql.class.4.php", "disabled/mysql.class.4.php");
    }
    if (!class_exists("MySQL") && $___php5 == true) {
        class MySQL
        {
            protected $querys;
            protected $ask;
            protected $fetch_array;
            protected $fetch_object;
            protected $fetch_assoc;
Example #12
0
 /**
  *	gContacts_fatal_error
  *
  *	gContacts Fatal Error Handling function
  **/
 function gContacts_fatal_error()
 {
     global $version;
     $version = check_version($version);
     $error = error_get_last();
     if ($error['type'] > 0) {
         new Error($version, 16, $error["message"], $error['file'], $error['line'], null, 'gContacts_fatal_error');
         return true;
     }
 }
Example #13
0
/**
 * Checks if the version of Pivot is as required.
 *
 * The required version must be given in the format "x.y.z" where (x, y, z)
 * are numbers in [0-9]. ("z" may be left out and is then assumed to be 0.)
 *
 * @param string $requiredversion
 * @return boolean
 */
function check_pivot_version($requiredversion)
{
    global $build;
    preg_match("/[^\\d]*([\\d.-]*).*/", $build, $match);
    $buildversion = $match[1];
    list($majorB, $minorB, $editB) = split('[/.-]', $buildversion);
    list($majorR, $minorR, $editR) = split('[/.-]', $requiredversion);
    if (!isset($editB)) {
        $editB = 0;
    }
    if (!isset($editR)) {
        $editR = 0;
    }
    $buildversion = implode(".", array($majorB, $minorB, $editB));
    $requiredversion = implode(".", array($majorR, $minorR, $editR));
    return check_version($buildversion, $requiredversion);
}
    function wpadm_plugins()
    {
        global $wp_version;
        $c = get_system_data();
        $phpVersion = $c['php_verion'];
        $maxExecutionTime = $c['maxExecutionTime'];
        $maxMemoryLimit = $c['maxMemoryLimit'];
        $extensions = $c['extensions'];
        $disabledFunctions = $c['disabledFunctions'];
        //try set new max time
        $newMaxExecutionTime = $c['newMaxExecutionTime'];
        $upMaxExecutionTime = $c['upMaxExecutionTime'];
        $maxExecutionTime = $c['maxExecutionTime'];
        //try set new memory limit
        $upMemoryLimit = $c['upMemoryLimit'];
        $newMemoryLimit = $c['newMemoryLimit'];
        $maxMemoryLimit = $c['maxMemoryLimit'];
        //try get mysql version
        $mysqlVersion = $c['mysqlVersion'];
        $show = !get_option('wpadm_pub_key') || (!is_super_admin() || !is_admin()) || !@get_option(_PREFIX_STAT . 'counter_id');
        ?>
 


        <?php 
        if (!$show) {
            ?>
            <div class="cfTabsContainer">
                <div id="cf_signin" class="cfContentContainer" style="display: block;">
                    <form method="post" action="<?php 
            echo WPADM_URL_BASE . "user/login";
            ?>
" autocomplete="off" target="_blank">
                        <div class="inline" style="width: 52%; margin-top: 0; color: #fff;">
                            WPAdm Sign-In:
                            <input class="input-small" type="email" required="required" name="username" placeholder="Email">
                            <input class="input-small" type="password" required="required" name="password" placeholder="Password">
                            <input class="button-wpadm" type="submit" value="Sign-In" name="submit" style="margin-top:1px;">    
                        </div>
                        <div class="wpadm-info-auth" style="width: 45%;">
                            Enter your email and password from an account at <a href="http://www.wpadm.com" target="_blank" style="color: #fff;" >www.wpadm.com</a>.<br /> After submitting user credentials you will be redirected to your Admin area on <a href="http://www.wpadm.com" style="color: #fff;" target="_blank">www.wpadm.com</a>.
                        </div>
                    </form>
                </div>
            </div>
            <?php 
        } else {
            ?>
            <div class="cfTabsContainer" style="display: none;">
                <div id="cf_activate" class="cfContentContainer">
                    <form method="post" action="<?php 
            echo admin_url('admin-post.php?action=wpadm_activate_plugin');
            ?>
" >
                        <div class="wpadm-info-title">
                            Free Sign Up to use more functionality...
                        </div>
                        <div class="wpadm-registr-info">
                            <table class="form-table">
                                <tbody>
                                    <tr valign="top">
                                        <th scope="row">
                                            <label for="email">E-mail</label>
                                        </th>
                                        <td>
                                            <input id="email" class="regular-text" type="text" name="email" value="">
                                        </td>
                                    </tr>
                                    <tr valign="top">
                                        <th scope="row">
                                            <label for="password">Password</label>
                                        </th>
                                        <td>
                                            <input id="password" class="regular-text" type="password" name="password" value="">
                                        </td>
                                    </tr>
                                    <tr valign="top">
                                        <th scope="row">
                                            <label for="password-confirm">Password confirm</label>
                                        </th>
                                        <td>
                                            <input id="password-confirm" class="regular-text" type="password" name="password-confirm" value="">
                                        </td>
                                    </tr>
                                    <tr valign="top">
                                        <th scope="row">
                                        </th>
                                        <td>
                                            <input class="button-wpadm" type="submit" value="Register & Activate" name="submit">
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="wpadm-info">
                            <span style="font-weight:bold; font-size: 14px;">If you are NOT registered at WPAdm,</span> enter your email and password to use as your Account Data for authorization on WPAdm. <br /><span style="font-weight: bold;font-size: 14px;">If you already have an account at WPAdm</span> and you want to Sign-In, so please, enter your registered credential data (email and password twice).
                        </div>
                    </form>
                </div>
            </div>  
            <?php 
        }
        ?>

        <script>
            jQuery(document).ready(function() {
                jQuery('.plugins-icon').click(function() {
                    title = jQuery(this).parent('.plugins-title');
                    box = title.parent('.plugins-box');
                    content = box.find('.plugins-info-content');
                    display = content.css('display');
                    if (display == 'none') {
                        content.show('slow');
                    } else {
                        content.hide('slow');
                    }
                })
            })
            function showRegistartion(show)
            {
                if (show) {
                    jQuery('.cfTabsContainer').show('slow');
                } else {
                    jQuery('.cfTabsContainer').hide('slow');
                }
            }
        </script>

        <div class="clear" style="margin-bottom: 50px;"></div>
        <table class="wp-list-table widefat fixed" >
            <thead>
                <tr>
                    <th></th>
                    <th>Recommended value</th>
                    <th>Your value</th>
                    <th>Status</th>
                </tr>
            </thead>
            <tbody>  
                <tr>
                    <th scope="row">PHP Version</th>
                    <td><?php 
        echo PHP_VERSION_DEFAULT;
        ?>
 or greater</td>
                    <td><?php 
        echo check_version($phpVersion, PHP_VERSION_DEFAULT) === false ? '<span style="color:#fb8004;font-weight:bold;">' . $phpVersion . '</span>' : $phpVersion;
        ?>
</td>
                    <td><?php 
        echo check_version($phpVersion, PHP_VERSION_DEFAULT) ? '<span style="color:green;font-weight:bold;">OK</span>' : '<span style="color:#fb8004;font-weight:bold;">Please update your PHP version to get it working correctly</span>';
        ?>
</td>
                </tr>
                <tr>
                    <th scope="row">MySQL Version</th>
                    <td><?php 
        echo MYSQL_VERSION_DEFAULT;
        ?>
 or greater</td>
                    <td><?php 
        echo check_version($mysqlVersion, MYSQL_VERSION_DEFAULT) === false ? '<span style="color:#fb8004;font-weight:bold;">' . $mysqlVersion . '</span>' : $mysqlVersion;
        ?>
</td>
                    <td><?php 
        echo check_version($mysqlVersion, MYSQL_VERSION_DEFAULT) ? '<span style="color:green;font-weight:bold;">OK</span>' : '<span style="color:#fb8004;font-weight:bold;">Please update your MySQL version to get it working correctly</span>';
        ?>
</td>
                </tr>
                <tr>
                    <th scope="row">Max Execution Time</th>
                    <td><?php 
        echo $newMaxExecutionTime;
        ?>
</td>
                    <td><?php 
        echo $upMaxExecutionTime == 0 ? '<span style="color:#fb8004;font-weight:bold;">' . $maxExecutionTime . '</span>' : $maxExecutionTime;
        ?>
</td>
                    <td><?php 
        echo $upMaxExecutionTime == 1 ? '<span style="color:green; font-weight:bold;">OK</span>' : '<span style="color:#fb8004;font-weight:bold;">Correct operation of the plugin can not be guaranteed.</span>';
        ?>
</td>
                </tr>
                <tr>
                    <th scope="row">Max Memory Limit</th>
                    <td><?php 
        echo $newMemoryLimit . 'M';
        ?>
</td>
                    <td><?php 
        echo $upMemoryLimit == 0 ? '<span style="color:#fb8004;font-weight:bold;">' . $maxMemoryLimit . '</span>' : $maxMemoryLimit;
        ?>
</td>
                    <td><?php 
        echo $upMemoryLimit == 1 ? '<span style="color:green;font-weight:bold;">OK</span>' : '<span style="color:#fb8004;font-weight:bold;">Correct operation of the plugin can not be guaranteed.</span>';
        ?>
</td>
                </tr>
                <tr>
                    <th scope="row">PHP Extensions</th>
                    <?php 
        $ex = $c['ex'];
        ?>
                    <td><?php 
        echo $ex === false ? 'All present' : '<span style="color:#ffba00;font-weight:bold;">' . implode(", ", $ex) . '</span>';
        ?>
</td>
                    <td><?php 
        echo $ex === false ? 'Found' : '<span style="color:#ffba00;font-weight:bold;">Not Found</span>';
        ?>
</td>
                    <td><?php 
        echo $ex === false ? '<span style="color:green;font-weight:bold;">Ok</span>' : '<span style="color:#fb8004;font-weight:bold;">Functionality are not guaranteed.</span>';
        ?>
</td>
                </tr>
                <tr>
                    <th scope="row">Disabled Functions</th>
                    <td colspan="3" align="left"><?php 
        echo ($func = $c['func']) === false ? '<span style="color:green;font-weight:bold;">All necessary functions are enabled</span>' : '<span style="color:#fb8004;font-weight:bold;">Please enable these functions to get plugin working correctly: ' . implode(", ", $func) . '</span>';
        ?>
</td>
                </tr>
                <tr>
                    <th scope="row">Plugin Access</th>
                    <td colspan="3" align="left"><?php 
        echo is_admin() && is_super_admin() ? "<span style=\"color:green; font-weight:bold;\">Granted</span>" : "<span style=\"color:red; font-weight:bold;\">To administrate this Plugin(s) is an 'Admin' right required.</span>";
        ?>
</td>
                </tr>
            </tbody>
        </table>
        <?php 
    }
require_once "../config.php";
include "includes/admin_functions.php";
if (is_file("../sales_config.php")) {
    include "../sales_config.php";
}
//sales option?
$sales_option = "";
if (is_file("../picturelib_config.php")) {
    include "../picturelib_config.php";
}
$menusep = " || ";
//menu separator
$redirect = "";
$url_to_start = substr($url_to_start, 0, strpos($url_to_start, $admin_dir) - 1);
//check version vs current code, to see if we need updates
$ver_check = check_version(NULL, NULL);
if ($ver_check !== false) {
    //handle the procedure to notify admin of updates or need to run upgrade procedure. warn about plugins and modules
}
#  Connect to DB        - might do to just drop it in a function file
#################################################################################################
mysql_connect($db_server, $db_user, $db_pass) or die(mysql_error());
mysql_select_db($db_name) or die(mysql_error());
#  Functions
#################################################################################################
#  Header
//TODO: Move this to header.php and/or header.tpl
#################################################################################################
echo "<html>\n";
echo " <head>\n";
echo "  <title>Logix Classifieds-AdminPanel</title>\n";
Example #16
0
/**
 * Get upgrade action
 * @param string download url
 * @return upgrade action
 */
function get_upgrade_action($download_url)
{
    global $upgrade_path, $backup_path, $servertimenow, $debug;
    // Construct version name from download URL
    $slash_pos = strrpos($download_url, '/');
    $point_pos = strrpos($download_url, '.');
    if ($slash_pos < $point_pos) {
        $version_name = substr($download_url, $slash_pos + 1, $point_pos - $slash_pos - 1);
    }
    if (empty($version_name)) {
        return false;
    }
    if (file_exists($upgrade_path)) {
        $filename_params = array('inc_files' => false, 'recurse' => false, 'basename' => true);
        // Search if there is unpacked version in '_upgrade' directory
        foreach (get_filenames($upgrade_path, $filename_params) as $dir_name) {
            if (strpos($dir_name, $version_name) === 0) {
                $action_props = array();
                $new_version_status = check_version($dir_name);
                if (!empty($new_version_status)) {
                    $action_props['action'] = 'none';
                    $action_props['status'] = $new_version_status;
                }
                if ($debug > 0 || empty($new_version_status)) {
                    if (file_exists($backup_path)) {
                        // The backup was already created. In this case the upgrade should have run successfully maybe the backup folder was not deleted.
                        $action_props['action'] = 'none';
                    } else {
                        // The backup was not created yet
                        $action_props['action'] = 'backup_and_overwrite';
                    }
                    $action_props['name'] = $dir_name;
                }
                return $action_props;
            }
        }
        $filename_params = array('inc_dirs' => false, 'recurse' => false, 'basename' => true);
        // Search if there is packed version in '_upgrade' directory
        foreach (get_filenames($upgrade_path, $filename_params) as $file_name) {
            if (strpos($file_name, $version_name) === 0) {
                return array('action' => 'unzip', 'name' => substr($file_name, 0, strrpos($file_name, '.')));
            }
        }
    }
    // There is no any version in '_upgrade' directory. So, we need download package before.
    return array('action' => 'download', 'name' => $version_name . '-' . date('Y-m-d', $servertimenow));
}
Example #17
0
     $upgrade_name = param('upd_name', 'string', '', true);
     $upgrade_file = $upgrade_path . $upgrade_name . '.zip';
     $success = true;
 }
 if ($success) {
     // Set maximum execution time
     set_max_execution_time(1800);
     // 30 minutes
     echo '<p>' . sprintf(T_('Unpacking package to &laquo;<strong>%s</strong>&raquo;...'), $upgrade_path . $upgrade_name);
     evo_flush();
     // Unpack package
     if ($success = unpack_archive($upgrade_file, $upgrade_path . $upgrade_name, true)) {
         global $debug;
         echo ' OK.</p>';
         evo_flush();
         $new_version_status = check_version($upgrade_name);
         if ($debug == 0 && !empty($new_version_status)) {
             echo '<h4 style="color:red">' . $new_version_status . '</h4>';
             evo_flush();
             break;
         }
     } else {
         echo '</p>';
         // Additional check
         @rmdir_r($upgrade_path . $upgrade_name);
     }
 }
 if ($success) {
     // Pause a process before upgrading
     $action = 'backup_and_overwrite';
     $AdminUI->disp_view('maintenance/views/_upgrade_continue.form.php');
Example #18
0
        echo '<b>' . $query[$i] . '</b><br>';
    }
    if (file_exists('scripts/' . $new_version . '.php')) {
        include 'scripts/' . $new_version . '.php';
    }
    if ($installed_version == $package_version) {
        echo 'Complete, now to <b><a href="?step=3">step 3</a></b>';
    } else {
        echo '<script type="text/javascript">window.location = "?step=2";</script>';
        echo '<noscript>Javascript is disabled please <a href="?step=2">refresh the page</a></noscript>';
    }
}
if ($step == 3) {
    $check = check_installation();
    $package_version = package_version();
    $installed_version = check_version();
    if (!$check) {
        echo print_header(true);
        echo '<p>It seems you don\'t currently have a version of WeBid installed we recommend you do a <b><a href="install.php">fresh install</a></b></p>';
        exit;
    }
    include $main_path . 'common.php';
    echo print_header(true);
    include $include_path . 'functions_rebuild.inc.php';
    echo '<p>Rebuilding membertypes...</p>';
    rebuild_table_file('membertypes');
    echo '<p>Rebuilding countries...</p>';
    rebuild_html_file('countries');
    echo '<p>Rebuilding categories...</p>';
    $catscontrol = new MPTTcategories();
    rebuild_cat_file();
Example #19
0
				<div style="border: 1px solid #bbb; margin: 10px; padding: 10px;">
						<h2 class="caption">Version</h2>

						<table>
							<tr>
								<td>This Version:</td>
								<td><?php 
@readfile(ABSOLUTE_PATH . "VERSION");
?>
</td>
							</tr>
						
							<tr>
								<td><a href="http://www.frech.ch/online-bookmarks/" target="_new">Newest Version available:</a></td>
								<td><a href="http://www.frech.ch/online-bookmarks/" target="_new"><?php 
echo check_version();
?>
</a></td>
							</tr>
						</table>
						
						<?php 
function check_version()
{
    $version = null;
    if ($fp = @fsockopen("www.frech.ch", 80)) {
        $get = "GET /online-bookmarks/bookmarks/VERSION HTTP/1.0\r\n\r\n";
        $data = null;
        fwrite($fp, $get);
        while (!feof($fp)) {
            $data .= fgets($fp, 128);
Example #20
0
//End form
require_once ROOT_PATH . '/base/load.php';
if (isGUI) {
    $argv = $_POST;
} else {
    $argv = parseArgs($argv);
}
Banner();
CheckRequirement();
Config::handle($argv);
if (Config::get('help')) {
    Help();
    exit;
}
if (Config::get('version')) {
    check_version();
    exit;
}
if (Config::get('upgrade')) {
    download();
    exit;
}
// credit syahiran
$ok = false;
$keys = array_keys(Config::all());
foreach ($keys as $key) {
    switch ($key) {
        case 'default':
        case 'basic':
        case 'et':
        case 'ep':
Example #21
0
if (!$gfconn) {
    print "{$sys_name} Could Not Connect to Database: " . db_error();
    exit;
}
// HERE BEGINS THE ACTUAL SCRIPT
if (count($argv) < 2) {
    echo "Usage: startpoint.php [version]\n";
    check_version();
} else {
    $date = 0;
    $version = $argv[1];
    if (!check_tables()) {
        echo "ERROR: Could not check tables\n";
        exit;
    } else {
        $date = check_version($version);
        if ($date != 0) {
            set_version($version, $date);
        }
    }
}
function check_tables()
{
    db_begin();
    $res = db_query("SELECT COUNT(*) AS exists FROM pg_class WHERE relname = 'database_startpoint' AND relkind = 'r'");
    if (!$res) {
        // db error
        echo "DB-ERROR-1: " . db_error() . "\n";
        db_rollback();
        return false;
    }