Lines 69-75
Link Here
|
69 |
if($k[$i] eq $unit) { |
69 |
if($k[$i] eq $unit) { |
70 |
use DBI; |
70 |
use DBI; |
71 |
|
71 |
|
72 |
$dbh = DBI->connect("DBI:mysql:database=$mysql_dbname;host=$mysql_host", $mysql_login, $mysql_password); |
72 |
$dbh = DBI->connect("DBI:$sql_type:database=$sql_dbname;host=$sql_host", $sql_login, $sql_password); |
73 |
if ($dbh eq "") {$p1.="<b>Unable to connect to SQL radius database!</b><hr>"; } |
73 |
if ($dbh eq "") {$p1.="<b>Unable to connect to SQL radius database!</b><hr>"; } |
74 |
$dbh->do("REPLACE $radcheck VALUES (".hex($oid).",'$name','Password','==','$password')"); |
74 |
$dbh->do("REPLACE $radcheck VALUES (".hex($oid).",'$name','Password','==','$password')"); |
75 |
$p4.="<b><i>Applying:</i></b> Syncing to Radius server<br>"; |
75 |
$p4.="<b><i>Applying:</i></b> Syncing to Radius server<br>"; |
Lines 121-131
Link Here
|
121 |
} elsif ($cgi->param("action") eq "view") { |
121 |
} elsif ($cgi->param("action") eq "view") { |
122 |
use DBI; |
122 |
use DBI; |
123 |
|
123 |
|
124 |
$dbh = DBI->connect("DBI:mysql:database=$mysql_dbname;host=$mysql_host", $mysql_login, $mysql_password); |
124 |
$dbh = DBI->connect("DBI:$sql_type:database=$sql_dbname;host=$sql_host", $sql_login, $sql_password); |
125 |
if ($dbh eq "") { |
125 |
if ($dbh eq "") { |
126 |
$p4.="<b>Unable to connect to SQL radius database!</b><hr>"; } |
126 |
$p4.="<b>Unable to connect to SQL radius database!</b><hr>"; } |
127 |
else { |
127 |
else { |
128 |
$p4.="<b>Connected to database $mysql_dbname</b><hr>"; |
128 |
$p4.="<b>Connected to database $sql_dbname</b><hr>"; |
129 |
} |
129 |
} |
130 |
|
130 |
|
131 |
$sth = $dbh->prepare("SELECT * FROM events WHERE account_oid='".hex($oid)."' ORDER BY time DESC"); |
131 |
$sth = $dbh->prepare("SELECT * FROM events WHERE account_oid='".hex($oid)."' ORDER BY time DESC"); |
Lines 235-241
Link Here
|
235 |
if (defined $log_to_events) { |
235 |
if (defined $log_to_events) { |
236 |
if ($log_to_events eq "yes") { |
236 |
if ($log_to_events eq "yes") { |
237 |
use DBI; |
237 |
use DBI; |
238 |
$dbh = DBI->connect("DBI:mysql:database=$mysql_dbname;host=$mysql_host", $mysql_login, $mysql_password |
238 |
$dbh = DBI->connect("DBI:$sql_type:database=$sql_dbname;host=$sql_host", $sql_login, $sql_password |
239 |
); |
239 |
); |
240 |
if ($dbh eq "") { return; } |
240 |
if ($dbh eq "") { return; } |
241 |
else { |
241 |
else { |