Anonymising the e-mail addresses in discussions

- The email addresses were shown on the event view even if the post was made by a user of another org
- fixed
pull/224/head
iglocska 2014-02-28 11:06:43 +01:00
parent 73159dd4e5
commit 09f2e5a0bc
2 changed files with 9 additions and 0 deletions

View File

@ -123,6 +123,8 @@ drop procedure AddColumnUnlessExists;
UPDATE `regexp` SET `type` = 'ALL';
UPDATE `roles` SET `perm_site_admin` = 1 WHERE `id` = 1;
UPDATE `roles` SET `perm_tagger` = 1 WHERE `id` = 1;
UPDATE `roles` SET `perm_regexp_access` = 1 WHERE `id` = 1;
INSERT IGNORE INTO `threat_levels` (`id`, `name`, `description`, `form_description`)
VALUES

View File

@ -323,6 +323,13 @@ class EventsController extends AppController {
'contain' => 'User'
);
$posts = $this->paginate('Post');
if (!$this->_isSiteAdmin()) {
foreach ($posts as &$post) {
if ($post['User']['org'] != $this->Auth->user('org')) {
$post['User']['email'] = 'User ' . $post['User']['id'] . ' (' . $post['User']['org'] . ')';
}
}
}
// Show the discussion
$this->set('posts', $posts);
$this->set('thread_id', $thread['Thread']['id']);