public function runVersionUpdates($updates)
 {
     global $class_path, $site;
     include_once $class_path . 'install.inc.php';
     global $CONF, $FDAT, $conn, $default_data_files, $install, $skip_html;
     $default_data_files = $updates;
     $install = 0;
     $CONF = ReadConf();
     $FDAT = $site->fdat;
     $skip_html = $this->cli;
     $conn = $site->db;
     run_dumpfile();
 }
Example #2
0
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 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.
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#============================================================================
# Visit http://www.nedi.ch/ for more information.
#============================================================================
$nedipath = preg_replace("/^(\\/.+)\\/ht\\w+\\/.+.php/", "\$1", $_SERVER['SCRIPT_FILENAME']);
# Guess NeDi path for nedi.conf
require_once "inc/libmisc.php";
ReadConf('usr');
require_once "inc/libdb-" . strtolower($backend) . ".php";
include_once "inc/timezones.php";
$_GET = sanitize($_GET);
$_POST = sanitize($_POST);
if (isset($_GET['goto']) and preg_match('/^\\w+-\\w+\\.php/', $_GET['goto'])) {
    # Only allow links to NeDi modules
    $goto = $_GET['goto'];
} elseif (date('z') > 330) {
    # Let the X-mas spirits inspire users...
    $goto = 'Other-Invoice.php';
} else {
    $goto = 'User-Profile.php';
}
$user = isset($_GET['user']) ? $_GET['user'] : '';
$user = isset($_POST['user']) ? $_POST['user'] : $user;
include $class_path . 'Update.class.php';
include_once $class_path . "install.inc.php";
# all installation related functions
$site = new Site(array('on_debug' => $_COOKIE['debug'] ? 1 : 0, 'on_admin_keel' => 1));
ini_set('display_errors', 0);
$sqlK = "SELECT encoding FROM keel WHERE on_default = '1'";
$sthK = new SQL($sqlK);
$encoding = $sthK->fetchsingle();
$encoding = $encoding ? $encoding : 'UTF-8';
$cli = php_sapi_name() == 'cli' ? true : false;
if (!($site->user->is_superuser || $cli)) {
    print '<font color=red>Error: you need permissions to run updates.</font>';
    exit;
}
############# CONF
$CONF = ReadConf();
# db connect data from config.php
############# VERSION CHECK
$current_ver = current_version();
# try to connect database and find which version is installed returns 0, if no database found
//$current_ver = '4.7.FINAL';
############# VERSION NUMBERS
$versions = array('4.0.0', '4.0.1', '4.0.2', '4.0.3', '4.0.4', '4.0.5', '4.0.6', '4.0.7', '4.0.8', '4.0.9', '4.0.10', '4.0.11', '4.0.12', '4.0.13', '4.0.14', '4.0.15', '4.1.0', '4.1.1', '4.2.0', '4.2.1', '4.2.2', '4.2.3', '4.2.4', '4.3.0', '4.3.1', '4.3.2', '4.3.3', '4.3.4', '4.3.5', '4.3.6', '4.4.0', '4.4.1', '4.4.2', '4.4.3', '4.4.4', '4.4.5', '4.4.6', '4.4.7', '4.4.8', '4.5.0', '4.5.1', '4.5.2', '4.5.3', '4.5.4', '4.5.5', '4.5.6', '4.5.7', '4.5.8', '4.6.0', '4.6.1', '4.6.2', '4.6.3', '4.6.4', '4.6.5', '4.6.6', '4.7.0', '4.7.1');
##############################
# get the new version number
$new_ver = end($versions);
//$url = site_url();
##########################
# default_data_files
$default_data_files = array();
foreach ($versions as $version_array_index => $tmpver) {
Example #4
0
<?php

//===============================
// Report Contract Inventory.
// [b]Export in PDF format with html2pdf library from http://html2pdf.fr/[/b]
//===============================
session_start();
if (isset($_GET['export']) and $_GET['export'] == 'pdf') {
    //like header.php
    ini_set("memory_limit", "128M");
    # Enterprise network support
    $self = preg_replace("/.*\\/(.+).php/", "\$1", $_SERVER['SCRIPT_NAME']);
    require_once 'inc/libmisc.php';
    if (isset($_SESSION['group'])) {
        ReadConf($_SESSION['group']);
    } else {
        echo "<script>document.location.href='index.php?goto=" . rawurlencode($_SERVER["REQUEST_URI"]) . "';</script>\n";
        die;
    }
    require_once "inc/libdb-msq.php";
    //start capture for pdf conversion
    ob_start();
    echo "<link href=\"themes/{$_SESSION['theme']}.css\" type=\"text/css\" rel=\"stylesheet\">";
    // special tag for html2pdf
    echo "<page orientation=\"paysage\" footer=\"\" style=\"font-size: 8px\">";
} else {
    //stabdard header
    include_once "inc/header.php";
}
if (isset($_GET['os']) and is_array($_GET['os'])) {
    $os = $_GET['os'];
Example #5
0
<?php

# Program: me.php (Locate me IP)
# Programmer: Remo Rickli
error_reporting(E_ALL ^ E_NOTICE);
$refresh = 60;
$printable = 0;
$_SESSION['gsiz'] = 6;
$_SESSION['lsiz'] = 8;
$_SESSION['view'] = "";
$_SESSION['date'] = 'j.M y G:i';
$_SESSION['tz'] = "GMT";
$self = "mh";
$modgroup[$self] = "mon";
require_once "inc/libmisc.php";
ReadConf();
include_once "./languages/english/gui.php";
# Don't require, GUI still works if missing
include_once "inc/libdb-" . strtolower($backend) . ".php";
require_once "inc/libnod.php";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>

<head>
<title>NeDi Find Me</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<link href="inc/print.css" type="text/css" rel="stylesheet">
<link rel="shortcut icon" href="img/favicon.ico">
</head>
Example #6
0
<?php

//===============================
// SNMPget utility.
//===============================
session_start();
$nedipath = preg_replace("/^(\\/.+)\\/html\\/.+.php/", "\$1", $_SERVER['SCRIPT_FILENAME']);
# Guess NeDi path for nedi.conf
if (!preg_match("/net/", $_SESSION['group'])) {
    echo $nokmsg;
    die;
}
include_once "libmisc.php";
ReadConf('nomenu');
require_once "libsnmp.php";
require_once "../languages/{$_SESSION['lang']}/gui.php";
$_GET = sanitize($_GET);
$debug = isset($_GET['debug']) ? $_GET['debug'] : "";
$ver = ($_GET['v'] > 1 and $comms[$_GET['c']]['pprot']) ? '3' : $_GET['v'];
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=<?php 
echo $charset;
?>
">
<link href="../themes/<?php 
echo $_SESSION['theme'];
?>
.css" type="text/css" rel="stylesheet">
</head>
Example #7
0
error_reporting(E_ALL ^ E_NOTICE);
$refresh = 60;
$printable = 0;
$firstmsg = time() - 86400;
$_SESSION['lim'] = 3;
$_SESSION['col'] = 4;
$_SESSION['vol'] = 100;
$_SESSION['gsiz'] = 6;
$_SESSION['lsiz'] = 8;
$_SESSION['view'] = "";
$_SESSION['date'] = 'j.M y G:i';
$_SESSION['tz'] = "GMT";
$self = "mh";
$modgroup[$self] = "mon";
require_once "inc/libmisc.php";
ReadConf('mon');
include_once "./languages/english/gui.php";
# Don't require, GUI still works if missing
include_once "inc/libdb-" . strtolower($backend) . ".php";
include_once "inc/libdev.php";
include_once "inc/libmon.php";
$_GET = sanitize($_GET);
$reg = isset($_GET['reg']) ? $_GET['reg'] : "";
$cty = isset($_GET['cty']) ? $_GET['cty'] : "";
$bld = isset($_GET['bld']) ? $_GET['bld'] : "";
$loc = TopoLoc($reg, $cty, $bld);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>

<head>