generate qrcode first try

master
Marc Wäckerlin 7 years ago
parent 916e7aa16a
commit 3a20a4b277
  1. 2
      configure.ac
  2. 1
      etc/settings.php
  3. 16
      html/index.php

@ -35,7 +35,7 @@ AX_BUILD_HTML
#AX_QT_NO_KEYWORDS
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
AC_CONFIG_FILES([html/configuration.php])

@ -1,4 +1,5 @@
<?php
require_once('qrlib.php');
$imagepath = "/path/to/your/files";
$thumbpath = "/var/tmp/sharing-gallery/thumbnails/";
$max_validity_days = "30";

@ -198,7 +198,7 @@
checkPath($secret['path']);
if (isset($secret['file'])) {
checkFile($secret['file'], true);
if ($file!="") returnFile($file);
if ($file!="") returnFile($file);
}
foreach ($secret['elements'] as $f) checkFile($f);
if (isset($_REQUEST['download'])) {
@ -217,13 +217,17 @@
header('Content-Length: '.$size);
header('Content-Disposition: attachment; filename=shared-images.tar');
foreach($files as $f) {
print tarHeader('shared-images/'.basename($f), filesize($f));
readfile($f);
print str_repeat(chr(0), ceil(filesize($f)/512)*512-filesize($f));
}
print tarHeader('shared-images/'.basename($f), filesize($f));
readfile($f);
print str_repeat(chr(0), ceil(filesize($f)/512)*512-filesize($f));
}
exit;
}
}
} elseif (isset($_REQUEST['qrcode'])) {
QRcode::png((isset($_SERVER['HTTPS']) ? 'https' : 'http')
.'://'.$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI].'?secret='.$_REQUEST['secret']);
exit;
}
}
?><!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
='.$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>
<form method="POST">
<table style="width: 100%"><tr>

Loading…
Cancel
Save