Changeset 18480
- Timestamp:
- 08/30/08 20:46:56 (4 months ago)
- Location:
- websites/events.php.gr.jp/branches/cake/app
- Files:
-
- 2 modified
-
controllers/event_comments_controller.php (modified) (2 diffs)
-
views/event/show.ctp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
websites/events.php.gr.jp/branches/cake/app/controllers/event_comments_controller.php
r18467 r18480 7 7 8 8 var $name = 'EventComments'; 9 var $uses = array('EventComment', 'User'); 9 10 10 11 /** … … 33 34 } 34 35 } 36 37 /** 38 * delete 39 * 40 */ 41 function delete($comment_id) 42 { 43 $comment = $this->EventComment->findById($comment_id); 44 if (!$comment) { 45 $this->redirect('/'); 46 } 47 48 $user = $this->User->findById($comment['EventComment']['user_id']); 49 50 $username = $this->Session->read('username'); 51 52 if ($user['User']['username'] == $username) { 53 $this->EventComment->del($comment['EventComment']['id']); 54 } else if ($this->Session->read('role') == 'admin') { 55 $this->EventComment->del($comment['EventComment']['id']); 56 } 57 58 $this->redirect('/events/show/'.$comment['EventComment']['event_id']); 59 } 35 60 } 36 61 ?> -
websites/events.php.gr.jp/branches/cake/app/views/event/show.ctp
r18446 r18480 124 124 <p> 125 125 <?php echo h($comment['comment']); ?> 126 <?php if ($comment['User'][' role']== 'admin'): ?>127 <?php $html->link('[delete]', '/event_comment/delete/'.$comment['id']);?>126 <?php if ($comment['User']['username'] == $session->read('username') || $session->read('role') == 'admin'): ?> 127 <?php echo $html->link('[delete]', '/event_comments/delete/'.$comment['id']);?> 128 128 <?php endif; ?> 129 129 </p>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)