Vault fixes. Added vault.locking

This commit is contained in:
Karl Cordes 2011-09-26 17:41:17 +10:00
parent 29bb1b322d
commit 519e2cced5
2 changed files with 19 additions and 5 deletions

View file

@ -25,22 +25,32 @@ class VaultShell extends Shell {
$testing = 0; //Whether to actually move the emails. 1=test, 0=production
if($testing == 1) {
$ripmime_path = '/opt/local/bin/ripmime';
$email_dir = '/Users/karlcordes/Sites/quotenik/app/emails';
$vault_dir = '/Users/karlcordes/Sites/quotenik/app/vaultmsgs';
$processed_dir = '/Users/karlcordes/Sites/quotenik/app/processed_vaultmsgs';
$lockfile = '/Users/karlcordes/Sites/quotenik/app/vault.lock';
}
else {
$ripmime_path = '/usr/local/bin/ripmime';
$email_dir = '/var/www/cakephp/app/emails';
$vault_dir = '/var/www/cakephp/app/vaultmsgs';
$processed_dir = '/var/www/cakephp/app/processed_vaultmsgs';
$lockfile = '/var/www/cakephp/app/vault.lock';
}
if(file_exists($lockfile)) {
die("Error: Another process is currently running. Terminating this one");
}
else {
if(!touch($lockfile)) {
die("FATAL ERROR: Unable to create vault.lock");
}
}
/* Find the strings we want to look for in the subjects. Build arrays
* using the string as the keys, IDs as the value
@ -376,6 +386,10 @@ class VaultShell extends Shell {
}
if(!unlink($lockfile)) {
die("FATAL ERROR: Unable to remove vault.lock. No further Vault instances can run!");
}
}

View file

@ -3,7 +3,7 @@ Dear <?php echo $enquiry['Contact']['first_name']; ?>,<br /><br />
Please see the attached PDF of your <?=$DocFullName?>.<br />
If you have any enquiries, please contact <?php echo $html->link($enquiry['User']['first_name'].' '.$enquiry['User']['last_name'], 'mailto:'.$enquiry['User']['email'].'?subject='.$enquiry['Enquiry']['title']); ?>
(<?php echo $html->link($enquiry['User']['email'], 'mailto:'.$enquiry['User']['email'].'?subject='.$enquiry['Enquiry']['title']); ?>).<br /><br />
(<?php echo $html->link($enquiry['User']['email'], 'mailto:'.$enquiry['User']['email'].'?subject='.$enquiry['Enquiry']['title']); ?>).<br /><br />
Sincerely, <br /><br />