예제 #1
0
파일: utils.php 프로젝트: gw-acadtech/VCL
function dbConnect()
{
    global $vclhost, $vcldb, $vclusername, $vclpassword, $mysql_link_vcl;
    global $accthost, $acctusername, $acctpassword, $mysql_link_acct;
    global $ENABLE_ITECSAUTH;
    // open a connection to mysql server for vcl
    if (!($mysql_link_vcl = mysql_connect_plus($vclhost, $vclusername, $vclpassword))) {
        die("Error connecting to {$vclhost}.<br>\n");
    }
    // select the vcl database
    mysql_select_db($vcldb, $mysql_link_vcl) or abort(104);
    if ($ENABLE_ITECSAUTH) {
        // open a connection to mysql server for accounts
        if (!($mysql_link_acct = mysql_connect_plus($accthost, $acctusername, $acctpassword))) {
            $ENABLE_ITECSAUTH = 0;
            return;
        }
        // select the accounts database
        mysql_select_db("accounts", $mysql_link_acct);
        # or safeExit($RC["ERROR"], "Failed to select vcl database");
    }
}
예제 #2
0
function dbConnect()
{
    global $vclhost, $vcldb, $vclusername, $vclpassword, $mysql_link_vcl;
    global $accthost, $acctusername, $acctpassword, $mysql_link_acct;
    global $ENABLE_ITECSAUTH;
    if ($ENABLE_ITECSAUTH) {
        // open a connection to mysql server for accounts
        if ($mysql_link_acct = mysql_connect_plus($accthost, $acctusername, $acctpassword)) {
            mysql_select_db("accounts", $mysql_link_acct);
        } else {
            $ENABLE_ITECSAUTH = 0;
        }
    }
    // open a connection to mysql server for vcl
    if (!($mysql_link_vcl = mysql_connect_plus($vclhost, $vclusername, $vclpassword))) {
        die("Error connecting to {$vclhost}.<br>\n");
    }
    // select the vcl database
    mysql_select_db($vcldb, $mysql_link_vcl) or abort(104);
}