Login via LDAP + Sort album names Login via LDAP + Sort album names
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Login via LDAP + Sort album names

Started by Vincent, June 12, 2004, 04:43:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Vincent

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


edalquist

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:


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 '.

Joachim Müller

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

Binerf

Hi,

Is ldap auth is envisaged in next Coppermine version please ?

THX.
Binerf

twobee

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. ;)


twobee

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.

Binerf

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

jjhat1

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?

twobee

Quote from: 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

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.

Tranz

Quote from: 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
Did you use a WYSIWYG editor?

twobee

Quote from: jjhat1 on May 30, 2006, 07:43:15 AM
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.

Binerf

Quote from: twobee on May 31, 2006, 05:03:51 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

Binerf


Joachim Müller


HanOverFist

#14
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

Joachim Müller

Quote from: HanOverFist on August 04, 2006, 05:10:54 PM
Just wondering if LDAP has been rolled into a plug-in yet.
No, it hasn't been released.

Quote from: HanOverFist on August 04, 2006, 05:10:54 PMGauGau, where should I post for help on this?
Nowhere, it goes unsupported.

Quote from: HanOverFist on August 04, 2006, 05:10:54 PMor am I on my own on this?
exactly.

Read NO SUPPORT in FEATURE REQUESTS

HanOverFist

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)

Joachim Müller

"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!

vimets

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.

phill104

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.
It is a mistake to think you can solve any major problems just with potatoes.