Skip to content

Commit

Permalink
Fix logins somewhat (still needs cleanup)
Browse files Browse the repository at this point in the history
darcs-hash:20080122001205-92d64-553476c15d7504e1de959db69ce873fefac2b987.gz
  • Loading branch information
aredridel committed Jan 22, 2008
1 parent eec27a9 commit a897299
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions campingatmailbox.rb
Expand Up @@ -132,8 +132,8 @@ class UserError < Exception

module Helpers
def imap
if @state['imapconnection'] and !residentsession[:imap]
residentsession[:imap] = @state['imapconnection'].dup
if @state[:imap] and !residentsession[:imap]
residentsession[:imap] = @state[:imap].dup
end
residentsession[:imap]
end
Expand Down Expand Up @@ -478,6 +478,10 @@ def post
end
if imap_connection.authenticated?
redirect Mailboxes
residentsession[:imap] = imap_connection
t = imap_connection.dup
t.send(:instance_variable_set, :@connection, nil)
@state[:imap] = t
return
end
caps = imap_connection.capability
Expand Down Expand Up @@ -525,9 +529,9 @@ def post
@state['username'] = input.username
@state['password'] = input.password

t = imap.dup
t = imap_connection.dup
t.send(:instance_variable_set, :@connection, nil)
@state['imapconnection'] = t
@state[:imap] = t
residentsession[:usesort] = if caps.include? "SORT": true else false end
redirect Mailboxes
rescue Net::IMAP::NoResponseError => e
Expand Down Expand Up @@ -1024,6 +1028,9 @@ def get(k,m,e)
h2 "#{k}.#{m}"
h3 "#{e.class} #{e.message}:"
ul { e.backtrace.each { |bt| li bt } }
p do
self << state.inspect.gsub(/&/, '&amp;').gsub(/</, '&lt;').gsub(/>/, '&gt;')
end
end
p { self << "You can try "; a('logging off', :href=> R(Logout)); self << ' and seeing if it helps' }
end
Expand Down

0 comments on commit a897299

Please sign in to comment.