<commit_before><?php
/*************** LDAP server, filters and mappings **************
 *
 */
define("LDAP_SERVER", "phonebook.harvard.edu");
define("LDAP_PATH", 'o=Harvard University,c=US'); 
define("SEARCH_TIMELIMIT", 30);
define("READ_TIMELIMIT", 30);
define("TELEPHONE_FILTER", "(telephonenumber=*%s*)");
define("TELEPHONE_SEARCH_FILTER", "(&(objectClass=person)%s)");
define("EMAIL_FILTER", "(mail=*%s*)");
define("EMAIL_SEARCH_FILTER", "(&(objectClass=person)%s)");
define("NAME_SINGLE_CHARACTER_FILTER", "(|(cn=%s*)(cn=* %s*)(cn=*-%s*))");
#define("NAME_MULTI_CHARACTER_FILTER", "(|(cn=*%s*)(mail=*%s*))"); // Not currently used.
#define("NAME_SEARCH_FILTER", "(&(objectClass=person)%s)");
define("UID_FILTER", "(uid=%s)");
define("UID_SEARCH_FILTER", "(&(objectClass=person)%s)");

/*  for the $personDisplayMapping array:
 *  index 0: display name,
 *  index 1: ldap attribute,
 *  index 2: href,
 *  index 3: class,
 *  index 4: set to TRUE if to be displayed on the mobile device, otherwise FALSE,
 *  index 5: group,
 *  index 6: has_link are for Touch,
 *  index 7: set to TRUE if needed for processing (non display), otherwise FALSE
*/
$appError = 0;

// All of LDAP attributes will come to mit_ldap as all lowercase, even if that is not the case when 
// querying the LDAP service directly, so make them all lowercase here.
$personDisplayMapping = array(array("surname", "sn", null, null, FALSE, FALSE, FALSE, TRUE),
                     array("givenname", "givenname", null, null, FALSE, FALSE, FALSE, TRUE),
                     array("name", "cn", null, null, TRUE, TRUE, FALSE, FALSE),
                     array("title", "title", null, null, TRUE, TRUE, FALSE, FALSE),
                     array("unit", "ou", null, null, TRUE, TRUE, FALSE, FALSE),
                     array("description", "description", null, null, TRUE, TRUE, FALSE, FALSE),
                     array("id", "uid", null, null, FALSE, FALSE, FALSE, TRUE),
                     array("phone", "telephonenumber", "phoneHREF", "phone", TRUE, TRUE, TRUE, FALSE),
                     array("fax", "facsimiletelephonenumber", "phoneHREF", "phone", TRUE, TRUE, TRUE, FALSE),
                     array("email", "mail", "mailHREF", "email", TRUE, FALSE, TRUE, FALSE),<commit_msg>Updates to fix iPhone people dir queries and keep results in sync with mobile web version [#36]<commit_after><?php
/*************** LDAP server, filters and mappings **************
 *
 */
define("LDAP_SERVER", "phonebook.harvard.edu");
define("LDAP_PATH", 'o=Harvard University,c=US'); 
define("SEARCH_TIMELIMIT", 30);
define("READ_TIMELIMIT", 30);
define("TELEPHONE_FILTER", "(telephonenumber=*%s*)");
define("TELEPHONE_SEARCH_FILTER", "(&(objectClass=person)%s)");
define("EMAIL_FILTER", "(mail=*%s*)");
define("EMAIL_SEARCH_FILTER", "(&(objectClass=person)%s)");
define("NAME_SINGLE_CHARACTER_FILTER", "(|(cn=%s*)(cn=* %s*)(cn=*-%s*))");
#define("NAME_MULTI_CHARACTER_FILTER", "(|(cn=*%s*)(mail=*%s*))"); // Not currently used.
define("NAME_SEARCH_FILTER", "(&(objectClass=person)%s)");
define("UID_FILTER", "(uid=%s)");
define("UID_SEARCH_FILTER", "(&(objectClass=person)%s)");

/*  for the $personDisplayMapping array:
 *  index 0: display name,
 *  index 1: ldap attribute,
 *  index 2: href,
 *  index 3: class,
 *  index 4: set to TRUE if to be displayed on the mobile device, otherwise FALSE,
 *  index 5: group,
 *  index 6: has_link are for Touch,
 *  index 7: set to TRUE if needed for processing (non display), otherwise FALSE
*/
$appError = 0;

// All of LDAP attributes will come to mit_ldap as all lowercase, even if that is not the case when 
// querying the LDAP service directly, so make them all lowercase here.
$personDisplayMapping = array(array("surname", "sn", null, null, FALSE, FALSE, FALSE, TRUE),
                     array("givenname", "givenname", null, null, FALSE, FALSE, FALSE, TRUE),
                     array("name", "cn", null, null, TRUE, TRUE, FALSE, FALSE),
                     array("title", "title", null, null, TRUE, TRUE, FALSE, FALSE),
                     array("unit", "ou", null, null, TRUE, TRUE, FALSE, FALSE),
                     array("description", "description", null, null, TRUE, TRUE, FALSE, FALSE),
                     array("id", "uid", null, null, FALSE, FALSE, FALSE, TRUE),
                     array("phone", "telephonenumber", "phoneHREF", "phone", TRUE, TRUE, TRUE, FALSE),
                     array("fax", "facsimiletelephonenumber", "phoneHREF", "phone", TRUE, TRUE, TRUE, FALSE),
                     array("email", "mail", "mailHREF", "email", TRUE, FALSE, TRUE, FALSE),
{'fraction_non_alphanumeric': 0.18596567456006952, 'fraction_numerical': 0.006082989354768629, 'mean_word_length': 4.02071973827699, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2609780', 'n_tokens_mistral': 1474, 'n_tokens_neox': 1443, 'n_words': 425}