コード例 #1
0
ファイル: setup.php プロジェクト: BackupTheBerlios/idb
require 'settings.php';
if (!isset($Settings['sqldb'])) {
    echo "<span class=\"TableMessage\">";
    echo "<br />Sorry you can not signup yet.<br />\n</span>\n";
    $Error = "Yes";
}
if ($_POST['License'] != "Agree") {
    echo "<span class=\"TableMessage\">";
    echo "<br />You need to agree to the tos.<br />\n</span>\n";
    $Error = "Yes";
}
$StatSQL = sql_connect_db($Settings['sqlhost'], $Settings['sqluser'], $Settings['sqlpass']);
if (!$StatSQL) {
    $Error = "Yes";
    echo "<span class=\"TableMessage\">";
    echo "<br />" . sql_errorno($StatSQL) . "<br />\n</span>\n";
}
if (!isset($_POST['unixname']) && isset($_GET['unixname'])) {
    $_POST['unixname'] = $_GET['unixname'];
}
if (isset($_POST['unixname']) && file_exists($_POST['unixname'] . "_settings.php")) {
    $_POST['unixname'] = "idb";
}
if (isset($_POST['unixname']) && !file_exists($_POST['unixname'] . "_settings.php")) {
    $_POST['unixname'] = preg_replace("/[^A-Za-z0-9_\$]/", "", $_POST['unixname']);
}
if (!isset($_POST['unixname'])) {
    $_POST['unixname'] = "idb";
}
if ($Error != "Yes") {
    ?>
コード例 #2
0
ファイル: sql.php プロジェクト: BackupTheBerlios/idb
        $SQLCharset = "latin1";
    }
    if ($Settings['charset'] == "UTF-8") {
        $SQLCollate = "utf8_unicode_ci";
        $SQLCharset = "utf8";
    }
    $Settings['sql_collate'] = $SQLCollate;
    $Settings['sql_charset'] = $SQLCharset;
}
sql_set_charset($SQLCharset, $SQLStat);
if ($SQLStat === false) {
    header("Content-Type: text/plain; charset=" . $Settings['charset']);
    sql_free_result($peresult);
    ob_clean();
    echo "Sorry could not connect to sql database.\nContact the board admin about error. Error log below.";
    echo "\n" . sql_errorno();
    $urlstatus = 503;
    gzip_page($Settings['use_gzip'], $GZipEncode['Type']);
    session_write_close();
    die;
}
$sqltable = $Settings['sqltable'];
$temp_user_ip = $_SERVER['REMOTE_ADDR'];
if (!isset($_SERVER['HTTP_USER_AGENT'])) {
    $_SERVER['HTTP_USER_AGENT'] = "";
}
if (strpos($_SERVER['HTTP_USER_AGENT'], "msie") && !strpos($_SERVER['HTTP_USER_AGENT'], "opera")) {
    header("X-UA-Compatible: IE=Edge");
}
if (strpos($_SERVER['HTTP_USER_AGENT'], "chromeframe")) {
    header("X-UA-Compatible: IE=Edge,chrome=1");
コード例 #3
0
ファイル: mkconfig.php プロジェクト: BackupTheBerlios/idb
    }
    if ($Settings['charset'] == "ISO-8859-15") {
        $SQLCollate = "latin1_general_ci";
        $SQLCharset = "latin1";
    }
    if ($Settings['charset'] == "UTF-8") {
        $SQLCollate = "utf8_unicode_ci";
        $SQLCharset = "utf8";
    }
    $Settings['sql_collate'] = $SQLCollate;
    $Settings['sql_charset'] = $SQLCharset;
}
sql_set_charset($SQLCharset, $SQLStat);
if ($SQLStat === false) {
    $Error = "Yes";
    echo "<br />" . sql_errorno($SQLStat) . "\n";
}
if ($Error != "Yes") {
    $ServerUUID = rand_uuid("rand");
    if (!is_numeric($_POST['YourOffSet'])) {
        $_POST['YourOffSet'] = "0";
    }
    if (!is_numeric($_POST['MinOffSet'])) {
        $_POST['MinOffSet'] = "00";
    }
    if ($_POST['MinOffSet'] < 0) {
        $_POST['MinOffSet'] = "00";
    }
    $YourOffSet = $_POST['YourOffSet'] . ":" . $_POST['MinOffSet'];
    $AdminDST = $_POST['DST'];
    $MyDay = GMTimeGet("d", $YourOffSet, 0, $AdminDST);
コード例 #4
0
ファイル: sql.php プロジェクト: BackupTheBerlios/idb
        $SQLCharset = "latin1";
    }
    if ($Settings['charset'] == "UTF-8") {
        $SQLCollate = "utf8_unicode_ci";
        $SQLCharset = "utf8";
    }
    $Settings['sql_collate'] = $SQLCollate;
    $Settings['sql_charset'] = $SQLCharset;
}
sql_set_charset($SQLCharset, $SQLStat);
if ($SQLStat === false) {
    header("Content-Type: text/plain; charset=" . $Settings['charset']);
    sql_free_result($peresult);
    ob_clean();
    echo "Sorry could not connect to sql database.\nContact the board admin about error. Error log below.";
    echo "\n" . sql_errorno($SQLStat);
    $urlstatus = 503;
    gzip_page($Settings['use_gzip'], $GZipEncode['Type']);
    session_write_close();
    die;
}
$sqltable = $Settings['sqltable'];
$temp_user_ip = $_SERVER['REMOTE_ADDR'];
if (!isset($_SERVER['HTTP_USER_AGENT'])) {
    $_SERVER['HTTP_USER_AGENT'] = "";
}
if (strpos($_SERVER['HTTP_USER_AGENT'], "msie") && !strpos($_SERVER['HTTP_USER_AGENT'], "opera")) {
    header("X-UA-Compatible: IE=Edge");
}
if (strpos($_SERVER['HTTP_USER_AGENT'], "chromeframe")) {
    header("X-UA-Compatible: IE=Edge,chrome=1");