Skip to content

Commit

Permalink
Merge pull request #534 from Augustin-FL/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
rbgarga committed Aug 6, 2018
2 parents eb39538 + e58a61c commit 9f7d8df
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 55 deletions.
2 changes: 1 addition & 1 deletion net/pear-Auth_RADIUS/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

PORTNAME= Auth_RADIUS
PORTVERSION= 1.1.0
PORTREVISION= 3
PORTREVISION= 4
CATEGORIES= net security pear

MAINTAINER= bofh@FreeBSD.org
Expand Down
70 changes: 16 additions & 54 deletions net/pear-Auth_RADIUS/files/patch-Auth_RADIUS.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,53 +12,20 @@
/**
* Puts standard attributes.
*/
@@ -300,6 +305,45 @@ class Auth_RADIUS {
$this->putAttribute(RADIUS_SERVICE_TYPE, RADIUS_FRAMED);
$this->putAttribute(RADIUS_FRAMED_PROTOCOL, RADIUS_PPP);
$this->putAttribute(RADIUS_CALLING_STATION_ID, isset($var['REMOTE_HOST']) ? $var['REMOTE_HOST'] : '127.0.0.1');
+
+ if (!function_exists("getNasIp")) {
+ $ipaddr = "0.0.0.0";
+ } else {
+ $ipaddr = getNasIP();
+ }
+
+ /*
+ * Add support for sending NAS-IP-Address, set this explicitly
+ * as an ip_addr
+ */
+ $this->putAttribute(RADIUS_NAS_IP_ADDRESS, $ipaddr, "addr");
+
+ /* Add support for sending NAS-Identifier */
+ if (function_exists("getNasID")) {
+ $nasId = getNasID();
+ } else if (!empty($cpzone) &&
+ empty($config["captiveportal"][$cpzone]["radiusnasid"])) {
+ $nasId = php_uname("n");
+ } else {
+ $nasId =
+ $config["captiveportal"][$cpzone]["radiusnasid"];
+ }
+ $this->putAttribute(RADIUS_NAS_IDENTIFIER, $nasId);
+
+ if (function_exists("getNasPortType")) {
+ $this->putAttribute(RADIUS_NAS_PORT_TYPE,
+ getNasPortType());
+ }
+
+ if (function_exists("getNasPort")) {
+ $this->putAttribute(RADIUS_NAS_PORT, getNasPort(),
+ 'integer');
+ }
+
+ if (function_exists("getCalledStationId")) {
+ $this->putAttribute(RADIUS_CALLED_STATION_ID,
+ getCalledStationId());
+ }
@@ -295,11 +300,7 @@ class Auth_RADIUS {
$var = $GLOBALS['HTTP_SERVER_VARS'];
}

- $this->putAttribute(RADIUS_NAS_IDENTIFIER, isset($var['HTTP_HOST']) ? $var['HTTP_HOST'] : 'localhost');
- $this->putAttribute(RADIUS_NAS_PORT_TYPE, RADIUS_VIRTUAL);
- $this->putAttribute(RADIUS_SERVICE_TYPE, RADIUS_FRAMED);
- $this->putAttribute(RADIUS_FRAMED_PROTOCOL, RADIUS_PPP);
- $this->putAttribute(RADIUS_CALLING_STATION_ID, isset($var['REMOTE_HOST']) ? $var['REMOTE_HOST'] : '127.0.0.1');
+ $this->putAttribute(RADIUS_SERVICE_TYPE, RADIUS_LOGIN);
}

/**
@@ -384,13 +428,13 @@ class Auth_RADIUS {
@@ -384,13 +385,13 @@ class Auth_RADIUS {
{
$req = radius_send_request($this->res);
if (!$req) {
Expand All @@ -74,7 +41,7 @@
}
return true;

@@ -399,12 +443,12 @@ class Auth_RADIUS {
@@ -399,12 +400,12 @@ class Auth_RADIUS {

case RADIUS_ACCOUNTING_RESPONSE:
if (is_subclass_of($this, 'auth_radius_pap')) {
Expand All @@ -89,7 +56,7 @@
}

}
@@ -464,7 +508,10 @@ class Auth_RADIUS {
@@ -464,7 +465,10 @@ class Auth_RADIUS {
break;

case RADIUS_CLASS:
Expand All @@ -101,7 +68,7 @@
break;

case RADIUS_FRAMED_PROTOCOL:
@@ -536,9 +583,179 @@ class Auth_RADIUS {
@@ -536,9 +540,179 @@ class Auth_RADIUS {
$this->attributes['ms_primary_dns_server'] = radius_cvt_string($datav);
break;
}
Expand Down Expand Up @@ -282,7 +249,7 @@
}
}

@@ -935,14 +1152,21 @@ class Auth_RADIUS_Acct extends Auth_RADIUS
@@ -935,11 +1109,16 @@ class Auth_RADIUS_Acct extends Auth_RADIUS
*/
function putAuthAttributes()
{
Expand All @@ -301,12 +268,7 @@ function putAuthAttributes()
if (isset($this->authentic)) {
$this->putAttribute(RADIUS_ACCT_AUTHENTIC, $this->authentic);
}
+
+ $this->putStandardAttributes();

}

@@ -1003,4 +1227,22 @@ class Auth_RADIUS_Acct_Update extends Auth_RADIUS_Acct
@@ -1003,4 +1182,22 @@ class Auth_RADIUS_Acct_Update extends Auth_RADIUS_Acct
var $status_type = RADIUS_UPDATE;
}

Expand Down

0 comments on commit 9f7d8df

Please sign in to comment.