generate qrcode first try

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

@ -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";

@ -224,6 +224,10 @@
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>

Loading…
Cancel
Save