From fc3a1ef36f40109f25c5e928604af7304a1c7bb9 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Wed, 5 Dec 2007 16:17:30 +0100 Subject: [PATCH] [svn r13958] Updated to suit anonymous user mode --- main/calendar/agenda.inc.php | 12 ++++++------ main/calendar/agenda.php | 11 +++++++---- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/main/calendar/agenda.inc.php b/main/calendar/agenda.inc.php index 8710d9d1fa..ce180ce19f 100644 --- a/main/calendar/agenda.inc.php +++ b/main/calendar/agenda.inc.php @@ -72,7 +72,7 @@ function get_calendar_items($month, $year) $group_memberships=GroupManager::get_group_ids($_course['dbName'], $_user['user_id']); - if (is_allowed_to_edit() OR api_get_course_setting('allow_user_edit_agenda')) + if (is_allowed_to_edit() OR (api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous())) { //echo "course admin"; // added GROUP BY agenda.id to prevent double display of a message that has been sent to two groups @@ -1215,7 +1215,7 @@ function save_edit_agenda_item($id,$title,$content,$start_date,$end_date) function delete_agenda_item($id) { global $_course; - if (is_allowed_to_edit() OR api_get_course_setting('allow_user_edit_agenda')) + if (is_allowed_to_edit() OR (api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous())) { if (isset($_GET['id'])&&$_GET['id']&&isset($_GET['action'])&&$_GET['action']=="delete") { @@ -1252,7 +1252,7 @@ function showhide_agenda_item($id) ==================================================*/ // and $_GET['isStudentView']<>"false" is added to prevent that the visibility is changed after you do the following: // change visibility -> studentview -> course manager view - if ((is_allowed_to_edit() OR api_get_course_setting('allow_user_edit_agenda')) and $_GET['isStudentView']<>"false") + if ((is_allowed_to_edit() OR (api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous())) and $_GET['isStudentView']<>"false") { if (isset($_GET['id'])&&$_GET['id']&&isset($_GET['action'])&&$_GET['action']=="showhide") { @@ -1314,7 +1314,7 @@ function display_agenda_items() //echo "user:".$_SESSION['user']."group: ".$_SESSION['group']; // A. you are a course admin //if ($is_courseAdmin) - if (is_allowed_to_edit() OR api_get_course_setting('allow_user_edit_agenda')) + if (is_allowed_to_edit() OR (api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous())) { // A.1. you are a course admin with a USER filter // => see only the messages of this specific user + the messages of the group (s)he is member of. @@ -1390,7 +1390,7 @@ function display_agenda_items() } } - } //if (is_allowed_to_edit() OR api_get_course_setting('allow_user_edit_agenda')) + } //if (is_allowed_to_edit() OR( api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous())) // B. you are a student else @@ -1577,7 +1577,7 @@ function display_agenda_items() $event_list.=$myrow['id'].','; echo ""; - if (is_allowed_to_edit() OR api_get_course_setting('allow_user_edit_agenda')) + if (is_allowed_to_edit() OR (api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous())) { // edit echo "", diff --git a/main/calendar/agenda.php b/main/calendar/agenda.php index 2b2c0f00d4..d8caff1dda 100644 --- a/main/calendar/agenda.php +++ b/main/calendar/agenda.php @@ -1,4 +1,4 @@ -'; - if (is_allowed_to_edit() OR api_get_course_setting('allow_user_edit_agenda')) + if (is_allowed_to_edit() OR (api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous())) { display_courseadmin_links(); } @@ -273,7 +276,7 @@ $fck_attribute['ToolbarSet'] = 'Middle'; // THE RIGHT PART echo ""; -if (is_allowed_to_edit() OR api_get_course_setting('allow_user_edit_agenda')) +if (is_allowed_to_edit() OR (api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous())) { switch ($_GET['action']) {