<@LANGUAGE=Javascript@><% if (Request.HasField("c")) { Response.Write(Request.Fields("e") == "1" ? "Enable Mail Forwarding" : "Disable Mail Forwarding"); } else Response.Write("Mailtraq Mailbox Forwarding"); %>
<% var username = ""; var message = ""; var user = null; var mailbox = null; var output = ""; var forwarding_enabled = false; var forwarding_address = ""; var title = "Configure Mailbox Forwarding"; if (Request.HasField("u")) { username = Request.Fields("u"); if (Request.HasField("h")) user = System.AuthenticateUser(username, Request.Fields("h"), "forwarding_%s"); else user = System.AuthenticateUser(username, Request.Fields("p")); } if ((username != "") && !user) { message = 'Incorrect credentials given'; } if (user) mailbox = Config.GetMailslot(user.PrimaryMailbox); if (mailbox) { if (Request.Fields("c") == "1") { mailbox.ForwardActive = Request.Fields("e") == "1"; title = mailbox.ForwardActive ? "Forwarding Enabled" : "Forwarding Disabled"; if (Request.HasField("a")) mailbox.ForwardTo = Request.Fields("a"); message = "Changes Applied"; } var hash = Toolkit.HashMD5("forwarding_" + user.Password); forwarding_enabled = mailbox.ForwardActive; forwarding_address = mailbox.ForwardTo; output += '

' + title + '


'; output += '

' + message + '

'; output += '
'; output += '

Configure Forwarding for mailbox: ' + mailbox.Name + '

'; output += '

Enable Mail Forwarding
'; output += 'Forward to address:
'; output += ''; output += ''; output += ''; output += '

'; output += '
'; output += '

Drag the links below to your Bookmarks Folder or to your Task Tray

'; output += '

'; } else { output += '

' + title + '


' + message + '

'; output += '

Please log in below to configure your mailbox forwarding

'; output += '

Username:

'; output += '

Password:

'; output += ''; } Response.Write(output); %>