Skip to content
Snippets Groups Projects
Commit 1290d4a5 authored by Peter Rotich's avatar Peter Rotich
Browse files

Minor terminology changes + lint fixes (love you lint)

parent 5ede534a
Branches
Tags
No related merge requests found
...@@ -21,7 +21,7 @@ require_once(INCLUDE_DIR.'class.mailparse.php'); ...@@ -21,7 +21,7 @@ require_once(INCLUDE_DIR.'class.mailparse.php');
require_once(INCLUDE_DIR.'class.email.php'); require_once(INCLUDE_DIR.'class.email.php');
//Make sure piping is enabled! //Make sure piping is enabled!
if(!$cfg->enableEmailPiping()) if(!$cfg->isEmailPipingEnabled())
api_exit(EX_UNAVAILABLE,'Email piping not enabled - check MTA settings.'); api_exit(EX_UNAVAILABLE,'Email piping not enabled - check MTA settings.');
//Get the input //Get the input
$data=isset($_SERVER['HTTP_HOST'])?file_get_contents('php://input'):file_get_contents('php://stdin'); $data=isset($_SERVER['HTTP_HOST'])?file_get_contents('php://input'):file_get_contents('php://stdin');
......
...@@ -320,23 +320,23 @@ class Config { ...@@ -320,23 +320,23 @@ class Config {
return ($this->config['clickable_urls']); return ($this->config['clickable_urls']);
} }
function canFetchMail() {
return ($this->config['enable_mail_polling']);
}
function enableStaffIPBinding() { function enableStaffIPBinding() {
return ($this->config['staff_ip_binding']); return ($this->config['staff_ip_binding']);
} }
function enableCaptcha() { function isCaptchaEnabled() {
return (extension_loaded('gd') && function_exists('gd_info') && $this->config['enable_captcha']); return (extension_loaded('gd') && function_exists('gd_info') && $this->config['enable_captcha']);
} }
function enableAutoCron() { function isAutoCronEnabled() {
return ($this->config['enable_auto_cron']); return ($this->config['enable_auto_cron']);
} }
function isEmailPollingEnabled() {
return ($this->config['enable_mail_polling']);
}
function enableEmailPiping() { function isEmailPipingEnabled() {
return ($this->config['enable_email_piping']); return ($this->config['enable_email_piping']);
} }
......
...@@ -389,7 +389,7 @@ class MailFetcher { ...@@ -389,7 +389,7 @@ class MailFetcher {
$var['subject']=$mailinfo['subject']?$this->mime_decode($mailinfo['subject']):'[No Subject]'; $var['subject']=$mailinfo['subject']?$this->mime_decode($mailinfo['subject']):'[No Subject]';
$var['message']=Format::stripEmptyLines($this->getBody($mid)); $var['message']=Format::stripEmptyLines($this->getBody($mid));
$var['header']=$this->getHeader($mid); $var['header']=$this->getHeader($mid);
$var['emailId']=$emailid?$emailid:$ost->getConfig()->getDefaultEmailId(); //ok to default? $var['emailId']=$emailId?$emailId:$ost->getConfig()->getDefaultEmailId(); //ok to default?
$var['name']=$var['name']?$var['name']:$var['email']; //No name? use email $var['name']=$var['name']?$var['name']:$var['email']; //No name? use email
$var['mid']=$mailinfo['mid']; $var['mid']=$mailinfo['mid'];
...@@ -403,9 +403,9 @@ class MailFetcher { ...@@ -403,9 +403,9 @@ class MailFetcher {
$newticket=true; $newticket=true;
//Check the subject line for possible ID. //Check the subject line for possible ID.
if($var['subject'] && preg_match ("[[#][0-9]{1,10}]", $var['subject'], $regs)) { if($var['subject'] && preg_match ("[[#][0-9]{1,10}]", $var['subject'], $regs)) {
$extid=trim(preg_replace("/[^0-9]/", "", $regs[0])); $tid=trim(preg_replace("/[^0-9]/", "", $regs[0]));
//Allow mismatched emails?? For now NO. //Allow mismatched emails?? For now NO.
if(!($ticket=Ticket::lookupByExtId($extId)) || strcasecmp($ticket->getEmail(), $var['email'])) if(!($ticket=Ticket::lookupByExtId($tid)) || strcasecmp($ticket->getEmail(), $var['email']))
$ticket=null; $ticket=null;
} }
...@@ -496,7 +496,7 @@ class MailFetcher { ...@@ -496,7 +496,7 @@ class MailFetcher {
function run() { function run() {
global $ost; global $ost;
if(!$ost->getConfig()->canFetchMail()) if(!$ost->getConfig()->isEmailPollingEnabled())
return; return;
//We require imap ext to fetch emails via IMAP/POP3 //We require imap ext to fetch emails via IMAP/POP3
......
...@@ -122,7 +122,7 @@ $info=($_POST && $errors)?Format::htmlchars($_POST):$info; ...@@ -122,7 +122,7 @@ $info=($_POST && $errors)?Format::htmlchars($_POST):$info;
} }
?> ?>
<?php <?php
if($cfg && $cfg->enableCaptcha() && (!$thisclient || !$thisclient->isValid())) { if($cfg && $cfg->isCaptchaEnabled() && (!$thisclient || !$thisclient->isValid())) {
if($_POST && $errors && !$errors['captcha']) if($_POST && $errors && !$errors['captcha'])
$errors['captcha']='Please re-enter the text again'; $errors['captcha']='Please re-enter the text again';
?> ?>
......
...@@ -22,7 +22,7 @@ if($_POST): ...@@ -22,7 +22,7 @@ if($_POST):
if($thisclient) { if($thisclient) {
$_POST['name']=$thisclient->getName(); $_POST['name']=$thisclient->getName();
$_POST['email']=$thisclient->getEmail(); $_POST['email']=$thisclient->getEmail();
} elseif($cfg->enableCaptcha()) { } elseif($cfg->isCaptchaEnabled()) {
if(!$_POST['captcha']) if(!$_POST['captcha'])
$errors['captcha']='Enter text shown on the image'; $errors['captcha']='Enter text shown on the image';
elseif(strcmp($_SESSION['captcha'],md5($_POST['captcha']))) elseif(strcmp($_SESSION['captcha'],md5($_POST['captcha'])))
......
...@@ -33,9 +33,9 @@ $sec=time()-$_SESSION['lastcroncall']; ...@@ -33,9 +33,9 @@ $sec=time()-$_SESSION['lastcroncall'];
if($sec>180): //user can call cron once every 3 minutes. if($sec>180): //user can call cron once every 3 minutes.
require_once(INCLUDE_DIR.'class.cron.php'); require_once(INCLUDE_DIR.'class.cron.php');
Cron::TicketMonitor(); //Age tickets: We're going to age tickets regardless of cron settings. Cron::TicketMonitor(); //Age tickets: We're going to age tickets regardless of cron settings.
if($cfg && $cfg->enableAutoCron()){ //ONLY fetch tickets if autocron is enabled! if($cfg && $cfg->isAutoCronEnabled()) { //ONLY fetch tickets if autocron is enabled!
Cron::MailFetcher(); //Fetch mail. Cron::MailFetcher(); //Fetch mail.
$ost->logDebug('Autocron', 'Cron job executed ['.$thisstaff->getUserName().']'); $ost->logDebug('Auto Cron', 'Mail fetcher cron call ['.$thisstaff->getUserName().']');
} }
$_SESSION['lastcroncall']=time(); $_SESSION['lastcroncall']=time();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment