in www/board/agenda/models/pending.rb [10:58]
def self.get(user, agenda=nil)
file = work_file(user)
response = ((file and File.exist?(file)) ? YAML.load_file(file) : {})
if agenda and agenda > response['agenda'].to_s
response = {'agenda' => agenda, 'initials' => response['initials']}
end
response['approved'] ||= []
response['unapproved'] ||= []
response['flagged'] ||= []
response['unflagged'] ||= []
response['comments'] ||= {}
response['seen'] ||= {}
response['userid'] ||= user
if user == 'test' and ENV['RACK_ENV'] == 'test'
username = 'Joe Tester'
else
username = ASF::Person.new(user).public_name
begin
username ||= Etc.getpwnam(user)[4].split(',')[0].
force_encoding('utf-8')
rescue ArgumentError
username = 'Anonymous'
end
end
if user == 'test' or ASF::Service['board'].members.map(&:id).include? user
response['role'] = :director
elsif ASF::Service['asf-secretary'].members.map(&:id).include? user
response['role'] = :secretary
else
response['role'] = :guest
end
response['username'] ||= username
response['initials'] ||= username.gsub(/[^A-Z]/, '').downcase
response['firstname'] ||= username.split(' ').first.downcase
response
end