[Isocial-svn] SF.net SVN: isocial: [239] app
Status: Pre-Alpha
Brought to you by:
aguidrevitch
From: <di...@us...> - 2008-06-15 13:11:46
|
Revision: 239 http://isocial.svn.sourceforge.net/isocial/?rev=239&view=rev Author: dim0s77 Date: 2008-06-15 06:11:54 -0700 (Sun, 15 Jun 2008) Log Message: ----------- enable limit accesing to few actions for user Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/views/groupapp/group/show_group.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-06-15 11:50:47 UTC (rev 238) +++ app/controllers/groupapp/group_controller.php 2008-06-15 13:11:54 UTC (rev 239) @@ -151,11 +151,22 @@ $this->members = $this->_getGroupMembers($this->group); $this->members_count = count($this->members); $this->admins = array(); + $this->is_admin = false; + $this->is_member = false; + $this->is_guest = true; + $current_user_id = $this->current_user->getId(); foreach ($this->members as $member) { if ($member->groupapp_member_role_id < 3) { $member->role->load(); $this->admins[] = $member; + if ($current_user_id == $member->getId()) { + $this->is_admin = true; + } } + if ($current_user_id == $member->getId()) { + $this->is_member = true; + $this->is_guest = false; + } } $this->group_type = $this->group->group_type->load()->get('name'); $messages = $this->GroupappMessage->find('all', Modified: app/views/groupapp/group/show_group.tpl =================================================================== --- app/views/groupapp/group/show_group.tpl 2008-06-15 11:50:47 UTC (rev 238) +++ app/views/groupapp/group/show_group.tpl 2008-06-15 13:11:54 UTC (rev 239) @@ -14,11 +14,19 @@ </div> <ul class="actions_list"> + {?is_admin} <li><a href="/groupapp/">_{Message All Members}</a></li> <li><a href="/groupapp/group/edit_info/{group.id?}">_{Edit Group}</a></li> <li><a href="/groupapp/group/edit_members/{group.id?}">_{Edit Members}</a></li> + {end} + {?is_member} <li><a href="/groupapp/group/edit_members/{group.id?}">_{Invite People to Join}</a></li> <li><a href="#">_{Leave Group}</a></li> + {end} + {?is_guest} + <li><a href="#">_{View Discussion Board}</a></li> + <li><a href="#">_{Join this Group}</a></li> + {end} </ul> <div class="box"> @@ -59,7 +67,7 @@ <div class="box"> <div class="header"> - <div class="edit"><a href="/groupapp/group/edit_info/{group.id?}">_{edit}</a></div> + {?is_admin}<div class="edit"><a href="/groupapp/group/edit_info/{group.id?}">_{edit}</a></div>{end} <div class="box_title">_{Group Info}</div> </div> <div class="clearfix"></div> @@ -117,14 +125,15 @@ </div> {else} <div class="emptyblock"> - _{There are no discussions}.<br><a href="/groupapp/board/start_topic/{group.id?}">_{Start the first topic}</a>. + _{There are no discussions}.<br> + {?is_member}<a href="/groupapp/board/start_topic/{group.id?}">_{Start the first topic}</a>.{end} </div> {end} </div> <div class="box"> <div class="header"> - <div class="edit"><a href="/groupapp/group/edit_members/{group.id?}">_{edit}</a></div> + {?is_admin}<div class="edit"><a href="/groupapp/group/edit_members/{group.id?}">_{edit}</a></div>{end} <div class="box_title">_{Members}</div> </div> <div class="menu"> @@ -143,7 +152,7 @@ </div> <div class="clearfix"></div> <div class="emptyblock"> - _{No one has said anything...yet}. <a href="#">_{Write something}</a>. + _{No one has said anything...yet}. {?is_member}<a href="#">_{Write something}</a>.{end} </div> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |