Project

General

Profile

Actions

Bug #14697

closed

When using LDAP for authorization, page generation fails after login

Added by old_manilius about 19 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Should have
Category:
Frontend
Target version:
-
Start date:
2005-04-21
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
3.7.0
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When using the LDAP-extensions and using LDAP for fe-login, the page after the login can not be created. The error says:
"Cannot redeclare class tslib_cobj"
This error was reported in the mailing list a while ago and it is easily reproducible.
So far I can not tell if it also applies to 3.8 but most likely it does.

The problem seems to be in "class.tslib_pagegen" and not in the LDAP extension. The problem is that in the LDAP-extension (class.tx_ldapserver) on can find the code

if(!class_exists('tslib_cObj')) {
require_once(t3lib_extmgm::extPath('cms','tslib/class.tslib_content.php'));
}

while in "class.tslib_pagegen" one finds just

require_once(PATH_tslib.'class.tslib_content.php');

The actual problem is, that two different files are included which contain the same class (tslib_cObj). The problem could easily be fixed by replacing above line in "class.tslib_pagegen" by

if(!class_exists('tslib_cObj')) {
require_once(PATH_tslib.'class.tslib_content.php');
}

(issue imported from #M1012)

Actions #1

Updated by Sebastian Kurfuerst about 19 years ago

when replacing the IF construction in the LDAP extension with the following line:
require_once(PATH_tslib.'class.tslib_content.php');
does this help? Require_once should care for not including files twice.

Actions #2

Updated by old_manilius about 19 years ago

Okay, this might help.
However I'm not very familiar with Typo3 so I don't know which way is the right way to go. Is there a suggestion about which path to use? I don't really know why there are two files in the first place. I assume there is a good reason and maybe I should read the archive first.
I think, the fix I suggested has the advantage, that it should remove this problem for all extensions and should not do any harm.

Actions #3

Updated by Sebastian Kurfuerst about 19 years ago

tslib is normally a symbolic link to typo3/sysext/cms/tslib (where this is possible). I don't know if PHP checks for symlinks when a require_once is done.
Does somebody else using the LDAP extensions have the same problem? I don't use it, that's why I can't say anything about it.
Greets, Sebastian

Actions #4

Updated by old_manilius about 19 years ago

As I wrote, at least two people in the (main, english) mailinglist reported the problem first. Maybe two weeks ago or something. There even were some suggesion to solve the problem but they did not help.
I will ask the author of the LDAP-extension as well, I do have some patches for him anyways.

Actions #5

Updated by Jens Scheidtmann over 18 years ago

For me the problem could be solved by Sebastians suggestion.

Actions #6

Updated by Jens Scheidtmann over 18 years ago

...on a windows installation, that is.

Actions #7

Updated by Jens Scheidtmann over 18 years ago

... but then in the backend, the ldap_sync module didn't work anymore.

I worked around this using a sledgehammer:

if(!class_exists('tslib_cObj')) {
if (PATH_tslib == "PATH_tslib") {
define("PATH_tslib", t3lib_extmgm::extPath('cms','tslib/'));
}
debug(PATH_tslib);
require_once(PATH_tslib.'class.tslib_content.php');
}

Actions #8

Updated by Christian Kuhn over 13 years ago

Resolved, unable to reproduce: ldap login works fine for me, everything is ok.

Actions

Also available in: Atom PDF