/** * get binary stream from document_id * * @param int $document_id */ function getMailDocument($document_id) { global $path; require "$path/document/document_query.inc"; require "$path/document/document_display.inc"; if ($document_id > 0) { $doc_q = run_query_document_detail($document_id); if ($doc_q->num_rows() == 1) { dis_document_file($doc_q); exit(); } } }
} catch (OverQuotaDocumentException $e) { redirect_err($params, $l_over_quota_error); } } elseif ($action == 'download_document') { /////////////////////////////////////////////////////////////////////////////// require '../document/document_query.inc'; require '../document/document_display.inc'; if (!check_user_attendance($params['event_id'], $obm['uid']) || !in_array($params['document_id'], get_calendar_event_document_ids($params['event_id']))) { $display['msg'] .= display_err_msg("$l_err_file_access_forbidden"); } else { $doc_q = run_query_document_detail($params['document_id']); if ($doc_q->num_rows() == 1) { dis_document_file($doc_q); } else { $display['msg'] .= display_err_msg("$l_no_document !"); } } } elseif ($action == 'rights_admin') { /////////////////////////////////////////////////////////////////////////////// if(Obm_Acl::isAllowed($obm['uid'], 'calendar', $params['entity_id'], "admin") || check_calendar_update_rights($params) ){ $display['detail'] = dis_calendar_right_dis_admin($params['entity_id']); } else{ $err['msg'] = $l_insufficient_permission; $display['msg'] .= display_err_msg($err['msg']); }