aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/freeradius2/freeradius.inc16
1 files changed, 14 insertions, 2 deletions
diff --git a/config/freeradius2/freeradius.inc b/config/freeradius2/freeradius.inc
index 2a6594f7..60ccbdf4 100644
--- a/config/freeradius2/freeradius.inc
+++ b/config/freeradius2/freeradius.inc
@@ -390,6 +390,18 @@ if (is_array($arrusers) && !empty($arrusers)) {
$varusersusername = $users['varusersusername'];
$varuserspassword = $users['varuserspassword'];
+
+ // Check password encryption
+ $varuserspasswordencryption = ($users['varuserspasswordencryption']?$users['varuserspasswordencryption']:'Cleartext-Password');
+ switch ($varuserspasswordencryption) {
+ case "MD5-Password":
+ $varuserspassword = md5($varuserspassword);
+ break;
+ default:
+ $varuserspassword = $users['varuserspassword'];
+ }
+
+
$varusersmotpinitsecret = $users['varusersmotpinitsecret'];
$varusersmotppin = $users['varusersmotppin'];
$varusersmotpoffset = ($users['varusersmotpoffset']?$users['varusersmotpoffset']:'0');
@@ -467,7 +479,7 @@ if (is_array($arrusers) && !empty($arrusers)) {
}
else {
// Add the user attributes to each user.
- $varuserscheckitem = '"' . $varusersusername . '"' . " Cleartext-Password := " . '"' . $varuserspassword .'"';
+ $varuserscheckitem = '"' . $varusersusername . '"' . " $varuserspasswordencryption := " . '"' . $varuserspassword .'"';
}
} // end of check if otp is enabled
@@ -4189,4 +4201,4 @@ EOD;
}
-?> \ No newline at end of file
+?>