Tested gateway with registration set to false on 1.4.15 no longer requires a username and password so it is no longer required in fusionpbx when the registration is set to false.

This commit is contained in:
Mark Crane
2015-01-29 07:07:54 +00:00
parent 1d2d13d120
commit 30706fa11d
3 changed files with 6 additions and 16 deletions

View File

@@ -421,7 +421,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo " ".$text['label-username'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='username' maxlength='255' autocomplete='off' value=\"$username\" required='required'>\n";
echo " <input class='formfld' type='text' name='username' maxlength='255' autocomplete='off' value=\"$username\">\n";
echo "<br />\n";
echo $text['description-username']."\n";
echo "</td>\n";
@@ -432,7 +432,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo " ".$text['label-password'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='password' name='password' id='password' autocomplete='off' maxlength='255' onmouseover=\"this.type='text';\" onfocus=\"this.type='text';\" onmouseout=\"if (!$(this).is(':focus')) { this.type='password'; }\" onblur=\"this.type='password';\" value=\"$password\" required='required'>\n";
echo " <input class='formfld' type='password' name='password' id='password' autocomplete='off' maxlength='255' onmouseover=\"this.type='text';\" onfocus=\"this.type='text';\" onmouseout=\"if (!$(this).is(':focus')) { this.type='password'; }\" onblur=\"this.type='password';\" value=\"$password\">\n";
echo " <br />\n";
echo " ".$text['description-password']."\n";
echo "</td>\n";

View File

@@ -113,7 +113,7 @@
sql = "select * from v_gateways as g, v_domains as d ";
sql = sql .. "where g.profile = '"..sip_profile_name.."' ";
sql = sql .. "and g.enabled = 'true' ";
sql = sql .. "and g.domain_uuid = d.domain_uuid ";
sql = sql .. "and (g.domain_uuid = d.domain_uuid or g.domain_uuid is null) ";
else
sql = "select * from v_gateways ";
sql = sql .. "where enabled = 'true' and profile = '"..sip_profile_name.."' ";
@@ -126,9 +126,7 @@
table.insert(xml, [[ <gateway name="]] .. string.lower(field.gateway_uuid) .. [[">]]);
if (string.len(field.username) > 0) then
table.insert(xml, [[ <param name="username" value="]] .. field.username .. [["/>]]);
else
table.insert(xml, [[ <param name="username" value="register:false"/>]]);
table.insert(xml, [[ <param name="username" value="]] .. field.username .. [["/>]]);;
end
if (string.len(field.distinct_to) > 0) then
table.insert(xml, [[ <param name="distinct-to" value="]] .. field.distinct_to .. [["/>]]);
@@ -137,9 +135,7 @@
table.insert(xml, [[ <param name="auth-username" value="]] .. field.auth_username .. [["/>]]);
end
if (string.len(field.password) > 0) then
table.insert(xml, [[ <param name="password" value="]] .. field.password .. [["/>]]);
else
table.insert(xml, [[ <param name="password" value="register:false"/>]]);
table.insert(xml, [[ <param name="password" value="]] .. field.password .. [["/>]]);;
end
if (string.len(field.realm) > 0) then
table.insert(xml, [[ <param name="realm" value="]] .. field.realm .. [["/>]]);

View File

@@ -1808,7 +1808,7 @@ function save_gateway_xml() {
//get the list of gateways and write the xml
$sql = "select * from v_gateways ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "where (domain_uuid = '$domain_uuid' or domain_uuid is null) ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
@@ -1827,9 +1827,6 @@ function save_gateway_xml() {
if (strlen($row['username']) > 0) {
$xml .= " <param name=\"username\" value=\"" . $row['username'] . "\"/>\n";
}
else {
$xml .= " <param name=\"username\" value=\"register:false\"/>\n";
}
if (strlen($row['distinct_to']) > 0) {
$xml .= " <param name=\"distinct-to\" value=\"" . $row['distinct_to'] . "\"/>\n";
}
@@ -1839,9 +1836,6 @@ function save_gateway_xml() {
if (strlen($row['password']) > 0) {
$xml .= " <param name=\"password\" value=\"" . $row['password'] . "\"/>\n";
}
else {
$xml .= " <param name=\"password\" value=\"register:false\"/>\n";
}
if (strlen($row['realm']) > 0) {
$xml .= " <param name=\"realm\" value=\"" . $row['realm'] . "\"/>\n";
}