You are here

public function LdapTestFunctions::generateUserLDAPAttributes in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.2 ldap_test/LdapTestFunctions.class.php \LdapTestFunctions::generateUserLDAPAttributes()
1 call to LdapTestFunctions::generateUserLDAPAttributes()
LdapTestFunctions::populateFakeLdapServerData in ldap_test/LdapTestFunctions.class.php
Set variable with fake test data.

File

ldap_test/LdapTestFunctions.class.php, line 321

Class

LdapTestFunctions

Code

public function generateUserLDAPAttributes($test_ldap_id, $user) {
  $attributes = [
    'cn' => [
      0 => $user['cn'],
      'count' => 1,
    ],
    'mail' => [
      0 => $user['cn'] . '@' . $this->csvTables['conf'][$test_ldap_id]['mailhostname'],
      'count' => 1,
    ],
    'uid' => [
      0 => $user['uid'],
      'count' => 1,
    ],
    'guid' => [
      0 => $user['guid'],
      'count' => 1,
    ],
    'sn' => [
      0 => $user['lname'],
      'count' => 1,
    ],
    'givenname' => [
      0 => $user['fname'],
      'count' => 1,
    ],
    'house' => [
      0 => $user['house'],
      'count' => 1,
    ],
    'department' => [
      0 => $user['department'],
      'count' => 1,
    ],
    'faculty' => [
      0 => (int) (bool) $user['faculty'],
      'count' => 1,
    ],
    'staff' => [
      0 => (int) (bool) $user['staff'],
      'count' => 1,
    ],
    'student' => [
      0 => (int) (bool) $user['student'],
      'count' => 1,
    ],
    'gpa' => [
      0 => $user['gpa'],
      'count' => 1,
    ],
    'probation' => [
      0 => (int) (bool) $user['probation'],
      'count' => 1,
    ],
    'password' => [
      0 => 'goodpwd',
      'count' => 1,
    ],
  ];
  return $attributes;
}