• 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 
00035 class ilObjiLincClassroomAccess extends ilObjectAccess
00036 {
00037         
00050         function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = "")
00051         {
00052                 global $ilUser, $lng, $rbacsystem, $ilAccess, $ilias;
00053 
00054                 $user_id = $ilUser->getId();
00055                 $class_id = $a_ref_id;
00056                 $course_ref_id = $a_obj_id;
00057                 $class_arr = $a_user_id;
00058 //var_dump($a_cmd,$a_permission,$a_ref_id,$a_obj_id,$a_user_id);
00064                 switch ($a_cmd)
00065                 {
00066 
00067                 }
00068 
00069                 switch ($a_permission)
00070                 {
00071                         case 'join':
00072                                 // closed rooms cannot joined 
00073                                 if ($class_arr['alwaysopen'] == "Falsch")
00074                                 {
00075                                         return false;
00076                                 }
00077                                 
00078                                 // non members cannot join
00079                                 include_once ('ilinc/classes/class.ilObjiLincCourse.php');
00080                                 
00081                                 if (!ilObjiLincCourse::_isMember($user_id,$a_ref_id))
00082                                 {
00083                                         return false;
00084                                 }
00085                                 break;
00086 
00087                         case "write":
00088                         case "delete":
00089                                 if(!$rbacsystem->checkAccessOfUser($user_id,'create',$a_ref_id,"ilca"))
00090                                 {
00091                                         return false;
00092                                 }       
00093                                 break;
00094                 }
00095                 
00096                 return true;
00097         }
00098 
00111         function _getCommands()
00112         {
00113                 $commands = array
00114                 (
00115                         array("permission" => "join", "cmd" => "joinClassroom", "lang_var" => "join", "frame" => "_blank"),
00116                         array("permission" => "write", "cmd" => "editClassroom", "lang_var" => "edit"),
00117                         array("permission" => "delete", "cmd" => "removeClassroom", "lang_var" => "delete")
00118                 );
00119                 
00120                 return $commands;
00121         }
00122 }
00123 
00124 ?>

Generated on Fri Dec 13 2013 10:18:30 for ILIAS Release_3_5_x_branch .rev 46805 by  doxygen 1.7.1