Not logged in. · Lost password · Register

All posts by bjblackmore (12)

topic: LDAP Authentication over Basic/HTTP  in the forum: General Help and Support Installation and Configuration
Avatar
bjblackmore #1
Member since Nov 2006 · 12 posts
Group memberships: Members
Show profile · Link to this post
Having throught about this over night, I'm thinking that I might be able to get this working, if I can explode the user details from the HTTP_Authorization.
I'm guessing that our ISA server is sending the details in the 'domain.com\username' format, but DokuWiki only wants the username. I see you already used explode on the HTTP_Authorization to split the username & password at the ':' point, what I also need to do, is after the username & password have been split, split the username again at the '\' point, so the domain is removed from the username. I'm having a little trouble working out where I'd add this second explode to the code.
I need to add:

explode('\\',$_REQUEST['u'])

somewhere in the code below.

list($_REQUEST['u'],$_REQUEST['p']) = explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6)));

Can you help?


SOLVED: After doing some testing, I found that $_SERVER['PHP_AUTH_USER'] & $_SERVER['PHP_AUTH_PW'] were actually being populated with a username & password during the IE popup login, so I re-enabled the previous code in auth.php and found that it worked the same as the new code, with $_REQUEST['u'] = domain.com\\username. I simply used explode('\\\\',$_SERVER['PHP_AUTH_USER']) to remove the domain, and it all seemed to work. New code below for anyone who wants it!

    if(empty($_REQUEST['u']) && !empty($_SERVER['PHP_AUTH_USER'])){
      $_REQUEST['u'] = $_SERVER['PHP_AUTH_USER'];
      $EXPLODEUSER    = explode('\\\\',$_SERVER['PHP_AUTH_USER']);
      $_REQUEST['u'] = $EXPLODEUSER[1];
      $_REQUEST['p'] = $_SERVER['PHP_AUTH_PW'];
    }
This post was edited on 2007-09-19, 19:16 by bjblackmore.
topic: LDAP Authentication over Basic/HTTP  in the forum: General Help and Support Installation and Configuration
Avatar
bjblackmore #2
Member since Nov 2006 · 12 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 4151
OK, just got it nearly working!

If I change user filter from:
$conf['auth']['ldap']['userfilter']  = '(samaccountname=%{user})';
to
$conf['auth']['ldap']['userfilter'] = '(userPrincipalName=%{user})';

And my users login via the IE HTTP/Basic auth popup, using username@domain.com, then this gets passed to dokuwiki and logins perfectly (although I still get the LDAP success message).

I can live with this, as long as I remind my users they have to enter their usernames in this format, but it would be nice if they cold drop the @domain.com suffix, as they login to our other external sites (Outlook Web Access, CRM etc) with just a username.

Ben
topic: LDAP Authentication over Basic/HTTP  in the forum: General Help and Support Installation and Configuration
Avatar
bjblackmore #3
Member since Nov 2006 · 12 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 4148
Hi Andi,

I got LDAP working (I thought it was already, but seems the config kept defaulting to ntlm), I not get the following line when I login with the dokuwiki login:

LDAP user search: Success [ldap.class.php:173

I notice that when I login with the IE http auth the following message appears:

Sorry, username or password was wrong.

If I then click on the login page, I see that the username field is pre-filled for me with domain.com\\username if I enter the password authentication fails, but if I delete the domain.com\\ and just enter the username & password, it authenticates. This is the same if I enter the login in username@domain.com format, the dokuwiki logon is prefilled with username@domain.com, and fails when you try to logon with that.

So I'm thinking that it is kind of working, but the basic http auth is trying to pass the domain.com\\ prefix, which is causing it to fail. Do you know how I might get the logon to drop the domain prefix?
Also, how do you turn off the "LDAP user search: Success [ldap.class.php:173]" message? I set debug to 0, but it didn't fix it.

Ben
topic: LDAP Authentication over Basic/HTTP  in the forum: General Help and Support Installation and Configuration
Avatar
bjblackmore #4
Member since Nov 2006 · 12 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 4142
Hi Andi,

I gave it a try, but I get the following error after the initial IE popup login.
LDAP user search: Operations error [ldap.class.php:173]
Which auth method should I be using in local.php? I tried basic, which didn't work, so I switched to LDAP, but that returns the error above.

Thanks

Ben
topic: LDAP Authentication over Basic/HTTP  in the forum: General Help and Support Installation and Configuration
Avatar
bjblackmore #5
Member since Nov 2006 · 12 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 4096
Hi Andi,

We're using IIS6 & PHP on the backend web server. The front facing ISA firewall provides a few different options for passing authentication to the web server behind (see screen shot below), would any of these work? If not, could you recommend an authmodule that would work? I've googled around, and it looks like I need something in the form of trustExternal() as specified on http://wiki.splitbrain.org/wiki:auth:howto. I guess the username & password need to get passed from ISA as basic auth, to the wiki, which would then perform an LDAP query.

[Image: http://i155.photobucket.com/albums/s317/bjblackmore/Wiki-ISA-Auth.gif]
topic: LDAP Authentication over Basic/HTTP  in the forum: General Help and Support Installation and Configuration
Avatar
bjblackmore #6
Member since Nov 2006 · 12 posts
Group memberships: Members
Show profile · Link to this post
Subject: LDAP Authentication over Basic/HTTP
Hi,

We've been running Dokuwiki internally for a few months now, and have been using LDAP authentication with our active directory. This means that no one can edit/create pages until they login via the DokuWiki login form page, which then authenticates against Active Directory.

However, we would now like to publish the WIKI out on the interent for our external clients. We run MS ISA 2004, which has a few different options available for authentication. I have published the site using basic authentication, over SSL, this means that when people visit https://wiki.ourdomain.com, before they even see the WIKI page, they get the Internet Explorer authentication pop up, asking for a usename & password, this is useful, because it means if you don't have a valid domain logon, you just get a 'Page Can Not Be Displayed' error, you don't even see the WIKI page, this stops people from accidently stumbling onto the site!

Once you enter your domain credentials correctly, you then get the WIKI front page, however to edit/create pages, you then have to login a 2nd time, using the WIKI login form page, entering the same domain username & password as before. Is there anyway to automatically pass the credentials entered in the IE pop up through to the WIKI authentication method, so users only have to enter their details once?

I have tried looking at http://wiki.splitbrain.org/wiki:tips:htaccessauth#htusers.… & http://wiki.splitbrain.org/wiki:tips:htaccessauth2, but couldn't get it working, and it seems that this doesn't work with LDAP anyway.

Any help/suggestions would be much appreciated.

Ben
topic: Wiki Structure in Image View? (Way of showing structure in an org structure?)  in the forum: General Help and Support Features and Functionality
Avatar
bjblackmore #7
Member since Nov 2006 · 12 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 2158
AH, this looks interesting, http://twiki.di.uniroma1.it/twiki/view/TWiki/DirectedGraph… seems to use the graphviz input format, but creates the page using PHP. Does anyone know ifit's possible to run this plugin in DokuWiki, of how easy it would be to convert it from Twiki to Dokuwiki?
topic: Wiki Structure in Image View? (Way of showing structure in an org structure?)  in the forum: General Help and Support Features and Functionality
Avatar
bjblackmore #8
Member since Nov 2006 · 12 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 2158
Hmm, nice little program, from the test page I created, it looks just like what I want. But, the question is; How do I get it to execute dynamically via a PHP page? IIt looks like it's a GUI/Command line application only, I'd like it to be executed everytime someone tries to view the structure, this way it's kept upto date, without anyone manually needing to re-create the document & upload it!
topic: Wiki Structure in Image View? (Way of showing structure in an org structure?)  in the forum: General Help and Support Features and Functionality
Avatar
bjblackmore #9
Member since Nov 2006 · 12 posts
Group memberships: Members
Show profile · Link to this post
Subject: Wiki Structure in Image View?
Hi,

I was wondering, is it possible to show the entire/part of, the wiki structure kinda in the form of an organisation structure. I.e. if you have:
Start > HR Documentation > Policies
Start > IT Documentation > Installations

The structure would be (in graphical format):
                  START
               ____|____
              |              |
HR Documentation    IT Documentation
        ____|____            ____|____
       |             |           |             |
Policies                                   Installations

I've seen such structures created in online software like SugarCRM (also PHP), which displays an organisation, and dynamically creates the structure for employees!

Ben
topic: Sorting Array With PHP in a Page! (Possible Bug?)  in the forum: General Help and Support Syntax and Usage
Avatar
bjblackmore #10
Member since Nov 2006 · 12 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 2131
Hi Chris,

Thanks for the reply. I'm not sure why, but I think the eval() function was causing problems as you suggested. I have changed my code to that below, which seems to work. I may look at changing this to a plugin, when I get some more free time, one thing I have noticed is that using the code below, if I change something in Active Directory, it takes a while to update the page, so I think your suggestion of disabling page caching would fix this problem!

/*function my_sort(&$a, &$b)
{
global $sort_by;
$sort_by = 'displayname';
if ($a[$sort_by][0] == $b[$sort_by][0]) return 0;
return ($a[$sort_by][0]<$b[$sort_by][0]) ? -1 : 1;
}

usort($info, 'my_sort');*/
   
function genericCmp($a, $b) {
if ($a == $b) {
return 0;
} elseif ($a < $b) {
return -1;
} else {
return 1;
}
}

$sort_by = 'displayname';
usort($info, create_function('$a,$b', "return genericCmp(\$a['$sort_by'][0], \$b['$sort_by'][0]);"));
topic: Sorting Array With PHP in a Page! (Possible Bug?)  in the forum: General Help and Support Syntax and Usage
Avatar
bjblackmore #11
Member since Nov 2006 · 12 posts
Group memberships: Members
Show profile · Link to this post
Subject: Sorting Array With PHP in a Page!
Hi,
I'm setting up a wiki for use on our company intranet, and I've created a page that will pull information out of active directory, and publish it, so employees have an easy way of finding each others contact details. I've created the page by using some PHP inside of the wiki page, which runs an LDAP query. This all works fine, and displays the information. However I would like to sort the information by employee name. I have the code, and it works in a plain PHP file, however, when I copy & paste the working code from the PHP file, into Dokuwiki, the sort function fails to work. I've looked through a few options, such as register_globals being off in the PHP.ini, and set it to ON, but this hasn't helped. Below is a snip of my code, can anyone suggest a way to get the info sorted?
Cheers
Ben

 function my_sort(&$a, &$b)
 {
        global $sort_by;
        if ($a[$sort_by][0]==$b[$sort_by][0]) return 0;
        return ($a[$sort_by][0]<$b[$sort_by][0]) ? -1 : 1;
 }

 $sort_by = 'displayname';
 usort($info, 'my_sort');
topic: Backlinks Not Working (Warning: Invalid argument supplied for foreach() in fulltext.php on line 273)  in the forum: General Help and Support Installation and Configuration
Avatar
bjblackmore #12
Member since Nov 2006 · 12 posts
Group memberships: Members
Show profile · Link to this post
Subject: Backlinks Not Working
Hi,

I've just upgraded to the latest version of DocuWiki (dokuwiki-2006-11-06), from dokuwiki-2006-03-09d and have noticed that the backlinks don't work at all, sometimes I get just a page with the following, no list:

Backlinks
This is a list of pages that seem to link back to the current page.

And sometimes I get an error:

Backlinks
This is a list of pages that seem to link back to the current page.
Warning: Invalid argument supplied for foreach() in C:\Inetpub\dokuwiki\inc\fulltext.php on line 273

What's strange is that both these problems can occure when clicking on the same backlink, i.e. from company:techdoc:troubleshoot:other if I click on techdoc I get the blank list, but if I go from company:techdoc:troubleshoot:cms and click on techdoc I get the error warning, even though it's the same page! Odd?

Can anyone help or suggest a fix?

Thanks

Ben
Close Smaller – Larger + Reply to this post:
Special characters:
Special queries
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-12-14, 08:35:41 (UTC +01:00)