From 5474c4c26d842ec1864255107ceaed9a0e00c1be Mon Sep 17 00:00:00 2001 From: surfrock66 Date: Thu, 17 Feb 2022 15:01:49 -0800 Subject: [PATCH] 2022.02.17 - Commit by jgullo - This commit furthers work to decouple the starting point from the original organization and move certain branding and naming to the configuration file. A large part of this was to modularize the connection to the AD/LDAP server, which was intended to be easy to adapt to other orgs and configurations, but had a lot of stuff baked in specific to the org's AD configuration. One thing I found was that the LDAP lookup found in web/includes/getContacts.php is REALLY difficult to modularize given the possible diversity in objectClasses, directory structure, attribute utilization, etc. To account for this, we created a fairly sane default directory connection configuration at web/includes/getContacts.php.sample which a new implementation should copy and rename to getContacts.php, then modify based on the needs of your organization. --- web/config.php.sample | 17 +++ web/includes/footer.php | 10 +- ...getContacts.php => getContacts.php.sample} | 101 +++++++++++++----- web/includes/header.php | 4 +- web/index.php | 24 ++++- 5 files changed, 121 insertions(+), 35 deletions(-) rename web/includes/{getContacts.php => getContacts.php.sample} (60%) diff --git a/web/config.php.sample b/web/config.php.sample index 3a9ed828..8e5db3a3 100644 --- a/web/config.php.sample +++ b/web/config.php.sample @@ -3,6 +3,9 @@ // Page Title //define("TITLE","Sample Web Phone"); +// Page Footer Text +//define("Footer","© Sample Footer Line"); + // SIP Realm //define("REALM","sample realm"); @@ -89,8 +92,19 @@ // SimpleSAMLPhp Logout Return URL //define("SAMLRETURNURL","https://domain.tld"); +// SimpleSAMLPhp Attribute Map - givenName +//define("SAMLATTRGIVENNAME","givenName"); + +// SimpleSAMLPhp Attribute Map - surame +//define("SAMLATTRSURNAME","sn"); + +// SimpleSAMLPhp Attribute Map - extension +//define("SAMLATTREXT","extension"); + // LDAP Credentials +// For LDAP lookup to work, you must copy includes/getContacts.php.sample to includes/getContacts.php +// Any further LDAP filtering or configuration will happen there // LDAP/AD URI //define("LDAPURI","ldaps://sampleserver.sampledomain.tld:636"); @@ -104,6 +118,9 @@ // LDAP Base DN //define("LDAPBASEDN","dc=SAMPLEDOMAIN,dc=TLD"); +// LDAP Search Filter +//define("LDAPSEARCHFILTER","(&(objectCategory=person)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))"); + // MySQL Credentials diff --git a/web/includes/footer.php b/web/includes/footer.php index 2dbfb3bd..13c46de2 100644 --- a/web/includes/footer.php +++ b/web/includes/footer.php @@ -1,7 +1,15 @@