From: Chris S. <san...@us...> - 2011-01-24 15:22:35
|
Update of /cvsroot/stack/stack-dev In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv25243 Modified Files: vista.php Log Message: Index: vista.php =================================================================== RCS file: /cvsroot/stack/stack-dev/vista.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** vista.php 9 Oct 2007 11:14:40 -0000 1.2 --- vista.php 24 Jan 2011 15:22:27 -0000 1.3 *************** *** 55,59 **** } ! // (1) Check that the userID exists. // If so, then login as this user // If not then create an account fully, including authentication and login. --- 55,59 ---- } ! // (1) Check that the userID exists. // If so, then login as this user // If not then create an account fully, including authentication and login. *************** *** 62,66 **** //1st attempt Moodle login see if it fails. ! $username = moodle_strtolower($username); //$password = 'stack'.$userID; //fake up a password $password = 'stack'.userID; --- 62,66 ---- //1st attempt Moodle login see if it fails. ! $username = moodle_strtolower($username); //$password = 'stack'.$userID; //fake up a password $password = 'stack'.userID; *************** *** 90,94 **** echo 'Need to add user to db. <br />'; //need to add the user to moodle. ! //create user object $dbUser = new stdClass(); --- 90,94 ---- echo 'Need to add user to db. <br />'; //need to add the user to moodle. ! //create user object $dbUser = new stdClass(); *************** *** 107,114 **** $dbUser->country= 'GB'; $dbUser->description = 'Vista User'; ! //insert record $result = insert_record('user', $dbUser, true); ! if($result == false) { --- 107,114 ---- $dbUser->country= 'GB'; $dbUser->description = 'Vista User'; ! //insert record $result = insert_record('user', $dbUser, true); ! if($result == false) { *************** *** 117,121 **** } echo 'User added to database: '.$result.'<br />'; ! $USER->id = $result; //attempt logon again --- 117,121 ---- } echo 'User added to database: '.$result.'<br />'; ! $USER->id = $result; //attempt logon again *************** *** 137,146 **** { //getting somewhere.. set up the users sessions and redirect. ! $USER = $user; global $user; add_to_log(SITEID, 'user', 'login', "view.php?id=$USER->id&course=".SITEID, $USER->id, 0, $USER->id); ! ! update_user_login_times(); if (empty($CFG->nolastloggedin)) { --- 137,146 ---- { //getting somewhere.. set up the users sessions and redirect. ! $USER = $user; global $user; add_to_log(SITEID, 'user', 'login', "view.php?id=$USER->id&course=".SITEID, $USER->id, 0, $USER->id); ! ! update_user_login_times(); if (empty($CFG->nolastloggedin)) { *************** *** 153,166 **** } set_login_session_preferences(); ! /// This is what lets the user do anything on the site :-) load_all_capabilities(); ! //redirect to requested course $courseURL = $CFG->wwwroot.'/course/view.php?id='.$subjectID; ! //echo 'Would redirect to '.$courseURL.' at this point.'; echo "Redirecting to: <a href=\"$courseURL\">$courseURL</a>"; redirect($courseURL); } - ?> \ No newline at end of file --- 153,165 ---- } set_login_session_preferences(); ! /// This is what lets the user do anything on the site :-) load_all_capabilities(); ! //redirect to requested course $courseURL = $CFG->wwwroot.'/course/view.php?id='.$subjectID; ! //echo 'Would redirect to '.$courseURL.' at this point.'; echo "Redirecting to: <a href=\"$courseURL\">$courseURL</a>"; redirect($courseURL); } |