[OPEN-ILS-DEV] Thanks -- Drupal module that authenticates against Evergreen now available

2009-02-26 Thread Mark Jordan
Hi,

Just a quick thanks to Mike and Niles for info that helped me with my Drupal 
module. I've got it working with both the Evergreen XML-RPC and JSON gateways. 
If anyone is interested, a request-for-comment version of the module is 
available at http://drupalib.interoperating.info/node/206

Mark

Mark Jordan
Head of Library Systems
W.A.C. Bennett Library, Simon Fraser University
Burnaby, British Columbia, V5A 1S6, Canada
Voice: 778.782.5753 / Fax: 778.782.3023
mjor...@sfu.ca


Re: [OPEN-ILS-DEV] Best way to authenticate users against Evergreen

2009-02-23 Thread Mark Jordan
Thanks for testing my code Niles. Looks like the demo.gapines.org XML-RPC 
gateway is not working... I'll try to contact the webmaster (unless he's on 
this list =8^).

Mark


Re: [OPEN-ILS-DEV] Best way to authenticate users against Evergreen

2009-02-22 Thread Mark Jordan
OK, I've got the json gateway working, based on Niles' code (thanks again). 
However, I'd like to get the XML-RPC approach working as well, since not all 
PHP installations have curl enabled. Maybe I'm missing something obvious, but 
the following PHP code returns a 500 error from http://demo.gapines.org. The 
code does work against a test XML-RPC server I have running on my laptop (which 
just prints back whatever you pass it), so I'm assuming that the values I've 
plugged in from Evergreen's collections.pl are not correct in some way. Here's 
the PHP code:

?php

// Gets seed for generating md5 hash of user password. Argument is 
// the patron's username.

$username = 'patron';
$request = xmlrpc_encode_request('open-ils.auth.authenticate.init', 
array('patron'));
$context = stream_context_create(array('http' = array(
'method' = POST,
'header' = Content-Type: text/xml,
'content' = $request
)));
$file = file_get_contents(https://demo.gapines.org/xml-rpc/open-ils.auth;, 
false, $context);
$response = xmlrpc_decode($file);
if (xmlrpc_is_fault($response)) {
trigger_error(xmlrpc: $response[faultString] ($response[faultCode]));
} else {
print_r($response);
}
?

Can anyone see what I'm missing? One possible problem is that in 
collections.pl, arguments in the RPC request are passed through the Perl 
RPC::XML module's smart_encode function. I tried replacing 'patron' in my code 
above with 'stringpatron/string', but the demo.gapines.org gateway still 
returns a 500 response.

What am I missing?

Mark

Mark Jordan
Head of Library Systems
W.A.C. Bennett Library, Simon Fraser University
Burnaby, British Columbia, V5A 1S6, Canada
Voice: 778.782.5753 / Fax: 778.782.3023
mjor...@sfu.ca


[OPEN-ILS-DEV] Best way to authenticate users against Evergreen

2009-02-20 Thread Mark Jordan
Hi,

I've looked through most of the docs and can't find any mention of an API to 
authenticate users against their credentials in Evergreen. Is there such an API 
(preferably a web-servicy one)? I saw the dicussion in the list archives from 
last May about writing a Perl script to pull up patron info via OpenSRF, but 
that's about all I've come across.

I'm writing a Drupal module that will use drivers to authenticate against 
whatever external auth source will respond, focusing for now on 
library-oriented sources like ILSs since there are already Drupal modules for 
LDAP, Shib, Pubcookie, etc. Each driver is a small PHP file that simply returns 
TRUE or FALSE, and optimially an email address, for a user who logs into 
Drupal. (It also allows you to modify the login form programmatically but 
that's independent of the authentication.) If the account is not an existing 
local Drupal account, the request is routed to the driver (configured by the 
site admin) and an account is either created or logged in if the driver returns 
TRUE after talkikg to the external auth source. If the driver returns FALSE, 
the user is told the standard Drupal unrecognized username or password.

I've got a working driver for Innovative (wich has a RESTful patron API) and a 
sample/generic SQL driver. I've figured out enough about Evergreen's actor.usr 
table to authenticate using it (well, it will work in Drupal 7 since in Drupal 
6 you can't switch between MySQL and Postgres nicely), but if there's a more 
API-oriented way to query for users, I'd rather use that. I've looked for a PHP 
library for OpenSRF but didn't find any.

Mark

Mark Jordan
Head of Library Systems
W.A.C. Bennett Library, Simon Fraser University
Burnaby, British Columbia, V5A 1S6, Canada
Voice: 778.782.5753 / Fax: 778.782.3023
mjor...@sfu.ca


Re: [OPEN-ILS-DEV] Best way to authenticate users against Evergreen

2009-02-20 Thread Mark Jordan
Niles,

Just what I'm looking for... thanks,

Mark

Mark Jordan
Head of Library Systems
W.A.C. Bennett Library, Simon Fraser University
Burnaby, British Columbia, V5A 1S6, Canada
Voice: 778.782.5753 / Fax: 778.782.3023
mjor...@sfu.ca


Re: [OPEN-ILS-DEV] Best way to authenticate users against Evergreen

2009-02-20 Thread Mark Jordan
Mike,

Thanks for the additional info. I'll play around with these options. Mind if I 
use the test accounts listed at http://open-ils.org/downloads.php to 
authenticate off of http://demo.gapines.org/?

Mark

Mark Jordan
Head of Library Systems
W.A.C. Bennett Library, Simon Fraser University
Burnaby, British Columbia, V5A 1S6, Canada
Voice: 778.782.5753 / Fax: 778.782.3023
mjor...@sfu.ca


Re: [OPEN-ILS-DEV] Booking Equipment or Rooms on Evergreen

2008-11-16 Thread Mark Jordan
Jason Etheridge wrote:

 Are there any other open source projects that do this?  We might be
 able to integrate with them or leverage their code.
 
 -- 

MRBS (http://mrbs.sourceforge.net/) is popular and feaure-rich. We've been 
using it for 5-6 year to book meeting rooms (both public study rooms and staff 
meeting rooms) and also to book some types of equipment like staff laptops.

Mark


Mark Jordan
Head of Library Systems
W.A.C. Bennett Library, Simon Fraser University
Burnaby, British Columbia, V5A 1S6, Canada
Voice: 778.782.5753 / Fax: 778.782.3023
[EMAIL PROTECTED]