aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorfrancis <francis>2008-12-18 18:55:22 +0000
committerfrancis <francis>2008-12-18 18:55:22 +0000
commitd0c412d09657cbc0a7c28ab3ed3dfb2f2ef65ff1 (patch)
tree8e4c08a61cd309e0509e9de9b96c592c99c08cf2 /app/models/user.rb
parent3d0a8dd7dd1f404f99cecf13c8683b405ecb12fe (diff)
Only show the name of the organisation if their domain matches that of email when rendering
incoming messages. Centralise domain stripping function.
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 472929144..62347713c 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -22,7 +22,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: user.rb,v 1.77 2008-12-04 15:03:42 francis Exp $
+# $Id: user.rb,v 1.78 2008-12-18 18:55:22 francis Exp $
require 'digest/sha1'
@@ -219,6 +219,11 @@ class User < ActiveRecord::Base
self.admin_level == 'super'
end
+ # Returns domain part of user's email address
+ def email_domain
+ return PublicBody.extract_domain_from_email(self.email)
+ end
+
private
def self.encrypted_password(password, salt)