Commit Graph

15 Commits

Author SHA1 Message Date
Tamir Suliman 05d33a777f Fix proxy support: replace putenv with CURLOPT_PROXY on every curl handle
putenv('https_proxy=...') is unreliable for HTTPS destinations across
libcurl versions - it frequently skips CONNECT tunnelling, so the first
call to login.microsoftonline.com fails auth even though the proxy itself
is reachable.

Replace the two commented putenv lines with the applyProxySettings()
pattern from index-proxy.php: $proxy / $proxy_userpwd config vars at
the top of the file and an applyProxySettings($ch) call on every curl
handle (11 handles: getAccessToken, fetchTokens, importTokens,
importCSVTokens x3, getUsers, assignToken, activateToken, unassignToken,
deleteToken).

Fixes #13
2026-06-16 21:52:45 +02:00
Token2 716ed98697 Enhance index.php with proxy and logging comments
Added comments for HTTP proxy support and server-side debug logging.
2026-06-12 09:37:18 +02:00
Tamir Suliman 17d57c6bc4 Fix HTTP 500 on user search: stop writing debug output to stderr
getUsers() was the only endpoint enabling CURLOPT_VERBOSE and calling
error_log() unconditionally. Both write to stderr, and on some SAPIs
(notably IIS FastCGI with fastcgi.logging=1) any stderr output fails the
request with HTTP 500 and returns the debug text as the response body,
even though the Graph call itself succeeded.

- Remove CURLOPT_VERBOSE from getUsers()
- Replace all error_log() calls with a debugLog() helper that appends to
  a file in the system temp directory (outside the web root), gated by a
  DEBUG_LOG flag that is off by default

Fixes token2/token_inventory#9
2026-06-10 05:18:09 +02:00
Token2 b4ba3c70b1 Update index.php 2026-06-02 18:14:53 +02:00
Marcel Burkhard 1278d07fbe Remove $page counter
as it's not needed
2025-12-15 11:11:41 +01:00
Marcel Burkhard fd0f514cc0 Make fetchTokens work with more than 1000 tokens
If your tenant has more than 1000 tokens it only returned the first 1000 as the presence of a `@odata.nextLink` was ignored.
2025-12-15 11:10:14 +01:00
Token2 993f2a42df Update LOCAL_APP definition and footer link 2025-10-17 14:25:57 +02:00
Token2 5078b41f8d Update index.php 2025-09-23 13:03:32 +02:00
Token2 3dd92b42fb Update index.php 2025-09-20 22:03:37 +02:00
Token2 ecbc49b12b Update index.php 2025-09-20 22:03:04 +02:00
Token2 eb20688f84 Update index.php 2025-09-20 22:02:33 +02:00
Token2 192c722d22 Update index.php 2025-09-20 22:00:24 +02:00
Token2 44330b90b7 Update index.php 2025-09-20 21:59:58 +02:00
Token2 2af31bd42e Add files via upload 2025-09-20 12:43:26 +02:00
Token2 51fde44c04 Add files via upload 2024-11-25 15:25:00 +01:00