Loading...
 
Skip to main content

Active Directory domain users are not recognized by TikiWiki

Status
Open
Subject
Active Directory domain users are not recognized by TikiWiki
Version
4.x
Category
  • Patch
  • Less than 30-minutes fix
Feature
External Authentication (LDAP, AD, PAM, CAS, etc)
Submitted by
dms
Lastmod by
dms
Rating
(0)
Description

Domain Users are not recognized by TikiWiki when using IIS and Webserver auth against AD.

substr function in tiki-setup_base.php mistakenly removing first char of the login name during substracting domain part. For example "DOMAIN\username" is truncated "sername".

I've fixed the issue with the patch below.

Files
  1. Substr Fix In Tiki Setup Base
Solution
Copy to clipboard
--- tiki-setup_base.php-orig 2009-11-02 14:55:09.000000000 +0000 +++ tiki-setup_base.php 2010-02-12 13:47:20.613776587 +0000 @@ -331,9 +331,9 @@ } elseif ($userlib->user_exists(str_replace("\\\\", "\\", $_SERVER['REMOTE_USER']))) { // Check for the domain\username with just one backslash $_SESSION["$user_cookie_site"] = str_replace("\\\\", "\\", $_SERVER['REMOTE_USER']); - } elseif ($userlib->user_exists(substr($_SERVER['REMOTE_USER'], strpos($_SERVER['REMOTE_USER'], "\\") + 2))) { + } elseif ($userlib->user_exists(substr($_SERVER['REMOTE_USER'], strpos($_SERVER['REMOTE_USER'], "\\") + 1))) { // Check for the username without the domain name - $_SESSION["$user_cookie_site"] = substr($_SERVER['REMOTE_USER'], strpos($_SERVER['REMOTE_USER'], "\\") + 2); + $_SESSION["$user_cookie_site"] = substr($_SERVER['REMOTE_USER'], strpos($_SERVER['REMOTE_USER'], "\\") + 1); } } // Check for Shibboleth Login
Easy to solve?
8
Priority
40
Demonstrate Bug on Tiki 19+
Please demonstrate your bug on show2.tiki.org
Demonstrate Bug (older Tiki versions)
Ticket ID
3036
Created
Friday 12 February, 2010 13:07:04 UTC
by dms
LastModif
Saturday 06 July, 2024 10:21:44 UTC


Collapse/expand modules below
Show PHP error messages