Skip to content

Commit

Permalink
use $_ENV instead of getenv() (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stell0 authored May 31, 2024
1 parent ab2fd15 commit 826f97c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions freepbx/var/www/html/freepbx/rest/lib/libUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
require_once('/etc/freepbx.conf');

function getUserPortalUrl() {
$host = getenv('NETHVOICE_HOST');
$host = $_ENV['NETHVOICE_HOST'];

# get domain
$provider_domain = strtolower(getenv('NETHVOICE_LDAP_BASE'));
$provider_domain = strtolower($_ENV['NETHVOICE_LDAP_BASE']);

# parse domain
$dcs = explode("dc=", $provider_domain);
Expand All @@ -39,8 +39,8 @@ function getUserPortalUrl() {

function getToken() {
$post = [
"username" => getenv('NETHVOICE_USER_PORTAL_USERNAME'),
"password" => getenv('NETHVOICE_USER_PORTAL_PASSWORD'),
"username" => $_ENV['NETHVOICE_USER_PORTAL_USERNAME'],
"password" => $_ENV['NETHVOICE_USER_PORTAL_PASSWORD'],
];

$ch = curl_init(getUserPortalUrl() . '/login');
Expand Down Expand Up @@ -175,7 +175,7 @@ function getUserID($username) {

function getAllUsers() {
global $astman;
$blacklist = ['admin', 'administrator', 'guest', 'krbtgt','ldapservice', getenv('NETHVOICE_USER_PORTAL_USERNAME')];
$blacklist = ['admin', 'administrator', 'guest', 'krbtgt','ldapservice', $_ENV['NETHVOICE_USER_PORTAL_USERNAME']];
$users = FreePBX::create()->Userman->getAllUsers();
$dbh = FreePBX::Database();
$i = 0;
Expand Down
2 changes: 1 addition & 1 deletion freepbx/var/www/html/freepbx/rest/lib/nmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def __init__(self, nmap_search_path=('nmap', '/usr/bin/nmap', '/usr/local/bin/nm
else:
raise PortScannerError(
'nmap program was not found in path. PATH is : {0}'.format(
os.getenv('PATH')
os.$_ENV['PATH']
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function setLegacyMode($value) {

$app->get('/configuration/userprovider', function (Request $request, Response $response, $args) {
# Get domain
$provider_domain = strtolower(getenv('NETHVOICE_LDAP_BASE'));
$provider_domain = strtolower($_ENV['NETHVOICE_LDAP_BASE']);

# Parse domain
$dcs = explode("dc=", $provider_domain);
Expand Down

0 comments on commit 826f97c

Please sign in to comment.