Sp0tteh
01-24-10, 12:58 PM
Hey all,
I'm having some problems with a module I'm trying to create.
In short what I'm trying to do is add the new user into a freeradius database on another server using mysql. Now this works, the problem is that the account stays as "Pending" (In WHMCS) even though i can see the data in the freeradius database and no sql errors.
function radius_CreateAccount($params) {
$dbhost = 'fake';
$dbuser = 'fake';
$dbpass = 'fake';
$dbname = 'fake';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
//mysql_select_db($dbname, $conn);
//mysql_query("INSERT INTO radcheck (username, attribute, op, value) VALUES ('".$clientsdetails['email']."', 'User-Password', ':=', '".$password."')", $conn);
//mysql_query("INSERT INTO radusergroup (username, groupname, priority) VALUES ('".$clientsdetails['email']."', 'Dynamic', '1')", $conn);
mysql_close($conn);
return "success";
}
In the code above i have tried to force it with the " return "success";" but it doesn't seem to make any difference.
If i comment out the "mysql_connect" line above, then it shows as "active". From my understanding PHP should have no issues creating a second sql connection.
If someone could help me out or at least explain whats going on it would be greatly appreciated
I'm having some problems with a module I'm trying to create.
In short what I'm trying to do is add the new user into a freeradius database on another server using mysql. Now this works, the problem is that the account stays as "Pending" (In WHMCS) even though i can see the data in the freeradius database and no sql errors.
function radius_CreateAccount($params) {
$dbhost = 'fake';
$dbuser = 'fake';
$dbpass = 'fake';
$dbname = 'fake';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
//mysql_select_db($dbname, $conn);
//mysql_query("INSERT INTO radcheck (username, attribute, op, value) VALUES ('".$clientsdetails['email']."', 'User-Password', ':=', '".$password."')", $conn);
//mysql_query("INSERT INTO radusergroup (username, groupname, priority) VALUES ('".$clientsdetails['email']."', 'Dynamic', '1')", $conn);
mysql_close($conn);
return "success";
}
In the code above i have tried to force it with the " return "success";" but it doesn't seem to make any difference.
If i comment out the "mysql_connect" line above, then it shows as "active". From my understanding PHP should have no issues creating a second sql connection.
If someone could help me out or at least explain whats going on it would be greatly appreciated