• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

ilinc/classes/class.ilObjiLincClassroomAccess.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00024 include_once("classes/class.ilObjectAccess.php");
00025 
00036 class ilObjiLincClassroomAccess extends ilObjectAccess
00037 {
00038         
00051         function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = "")
00052         {
00053                 global $ilUser, $lng, $rbacsystem, $ilAccess, $ilias;
00054 
00055                 $user_id = $ilUser->getId();
00056                 $class_id = $a_ref_id;
00057                 $course_ref_id = $a_obj_id;
00058                 $class_arr = $a_user_id;
00059 //var_dump($a_cmd,$a_permission,$a_ref_id,$a_obj_id,$a_user_id);
00065                 switch ($a_cmd)
00066                 {
00067 
00068                 }
00069 
00070                 switch ($a_permission)
00071                 {
00072                         case 'join':
00073                                 // Cannot join closed classrooms 
00074                                 if (!$class_arr['alwaysopen'])
00075                                 {
00076                                         return false;
00077                                 }
00078                                 
00079                                 // non members cannot join
00080                                 include_once ('ilinc/classes/class.ilObjiLincCourse.php');
00081                                 
00082                                 if (!ilObjiLincCourse::_isMember($user_id,$a_ref_id))
00083                                 {
00084                                         return false;
00085                                 }
00086                                 break;
00087 
00088                         case "write":
00089                         case "delete":
00090                                 if(!$rbacsystem->checkAccessOfUser($user_id,'write',$a_ref_id,"ilca"))
00091                                 {
00092                                         return false;
00093                                 }       
00094                                 break;
00095                 }
00096                 
00097                 return true;
00098         }
00099 
00112         function _getCommands()
00113         {
00114                 $commands = array
00115                 (
00116                         array("permission" => "join", "cmd" => "joinClassroom", "lang_var" => "join", "frame" => "_blank"),
00117                         array("permission" => "write", "cmd" => "editClassroom", "lang_var" => "edit"),
00118                         array("permission" => "delete", "cmd" => "removeClassroom", "lang_var" => "delete")
00119                 );
00120                 
00121                 return $commands;
00122         }
00123 }
00124 
00125 ?>

Generated on Fri Dec 13 2013 11:57:58 for ILIAS Release_3_6_x_branch .rev 46809 by  doxygen 1.7.1