summaryrefslogtreecommitdiffstats
path: root/etc/inc/auth.inc
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-05-31 10:55:20 +0545
committerPhil Davis <phil.davis@inf.org>2015-05-31 10:55:20 +0545
commit086cf944580b3a62a7c0e5dcbd2b92115cfb1334 (patch)
tree5043b938bdfd715daf231bfa3825d0b51c8c16f3 /etc/inc/auth.inc
parent5be3060472b257e0f171669b91d4e407960463e6 (diff)
downloadpfsense-086cf944580b3a62a7c0e5dcbd2b92115cfb1334.zip
pfsense-086cf944580b3a62a7c0e5dcbd2b92115cfb1334.tar.gz
Code style bits and pieces from etc
Diffstat (limited to 'etc/inc/auth.inc')
-rw-r--r--etc/inc/auth.inc34
1 files changed, 17 insertions, 17 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc
index ee32c2b..0a2cbfa 100644
--- a/etc/inc/auth.inc
+++ b/etc/inc/auth.inc
@@ -293,7 +293,7 @@ function get_user_privileges(& $user) {
foreach ($names as $name) {
$group = getGroupEntry($name);
if (is_array($group['priv'])) {
- $privs = array_merge( $privs, $group['priv']);
+ $privs = array_merge($privs, $group['priv']);
}
}
@@ -353,7 +353,7 @@ function local_sync_accounts() {
$fd = popen("/usr/sbin/pw usershow -a", "r");
if ($fd) {
while (!feof($fd)) {
- $line = explode(":",fgets($fd));
+ $line = explode(":", fgets($fd));
if (((!strncmp($line[0], "_", 1)) || ($line[2] < 2000) || ($line[2] > 65000)) && ($line[0] != "admin")) {
continue;
}
@@ -376,7 +376,7 @@ function local_sync_accounts() {
$fd = popen("/usr/sbin/pw groupshow -a", "r");
if ($fd) {
while (!feof($fd)) {
- $line = explode(":",fgets($fd));
+ $line = explode(":", fgets($fd));
if (!strncmp($line[0], "_", 1)) {
continue;
}
@@ -572,7 +572,7 @@ function local_user_set_password(& $user, $password) {
$ustr = '';
for ($i = 0; $i < strlen($astr); $i++) {
$a = ord($astr{$i}) << 8;
- $ustr.= sprintf("%X", $a);
+ $ustr .= sprintf("%X", $a);
}
// Generate the NT-HASH from the unicode string
@@ -588,7 +588,7 @@ function local_user_get_groups($user, $all = false) {
}
foreach ($config['system']['group'] as $group) {
- if ( $all || ( !$all && ($group['name'] != "all"))) {
+ if ($all || (!$all && ($group['name'] != "all"))) {
if (is_array($group['member'])) {
if (in_array($user['uid'], $group['member'])) {
$groups[] = $group['name'];
@@ -607,7 +607,7 @@ function local_user_get_groups($user, $all = false) {
}
-function local_user_set_groups($user, $new_groups = NULL ) {
+function local_user_set_groups($user, $new_groups = NULL) {
global $debug, $config, $groupindex;
if (!is_array($config['system']['group'])) {
@@ -627,7 +627,7 @@ function local_user_set_groups($user, $new_groups = NULL ) {
/* determine which memberships to add */
foreach ($new_groups as $groupname) {
- if ($groupname == '' || in_array($groupname,$cur_groups)) {
+ if ($groupname == '' || in_array($groupname, $cur_groups)) {
continue;
}
$group = & $config['system']['group'][$groupindex[$groupname]];
@@ -638,7 +638,7 @@ function local_user_set_groups($user, $new_groups = NULL ) {
/* determine which memberships to remove */
foreach ($cur_groups as $groupname) {
- if (in_array($groupname,$new_groups)) {
+ if (in_array($groupname, $new_groups)) {
continue;
}
if (!isset($config['system']['group'][$groupindex[$groupname]])) {
@@ -684,7 +684,7 @@ function local_group_set($group, $reset = false) {
$group_gid = $group['gid'];
$group_members = '';
if (!$reset && !empty($group['member']) && count($group['member']) > 0) {
- $group_members = implode(",",$group['member']);
+ $group_members = implode(",", $group['member']);
}
if (empty($group_name)) {
@@ -747,7 +747,7 @@ function ldap_test_connection($authcfg) {
}
/* first check if there is even an LDAP server populated */
- if ( !$ldapserver) {
+ if (!$ldapserver) {
return false;
}
@@ -956,8 +956,8 @@ function ldap_get_user_ous($show_complete_ou=true, $authcfg) {
if (!$show_complete_ou) {
$inf_split = explode(",", $inf['dn']);
$ou = $inf_split[0];
- $ou = str_replace("OU=","", $ou);
- $ou = str_replace("CN=","", $ou);
+ $ou = str_replace("OU=", "", $ou);
+ $ou = str_replace("CN=", "", $ou);
} else {
if ($inf['dn']) {
$ou = $inf['dn'];
@@ -1095,7 +1095,7 @@ function ldap_get_groups($username, $authcfg) {
/* Time to close LDAP connection */
@ldap_unbind($ldap);
- $groups = print_r($memberof,true);
+ $groups = print_r($memberof, true);
//log_error("Returning groups ".$groups." for user $username");
@@ -1214,7 +1214,7 @@ function ldap_backed($username, $passwd, $authcfg) {
/* Get LDAP Authcontainers and split em up. */
$ldac_splits = explode(";", $ldapauthcont);
- /* setup the usercount so we think we havn't found anyone yet */
+ /* setup the usercount so we think we haven't found anyone yet */
$usercount = 0;
/*****************************************************************/
@@ -1251,7 +1251,7 @@ function ldap_backed($username, $passwd, $authcfg) {
log_error(sprintf(gettext("Search resulted in error: %s"), ldap_error($ldap)));
continue;
}
- $info = ldap_get_entries($ldap,$search);
+ $info = ldap_get_entries($ldap, $search);
$matches = $info['count'];
if ($matches == 1) {
$userdn = $_SESSION['ldapdn'] = $info[0]['dn'];
@@ -1360,7 +1360,7 @@ function get_user_expiration_date($username) {
function is_account_expired($username) {
$expirydate = get_user_expiration_date($username);
if ($expirydate) {
- if (strtotime("-1 day") > strtotime(date("m/d/Y",strtotime($expirydate)))) {
+ if (strtotime("-1 day") > strtotime(date("m/d/Y", strtotime($expirydate)))) {
return true;
}
}
@@ -1404,7 +1404,7 @@ function auth_get_authserver_list() {
}
}
- $list["Local Database"] = array( "name" => gettext("Local Database"), "type" => "Local Auth", "host" => $config['system']['hostname']);
+ $list["Local Database"] = array("name" => gettext("Local Database"), "type" => "Local Auth", "host" => $config['system']['hostname']);
return $list;
}
OpenPOWER on IntegriCloud