Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117751962
D1279.1775187462.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D1279.1775187462.diff
View Options
diff --git a/lib/AutodiscoverMicrosoft.php b/lib/AutodiscoverMicrosoft.php
--- a/lib/AutodiscoverMicrosoft.php
+++ b/lib/AutodiscoverMicrosoft.php
@@ -42,13 +42,6 @@
{
$post = $_SERVER['REQUEST_METHOD'] == 'POST' ? file_get_contents('php://input') : null;
- // check for basic authentication
- Log::debug('Request [microsoft]: Basic Auth Username: ' . ($_SERVER['PHP_AUTH_USER'] ?: 'none'));
- if (empty($_SERVER['PHP_AUTH_USER']) || empty($_SERVER['PHP_AUTH_PW'])) {
- $this->unauthorized();
- }
- $this->password = $_SERVER['PHP_AUTH_PW'];
-
// check for request object
Log::debug('Request [microsoft]: ' . $post);
if (empty($post)) {
@@ -82,9 +75,19 @@
$this->error("Invalid input");
}
- // basic auth username must match with given email address
- if ($_SERVER['PHP_AUTH_USER'] != $this->email) {
- $this->unauthorized();
+ // check for basic authentication if ldap is available
+ if (!empty($this->_ldap_server)) {
+ Log::debug('Request [microsoft]: Basic Auth Username: ' . ($_SERVER['PHP_AUTH_USER'] ?: 'none'));
+ if (empty($_SERVER['PHP_AUTH_USER']) || empty($_SERVER['PHP_AUTH_PW'])) {
+ $this->unauthorized();
+ }
+
+ // basic auth username must match with given email address
+ if ($_SERVER['PHP_AUTH_USER'] != $this->email) {
+ $this->unauthorized();
+ }
+
+ $this->password = $_SERVER['PHP_AUTH_PW'];
}
}
@@ -93,9 +96,11 @@
*/
public function handle_response()
{
- // authenticate the user found during configure() against ldap
- if (empty($this->config['dn']) || !$this->authenticate($this->config['dn'], $this->password)) {
- $this->unauthorized();
+ if (!empty($this->_ldap_server)) {
+ // authenticate the user found during configure() against ldap
+ if (empty($this->config['dn']) || !$this->authenticate($this->config['dn'], $this->password)) {
+ $this->unauthorized();
+ }
}
$method = $this->type . '_response';
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 3, 3:37 AM (22 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18775743
Default Alt Text
D1279.1775187462.diff (2 KB)
Attached To
Mode
D1279: Only authenticate against ldap if ldap is available.
Attached
Detach File
Event Timeline