Joomla 2x-3x to CPG Tunnel Joomla 2x-3x to CPG Tunnel
 

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

Joomla 2x-3x to CPG Tunnel

Started by ron4mac, June 01, 2013, 02:01:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ron4mac

This package contains a plugin for CPG and one for Joomla.  Installing and configuring the plugins will create a "tunnel" whereby registered Joomla! users can link to CPG and automatically be logged in to CPG (with automatic account creation).  Joomla! and CPG must be in the same domain.

Note: This method DOES NOT provide visual integration.

Comments, suggestions, requests, complaints ... all welcome.

README.txt

Joomla! to Coppermine Photo Gallery Tunnel
version: 1.2

The two zipped files in this package are plugins for Joomla! and CPG.
The CPG plugin is named generically because it may be used to tunnel additional web apps in the future.

For CPG:
--------
Install the plugin, cpg1.5.x_plugin_tunnel2cpg_v1.2.zip
Configure its 'secret phrase', usergroup settings and optional theme name.

For Joomla!:
------------
Install the plugin, plg_system_cpgtunnel_v1.2.zip
Enable the plugin and configure its 'secret phrase' (phrase same as CPG) and usergroup settings

Establish any links in Joomla! that will point to CPG as:  <CPG URL>/index.php?file=tunnel2cpg/joomla
Use the same link when setting up access to CPG using a Joomla! menu item 'wrapper'.


NOTES:
------
Joomla! users will have to logout and back in before a tunnel will be established.
Subsequently, when users logout from Joomla!, they will also be logged out of CPG.

Once users have accessed the CPG instance via Joomla!, they will also be able to go directly to the
CPG instance (<CPG URL>) and login with their same Joomla! username and password.

A sample CPG theme is provided that is designed for use when accessing CPG via a Joomla! menu item wrapper.


v1.1.1 Bug fix (!important!)
   Changed encoding method to correct rare issue with cookie data pattern causing site access problems
   (bad upload corrected)
   
v1.2 Maintenance/Update
   Added code to logout user from CPG when they have logged out from Joomla!.
   

phill104

Excellent work as usual.

I assume you have seen the mehdi bridge that does similar? With a few hacks it works with Joomla 2.5 but I have not tested it with J3.x yet.
It is a mistake to think you can solve any major problems just with potatoes.

ron4mac

Quote from: Phill Luckhurst on June 01, 2013, 09:50:29 PM
I assume you have seen the mehdi bridge that does similar?

Have not seen the mehdi bridge.  The whole bridge thing seemed a little cumbersome, so I thought I'd try a tunnel. :D

Αndré

Can you please explain what exactly your tunnel does? If you bridge Coppermine to another application, the user management and authentication is completely dropped by Coppermine. How exactly works your tunnel? Does one application use the other's user database and authentication cookies or will it be cloned in some way?

ron4mac

#4
Quote from: Αndré on June 03, 2013, 01:33:31 PM
Can you please explain what exactly your tunnel does? If you bridge Coppermine to another application, the user management and authentication is completely dropped by Coppermine. How exactly works your tunnel? Does one application use the other's user database and authentication cookies or will it be cloned in some way?

When a Joomla! user logs in and is in the allowed group(s), the Joomla! system plugin grabs the the user's info, including actual password, and creates an encrypted cookie with these data that has a persistence to match how they logged in.  Then, when linking to CPG using the tunnel URL, the tunnel plugin sees the tunnel cookie and decrypts it.  If the user does not exist in CPG, the plugin creates the user in the CPG specified group, otherwise it simply logs-in the user.  In either case, the plugin then redirects to the main CPG entry point. When the Joomla! user logs out, the tunnel cookie is deleted.

I have done the same thing with myBB for a family site of mine.  In the case of myBB (and many other apps, I would presume), without hacking the app, the actual password is not available.  In that case, I take the first 10 characters of their password hash to use as a password at CPG.  This, of course, means that the user cannot login directly at CPG, but I have yet to see that as a problem.

Thanks for your interest.  Have I been clear enough?

trehahn

Hello, I have been searching for a way to link Joomla 2.5 to Coppermine for awhile, and came across this.  I installed the plugin on both sites, entered the secret phrase but it isn't working.  I get the following error:

Failed to authenticate via tunnel (sentinal not detected)

I have tried changing settings and nothing.  I also did a search for that error, and found nothing that would help me.  Any idea why it's not working?  Thank you for your time, I look forward to your reply.

Tim

trehahn

I continued to mess with settings on both sides, and was able to get it to work only if you're logged in.  I can now access it from my admin account on Joomla, and my registered account, however when I use the Public link I still get the error.  Is this normal?  Is there a way for the public to view the files?

ron4mac

Quote from: trehahn on June 22, 2013, 01:24:29 AM
I installed the plugin on both sites, entered the secret phrase but it isn't working.  I get the following error:

Failed to authenticate via tunnel (sentinal not detected)

Hi Tim.

Two things to make sure of:  1) make sure the Joomla plugin is enabled, and 2) that you logout of Joomla and then log back in.

ron4mac

#8
Quote from: trehahn on June 22, 2013, 01:38:59 AM
I continued to mess with settings on both sides, and was able to get it to work only if you're logged in.  I can now access it from my admin account on Joomla, and my registered account, however when I use the Public link I still get the error.  Is this normal?  Is there a way for the public to view the files?

The tunnel is designed for registered users on Joomla to enter CPG (as CPG registered users) without having to log in.  For public users, you need to just have a normal link to your CPG instance from Joomla (and have files there viewable by the public).

trehahn

I thought about the extra link for Joomla, but the problem with that is the registered users will then see 2 links, one that'll use the tunnel one that will not.    I thought of that already, but having the 2 links will be confusing for registered users.  I was hoping there was something I missed.

ron4mac

Quote from: trehahn on June 22, 2013, 03:04:26 AM
I thought about the extra link for Joomla, but the problem with that is the registered users will then see 2 links, one that'll use the tunnel one that will not.    I thought of that already, but having the 2 links will be confusing for registered users.  I was hoping there was something I missed.
When public users link to CPG via the tunnel, they have exactly the same capabilities they would have had they linked from a normal link.  The only difference is that authentication message.  If you want to soften that message you could make changes to two files:

./plugins/tunnel2cpg/joomla.php

change 8th line:
cpgRedirectPage . . . . . [$joomlaTunnel_result], 0, 'warning');
to:
cpgRedirectPage . . . . . [$joomlaTunnel_result], 0, 'info');


./plugins/tunnel2cpg/lang/english.php

near the bottom of the file:
$lang_plugin_tunnel2cpg['nosentinal'] = ' (sentinal not detected)';
to:
$lang_plugin_tunnel2cpg['nosentinal'] = ' <whatever you would like it to say>';


I'm not sure how you're providing the link in Joomla, but there are ways to present things that will be one way for registered users and another way for public users ... but that's a thread for a Joomla! forum  :-X

trehahn

Thank you again!  Coppermine is such a great program, with the ability to do all files I haven't found any other that will do sound, video, pictures etc and is compatible with Joomla yet.  This is the only work around I've found! I may look into other Joomla options for the public/registered menu as well.  Thanks again.

ildaniel

Hi,
i have the smae problem : Failed to authenticate via tunnel (sentinal not detected)
to terhahn : your tunnel work? what are your settings in joomla and coppermine?
in addition to the secret phrase about what you have done?
thanks



ron4mac

Quote from: ildaniel on October 03, 2013, 11:20:57 PM
Hi,
i have the smae problem : Failed to authenticate via tunnel (sentinal not detected)
to terhahn : your tunnel work? what are your settings in joomla and coppermine?
in addition to the secret phrase about what you have done?
thanks

These requirements must be met:  The Joomla! and CPG locations must be in the same domain, both plugins must be enabled, you must be using the same web browser for access to both and you must have just logged in to Joomla! (logging out first if necessary).  And, of course, you must be linking to CPG as described in the original post above.

ildaniel

nothing. joomla and cpg in the same domain, but in different directories and in different databse. both plugins activated, the same passphrase, log out and log in, but the tunnel does not work.
I do not understand why .... I have very few options, where can I go wrong?
cookies? the user must first be registered individually in cpg for later access through the tunnel? the user must register after the installation of the tunnel?

ron4mac

@ildaniel
Can you PM me with your Joomla! site url?  And will I be able to register? (or can you create an account for me)
I'll see what I might be able to discover without having to go behind the scenes.

ildaniel


I can not send personal messages
the address is www.ilcubo.net
registration is permitted
thanks for asking

ildaniel


ron4mac

Quote from: ildaniel on October 27, 2013, 10:04:14 AM
activated
When logging in to your site, the tunnel plugin should be creating a cookie ("joomla_2_cpg").  That is not happening.  The only reasons that I can think of for why that is not happening is:  1) the plugin is not enabled,  2) the registered user group is not one of the groups configured in the tunnel plugin or 3) some sort of error is occurring.

Pease check your error logs for any associated error, insure that the Joomla plugin is enabled and your registered user group is configured in the plugin as an allowed group.

ildaniel

ok, thanks for your time
the plugin is activated, the selected group ok (I also tried to create another group for it)
from the error log I see this:

PHP Strict Standards: Non-static method Inspekt_Cage::Factory() should not be called statically, assuming $this from incompatible context in /web/htdocs/www.ilcubo.net/home/gallerie/include/inspekt.php on line 124, referer: http://www.ilcubo.net/J3/
PHP Strict Standards: Non-static method Inspekt::makeServerCage() should not be called statically, assuming $this from incompatible context in /web/htdocs/www.ilcubo.net/home/gallerie/include/inspekt/supercage.php on line 134, referer: http://www.ilcubo.net/J3/

coppermine path should be "www.ilcubo.net/gallerie" but I see the string "ilcubo.net/home/gallerie..." maybe it's the problem here?

on the coppermine forum I read something like that in other cases, perhaps this can be the problem?
you think that I can also post on the forum Italian Joomla to verify the problem, with a link to this topic?