Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74544ac5b4 | ||
|
|
863f84f37e | ||
|
|
b73a4c792c | ||
|
|
78ee5fdf48 |
+7
-3
@@ -74,10 +74,14 @@ TRUSTED_PROXIES=
|
||||
; Timezone (default: America/New_York)
|
||||
TIMEZONE=America/New_York
|
||||
|
||||
; LDAP / lldap (for user avatar lookups)
|
||||
; LDAP / lldap (for user avatar lookups). Connects over LDAPS — 6360 is
|
||||
; lldap's default LDAPS port, NOT its plaintext port (3890), since
|
||||
; LDAP_BIND_PW below would otherwise go over the wire unencrypted.
|
||||
; LDAP_HOST must be a hostname matching the LDAPS cert (TLS hostname
|
||||
; verification is not skipped), not a bare IP.
|
||||
LDAP_ENABLED=true
|
||||
LDAP_HOST=10.10.10.39
|
||||
LDAP_PORT=3890
|
||||
LDAP_HOST=ldap.lotusguild.org
|
||||
LDAP_PORT=6360
|
||||
LDAP_BIND_DN="uid=tinker-tickets,ou=people,dc=example,dc=com"
|
||||
LDAP_BIND_PW=
|
||||
LDAP_BASE_DN="dc=example,dc=com"
|
||||
|
||||
+4
-1
@@ -113,7 +113,10 @@ $avatarData = null;
|
||||
$ldapQueryOk = false; // true only if the LDAP lookup completed without error
|
||||
|
||||
try {
|
||||
$ldap = @ldap_connect("ldap://$ldapHost:$ldapPort");
|
||||
// LDAPS, not plain ldap:// — LDAP_BIND_PW is sent during ldap_bind() below,
|
||||
// and lldap's plaintext port (3890) would put it on the wire unencrypted.
|
||||
// lldap's LDAPS listener defaults to port 6360 (see config.php).
|
||||
$ldap = @ldap_connect("ldaps://$ldapHost:$ldapPort");
|
||||
if (!$ldap) {
|
||||
throw new RuntimeException("ldap_connect failed");
|
||||
}
|
||||
|
||||
+13
-3
@@ -154,9 +154,19 @@ $GLOBALS['config'] = [
|
||||
'TIMEZONE' => $envVars['TIMEZONE'] ?? 'America/New_York',
|
||||
'TIMEZONE_OFFSET' => null, // Will be calculated below
|
||||
|
||||
// LDAP / lldap settings (for user avatar lookups)
|
||||
'LDAP_HOST' => $envVars['LDAP_HOST'] ?? '10.10.10.39',
|
||||
'LDAP_PORT' => (int)($envVars['LDAP_PORT'] ?? 3890),
|
||||
// LDAP / lldap settings (for user avatar lookups). Connects over LDAPS
|
||||
// (see api/user_avatar.php) — lldap's default LDAPS port is 6360, not
|
||||
// its plaintext port 3890. The bind password must never go over the
|
||||
// wire unencrypted, so this is not configurable back to a plaintext
|
||||
// ldap:// connection.
|
||||
//
|
||||
// LDAP_HOST must be a hostname matching the LDAPS cert's *.lotusguild.org
|
||||
// CN/SAN, not a bare IP — PHP's ldap extension verifies the cert's
|
||||
// hostname by default and a mismatch fails the connection. Pi-hole has a
|
||||
// split-horizon override so ldap.lotusguild.org resolves internally to
|
||||
// the real LDAP server IP (its public DNS record points elsewhere).
|
||||
'LDAP_HOST' => $envVars['LDAP_HOST'] ?? 'ldap.lotusguild.org',
|
||||
'LDAP_PORT' => (int)($envVars['LDAP_PORT'] ?? 6360),
|
||||
'LDAP_BIND_DN' => $envVars['LDAP_BIND_DN'] ?? 'uid=tinker-tickets,ou=people,dc=example,dc=com',
|
||||
'LDAP_BIND_PW' => $envVars['LDAP_BIND_PW'] ?? '',
|
||||
'LDAP_BASE_DN' => $envVars['LDAP_BASE_DN'] ?? 'dc=example,dc=com',
|
||||
|
||||
@@ -148,7 +148,7 @@ class StatsModel
|
||||
FROM tickets t WHERE status != 'Closed' AND ($visSQL) GROUP BY priority
|
||||
UNION ALL
|
||||
SELECT 'status' as type, status as label, COUNT(*) as count
|
||||
FROM tickets t WHERE ($visSQL) GROUP BY status
|
||||
FROM tickets t WHERE status != 'Closed' AND ($visSQL) GROUP BY status
|
||||
UNION ALL
|
||||
SELECT 'category' as type, category as label, COUNT(*) as count
|
||||
FROM tickets t WHERE status != 'Closed' AND ($visSQL) GROUP BY category";
|
||||
|
||||
@@ -280,8 +280,11 @@ include __DIR__ . '/layout_header.php';
|
||||
// default: with no `status` param the controller falls back to the viewer's
|
||||
// default_status_filters preference, which can be anything, so the resulting
|
||||
// list would not necessarily match what the chart counted. StatsModel builds
|
||||
// by_priority and by_category with `status != 'Closed'`, while by_status spans
|
||||
// every status — so only the priority and category charts pin the open set.
|
||||
// by_priority, by_status, and by_category all with `status != 'Closed'` —
|
||||
// closed tickets accumulate indefinitely and would otherwise dominate every
|
||||
// breakdown over time — so chartPriority/chartCategory pin the open set
|
||||
// explicitly, while chartStatus's clicked label is itself already one of
|
||||
// the non-Closed statuses.
|
||||
function openStatuses() {
|
||||
var all = window.TICKET_STATUSES || ['Open', 'Pending', 'In Progress', 'Closed'];
|
||||
return all.filter(function(s) { return s !== 'Closed'; }).join(',');
|
||||
|
||||
Reference in New Issue
Block a user