Skip to content

rename confusing variable #219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions resources/lib/UnityLDAP.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ class UnityLDAP extends ldapConn

// string vars for OUs
private $STR_USEROU;
private $STR_GROUPOU;
private $STR_USERGROUPOU;
private $STR_PIGROUPOU;
private $STR_ORGGROUPOU;
private $STR_ADMINGROUP;

// Instance vars for various ldapEntry objects
private $userOU;
private $groupOU;
private $user_groupOU;
private $pi_groupOU;
private $org_groupOU;
private $adminGroup;
Expand All @@ -59,14 +59,14 @@ public function __construct(
parent::__construct($host, $dn, $pass);

$this->STR_USEROU = $user_ou;
$this->STR_GROUPOU = $group_ou;
$this->STR_USERGROUPOU = $group_ou;
$this->STR_PIGROUPOU = $pigroup_ou;
$this->STR_ORGGROUPOU = $orggroup_ou;
$this->STR_ADMINGROUP = $admin_group;

// Get Global Entries
$this->userOU = $this->getEntry($user_ou);
$this->groupOU = $this->getEntry($group_ou);
$this->user_groupOU = $this->getEntry($group_ou);
$this->pi_groupOU = $this->getEntry($pigroup_ou);
$this->org_groupOU = $this->getEntry($orggroup_ou);
$this->adminGroup = $this->getEntry($admin_group);
Expand All @@ -85,9 +85,9 @@ public function getUserOU()
return $this->userOU;
}

public function getGroupOU()
public function getUserGroupOU()
{
return $this->groupOU;
return $this->user_groupOU;
}

public function getPIGroupOU()
Expand Down Expand Up @@ -186,7 +186,7 @@ private function PIGIDNumInUse($id)

private function GIDNumInUse($id)
{
$groups = $this->groupOU->getChildrenArray(true);
$groups = $this->user_groupOU->getChildrenArray(true);
foreach ($groups as $group) {
if ($group["gidnumber"][0] == $id) {
return true;
Expand Down Expand Up @@ -322,10 +322,10 @@ public function getUserEntry($uid)
return $this->getEntry(unityLDAP::RDN . "=$uid," . $this->STR_USEROU);
}

public function getGroupEntry($gid)
public function getUserGroupEntry($gid)
{
$gid = ldap_escape($gid, LDAP_ESCAPE_DN);
return $this->getEntry(unityLDAP::RDN . "=$gid," . $this->STR_GROUPOU);
return $this->getEntry(unityLDAP::RDN . "=$gid," . $this->STR_USERGROUPOU);
}

public function getPIGroupEntry($gid)
Expand Down
2 changes: 1 addition & 1 deletion resources/lib/UnityUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function getLDAPUser()
*/
public function getLDAPGroup()
{
return $this->LDAP->getGroupEntry($this->uid);
return $this->LDAP->getUserGroupEntry($this->uid);
}

public function exists()
Expand Down
Loading