Skip to content
Snippets Groups Projects
Commit fa5dfe2c authored by Jared Hancock's avatar Jared Hancock
Browse files

Drop OstConfig::updateAttachmentsSettings(), ::allowSMTPSpoofing()

Attachment settings were merged into ticket settings
SMTPSpoofing feature was moved to per-email rather than global
parent 03ede650
No related branches found
No related tags found
No related merge requests found
......@@ -343,10 +343,6 @@ class OsticketConfig extends Config {
return $this->defaultSMTPEmail;
}
function allowSMTPSpoofing() {
return $this->get('spoof_default_smtp');
}
function getDefaultPriorityId() {
return $this->get('default_priority_id');
}
......@@ -636,9 +632,6 @@ class OsticketConfig extends Config {
case 'emails':
return $this->updateEmailsSettings($vars, $errors);
break;
case 'attachments':
return $this->updateAttachmentsSetting($vars,$errors);
break;
case 'autoresp':
return $this->updateAutoresponderSettings($vars, $errors);
break;
......@@ -802,45 +795,6 @@ class OsticketConfig extends Config {
));
}
function updateAttachmentsSetting($vars,&$errors) {
if($vars['allow_attachments']) {
if(!ini_get('file_uploads'))
$errors['err']='The \'file_uploads\' directive is disabled in php.ini';
if(!is_numeric($vars['max_file_size']))
$errors['max_file_size']='Maximum file size required';
if(!$vars['allowed_filetypes'])
$errors['allowed_filetypes']='Allowed file extentions required';
if(!($maxfileuploads=ini_get('max_file_uploads')))
$maxfileuploads=DEFAULT_MAX_FILE_UPLOADS;
if(!$vars['max_user_file_uploads'] || $vars['max_user_file_uploads']>$maxfileuploads)
$errors['max_user_file_uploads']='Invalid selection. Must be less than '.$maxfileuploads;
if(!$vars['max_staff_file_uploads'] || $vars['max_staff_file_uploads']>$maxfileuploads)
$errors['max_staff_file_uploads']='Invalid selection. Must be less than '.$maxfileuploads;
}
if($errors) return false;
return $this->updateAll(array(
'allow_attachments'=>isset($vars['allow_attachments'])?1:0,
'allowed_filetypes'=>strtolower(preg_replace("/\n\r|\r\n|\n|\r/", '',trim($vars['allowed_filetypes']))),
'max_file_size'=>$vars['max_file_size'],
'max_user_file_uploads'=>$vars['max_user_file_uploads'],
'max_staff_file_uploads'=>$vars['max_staff_file_uploads'],
'email_attachments'=>isset($vars['email_attachments'])?1:0,
'allow_email_attachments'=>isset($vars['allow_email_attachments'])?1:0,
'allow_online_attachments'=>isset($vars['allow_online_attachments'])?1:0,
'allow_online_attachments_onlogin'=>isset($vars['allow_online_attachments_onlogin'])?1:0,
));
}
function updateAutoresponderSettings($vars, &$errors) {
if($errors) return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment