ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilPaymentAdminGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
35 include_once 'payment/classes/class.ilPaymentVendors.php';
36 include_once 'payment/classes/class.ilPaymentBaseGUI.php';
37 include_once 'payment/classes/class.ilPaymentTrustees.php';
38 include_once 'payment/classes/class.ilPaymentBillAdminGUI.php';
39 
41 {
42  public function ilPaymentAdminGUI($user_obj)
43  {
44  $this->user_obj = $user_obj;
45  }
46 
47  public function executeCommand()
48  {
49  global $ilCtrl;
50 
51  $next_class = $ilCtrl->getNextClass($this);
52  $cmd = $ilCtrl->getCmd();
53 
54  switch($next_class)
55  {
56  case 'ilpaymenttrusteegui':
57  include_once 'payment/classes/class.ilPaymentTrusteeGUI.php';
58  $ilCtrl->forwardCommand(new ilPaymentTrusteeGUI($this->user_obj));
59  break;
60 
61  case 'ilpaymentobjectgui':
62  include_once 'payment/classes/class.ilPaymentObjectGUI.php';
63  $ilCtrl->forwardCommand(new ilPaymentObjectGUI($this->user_obj));
64  break;
65 
66  case 'ilpaymentstatisticgui':
67  include_once 'payment/classes/class.ilPaymentStatisticGUI.php';
68  $ilCtrl->forwardCommand(new ilPaymentStatisticGUI($this->user_obj));
69  break;
70 
71  case 'ilpaymentbilladmingui':
72  include_once 'payment/classes/class.ilPaymentBillAdminGUI.php';
73  $ilCtrl->forwardCommand(new ilPaymentBillAdminGUI($this->user_obj, (int)$_GET['pobject_id']));
74  break;
75 
76  case 'ilpaymentcoupongui':
77  include_once 'payment/classes/class.ilPaymentCouponGUI.php';
78  $ilCtrl->forwardCommand(new ilPaymentCouponGUI($this->user_obj));
79  break;
80 
81  default:
82  $this->forwardToDefault();
83  break;
84  }
85  }
86 
87  private function forwardToDefault()
88  {
89  global $ilCtrl;
90 
91  if(ilPaymentVendors::_isVendor($this->user_obj->getId()) ||
92  ilPaymentTrustees::_hasStatisticPermission($this->user_obj->getId()))
93  {
94  $ilCtrl->redirectByClass('ilpaymentstatisticgui');
95  }
96  else if(ilPaymentTrustees::_hasObjectPermission($this->user_obj->getId()))
97  {
98  $ilCtrl->redirectByClass('ilpaymentobjectgui');
99  }
100 
101  echo 'No access to payment administration!';
102 
103  return false;
104  }
105 }
106 ?>