def imapFetch(): from core.common import cleanup cleanup().cleartmp(transferDir) context = {} usr = request.forms.user pwd = request.forms.password server = request.forms.server inbox = request.forms.inbox protocol = request.forms.protocol from core.webMail import imapMail if protocol == 'imap': imapMail().getIMAP(usr, pwd, server, inbox) elif protocol == 'pop': imapMail().getPOP(usr, pwd, server) redirect("/browse")
def imapFetch(): auth.require(role='admin', fail_redirect='/sorry_page') context = {} usr = request.forms.user pwd = request.forms.password server = request.forms.server inbox = request.forms.inbox protocol = request.forms.protocol from core.webMail import imapMail mailFetch = imapMail() if protocol == 'imap': mailFetch.getIMAP(usr, pwd, server, inbox) elif protocol == 'pop': mailFetch.getPOP(usr, pwd, server) redirect("/browse")