diff options
Diffstat (limited to 'upload_code.inc')
-rwxr-xr-x | upload_code.inc | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/upload_code.inc b/upload_code.inc index 568d1c2..c387270 100755 --- a/upload_code.inc +++ b/upload_code.inc @@ -350,8 +350,8 @@ function lab_migration_upload_code_form_validate($form, &$form_state) if (isset($_FILES['files'])) { /* check if atleast one source or result file is uploaded */ - if ( ! ($_FILES['files']['name']['sourcefile1'] || $_FILES['files']['name']['xcos1'])) - form_set_error('sourcefile1', t('Please upload atleast one main or source file or xcos file.')); + if ( ! ($_FILES['files']['name']['sourcefile1'] )) + form_set_error('sourcefile1', t('Please upload atleast one main or source file.')); /* check for valid filename extensions */ foreach ($_FILES['files']['name'] as $file_form_name => $file_name) @@ -580,11 +580,20 @@ function lab_migration_upload_code_form_submit($form, &$form_state) { } drupal_set_message('Solution uploaded successfully.', 'status'); - /* sending email */ - $email_to = $user->mail . ', ' . variable_get('lab_migration_emails', ''); + /* sending email */ + $email_to = $user->mail; + + $from = variable_get('lab_migration_from_email', ''); + $bcc= variable_get('lab_migration_emails', ''); + $cc=variable_get('lab_migration_cc_emails', ''); $param['solution_uploaded']['solution_id'] = $solution_id; $param['solution_uploaded']['user_id'] = $user->uid; - if (!drupal_mail('lab_migration', 'solution_uploaded', $email_to, language_default(), $param, variable_get('lab_migration_from_email', NULL), TRUE)) + $param['solution_uploaded']['headers']=array('From'=>$from,'MIME-Version'=> '1.0', + 'Content-Type'=> 'text/plain; charset=UTF-8; format=flowed; delsp=yes', + 'Content-Transfer-Encoding' => '8Bit', + 'X-Mailer'=> 'Drupal','Cc' => $cc, 'Bcc' => $bcc); + + if (!drupal_mail('lab_migration', 'solution_uploaded', $email_to, language_default(), $param, $from, TRUE)) drupal_set_message('Error sending email message.', 'error'); drupal_goto('lab-migration/code'); |