Code Search for Developers
 
 
  

quota.html from AlphaMail at Krugle


Show quota.html syntax highlighted

% # vim: set syntax=mason:
% $pct = (($free/$space->{total}) * 100);
<& /mail/header.mhtml, title => "Quotas",
   message => ($pct < 10 ? "Warning: You are almost out of space! Please delete old messages and files.": "") &>
   <p class="freespace">Free Space: <% size_with_units($free) %> (<% $free_pct %>%)</p>
<div class="subheading">Breakdown of usage</div>
<div class="section">
   <img class="usage" src="<% build_url("$base/mail/quota_graph.html", { free => $free, used => $space->{used}, categories => $space->{categories} } ) |h %>">
   <table class="usage">
% my $i = 1;
% for my $k (sort keys %{$space->{categories}}) {
      <tr>
         <th>
            <% $k |h %>: 
         </th>
         <td class="quotaspace_<% $i %>">
% $pct = ($space->{categories}{$k}/$space->{total} < 0.01) ? "<1":sprintf("%2d", (($space->{categories}{$k}/$space->{total}) * 100));
            <% size_with_units($space->{categories}{$k}) %> (<% $pct %>%)
         </td>
      </tr>
% }
   </table>
</div>
<div class="smallprint">Note: Quota information updates at 1 minute intervals</div>
<div class="subheading">Usage by Folder</div>
<div class="section">
   <table class="usage">
% for my $k (sort { $space->{folders}{$b} <=> $space->{folders}{$a} } keys %{$space->{folders}}) {
      <tr>
         <th>
            <% decode('utf8', $tr->decode($k)) |h %>
         </th>
         <td>
% $pct = ($space->{folders}{$k}/$space->{total} < 0.01 ? "<1":sprintf("%2d", (($space->{folders}{$k}/$space->{total}) * 100)));
            <% size_with_units($space->{folders}{$k}) %> (<% $pct %>%)
         </td>
      </tr>
% }
   </table>
</div>
<& /mail/footer.mhtml &>
<%init>
# return if $m->cache_self(key => "quota_$username.$host", expires_in => "1 min");
my $user = Apache2::SiteControl->getCurrentUser($r);
if(!$user || !$user->isa('Apache2::SiteControl::User')) {
   $logger->error("Unable to find a user for the given session key.");
   $m->redirect("/");
}
my $tr = Unicode::IMAPUtf7->new();
my $quota_class = $config->get("quota_class", "AlphaMail::Quota");
my $quota;
my $exp;
my $pct;

eval "require $quota_class" or $logger->error("Could not load $quota_class: $@");
$exp = '$quota = new ' . $quota_class . '($user, $config);';
$logger->debug("$exp");
eval($exp) or $logger->error("Eval failed: $@");
if(!$quota && !$quota->isa('AlphaMail::Quota')) {
   $m->redirect(build_url($base . '/mail/index.html', { error => "Quota subsystem failure. Contact support." }));
}

my $space = $quota->getUsage();
my $free = $space->{total} - $space->{used};
my $free_pct = sprintf("%2d", (($free/$space->{total}) * 100));
#      (sprintf("%.1f", $sizemap{other}{kb}/1024)):$sizemap{other}{kb});

</%init>
<%once>
use Encode;
use AlphaMail::Quota;
use AlphaMail::HTMLHelper qw(build_url size_with_units);
our $logger = Log::Log4perl->get_logger('alphamail');
our $base = $config->get('base_uri');
</%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
  admin/
    autohandler
    index.html
    show_stats.mhtml
    test.mhtml
  docs/
    faq/
      colors.gif
      dates1.gif
      drafts.gif
      filter.gif
      general.html
      index.html
      notrash1.gif
      notrash2.gif
      notrash3.gif
      other.html
      sort.gif
      timeout.gif
    new_features.html
  settings/
    add_filter.html
    altfolder_update.html
    altprefix_update.html
    edit_folders.html
    filters.mhtml
    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.html
  autohandler
  check_spelling.html
  compose.html
  error.html
  feedback.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
  process_compose.html
  process_first_login.html
  process_messages.html
  process_read_message.html
  process_search.html
  quota.html
  quota_graph.html
  raw.html
  read.html
  remove_attachment.html
  renew_session.html
  resume_compose.html
  sanitized.html
  share_options.html
  share_upload.html
  verify_password.html
  view_attachment.html