Show share_options.html syntax highlighted
% # vim:set syntax=mason:
<%args>
$cancel => 0
$message => ''
</%args>
<& /mail/header.mhtml, message => $message, share => 1, title => "Sharing Options" &>
<div class="heading">Sharing Parameters</div>
<div class="section">
<form method="post" action="/mail/share_upload.html"
name="sharing_form" enctype="multipart/form-data">
<p>Please specify the following:</p>
<p>Password to use for encrypting the file: <input type="text" name="password">
% if($user->getAttribute('javascript')) {
<script language="javascript">
var letters = [ 'a', 'b', 'c', 'd', 'e','f','g','h','i','j','k','l','m','n','p','q','r','s','t','u','v','w','x','y','z', 'A', 'B', 'C', 'D', 'E','F','G','H','I','J','K','L','M','N','P','Q','R','S','T','U','V','W','X','Y','Z','1','2','3','4','5','6','7','8','9' ];
function genKey()
{
var n;
var pw = "";
for(n=0; n<10; n++) {
pw += letters[Math.round(Math.random()*58)];
}
document.sharing_form.password.value = pw;
}
</script>
<a href="#" onClick="genKey();">Suggest a secure password</a>
% }
<p><input type="checkbox" value="1" name="key"> I want the password to be
sent with the email. (If you do not check this, you will tell the
recipient the password by some other method, i.e. by phone or a separate
email).
</p>
<p>File (Max size: <% int($config->get('large_file_limit') / (1024*1024)) %> Mbytes): <input type="file" name="file">
<br>
<br>
<input type="submit" name="upload" value="Upload and Compose a message">
<input type="submit" name="cancel" value="Cancel">
</form>
</div>
<& /mail/footer.mhtml &>
<%init>
my $user = Apache::SiteControl->getCurrentUser($r);
my $prefs = new AlphaMail::Preferences($user->getUsername(),
$user->getAttribute('imap'), $config);
my $number = $prefs->get('sharing_number');
my $agree = $prefs->get('sharing_agree');
my $copyright = $prefs->get('sharing_copyright');
my $expire = $prefs->get('sharing_expire');
if(!$number || !$copyright || !$agree || !$expire) {
$m->redirect(build_url("/mail/settings/index.html", {message => "You must check all of the agreement items and click agree in order to share files", doshare => 1, selected => "Sharing"}));
}
</%init>
<%once>
use AlphaMail::HTMLHelper qw(build_url);
</%once>
See more files for this project here