experimental: try to get user data

master
Marc Wäckerlin 8 years ago
parent 68781d4ce4
commit 916e7aa16a
  1. 2
      configure.ac
  2. 3
      etc/authentication.php
  3. 4
      etc/settings.php
  4. 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) AX_DEB_DEPEND(php-patchwork-utf8, php-mbstring, php-imagick, php-gnupg, php-ldap, php-mcrypt, php-bz2, php-mail)
AX_DEB_RESOLVE AX_DEB_RESOLVE
AC_CONFIG_FILES([html/configuration.php]) AC_CONFIG_FILES([html/configuration.php])

@ -23,6 +23,9 @@ if (!isset($_SERVER['PHP_AUTH_USER'])) {
ldap_start_tls($ldapconn) ldap_start_tls($ldapconn)
or error_die($ldapconn, "cannot start LDAP TLS"); or error_die($ldapconn, "cannot start LDAP TLS");
if ($ldapbind = @ldap_bind($ldapconn, $checkuser.'='.$tstusername.','.$ldapbase, $password)) { if ($ldapbind = @ldap_bind($ldapconn, $checkuser.'='.$tstusername.','.$ldapbase, $password)) {
ldap_bind($ldap, 'username', 'password');
$search = ldap_search($ldapconn, 'base_dn', 'search_filter', array('mail', 'cn'));
$data = ldap_get_entries($ldap, $search);
ldap_close($ldapconn); ldap_close($ldapconn);
$username = $tstusername; $username = $tstusername;
} else { } else {

@ -4,4 +4,8 @@ $thumbpath = "/var/tmp/sharing-gallery/thumbnails/";
$max_validity_days = "30"; $max_validity_days = "30";
$font = "DejaVu-Sans"; $font = "DejaVu-Sans";
$preview_num = "5"; $preview_num = "5";
$default_mail_subject = "Sharing Gallery: See my Fotos";
$default_mail_text = "Fotos from my gallery:\n\npassword = PASSWORD\n\nlink: LINK\n\nRegards\nUSERNAME";
$default_mailto = "";
$fallback_mail_replyto = "";
?> ?>

@ -158,6 +158,12 @@
} }
if (!isset($_REQUEST['secret'])) { if (!isset($_REQUEST['secret'])) {
if ($username=="") error_die('not authorized', '403 Forbidden'); if ($username=="") error_die('not authorized', '403 Forbidden');
?>
<h1>Your Login Data</h2>
<pre>
<?php print_r($data) ?>
</pre>
<?php
if (isset($_REQUEST['path'])) checkPath($_REQUEST['path']); if (isset($_REQUEST['path'])) checkPath($_REQUEST['path']);
if (isset($_REQUEST['folder']) && !preg_match('/\//', $_REQUEST['folder'])) { if (isset($_REQUEST['folder']) && !preg_match('/\//', $_REQUEST['folder'])) {
$file = $thumbpath.'/folders/'.$subpath.'/'.$_REQUEST['folder'].'.png'; $file = $thumbpath.'/folders/'.$subpath.'/'.$_REQUEST['folder'].'.png';

Loading…
Cancel
Save