diff options
-rwxr-xr-x | download.inc | 4 | ||||
-rwxr-xr-x | pdf/cert_new.inc | 9 | ||||
-rwxr-xr-x | proposal.inc | 2 |
3 files changed, 12 insertions, 3 deletions
diff --git a/download.inc b/download.inc index 5dfb9ef..d8a6839 100755 --- a/download.inc +++ b/download.inc @@ -24,7 +24,7 @@ function dwsim_flowsheet_download_abstract() { $query = db_select('dwsim_flowsheet_submitted_abstracts_file'); $query->fields('dwsim_flowsheet_submitted_abstracts_file'); $query->condition('proposal_id', $proposal_id); - $query->condition('filetype', A); + $query->condition('filetype', 'A'); $result = $query->execute(); $flowsheet_project_files = $result->fetchObject(); //var_dump($custom_model_project_files);die; @@ -43,7 +43,7 @@ function dwsim_flowsheet_download_abstract() { header("Content-Description: File Transfer"); header("Content-Type: application/pdf"); header('Content-disposition: attachment; filename="' . $samplecodename . '"'); - header("Content-Length: " . filesize($root_path . $directory_name . $samplecodename)); + header("Content-Length: " . filesize($root_path . $directory_name . '/' . $samplecodename)); header("Content-Transfer-Encoding: binary"); header("Expires: 0"); header("Pragma: no-cache"); diff --git a/pdf/cert_new.inc b/pdf/cert_new.inc index 19b64bb..cca67e7 100755 --- a/pdf/cert_new.inc +++ b/pdf/cert_new.inc @@ -165,12 +165,21 @@ function generate_pdf() $filename = str_replace(' ', '-', $data3->contributor_name) . '-DWSIM-Flowsheet-Certificate.pdf'; $file = $path . '/pdf/temp_certificate/' . $proposal_id . '_' . $filename; $pdf->Output($file, 'F'); + ob_clean(); + header("Pragma: public"); + header("Expires: 0"); + header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); + header("Cache-Control: public"); header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=" . $filename); header("Content-Type: application/octet-stream"); header("Content-Type: application/download"); header("Content-Description: File Transfer"); header("Content-Length: " . filesize($file)); + header("Content-Transfer-Encoding: binary"); + header("Expires: 0"); + header("Pragma: no-cache"); + ob_clean(); flush(); $fp = fopen($file, "r"); while (!feof($fp)) { diff --git a/proposal.inc b/proposal.inc index 83b87b6..8c83cef 100755 --- a/proposal.inc +++ b/proposal.inc @@ -32,7 +32,7 @@ function dwsim_flowsheet_proposal_form($form, &$form_state, $no_js_use = FALSE) { $msg = drupal_set_message(t('It is mandatory to ' . l('login', 'user') . ' on this website to access the flowsheet proposal form. If you are new user please create a new account first.'), 'error'); //drupal_goto('dwsim-flowsheet-project'); - drupal_goto('user'); + drupal_goto('user/login', array('query' => drupal_get_destination())); return $msg; } //$user->uid == 0 $query = db_select('dwsim_flowsheet_proposal'); |