Index: openacs-4/packages/lamsconf/lamsconf.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lamsconf/lamsconf.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lamsconf/lamsconf.info 8 Dec 2005 09:20:21 -0000 1.1 @@ -0,0 +1,39 @@ + + + + + LAMS Integration Configuration + LAMS Integration Configurations + f + t + lamsconf + + + Ernie Ghiglione + This package serves two purposes: + +* User data exchange between LAMS and .LRN +* Configuration setting "holder" for .LRN + +See more details in the LAMS Community or LAMS/.LRN integration webpage (http://lamsfoundation.org/integration/dotlrn) + LAMS Foundation + This package serves two purposes: + +* User data exchange between LAMS and .LRN +* Configuration setting "holder" for .LRN + +See more details in the LAMS Community or LAMS/.LRN integration webpage (http://lamsfoundation.org/integration/dotlrn) + + + 0 + + + + + + + + + + + Index: openacs-4/packages/lamsconf/www/userinfo.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lamsconf/www/userinfo.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lamsconf/www/userinfo.tcl 8 Dec 2005 09:20:21 -0000 1.1 @@ -0,0 +1,50 @@ +# packages/lamsconf/www/userinfo.tcl + +ad_page_contract { + + This page return user info in CSV format to LAMS server. + + @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) + @creation-date 2005-11-23 + @arch-tag: d96fffd1-bbf0-479e-9fc0-92cd09a63568 + @cvs-id $Id: userinfo.tcl,v 1.1 2005/12/08 09:20:21 ernieg Exp $ +} { + ts + un + hs +} -properties { +} -validate { +} -errors { +} + +set datetime $ts +set username $un +set hash $hs + +ns_log Notice "LAMSint: LAMS requests userinfo for user_id $username (datetime: $ts hash: $hs)" + +set lams_server_url [parameter::get -parameter lams_server_url -package_id [ad_conn package_id]] +set server_key [parameter::get -parameter server_key -package_id [ad_conn package_id]] +set server_id [parameter::get -parameter server_id -package_id [ad_conn package_id]] + + +set plaintext [string tolower [concat $ts$un$server_id$server_key]] +set hashValue [string tolower [ns_sha1 $plaintext]] + +if {![string equal [string tolower $hash] $hashValue]} { + + ns_log Warning "LAMSint: userinfo request hash authentication failed. localhash: $hashValue requesthash: $hs" + ns_write "HTTP/1.1 401 Unauthenticated" + +} + +# get the user info we need to pass to LAMS +set first_name [acs_user::get_element -user_id $username -element first_names] +set last_name [acs_user::get_element -user_id $username -element last_name] +set email [acs_user::get_element -user_id $username -element email] + +ns_log Notice "LAMSint: userinfo transfered to LAMS (user_id $username)" + +# send it to LAMS +ReturnHeaders "text/plain" +ns_write "$username,$first_name,$last_name,'','','','','','','',$email" \ No newline at end of file