Exemplo n.º 1
0
 public function get_faculty()
 {
     $__reqData = Input::all();
     if (isset($__reqData['view'])) {
         $viewType = $__reqData['view'];
     } else {
         $viewType = 'index';
     }
     $active_user = Session::get('user.current_active');
     $__perCheck = MyPermission::check($active_user, 'department_department' . $viewType);
     if (!$__perCheck) {
         Response::redirect('deny_access');
     }
     if ($viewType == 'index') {
         $this->faculty_view_list();
     } elseif ($viewType == 'add' || $viewType == 'edit') {
         $fucn = 'faculty_view_' . $viewType;
         $this->{$fucn}();
     } else {
         Response::redirect('not_found');
     }
 }
 /**
  * Load grants between two people. Note that this load is unidirectional, between a grantor and a grantee.
  */
 public static function load_grants(MyRelationshipPerson $grantor, MyRelationshipPerson $grantee)
 {
     $sql = "\n\t\t\tSELECT *\n\t\t\tFROM relgrants rg\n\t\t\tWHERE\n\t\t\t\trg.wpid_grantor = ? AND\n\t\t\t\trg.wpid_grantee = ?\n\t\t";
     $args = array($grantor->wpid, $grantee->wpid);
     $rset = PSU::db('portal')->Execute($sql, $args);
     $grants = array();
     foreach ($rset as $row) {
         $permission = MyPermission::load($row['relpermission_id']);
         $grant = new self($row['id'], $grantor, $grantee, $permission, strtotime($row['activity_date']));
         $grants[$permission->code] = $grant;
         unset($grant);
     }
     return $grants;
 }