Code Search for Developers
 
 
  

first_login.html from AlphaMail at Krugle


Show first_login.html syntax highlighted

% # vim: set syntax=mason:
<& /mail/header.mhtml, title => "Initial Preferences" &>
<div class="heading">Initial Preferences</div>
<p>You do not have any preferences set yet. Please choose the following and
select "Save":</p>
<form class="foldereditor" method="post" 
      action="/mail/process_first_login.html">
   <div class="subheading">Addressing</div>
   <div class="section">
      <p>Your full name:
         <input type="text" size="40" value="<% $p->get('fullname') |h %>"
                name="fullname">
      </p>
   </div>
   <div class="subheading">Utility Folders</div>
   <div class="section">
      <p>The following is a list of special folders. Changing the
         selections will modify how the mail system behaves.
      <p>Sent mail folder:
      <select name="sent_folder">
         <option value="none">None (don't save sent messages)</option>
% for(my $i=0; $i <= $#alt_folders; $i++) { 
%     my $displayname = decode('utf8', $tr->decode($alt_folders[$i]));
         <option <% $alt_folders[$i] eq $sent ? "SELECTED":"" %> value="<% $alt_folders[$i] |h %>"><% $displayname |h %></option>
% }
% for(my $i=0; $i <= $#$list; $i++) {
%     my $displayname = decode('utf8', $tr->decode($list->[$i]));
         <option <% ("$base/" . $list->[$i]) eq $sent ? "SELECTED":"" %> value="<% "$base/" . $list->[$i] |h %>"><% $displayname |h %></option>
% }
      </select>
      <p>Trash Folder:
      <select name="trash_folder">
         <option value="none">None (delete messages on purge)</option>
% for(my $i=0; $i <= $#alt_folders; $i++) { 
%     my $displayname = decode('utf8', $tr->decode($alt_folders[$i]));
         <option <% $alt_folders[$i] eq $trash ? "SELECTED":"" %> value="<% $alt_folders[$i] |h %>"><% $displayname |h %></option>
% }
% for(my $i=0; $i <= $#$list; $i++) {
%     my $displayname = decode('utf8', $tr->decode($list->[$i]));
         <option <% ("$base/" . $list->[$i]) eq $trash ? "SELECTED":"" %> value="<% "$base/" . $list->[$i] |h %>"><% $displayname |h %></option>
% }
      </select>
   </div>
   <div class="subheading">Subscribed Folders</div>
   <div class="section">
      <p>The following is a list of all available mail folders in your
      account. The checkbox indicates whether or not that folder will
      appear in your primary folder list along the left edge of the
      interface.</p>
         <table class="foldereditor">
            <tr>
% my $ccnt = 0;
% for(my $i=0; $i <= $#$list; $i++) { 
%     my $displayname = decode('utf8', $tr->decode($list->[$i]));
               <td>
                  <input <% (grep(/^\Q$list->[$i]\E$/, @$slist) ? "CHECKED":"") %> type="checkbox" name="subscribed" value="<% $list->[$i] |h %>">
                  <% $displayname |h %>
               </td>
%    if($ccnt % 3 == 2) {
            </tr><tr>
%    }
%        $ccnt++;
% }
            </tr>
         </table>
         <div class="control">
            <input type="submit" name="save" value="Save Changes">
            <input type="submit" name="cancel" value="Cancel">
         </div>
   </div>
</form>

<& /mail/footer.mhtml &>

<%init>
my $user = Apache::SiteControl->getCurrentUser($r);
my $tr = Unicode::IMAPUtf7->new();
my $base = $config->get('folder_prefix', "mail");
my $list;
my $slist;
my $c;
my $p;
my ($trash, $sent, $drafts, $altfolders);
my @alt_folders = ();

$base =~ s/\/$//;

$c = new AlphaMail::Middleware($user->getAttribute('imap'), 
                            $user->getUsername(), 
                            $user->getAttribute('password'), $config);
$p = new AlphaMail::Preferences($user->getUsername(), 
                             $user->getAttribute('imap'), $config);
# Set reasonable defaults for stuff:
$p->set('signature_on_top', $config->get('default_signature_on_top', 0));
$p->set('icon_preview', $config->get('default_icon_preview', 1));
$p->set('linkify', $config->get('default_linkify', 0));
$p->set('messages_per_page', $config->get('default_messages_per_page', 10));
$p->set('quicknav', $config->get('default_quicknav', 1));

$trash = $p->get('trash_folder', $config->get("default_trash", 'none'));
$sent = $p->get('sent_folder', $config->get("default_sent", 'none'));
$drafts = $p->get('drafts_folder', $config->get("default_drafts", 'none'));
$altfolders = $p->get('alt_folders', '');
@alt_folders = split /,/, $altfolders if($altfolders);

# make sure the "defaults" at least exist.
if($trash ne 'none') {
   eval {
      $c->makeFolder($trash);
   };
}
if($sent ne 'none') {
   eval {
      $c->makeFolder($sent);
   };
}

$list = $c->getFolderList($base);
$slist = $c->getSubscribedFolderList($base);
$logger->debug("Got folderlist: @$list");
$logger->debug("Got subscribed folderlist: @$slist");

# Remove entries that are subdirectories
@$slist = grep /[^\/]$/, @$slist;
@$list = grep /[^\/]$/, @$list;

# Remove the extra crap at BOL
map { s/^\Q$base\E\/?//; } @$slist;
map { s/^\Q$base\E\/?//; } @$list;

# Remove dot file for old imho prefs
@$slist = grep !/^\.imhoprefs$/, @$slist;
@$list = grep !/^\.imhoprefs$/, @$list;

# Sort them:
@$slist = sort { lc($a) cmp lc($b) } @$slist;
@$list = sort { lc($a) cmp lc($b) } @$list;
@alt_folders = sort { lc($a) cmp lc($b) } @alt_folders;

$c->close();
</%init>
<%once>
our $logger = Log::Log4perl->get_logger('alphamail');
use Encode;
</%once>




See more files for this project here

AlphaMail

AlphaMail is an accelerated web mail interface with a C++ middleware layer that is more effective than an IMAP proxy which is a highly scalable (10k+ users). The interface includes modern features, Section 508 compliance, and universal browser support.

Project homepage: http://sourceforge.net/projects/alphamail
Programming language(s): C++,Java,JavaScript,Perl
License: other

  addressbook/
    edit.mhtml
    import.mhtml
    import_complete.html
    import_csv.html
    import_csv_save.html
    import_fname.html
    import_imho.html
    import_lname.html
    index.html
    lists.mhtml
    process_edit.html
    process_lists.html
    process_take.html
    take.html
  settings/
    altfolder_update.html
    edit_folders.html
    folders.mhtml
    general.mhtml
    index.html
    share.mhtml
    sharing_agree.html
    signatures.mhtml
    update_folderlist.html
    update_general.html
    update_signatures.html
  viewers/
    excel.html
    html.html
    targz.html
    text.html
    word.html
    zip.html
  address_mail.html
  addresslist.mhtml
  autohandler
  check_spelling.html
  compose.html
  error.html
  first_login.html
  fix_spelling.html
  folderlist.mhtml
  footer.mhtml
  get_attachment.html
  header.mhtml
  help.html
  index.html
  logout.html
  menu.mhtml
  other_folders.html
  print.html
  process_compose.html
  process_first_login.html
  process_messages.html
  process_read_message.html
  quota.html
  quota_graph.html
  read.html
  remove_attachment.html
  renew_session.html
  sanitized.html
  share_options.html
  share_upload.html
  verify_password.html
  view_attachment.html