Beispiel #1
0
function make_person($info)
{
    global $personDisplayMapping;
    
    $person = array();
    foreach ($personDisplayMapping as $personDisplay)
    {
        if (($personDisplay[4] == TRUE) || ($personDisplay[7] == TRUE))
        {
            if (strcasecmp($personDisplay[0], "id") == 0)
            {
                $person[$personDisplay[0]] = id_key($info);
            }
            else
            {
                $person[$personDisplay[0]] = lkey($info, $personDisplay[1]);
            }
        }
    }
/*
  $person = array(
     $personDisplayMapping[0][0]=>lkey($info, $personDisplayMapping[0][1]),
     $personDisplayMapping[1][0]=>lkey($info, $personDisplayMapping[1][1]),
     $personDisplayMapping[2][0]=>lkey($info, $personDisplayMapping[2][1]),
     $personDisplayMapping[3][0]=>lkey($info, $personDisplayMapping[3][1]),
     $personDisplayMapping[4][0]=>lkey($info, $personDisplayMapping[4][1]),
     $personDisplayMapping[5][0]=>lkey($info, $personDisplayMapping[5][1]),
     $personDisplayMapping[6][0]=>lkey($info, $personDisplayMapping[6][1]),
     $personDisplayMapping[7][0]=>lkey($info, $personDisplayMapping[7][1]),
     $personDisplayMapping[8][0]=>lkey($info, $personDisplayMapping[8][1]),
     $personDisplayMapping[9][0]=>lkey($info, $personDisplayMapping[9][1]),
     $personDisplayMapping[10][0]=>lkey($info, $personDisplayMapping[10][1]),
     $personDisplayMapping[11][0]=>lkey($info, $personDisplayMapping[11][1]),
     $personDisplayMapping[12][0]=>lkey($info, $personDisplayMapping[12][1]),
     $personDisplayMapping[13][0]=>lkey($info, $personDisplayMapping[13][1])
  );
*/
    foreach($person["room"] as $room)
    {
        if(!in_array($room, $person["office"]))
        {
            $person["office"][] = $room;
        }
    }
    if ($person['givenname'] != null)
    {
        if ($person["initials"] != null)
        {
            $person["givenname"][0] = $person["givenname"][0] . " " . $person["initials"][0];
        }
    }
    unset($person["initials"]);
    unset($person["room"]);
    unset($person["count"]);

    return $person;
}  
Beispiel #2
0
function make_person($info)
{
    $person = array("surname" => lkey($info, "sn"), "givenname" => lkey($info, "givenname"), "fullname" => lkey($info, "cn"), "title" => lkey($info, "title"), "dept" => lkey($info, "department"), "affiliation" => lkey($info, "wvuptype"), "address" => lkey($info, "postaladdress"), "homephone" => lkey($info, "homephone"), "email" => lkey($info, "mail"), "room" => lkey($info, "roomnumber"), "id" => id_key($info), "telephone" => lkey($info, "telephonenumber"), "fax" => lkey($info, "facsimiletelephonenumber"), "office" => lkey($info, "physicaldeliveryofficename"));
    foreach ($person["office"] as $office) {
        if (!in_array($office, $person["room"])) {
            $person["room"][] = $office;
        }
    }
    return $person;
}