forum.coppermine-gallery.net

No Support => Feature requests => Topic started by: Vincent on June 12, 2004, 04:43:13 pm

Title: Login via LDAP + Sort album names
Post by: Vincent on June 12, 2004, 04:43:13 pm
Hello developers,

I just installed CPG 1.3.0 and you did a great job! Especialy the e-mail notification and multiple file uploads.

After installing I made some quick-and-dirty modifications to customize the gallery. It would be great if I don't have to do these modifications anymore in the next release. They are too 'dirty' to publish them as hacks, sorry. But I will give a short description.

The modifications I made are:
- Login via LDAP
In short: Bind using the supplied username/password. Do a ldap search on a person using the supplied username (=cn) and copy the name and e-mail to the cpg_users table.
- User galleries also in other categories (already requested by someone as: Allowing registered users to create albums in "public" catagories)
I've added a new category field in cpg_albums table. Use this new category field in index.php to display categories. I'm aware of the fact that this modification has big implications for the whole system. I can put user galleries by hand (any sql client) in the correct category.
- Sort album names Changed in index.php sort by 'pos' to sort by 'title' DESC. Maybe nice to add this feuture in the config?

Thanks for all your efforts!

Many greetings,
 Vincent de Groot
 Webmaster AEGEE-Nijmegen
 http://www.ru.nl/aegee

Title: Re: Login via LDAP + Sort album names
Post by: edalquist on January 04, 2005, 05:18:06 am
On your sorting albums by name I'd like to second that it would be a very usefull feature to have the option to sort by title and the sort order. Here is a diff of my changes to index.php for CPG 132 to get sorting by title working:

Code: [Select]
diff index.php.bak index.php
407c407
<            ' ORDER BY a.pos '.
---
>            ' ORDER BY a.title DESC '.
551c551
<            "WHERE category = $cat ORDER BY a.pos ".$limit;
---
>            "WHERE category = $cat ORDER BY a.title DESC ".$limit;
560c560
<            ' ORDER BY a.pos '.
---
>            ' ORDER BY a.title DESC '.
Title: Re: Login via LDAP + Sort album names
Post by: Joachim Müller on January 04, 2005, 07:02:41 am
I agree that LDAP authentification would be very usefull on intranets. Your second suggestion should have gone somewhere else though, as our "one issue/question per thread" policy is meant to make things easier manageable. In the future, please do only post one issue per thread.

Joachim
Title: Re: Login via LDAP + Sort album names
Post by: Binerf on March 19, 2006, 11:26:38 am
Hi,

Is ldap auth is envisaged in next Coppermine version please ?

THX.
Binerf
Title: Re: Login via LDAP + Sort album names
Post by: twobee on April 30, 2006, 05:53:58 pm
Sorry, for bringing up the old topic.

But, after working several ours on a alternative login script, I figured out that the best way to integrate a LDAP login is to modify the 'bridge/coppermine.inc.php'.
I already having a working LDAP-Login, but the session registration isn't implemented, yet. Maybe in some days I will release the final version, I have to get it working anyways. ;)

Title: Re: Login via LDAP + Sort album names
Post by: twobee on May 12, 2006, 08:01:54 pm
Ok it's ready now, sorry for only partial usage of the coppermine api.
The file is replacing the login.php, you also should deactivate registration.
It's completly passing the authorization to LDAP, if you not have a LDAP
Account you can't login.

You will need to add following to your include/config.inc.php

   $CONFIG['ldapserver'] = 'your.ldapserver.com';
   $CONFIG['ldapdn'] = 'ou=group,dc=ldapserver,dc=com';
   $CONFIG['ldapforcehttps'] = '1'; // or '0' to deactivate

and following to your language file, search for login.php and add this at the end. ->

  'ldap_warning' => 'Warning: LDAP authorization is not active.',
  'ldap_group_failure' => 'Error while login:',
  'ldap_group_failure_msg' => 'You are lacking rights to access this area.',
  'ldap_user_created_msg'] => 'User created  in database, please log in again.';


have fun,

twobee.
Title: Re: Login via LDAP + Sort album names
Post by: Binerf on May 21, 2006, 08:31:40 pm
Thanks a lot but I've a problem with login.php:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/login.php.ldap on line 229

And nothing else.

Matt
Title: Re: Login via LDAP + Sort album names
Post by: jjhat1 on May 30, 2006, 07:43:15 am
I am interested in this feature but my test servers do not have access to a LDAP server and I only have my production server which I dont always have access to to test this out on.  Is there going to be some type of official plugin / bridge that will add support for LDAP to Coppermine or are users still resorting to hacks?
Title: Re: Login via LDAP + Sort album names
Post by: twobee on May 31, 2006, 05:03:51 pm
Thanks a lot but I've a problem with login.php:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/login.php.ldap on line 229

And nothing else.

Matt

Sorry for the late answer, but which Webserver (&Version) and PHP Version do you use?

The script were tested with Apache 2.0.58 and PHP 5.1.1 with a very restrictive php.ini.
Title: Re: Login via LDAP + Sort album names
Post by: Tranz on May 31, 2006, 05:06:13 pm
Thanks a lot but I've a problem with login.php:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/login.php.ldap on line 229

And nothing else.

Matt
Did you use a WYSIWYG editor?
Title: Re: Login via LDAP + Sort album names
Post by: twobee on May 31, 2006, 05:08:37 pm
Is there going to be some type of official plugin / bridge that will add support for LDAP to Coppermine or are users still resorting to hacks?

First I planned to make a inofficial bridge, but I couldn't get in touch with the bridging stuff. From my side I will not write a LDAP bridge in the near future. Other projects are in schedule, so this have to wait.
Title: Re: Login via LDAP + Sort album names
Post by: Binerf on June 06, 2006, 10:11:03 pm
Sorry for the late answer, but which Webserver (&Version) and PHP Version do you use?

The script were tested with Apache 2.0.58 and PHP 5.1.1 with a very restrictive php.ini.
I use Apache 1.3.34 with php 4.4.2-1.

Perhaps it's my problem...

Matt
Title: Re: Login via LDAP + Sort album names
Post by: Binerf on June 06, 2006, 10:12:11 pm
Did you use a WYSIWYG editor?
"a WYSIWYG editor" ? To do what ?

Matt
Title: Re: Login via LDAP + Sort album names
Post by: Joachim Müller on June 07, 2006, 12:10:20 am
http://en.wikipedia.org/wiki/WySiWyG
Title: Re: Login via LDAP + Sort album names
Post by: HanOverFist on August 04, 2006, 05:10:54 pm
Just wondering if LDAP has been rolled into a plug-in yet.
I tried the hack in this thread but all I get is a white screen.
dl'ed the new login.php and modified my include\config.ini.php and my lang\english.php
put all my ldap info into config.ini.php and modified login.php to include my bindings.

no dice.

cpg ver 1.4.8
linux sles ver 10
apache ver 2.2.0
php ver 5.1.2
mysql ver 5.0.18

GauGau, where should I post for help on this?
or am I on my own on this?

tia,
HanOver

edit>>>>>>>>
or is this currently the best method?
http://forum.coppermine-gallery.net/index.php?topic=19568.0
Title: Re: Login via LDAP + Sort album names
Post by: Joachim Müller on August 04, 2006, 08:27:49 pm
Just wondering if LDAP has been rolled into a plug-in yet.
No, it hasn't been released.

GauGau, where should I post for help on this?
Nowhere, it goes unsupported.

or am I on my own on this?
exactly.

Read NO SUPPORT in FEATURE REQUESTS (http://forum.coppermine-gallery.net/index.php?topic=15866.0)
Title: Re: Login via LDAP + Sort album names
Post by: HanOverFist on August 07, 2006, 02:43:57 pm
I was not asking for support!
I asked if it had been rolled into a plug-in.
If it had, I was asking where to go!
I didn't think that was bad karma!

Thanks for the reply.

Jay

(this post probably is though, figured I earn it)
Title: Re: Login via LDAP + Sort album names
Post by: Joachim Müller on August 07, 2006, 02:52:41 pm
"post for help" equals "ask for support". You have asked for support, and I posted the answers to your questions. What's the use of your reply ::)? Don't clutter this board with meta discussion about karma!
Title: Re: Login via LDAP + Sort album names
Post by: vimets on January 15, 2013, 10:04:26 am
Fatal error: Call to a member function login() on a non-object in C:\wamp\www\cpg132\login.php on line 154

i know it's old and outdated but we use this version and we need a ldap bridge working :( and there is no more info on the internet about the topic

i'm using
php: 5.2.2
apache: 2.2.22
mysql: 5.5.24

if ($USER_DATA = $cpg_udb->login( addslashes($_POST['username']), isset($_POST['remember_me'])))

is this line, the object cpg_udb is not initalized anywhere :(

need some light over here.

Thanks in advance.
Title: Re: Login via LDAP + Sort album names
Post by: phill104 on January 15, 2013, 10:55:36 am
Sorry, but we cannot help you. Your version is just too old. In addition we cannot really support local/self hosted installations as they can cause problems we cannot control.
Title: Re: Login via LDAP + Sort album names
Post by: vimets on January 15, 2013, 12:29:26 pm
Ok, thanks anyway :)
I've done my own modifications to this ldap.php in order to login.
I update the file just in case anyone needs some help cause there's no much info about coppermine ldap 1.3 over the internet due to the outdated version.

Thanks again
bless!
Title: Re: Login via LDAP + Sort album names
Post by: vimets on January 22, 2013, 10:06:26 am
Hi again, i upload a new "version" of the file.
Changes:
- Passwords stored in md5
- Check length of password field in the DB in order to enable > 50 for md5
- Updates the user password when it changes
- Some bug fixes and extra elses added in case password incorrect, user incorrect, etc...

Bless!
Title: Re: Login via LDAP + Sort album names
Post by: Αndré on January 22, 2013, 10:46:29 am
There's no support in feature requests. There's also no support for outdated galleries. However, there's an LDAP bridge file for cpg1.5.x (http://forum.coppermine-gallery.net/index.php/topic,74451.0.html) available, so if you need support, upgrade to the latest stable release of cpg1.5.x (currently 1.5.22).
Title: Re: Re: Login via LDAP + Sort album names
Post by: vimets on January 22, 2013, 12:33:19 pm
There's no support in feature requests. There's also no support for outdated galleries. However, there's an LDAP bridge file for cpg1.5.x (http://forum.coppermine-gallery.net/index.php/topic,74451.0.html) available, so if you need support, upgrade to the latest stable release of cpg1.5.x (currently 1.5.22).

Hi, I know, that's why this is posted in No Support :)
I posted this, as i said before, because maybe someone still uses 1.3 and needs LDAP bridge, and the one that is on the first page here, doesn't work.
Maybe i asked for support on previous posts, but I end up making my own login.php for ldaps logins based on this one, and i was just postting it, no support is needed :)
bless
Title: Re: Login via LDAP + Sort album names
Post by: Αndré on January 22, 2013, 12:41:34 pm
Sorry, I missed the second page of this thread (thus I've just read your first post on page one).

Thank you for your contribution!
Title: Re: Re: Login via LDAP + Sort album names
Post by: vimets on January 22, 2013, 12:43:51 pm
Sorry, I missed the second page of this thread (thus I've just read your first post on page one).

Thank you for your contribution!

:) no problem i don't wanna bother anymore, hope this will be useful to someone.
bless! and thanks for your time!
Title: Re: Login via LDAP + Sort album names
Post by: phill104 on January 22, 2013, 12:54:07 pm
Far from it. It is always a pleasure to see new contributions to Coppermine. Many thanks once again and hope to see you stick around.
Title: Re: Login via LDAP + Sort album names
Post by: LnQ on February 28, 2013, 10:42:08 am
Thanks Viments...i want to use your modification
so here i go.

/* ============== O P T I O N S =========== */

   $CONFIG['ldapserver'] = 'domain controller'; // here I can type in the ip or hostname?
   $CONFIG['ldapdn'] = 'ou=Users,dc=int,dc=test,dc=com'; // If my domain is int.test.com it should be like this right
   $CONFIG['ldapforcehttps'] = '0'; // or '0' to deactivate
   define('LDAP_SERVER',  $CONFIG['ldapserver']);
   define('LDAP_DN',  $CONFIG['ldapdn']);
   define('LDAP_FORCE_HTTPS', $CONFIG['ldapforcehttps']);
   define('LDAP_DEBUG', 0);
   define('PHP_SELF', $_SERVER['SCRIPT_NAME']);
   define('CPG_DB_SERVER', $CONFIG['localhost']); //localhost is fine here or can i use ip/hostname?
   define('CPG_DB_USER', $CONFIG['galleri']); //username for the db account right?
   define('CPG_DB_PASSWORD', $CONFIG['dbpass']); //db pass for the db user right?
   define('CPG_DB_NAME', $CONFIG['galleri']); // db name.
   define('CPG_DB_USERS', $CONFIG['TABLE_PREFIX']."users");
   define('CPG_DB_SESSIONS', $CONFIG['TABLE_PREFIX']."sessions");

this login.php does it work with 1.3.0? can see in the top it for Coppermine Photo Gallery 1.3.2   
Title: Re: Login via LDAP + Sort album names
Post by: LnQ on February 28, 2013, 11:16:20 am
LDAP_DEBUG = 0

if i set it to 1 does it generate a log?
Title: Re: Login via LDAP + Sort album names
Post by: vimets on February 28, 2013, 03:06:57 pm
Thanks Viments...i want to use your modification
so here i go.

/* ============== O P T I O N S =========== */

   $CONFIG['ldapserver'] = 'domain controller'; // here I can type in the ip or hostname?
   $CONFIG['ldapdn'] = 'ou=Users,dc=int,dc=test,dc=com'; // If my domain is int.test.com it should be like this right
   $CONFIG['ldapforcehttps'] = '0'; // or '0' to deactivate
   define('LDAP_SERVER',  $CONFIG['ldapserver']);
   define('LDAP_DN',  $CONFIG['ldapdn']);
   define('LDAP_FORCE_HTTPS', $CONFIG['ldapforcehttps']);
   define('LDAP_DEBUG', 0);
   define('PHP_SELF', $_SERVER['SCRIPT_NAME']);
   define('CPG_DB_SERVER', $CONFIG['localhost']); //localhost is fine here or can i use ip/hostname?
   define('CPG_DB_USER', $CONFIG['galleri']); //username for the db account right?
   define('CPG_DB_PASSWORD', $CONFIG['dbpass']); //db pass for the db user right?
   define('CPG_DB_NAME', $CONFIG['galleri']); // db name.
   define('CPG_DB_USERS', $CONFIG['TABLE_PREFIX']."users");
   define('CPG_DB_SESSIONS', $CONFIG['TABLE_PREFIX']."sessions");

this login.php does it work with 1.3.0? can see in the top it for Coppermine Photo Gallery 1.3.2

Hi there,
I only add the options $CONFIG, the rest were already there, which i assume that are correct as you say.  The first $CONFIG one depends on your dns, if the web server is capable of resolving the hostname, if not put the ip that will work for sure. Then, if you configured the LDAP you should know the branch of the tree where the users are hanging, so the domain would be as you said, but maybe the Organitzational Unit ( OU ) is diferent, remember also always case sensitive.  With a LDAP browser software you can easily see this :), and finally the last one is for securing the connection in case you have a Certificate and want to avoid a posible Man in the middle attack.
I haven't test it with 1.3.2, my version is 1.3.0 sorry.
Hope it helps, anything else let it know ;)
cya

By the way, the comments in the code are in catalan in case you wanna use a translator. Sorry about that.