[OSM-dev] forum.openstreetmap.org
Lambertus
osm at na1400.info
Wed Oct 31 12:45:19 GMT 2007
Thanks Spaetz, I'll try to look into this tonight. But moving the forum
to the forum.openstreetmap.org vhost subdirectory (which involves some
forum configuration) has priority now that the DNS stuff seems to be
working.
spaetz wrote:
> On Wed, Oct 31, 2007 at 11:37:12AM +0100, Lambertus wrote:
>
>> Well there is no such thing as 'install' a new auth method on the forum,
>> but I certainly can try to implement this.
>>
>> Spaetz, can you post some relevant code snippets?
>
> This is the whole authentication function (basically, I snipped a couple of irrelevant lines) as needed by the phorum plugin.
>
> function phorum_mod_osmauth_userauth ($login) {
> // Input : Array containing:
> // username => the username to check
> // password => the password to check
> // user_id => empty value
> // Return : Same as input
>
> $authURL=sprintf("http://%s:%s@api.openstreetmap.org/api/0.4/user/details",urlencode($login['username']),urlencode($login['password']));
> $header = get_headers($authURL,1);
> if ($header[0] == 'HTTP/1.0 200 OK') {
> // Does the user exist already?
> $login['user_id'] = phorum_api_user_search('username', $login[username]);
> // print "User: $login[username] id $login['user_id']";
> if (!$login['user_id']) {
> //Create the user
> $login['user_id'] = phorum_api_user_save (array("user_id" => NULL,
> "username" => $login[username],
> "real_name" => $login[username],
> "email" => "ENTER ME!",
> "active" => 1,
> "password" => $login[password]));
> }
> }
> else
> {// remote auth failed. Fail totally (returning NULL would Phorum let do the auth locally)
> $login['user_id'] = FALSE;
> }
> }
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev
More information about the dev
mailing list