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

classes/class.ilLocalUser.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 /*
00025 * Helper class for local user accounts (in categories)
00026 *
00027 * @author Stefan Meyer <smeyer@databay.de>
00028 * @version $Id: class.ilLocalUser.php 5669 2004-11-04 11:00:36Z smeyer $
00029 *
00030 * @package core
00031 */
00032 
00033 class ilLocalUser
00034 {
00035         var $db;
00036         
00037         var $parent_id;
00038                 
00045         function ilLocalUser($a_parent_id)
00046         {
00047                 global $ilDB;
00048 
00049                 $this->db =& $ilDB;
00050                 $this->parent_id = $a_parent_id;
00051                 
00052         }
00053 
00054         function setParentId($a_parent_id)
00055         {
00056                 $this->parent_id = $a_parent_id;
00057         }
00058         function getParentId()
00059         {
00060                 return $this->parent_id;
00061         }
00062 
00063         // STATIC
00064         function _getFolderIds()
00065         {
00066                 global $ilDB,$rbacsystem;
00067 
00068                 $query = "SELECT DISTINCT(time_limit_owner) as parent_id FROM usr_data ";
00069 
00070                 $res = $ilDB->query($query);
00071                 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
00072                 {
00073                         if($rbacsystem->checkAccess('read_users',$row->parent_id))
00074                         {
00075                                 $parent[] = $row->parent_id;
00076                         }
00077                 }
00078                 return $parent ? $parent : array();
00079         }
00080         function _getAllUserIds($a_filter = 0)
00081         {
00082                 global $ilDB;
00083                 switch($a_filter)
00084                 {
00085                         case 0:
00086                                 if(ilLocalUser::_getFolderIds())
00087                                 {
00088                                         $where = "WHERE time_limit_owner IN ";
00089                                         $where .= '(';
00090                                         $where .= implode(",",ilLocalUser::_getFolderIds());
00091                                         $where .= ')';
00092 
00093                                 }
00094                                 else
00095                                 {
00096                                         $where = "WHERE time_limit_owner IN ('')";
00097                                 }
00098 
00099                                 break;
00100 
00101                         default:
00102                                 $where = "WHERE time_limit_owner = '".$a_filter."'";
00103 
00104                                 break;
00105                 }
00106                 
00107                 $query = "SELECT usr_id FROM usr_data ".$where;
00108                 $res = $ilDB->query($query);
00109 
00110                 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
00111                 {
00112                         $users[] = $row->usr_id;
00113                 }
00114 
00115                 return $users ? $users : array();
00116         }
00117 
00118         function _getUserFolderId()
00119         {
00120                 return 7;
00121         }
00122                 
00123                         
00124 
00125                 
00126 
00127 } // CLASS ilLocalUser
00128 ?>

Generated on Fri Dec 13 2013 09:06:34 for ILIAS Release_3_4_x_branch .rev 46804 by  doxygen 1.7.1