Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved PDF export and made LDAP compatible to anonymous bind #140

Closed
wants to merge 1 commit into from

Conversation

Jay2k1
Copy link

@Jay2k1 Jay2k1 commented Aug 23, 2012

In this commit, I modified the raw base version 2.1.8 of TeamPass with
the following changes:

  • add PDF encryption (requires password)
  • add password input field for PDF export
  • add folder tree to PDF table headers
  • repeat table headers on every folder change in PDFs
  • add monospace font for passwords in PDFs
  • log PDF exports (who, when, which folders)
  • in views, add page to view these logged items
  • automatically set focus to search field when opening search page
  • use PHP's built-in LDAP class instead of AdLDAP because the latter
    apparently doesn't support authentication via "anonymous bind" method
    (first bind anonymously and ask for DN using username, then bind again
    with retrieved DN and authenticate) and without anonymous bind, it
    didn't work with our OpenLDAP

In this commit, I modified the raw base version 2.1.8 of TeamPass with
the following changes:
- add PDF encryption (requires password)
- add password input field for PDF export
- add folder tree to PDF table headers
- repeat table headers on every folder change in PDFs
- add monospace font for passwords in PDFs
- log PDF exports (who, when, which folders)
- in views, add page to view these logged items
- automatically set focus to search field when opening search page
- use PHP's built-in LDAP class instead of AdLDAP because the latter
apparently doesn't support authentication via "anonymous bind" method
(first bind anonymously and ask for DN using username, then bind again
with retrieved DN and authenticate) and without anonymous bind, it
didn't work with our OpenLDAP
@nilsteampassnet
Copy link
Owner

Hello Jay

Many thanks for your input.
Very interresting concerning the PDF part ... great!
For the LDAP, do you think the functionnalities proposed by AdLDAP are covered with the LDAP PHP built-in?

I'll add this in 2.1.10 release

@Jay2k1
Copy link
Author

Jay2k1 commented Aug 29, 2012

Hi Nils,

thanks. One could of course tweak my changes a little bit more, for example, make PDF encryption optional (via settings page), hide the password input field when the CSV radio button is selected / only show it when PDF is selected etc.

Also, maybe my method to automatically set focus to the search field on the search page can be solved more cleverly (incase you didn't yet look at it, I'm using a loop because I couldn't figure out where to set an onload event).

Regarding LDAP, the AdLDAP class is meant to work with and administer an Active Directory. This includes user authentication, but also user management, group management, contact management and much more. I think it is way too powerful and big just to use it for authentication. So yes, I think PHP's built-in LDAP methods should be sufficient. Unfortunately I cannot tell you what to do to make it work with Active Directory because we're a linux only company and I don't have access to any AD server. But the way I coded the authentication should at least work with every standard LDAP server that supports/requires anonymous bind.
Our samsung printer uses the exact same mechanism so it has to be some kind of standard ;)

You can of course look at what the AdLDAP class does in your current codeset and do that with PHP's built-in method. It can't be that hard. Actually it should be quite easy, this is what I found on a quick google search (how to check user credentials):

function checkNTUser ($username,$passwort)
03.
{
04.
$ldapserver = '[your Server]';
05.
$ds=ldap_connect($ldapserver);
06.
if ($ds)
07.
{
08.
$dn="cn=$username,cn=Users, DC=example, DC=com";
09.
$r=@ldap_bind($ds,$dn,$passwort);
10.
if ($r)
11.
{
12.
return true;
13.
}
14.
else
15.
{
16.
return false;
17.
}
18.
}
19.
}

Thanks for including my changes. As you can see looking at them, the LDAP part is actually a very simple patch (one code block in one file), so if you're gonna do it differently, I could easily patch future versions for our own use. With the PDF changes it's more difficult. There are changes at so many places in many different files, I had it all finished for 2.1.7 and already made a .patch file, then in 2.1.8 you made so many changes to the PDF export that I had to change many things again so it would work. So I thought, I'm gonna submit my changes and hope you'd include them in future versions ;)

Thanks again and best regards,

Robert (Jay)

PS: Thanks for making TeamPass! It is a great software and exactly what our company needed (we're a hosting company and our IT techs have to manage hundreds of passwords for SSH, MySQL, Cisco router, Websites and other things). Great Job, Nils.

Am 29.08.2012 um 21:35:45 schrieb Nils Laumaillé:

Hello Jay

Many thanks for your input.
Very interresting concerning the PDF part ... great!
For the LDAP, do you think the functionnalities proposed by AdLDAP are covered with the LDAP PHP built-in?

I'll add this in 2.1.10 release


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants