generate qrcode first try
This commit is contained in:
		@@ -35,7 +35,7 @@ AX_BUILD_HTML
 | 
				
			|||||||
#AX_QT_NO_KEYWORDS
 | 
					#AX_QT_NO_KEYWORDS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
AX_DEB_SECTION(web)
 | 
					AX_DEB_SECTION(web)
 | 
				
			||||||
AX_DEB_DEPEND(php-patchwork-utf8, php-mbstring, php-imagick, php-gnupg, php-ldap, php-mcrypt, php-bz2, php-mail)
 | 
					AX_DEB_DEPEND(php-patchwork-utf8, php-mbstring, php-imagick, php-gnupg, php-ldap, php-mcrypt, php-bz2, php-mail, phpqrcode)
 | 
				
			||||||
AX_DEB_RESOLVE
 | 
					AX_DEB_RESOLVE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
AC_CONFIG_FILES([html/configuration.php])
 | 
					AC_CONFIG_FILES([html/configuration.php])
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,5 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					require_once('qrlib.php'); 
 | 
				
			||||||
$imagepath = "/path/to/your/files";
 | 
					$imagepath = "/path/to/your/files";
 | 
				
			||||||
$thumbpath = "/var/tmp/sharing-gallery/thumbnails/";
 | 
					$thumbpath = "/var/tmp/sharing-gallery/thumbnails/";
 | 
				
			||||||
$max_validity_days = "30";
 | 
					$max_validity_days = "30";
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -198,7 +198,7 @@
 | 
				
			|||||||
       checkPath($secret['path']);
 | 
					       checkPath($secret['path']);
 | 
				
			||||||
       if (isset($secret['file'])) {
 | 
					       if (isset($secret['file'])) {
 | 
				
			||||||
         checkFile($secret['file'], true);
 | 
					         checkFile($secret['file'], true);
 | 
				
			||||||
	 if ($file!="") returnFile($file);	 
 | 
					         if ($file!="") returnFile($file);	 
 | 
				
			||||||
       }
 | 
					       }
 | 
				
			||||||
       foreach ($secret['elements'] as $f) checkFile($f);
 | 
					       foreach ($secret['elements'] as $f) checkFile($f);
 | 
				
			||||||
       if (isset($_REQUEST['download'])) {
 | 
					       if (isset($_REQUEST['download'])) {
 | 
				
			||||||
@@ -217,13 +217,17 @@
 | 
				
			|||||||
           header('Content-Length: '.$size);
 | 
					           header('Content-Length: '.$size);
 | 
				
			||||||
           header('Content-Disposition: attachment; filename=shared-images.tar');
 | 
					           header('Content-Disposition: attachment; filename=shared-images.tar');
 | 
				
			||||||
           foreach($files as $f) {
 | 
					           foreach($files as $f) {
 | 
				
			||||||
             print tarHeader('shared-images/'.basename($f), filesize($f));
 | 
					               print tarHeader('shared-images/'.basename($f), filesize($f));
 | 
				
			||||||
             readfile($f);
 | 
					               readfile($f);
 | 
				
			||||||
             print str_repeat(chr(0), ceil(filesize($f)/512)*512-filesize($f));
 | 
					               print str_repeat(chr(0), ceil(filesize($f)/512)*512-filesize($f));
 | 
				
			||||||
  	   }
 | 
					           }
 | 
				
			||||||
           exit;
 | 
					           exit;
 | 
				
			||||||
         }
 | 
					         }
 | 
				
			||||||
       }
 | 
					       }
 | 
				
			||||||
 | 
					     } elseif (isset($_REQUEST['qrcode'])) {
 | 
				
			||||||
 | 
					         QRcode::png((isset($_SERVER['HTTPS']) ? 'https' : 'http')
 | 
				
			||||||
 | 
					         .'://'.$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI].'?secret='.$_REQUEST['secret']);
 | 
				
			||||||
 | 
					         exit;
 | 
				
			||||||
     }
 | 
					     }
 | 
				
			||||||
   }
 | 
					   }
 | 
				
			||||||
?><!DOCTYPE html>
 | 
					?><!DOCTYPE html>
 | 
				
			||||||
@@ -293,6 +297,8 @@
 | 
				
			|||||||
         echo '<p>Share files: Tell your friend the password on a separate channel and send this: <a href="?secret
 | 
					         echo '<p>Share files: Tell your friend the password on a separate channel and send this: <a href="?secret
 | 
				
			||||||
='.$secret.'">Link to Share</a></p>';
 | 
					='.$secret.'">Link to Share</a></p>';
 | 
				
			||||||
           ?>
 | 
					           ?>
 | 
				
			||||||
 | 
					         <img src="<?php echo (isset($_SERVER['HTTPS']) ? 'https' : 'http')
 | 
				
			||||||
 | 
					             .'://'.$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI].'?secret='.$secret.'&qrcode=1'; ?>" />
 | 
				
			||||||
	     <p>or Send Link in E-Mail:</p>
 | 
						     <p>or Send Link in E-Mail:</p>
 | 
				
			||||||
             <form method="POST">
 | 
					             <form method="POST">
 | 
				
			||||||
               <table style="width: 100%"><tr>
 | 
					               <table style="width: 100%"><tr>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user