Exemple #1
0
<?

include_once("classes/configTool.class.php");

if (!isset($config)) {
  $configFilename = 'config.inc.php';
	$path = getProgramPath();
	$path = str_replace("ajax/", "", $path);
  if (!file_exists($path.$configFilename)) header('Location: settings.php');
  $conf = new ConfigTool();
  $conf->setConfigFromFile($path.$configFilename);
  if (!$conf->get('s_projectTitle')) {
    echo '<p><b>There was a problem with the config file.  Please contact an administrator.</b></p>';
  	exit;
  }
}

function db_connect() {
  global $conf;
  $db_username = $conf->get("s_db_username");
	$db_password = $conf->get("s_db_password");
	$db_name     = $conf->get("s_db_name");
	$db = mysql_pconnect("lamp-db2.its.uiowa.edu", $db_username, $db_password);
	if (!mysql_select_db($db_name,$db)) {
		echo '<p><b>Could not select the database.  This is probably due to incorrect database values in the configuration.  Please adjust the config file and try again.</b></p>';
		exit;
	}
	return $db;
}
$db = db_connect();
if (!$db) {
<?php

session_start();
$strMaxLen = 30;
$debug = FALSE;
if (!empty($_GET['debug'])) {
    $debug = TRUE;
}
if (!$debug) {
    header('Content-type: text/json;');
}
include "../dbConnect.php";
$configFilename = '../config.inc.php';
$conf = new ConfigTool();
$conf->setConfigFromFile($configFilename);
if (!$conf->get('s_projectTitle')) {
    echo '<p><b>There was a problem with the config file.  Please contact an administrator.</b></p>';
    exit;
}
// current table
$table = trim($_POST['table']);
$curTablePkValue = trim($_POST['curTablePkValue']);
// relational table
$relTable = trim($_POST['relTable']);
$relTablePk = trim($_POST['relTablePk']);
$relTablePkValue = trim($_POST['relTablePkValue']);
// second table
$secTable = trim($_POST['secTable']);
$secTablePk = trim($_POST['secTablePk']);
$content = trim($_POST['content']);
// replaces secTablePkValue
Exemple #3
0
    $_SESSION["core"] = "";
    if ($param[0] != '') {
        $_SESSION["core"] = $param[0];
    }
} else {
    if (isset($_POST["core"])) {
        $_SESSION["core"] = $_POST["core"];
    }
}
$configFilePath = $rootpath . "/../config/" . $config_file;
if (!file_exists($configFilePath)) {
    echo "Configuration file not found [" . $configFilePath . "]";
    exit;
}
$config = new ConfigTool();
$config->setConfigFromFile($configFilePath);
$config->setCookiePath("/");
$config->setCookieDomain($_SERVER['SERVER_NAME']);
$config->setCookieExpire(3600 * 10);
$debug = $config->get("application.debug") == "1";
$debug_file = $config->getDefault("application.logfile", "");
$cLog = new Logger($debug_file);
if ($debug) {
    $cLog->setDebug(true);
}
$cLog->log_debug("------ search2 ------");
$cLog->log_debug("config = " . $config_file);
$cLog->log_debug("key = " . $key);
// $user initialisation
//
if (isset($_SESSION["user"])) {