Permalink
Browse files

more hardcoded bug fixes

  • Loading branch information...
1 parent 867f41e commit bb3385d7b87960b655584b2e475bfd478e350a85 @georgiaw committed Aug 4, 2012
Showing with 37 additions and 10 deletions.
  1. +17 −5 frameworkconsole/agentpoll.pl
  2. +20 −5 frameworkgui/agentpoll.pl
@@ -36,7 +36,7 @@
system($catcommand);
@split = split(/ /, $line);
if (@split[0] eq $key)
- {
+∠{
if (@split[1] eq "ROOT")
{
$delivery = @split[2];
@@ -271,7 +271,10 @@
open(TEXTFILE, "+<$text");
$line= <TEXTFILE>;
$table = "data";
- $dbh = DBI->connect("dbi:mysql:database=framework;host=$sqlserver;port=3306", 'root','password');
+ $username = $Variables{"MYSQLUSER"};
+ $password = $Variables{"MYSQLPASS"};
+ $port = $Variables{"MYSQLPORT"};
+ $dbh = DBI->connect("dbi:mysql:database=framework;host=$sqlserver;port=$port", $username,$password);
$insertquery = "UPDATE $table SET sms=" . "'" . $line . "'" . " WHERE id=" . "'" . $id . "'";
$sql = $dbh->prepare($insertquery);
$sql->execute;
@@ -295,7 +298,10 @@
open(TEXTFILE, "+<$text");
$line= <TEXTFILE>;
$table = "data";
- $dbh = DBI->connect("dbi:mysql:database=framework;host=$sqlserver;port=3306", 'root','password');
+ $username = $Variables{"MYSQLUSER"};
+ $password = $Variables{"MYSQLPASS"};
+ $port = $Variables{"MYSQLPORT"};
+ $dbh = DBI->connect("dbi:mysql:database=framework;host=$sqlserver;port=$port", $username,$password);
$insertquery = "UPDATE $table SET sms=" . "'" . $line . "'" . " WHERE id=" . "'" . $id . "'";
$sql = $dbh->prepare($insertquery);
close(TEXTFILE);
@@ -333,7 +339,10 @@
open(TEXTFILE, "+<$text");
$line= <TEXTFILE>;
$table = "data";
- $dbh = DBI->connect("dbi:mysql:database=framework;host=$sqlserver;port=3306", 'root','password');
+ $username = $Variables{"MYSQLUSER"};
+ $password = $Variables{"MYSQLPASS"};
+ $port = $Variables{"MYSQLPORT"};
+ $dbh = DBI->connect("dbi:mysql:database=framework;host=$sqlserver;port=$port", $username,$password);
$insertquery = "UPDATE $table SET sms=" . "'" . $line . "'" . " WHERE id=" . "'" . $id . "'";
$sql = $dbh->prepare($insertquery);
$sql->execute;
@@ -488,7 +497,10 @@
open(TEXTFILE, "+<$text");
$line= <TEXTFILE>;
$table = "data";
- $dbh = DBI->connect("dbi:mysql:database=framework;host=$sqlserver;port=3306", 'root','password');
+ $username = $Variables{"MYSQLUSER"};
+ $password = $Variables{"MYSQLPASS"};
+ $port = $Variables{"MYSQLPORT"};
+ $dbh = DBI->connect("dbi:mysql:database=framework;host=$sqlserver;port=$port", $username,$password);
$insertquery = "UPDATE $table SET contacts=" . "'" . $line . "'" . " WHERE id=" . "'" . $id . "'";
$sql = $dbh->prepare($insertquery);
$sql->execute;
View
@@ -105,7 +105,10 @@
if ($line eq "Root Succeeded")
{
$table = "data";
- $dbh = DBI->connect("dbi:mysql:database=framework;host=$sqlserver;port=3306", 'root','password');
+ $username = $Variables{"MYSQLUSER"};
+ $password = $Variables{"MYSQLPASS"};
+ $port = $Variables{"MYSQLPORT"};
+ $dbh = DBI->connect("dbi:mysql:database=framework;host=$sqlserver;port=$port", $username,$password);
$yes = "yes";
$insertquery = "UPDATE $table SET root=" . "'" . $yes . "'" . " WHERE id=" . "'" . $id . "'";
$sql = $dbh->prepare($insertquery);
@@ -268,7 +271,10 @@
open(TEXTFILE, "+<$text");
$line= <TEXTFILE>;
$table = "data";
- $dbh = DBI->connect("dbi:mysql:database=framework;host=$sqlserver;port=3306", 'root','password');
+ $username = $Variables{"MYSQLUSER"};
+ $password = $Variables{"MYSQLPASS"};
+ $port = $Variables{"MYSQLPORT"};
+ $dbh = DBI->connect("dbi:mysql:database=framework;host=$sqlserver;port=$port", $username,$password);
$insertquery = "UPDATE $table SET sms=" . "'" . $line . "'" . " WHERE id=" . "'" . $id . "'";
$sql = $dbh->prepare($insertquery);
$sql->execute;
@@ -292,7 +298,10 @@
open(TEXTFILE, "+<$text");
$line= <TEXTFILE>;
$table = "data";
- $dbh = DBI->connect("dbi:mysql:database=framework;host=$sqlserver;port=3306", 'root','password');
+ $username = $Variables{"MYSQLUSER"};
+ $password = $Variables{"MYSQLPASS"};
+ $port = $Variables{"MYSQLPORT"};
+ $dbh = DBI->connect("dbi:mysql:database=framework;host=$sqlserver;port=$port", $username,$password);
$insertquery = "UPDATE $table SET sms=" . "'" . $line . "'" . " WHERE id=" . "'" . $id . "'";
$sql = $dbh->prepare($insertquery);
close(TEXTFILE);
@@ -330,7 +339,10 @@
open(TEXTFILE, "+<$text");
$line= <TEXTFILE>;
$table = "data";
- $dbh = DBI->connect("dbi:mysql:database=framework;host=$sqlserver;port=3306", 'root','password');
+ $username = $Variables{"MYSQLUSER"};
+ $password = $Variables{"MYSQLPASS"};
+ $port = $Variables{"MYSQLPORT"};
+ $dbh = DBI->connect("dbi:mysql:database=framework;host=$sqlserver;port=$port", $username,$password);
$insertquery = "UPDATE $table SET sms=" . "'" . $line . "'" . " WHERE id=" . "'" . $id . "'";
$sql = $dbh->prepare($insertquery);
$sql->execute;
@@ -485,7 +497,10 @@
open(TEXTFILE, "+<$text");
$line= <TEXTFILE>;
$table = "data";
- $dbh = DBI->connect("dbi:mysql:database=framework;host=$sqlserver;port=3306", 'root','password');
+ $username = $Variables{"MYSQLUSER"};
+ $password = $Variables{"MYSQLPASS"};
+ $port = $Variables{"MYSQLPORT"};
+ $dbh = DBI->connect("dbi:mysql:database=framework;host=$sqlserver;port=$port", $username,$password);
$insertquery = "UPDATE $table SET contacts=" . "'" . $line . "'" . " WHERE id=" . "'" . $id . "'";
$sql = $dbh->prepare($insertquery);
$sql->execute;

0 comments on commit bb3385d

Please sign in to comment.