[Openfirst-cvscommit] photogallery/admin upload.php,1.14,1.15
Brought to you by:
xtimg
From: Astronouth7303 <ast...@us...> - 2005-03-14 16:20:42
|
Update of /cvsroot/openfirst/photogallery/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28266/photogallery/admin Modified Files: upload.php Log Message: Trying to get it to work right, won't upload Index: upload.php =================================================================== RCS file: /cvsroot/openfirst/photogallery/admin/upload.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** upload.php 14 Mar 2005 15:38:45 -0000 1.14 --- upload.php 14 Mar 2005 16:20:30 -0000 1.15 *************** *** 24,31 **** include_once('../../config/globals.php'); include_once($header); ! include_once("galleryglobals.php"); // Check if user is an admin then allow processes ! if(! ISSET($user->user) || $user->membertype != "administrator"){ showlogin(); die(include_once($footer)); --- 24,31 ---- include_once('../../config/globals.php'); include_once($header); ! include_once('galleryglobals.php'); // Check if user is an admin then allow processes ! if(! ISSET($user->user) || $user->membertype != 'administrator'){ showlogin(); die(include_once($footer)); *************** *** 38,45 **** if(ISSET($_POST['upload'])){ ! ini_set("max_execution_time",$gallery_execution_time); ! $dirlocate = "../".$gallerydir.$gallery->GalleryName; ! $imgtypes[] = "txt"; for ($num=1;$num<=$_POST['NUM_UPLOADS'];$num++){ --- 38,45 ---- if(ISSET($_POST['upload'])){ ! ini_set('max_execution_time',$gallery_execution_time); ! $dirlocate = "$basepath/photogallery$gallerydir".$gallery->GalleryName.'/'; ! $imgtypes[] = 'txt'; for ($num=1;$num<=$_POST['NUM_UPLOADS'];$num++){ *************** *** 47,55 **** // If upload field is empty then exit the particular loop ! if (! $_FILES['upload'.$num]['name'] == ''){ $continue = false; ! $name = basename($_FILES['upload'.$num]['name']); ! $extension = substr(strrchr($text, '.'), 1 ); foreach($imgtypes As $type){ if(strcasecmp($extension, $type) == 0){ --- 47,55 ---- // If upload field is empty then exit the particular loop ! if (! $_FILES["upload$num"]['name'] == ''){ $continue = false; ! $name = basename($_FILES["upload$num"]['name']); ! $extension = substr(strrchr($name, '.'), 1 ); foreach($imgtypes As $type){ if(strcasecmp($extension, $type) == 0){ *************** *** 60,64 **** if(! $continue){ ! echo "<center><br />".$_FILES['upload'.$num]['name']." - ".$_FILES['upload'.$num]['size']." - ".$_FILES['upload'.$num]['type']." - <font color='Red'>Illegal file type!</font></center>"; continue; } --- 60,64 ---- if(! $continue){ ! echo '<center><br />'.$_FILES["upload$num"]['name'].' - '.$_FILES["upload$num"]['size'].' - '.$_FILES["upload$num"]['type']." - <font color='Red'>Illegal file type!</font></center>"; continue; } *************** *** 66,78 **** // Copy files to the proper directory if(is_writable($dirlocate)) { ! copy($_FILES['upload'.$num]['tmp_name'], $dirlocate."/".$_FILES['upload'.$num]['name']) or $error = true; ! echo "<center><br />".$_FILES['upload'.$num]['name']." - ".$_FILES['upload'.$num]['size']." - ".$_FILES['upload'.$num]['type']." - "; } else { ! echo("It appears that the permissions on the photogallery have become incorrect. In order for uploading of pictures to work, the gallery directory within the photogallery module must be writable ! by the web-user. ! <br />On UNIX systems this is typically accomplished by: ! <br /><tt>chmod -R 666 photogallery/gallery/</tt>"); } if(empty($error)){ --- 66,78 ---- // Copy files to the proper directory if(is_writable($dirlocate)) { ! copy($_FILES["upload$num"]['tmp_name'], "$dirlocate/".$_FILES["upload$num"]['name']) or $error = true; ! echo '<center><br />'.$_FILES["upload$num"]['name'].' - '.$_FILES["upload$num"]['size'].' - '.$_FILES["upload$num"]['type'].' - '; } else { ! echo('<p>It appears that the permissions on the photogallery have become incorrect. In order for uploading of pictures to work, the gallery directory within the photogallery module must be writable ! by the web-user.</p> ! <p>On UNIX systems this is typically accomplished by: ! <br /><code>chmod -R 666 photogallery/gallery/</code></p>'); } if(empty($error)){ |