KevinTheJedi
yes I see this section in the same file with Encrypt lower down, but I'm unsure what to do next. If you do get a chance to help along with this, that would be awesome or if anyone else has any input or had a similar issue then I'm all ears and would be grateful. Cheers
` if(!$errors) {
$sql='updated=NOW(),mail_errors=0, mail_lastfetch=NULL'.
',email='.db_input($vars['email']).
',name='.db_input(Format::striptags($vars['name'])).
',dept_id='.db_input($vars['dept_id']).
',priority_id='.db_input($vars['priority_id']).
',noautoresp='.db_input(isset($vars['noautoresp'])?1:0).
',userid='.db_input($vars['userid']).
',userpass='.db_input(Misc::encrypt($vars['userpass'],SECRET_SALT)).
',mail_active='.db_input($vars['mail_active']).
',mail_host='.db_input($vars['mail_host']).
',mail_protocol='.db_input($vars['mail_protocol']?$vars['mail_protocol']:'POP').
',mail_encryption='.db_input($vars['mail_encryption']).
',mail_port='.db_input($vars['mail_port']?$vars['mail_port']:0).
',mail_fetchfreq='.db_input($vars['mail_fetchfreq']?$vars['mail_fetchfreq']:0).
',mail_fetchmax='.db_input($vars['mail_fetchmax']?$vars['mail_fetchmax']:0).
',mail_delete='.db_input(isset($vars['mail_delete'])?$vars['mail_delete']:0).
',smtp_active='.db_input($vars['smtp_active']).
',smtp_host='.db_input($vars['smtp_host']).
',smtp_port='.db_input($vars['smtp_port']?$vars['smtp_port']:0).
',smtp_auth='.db_input($vars['smtp_auth']);
if($id){ //update
$sql='UPDATE '.EMAIL_TABLE.' SET '.$sql.' WHERE email_id='.db_input($id);
if(!db_query($sql) || !db_affected_rows())
$errors['err']='Unable to update email. Internal error occured';
}else {
$sql='INSERT INTO '.EMAIL_TABLE.' SET '.$sql.',created=NOW()';
if(!db_query($sql) or !($emailID=db_insert_id()))
$errors['err']='Unable to add email. Internal error';
else
return $emailID; //newly created email.
}
}else{
$errors['err']='Error(s) Occured. Try again';
}
return $errors?FALSE:TRUE;
}`