Update of /cvsroot/openfirst/projects
In directory sc8-pr-cvs1:/tmp/cvs-serv30024
Modified Files:
getfile.php
Log Message:
Added execution time for downloads. Added feature to check if users are logged in.
Index: getfile.php
===================================================================
RCS file: /cvsroot/openfirst/projects/getfile.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** getfile.php 23 Oct 2003 13:47:27 -0000 1.2
--- getfile.php 1 Nov 2003 21:27:23 -0000 1.3
***************
*** 26,46 ****
*
*/
include_once("../config/globals.php");
! if(isset($_GET["id"])){
! $id=$_GET["id"];
! }
! else{
! die("File not found");
! }
! $query=ofirst_dbquery("SELECT AttachedFile,mime FROM ofirst_projects_notes WHERE ID='".$id."';");
! if (ofirst_dbnum_rows($query)==0){
! die("File not found");
! }
! else {
! $file = ofirst_dbfetch_object($query);
! header("Content-type: ".$file->mime);
! echo(base64_decode($file->AttachedFile));
}
?>
--- 26,51 ----
*
*/
+
+ ini_set("max_execution_time","9999999999999");
include_once("../config/globals.php");
! if(isset($user)){
! if(isset($_GET["id"])){
! $id=$_GET["id"];
! }else{
! die("File not found!");
! }
!
! $query = ofirst_dbquery("SELECT AttachedFile,mime FROM ofirst_projects_notes WHERE ID='".$id."';");
!
! if(ofirst_dbnum_rows($query) == 0){
! die("File not found!");
! }else {
! $file = ofirst_dbfetch_object($query);
! header("Content-type: ".$file->mime);
! echo(base64_decode($file->AttachedFile));
! }
}
+
?>
|