Files
ViciDialSVN/agc_2-X/trunk/www/agc/dbconnect.php
T
mattf 35d12e4374 Added ability to use .agi scripts in Call Menu prompt. Also added cm_date.agi script to say date with options
Converted ereg to preg in the agc agent interface PHP scripts

git-svn-id: svn://192.168.202.10@1945 3d104415-ff17-0410-8863-d5cf3c621b8a
2013-03-28 04:52:48 +00:00

66 lines
2.2 KiB
PHP

<?php
#
# dbconnect.php version 2.6
#
# database connection settings and some global web settings
#
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES:
# 130328-0022 - Converted ereg to preg functions
#
if ( file_exists("/etc/astguiclient.conf") )
{
$DBCagc = file("/etc/astguiclient.conf");
foreach ($DBCagc as $DBCline)
{
$DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline);
if (preg_match("/^PATHlogs/", $DBCline))
{$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);}
if (preg_match("/^PATHweb/", $DBCline))
{$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);}
if (preg_match("/^VARserver_ip/", $DBCline))
{$WEBserver_ip = $DBCline; $WEBserver_ip = preg_replace("/.*=/","",$WEBserver_ip);}
if (preg_match("/^VARDB_server/", $DBCline))
{$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);}
if (preg_match("/^VARDB_database/", $DBCline))
{$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);}
if (preg_match("/^VARDB_user/", $DBCline))
{$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);}
if (preg_match("/^VARDB_pass/", $DBCline))
{$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);}
if (preg_match("/^VARDB_port/", $DBCline))
{$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);}
}
}
else
{
#defaults for DB connection
$VARDB_server = 'localhost';
$VARDB_port = '3306';
$VARDB_user = 'cron';
$VARDB_pass = '1234';
$VARDB_database = '1234';
$WeBServeRRooT = '/usr/local/apache2/htdocs';
}
$link=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass");
if (!$link)
{
die('MySQL connect ERROR: ' . mysql_error());
}
mysql_select_db("$VARDB_database");
$local_DEF = 'Local/';
$conf_silent_prefix = '7';
$local_AMP = '@';
$ext_context = 'demo';
$recording_exten = '8309';
$WeBRooTWritablE = '1';
$non_latin = '0'; # set to 1 for UTF rules, overridden by system_settings
$flag_channels=0;
$flag_string = 'VICIast20';
?>