[Hw4mdl-svn] SF.net SVN: hw4mdl: [124] trunk/moodle/mod/liveclassroom/lib.php
Brought to you by:
jhlinder,
trollinger
|
From: <sh...@us...> - 2006-12-22 15:15:11
|
Revision: 124
http://svn.sourceforge.net/hw4mdl/?rev=124&view=rev
Author: shazan
Date: 2006-12-22 07:15:10 -0800 (Fri, 22 Dec 2006)
Log Message:
-----------
update to manage the role on moodle 1.7
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/lib.php
Modified: trunk/moodle/mod/liveclassroom/lib.php
===================================================================
--- trunk/moodle/mod/liveclassroom/lib.php 2006-12-22 13:43:04 UTC (rev 123)
+++ trunk/moodle/mod/liveclassroom/lib.php 2006-12-22 15:15:10 UTC (rev 124)
@@ -903,17 +903,27 @@
function liveclassroom_get_url_params($courseid) {
global $USER;
-/*
+ global $CFG;
+
//For moodle 1.7
- if(strstr($CFG->release,"1.6")) // 1.6.* version
- else if(strstr($CFG->release,"1.7")) // 1.7.* version
-*/
- if (isstudent($courseid)) {
- $role='Student';
- }
- else if (isteacher($courseid, $USER->id) || isteacheredit($courseid)) {
+// if(strstr($CFG->release,"1.6")) // 1.6.* version
+
+ if(isstudent($courseid)) { //Student
+ $role='Student';
+ }
+ else if (isadmin() || isteacher($courseid, $USER->id)) { // Admin, Teacher
$role='Instructor';
}
+
+ if(strstr($CFG->release,"1.7")) { // 1.7.* version
+ if (iscreator()) { // Course Creator
+ $role='Instructor';
+ }
+ else if (!isteacheredit($courseid)) { // Non-editing Teacher
+ $role='Student';
+ }
+ }
+
$signature = md5($courseid.$USER->email.$USER->firstname.$USER->lastname.$role);
$url_params = "enc_course_id=".$courseid."&enc_email=".$USER->email."&enc_firstname=".$USER->firstname."&enc_lastname=".$USER->lastname."&enc_role=".$role."&signature=".$signature;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|