Example #1
0
 function avDb()
 {
     global $g_error;
     $ini =& avIni::globalINI();
     $this->error =& $g_error;
     $this->server = $ini->read_var('db', 'db_host');
     $this->dbname = $ini->read_var('db', 'db_name');
     $this->user = $ini->read_var('db', 'db_user');
     $this->password = $ini->read_var('db', 'db_password');
     $this->connect();
 }
Example #2
0
$PHP_SELF = $_SERVER['PHP_SELF'];
include_once $RELPATH . $COREPATH . "averror.class.php";
include_once $RELPATH . $COREPATH . "avdb.class.php";
include_once $RELPATH . $COREPATH . "avini.class.php";
include_once $RELPATH . $COREPATH . "phemplate.class.php";
include_once $RELPATH . $COREPATH . "avsession.class.php";
include_once $RELPATH . $COREPATH . "avuser.class.php";
include_once $RELPATH . $LIBPATH . "util.lib.php";
if (isset($GLOBALS['bench'])) {
    echo "<br>checkpoint[includes]: " . round(getmicrotime() - $pradedam, 2);
}
$g_error = new avError('report');
if (isset($GLOBALS['bench'])) {
    echo "<br>checkpoint[error]: " . round(getmicrotime() - $pradedam, 2);
}
$g_ini = new avIni($RELPATH . 'global.ini.php');
if (isset($GLOBALS['bench'])) {
    echo "<br>checkpoint[ini]: " . round(getmicrotime() - $pradedam, 2);
}
if (empty($lang) || $lang != 'lt' && $lang != 'en') {
    $lang = $g_ini->read_var('site', 'Language');
}
$lang = clean_name($lang);
include_once $RELPATH . $LANGPATH . $lang . '.inc.php';
if (isset($GLOBALS['bench'])) {
    echo "<br>checkpoint[lang]: " . round(getmicrotime() - $pradedam, 2);
}
$g_db = new avDb();
if (isset($GLOBALS['bench'])) {
    echo "<br>checkpoint[db]: " . round(getmicrotime() - $pradedam, 2);
}
Example #3
0
/*
	ini file editor

	Created: js, 2001.09.02
	___________________________________________________________
	This file is part of flexiUpdate, content control framework
	Copyright (c) 2001 UAB "Alternatyvus valdymas"
	http://www.avc.lt <*****@*****.**>
*/
$RELPATH = "../";
include_once $RELPATH . 'site.ini.php';
include_once $RELPATH . $LIBPATH . 'header.inc.php';
check_permission('ini_edit_view');
$g_tpl->set_var('table_inner_name', 'ini_edit');
$g_ini = new avIni($RELPATH . 'global.ini.php', true);
if (isset($submit)) {
    check_permission('ini_edit_edit');
    while (list($key, $value) = each($HTTP_POST_VARS)) {
        if (1 == strpos($key, 'ni|')) {
            $names = explode('|', $key);
            $g_ini->set_var($names[1], $names[2], stripslashes($value));
            if ($names[2] == "Theme") {
                setcookie("g_theme", $value, time() + 360000000, "/");
            }
        }
    }
    $g_ini->save_data();
}
$g_tpl->set_file('ini_edit', 'control/tpl/' . $g_theme_dir . 'ini_edit.html', 1);
$g_tpl->set_var('header', $g_lang['options']);