Changeset 10356
- Timestamp:
- Jan 25, 2009, 12:06:31 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OpenPNE3/trunk/lib/model/Community.php
r10003 r10356 53 53 } 54 54 55 public function checkPrivilegeBelong($memberId) 56 { 57 if (!$this->isPrivilegeBelong($memberId)) 58 { 59 throw new opPrivilegeException('fail'); 60 } 61 } 62 63 public function isPrivilegeBelong($memberId) 64 { 65 $c = new Criteria(); 66 $c->add(CommunityMemberPeer::MEMBER_ID, $memberId); 67 68 return (bool)$this->getCommunityMembers($c); 69 } 70 71 public function isAdmin($memberId) 72 { 73 $c = new Criteria(); 74 $c->add(CommunityMemberPeer::MEMBER_ID, $memberId); 75 $c->add(CommunityMemberPeer::POSITION, 'admin'); 76 77 return (bool)$this->getCommunityMembers($c); 78 } 55 79 }
Note: See TracChangeset
for help on using the changeset viewer.