Index: temp_moodle_dev/lamstwo/userinfo.php =================================================================== RCS file: /usr/local/cvsroot/temp_moodle_dev/lamstwo/Attic/userinfo.php,v diff -u -r1.2 -r1.3 --- temp_moodle_dev/lamstwo/userinfo.php 17 May 2007 02:46:14 -0000 1.2 +++ temp_moodle_dev/lamstwo/userinfo.php 18 Aug 2008 07:31:54 -0000 1.3 @@ -12,28 +12,28 @@ * Moodle's admin should be responsible for correctly setting * serverId and serverKey */ - include_once("../../config.php"); + include_once('../../config.php'); include_once($CFG->libdir.'/datalib.php'); if(!isset($CFG->lamstwo_serverid)||!isset($CFG->lamstwo_serverkey)) { - header("HTTP/1.1 401 Unauthenticated"); + header('HTTP/1.1 401 Unauthenticated'); exit(1); } - $plaintext = trim($_GET["ts"]).trim($_GET["un"]).trim($CFG->lamstwo_serverid).trim($CFG->lamstwo_serverkey); + $plaintext = trim($_GET['ts']).trim($_GET['un']).trim($CFG->lamstwo_serverid).trim($CFG->lamstwo_serverkey); $hash = sha1(strtolower($plaintext)); - if($hash!=$_GET["hs"]){ - header("HTTP/1.1 401 Unauthenticated"); + if($hash!=$_GET['hs']){ + header('HTTP/1.1 401 Unauthenticated'); exit(1); } //OK, the caller is authenticated. Now let's fulfill its request. //What it needs is user info in CSV format. It should be like this: //username,first name,last name,job title, department, organisation, //address,phone,fax,mobile,email - $user = get_record('user', 'username', $_GET["un"]);//return false if none found + $user = get_record('user', 'username', $_GET['un']);//return false if none found if(!$user){ - header("HTTP/1.1 401 Unauthenticated");//which status code is appropriate? + header('HTTP/1.1 401 Unauthenticated');//which status code is appropriate? exit(1); } $array = array('',$user->firstname,$user->lastname,$user->address,$user->city,'','',$user->country,$user->phone1,'','',$user->email,$user->country,substr($user->lang,0,2));