Home Forum
2024-04-19
Benvenuto, Ospite
Nome Utente Password: Ricordami

Directing login to Community Builder
(1 Online) (1) Ospite
  • Pagina:
  • 1
  • 2

ARGOMENTO: Directing login to Community Builder

Re: Directing login to Community Builder 12 Anni, 7 Mesi fa #2574

  • dacker
  • Offline
  • Fresh Boarder
  • Messaggi: 8
Luigi -

That was quite unexpected. Thank you!

Unfortunately my source URL "changed" [I put in a code update of Jevents) to:

[code] t1631.org/login?return=aHR0cDovL3QxNjMxLm9yZy9ob21lL3VwY29taW5nLWV2ZW50cy9pY2FscmVwZWF0LmRldGFpbC8yMDExLzA5LzIzLzExMi8tL2RhbW9ucy1zZXZlbi1sYWtlcy1jYW1wb3V0 [/code]

so I changed the source URL to:
login\?return=  


and the destination to:

http://{siteurl}/index.php?option=com_comprofiler&task=login&{preg_match}/return=.*==/i{/preg_match}


but I get this error:


Notice: Undefined offset: 0 in /home/content/52/7991152/html/plugins/system/redj/redj.php on line 713

Warning: Cannot modify header information - headers already sent by (output started at /home/content/52/7991152/html/plugins/system/redj/redj.php:713) in /home/content/52/7991152/html/plugins/system/redj/redj.php on line 451

Warning: Cannot modify header information - headers already sent by (output started at /home/content/52/7991152/html/plugins/system/redj/redj.php:713) in /home/content/52/7991152/html/plugins/system/redj/redj.php on line 452


This is Joomla 1.7 and PHP 5.2.x

Is there some docs on ReDJ?
L'Argomento è stato bloccato.

Re: Directing login to Community Builder 12 Anni, 7 Mesi fa #2575

  • dacker
  • Offline
  • Fresh Boarder
  • Messaggi: 8
I just remember this is moderated (sorry for the double post).

I found the docs .. and I got my from working by using this:

http://{siteurl}/index.php?option=com_comprofiler&task=login&{preg_match}/return=.*/i{/preg_match}


but the CB plugin doesn't seem to put me back to the page

This is what my redirect looks like now:

http://t1631.org/index.php?option=com_comprofiler&task=login&return=aHR0cDovL3QxNjMxLm9yZy9ob21lL3VwY29taW5nLWV2ZW50cy9pY2FscmVwZWF0LmRldGFpbC8yMDExLzA5LzIzLzExMi8tL2RhbW9ucy1zZXZlbi1sYWtlcy1jYW1wb3V0 


What does the /i do in the {preg_match} [BTW. you have some typos in the doc in this area .. i..e preg match]
L'Argomento è stato bloccato.

Re: Directing login to Community Builder 12 Anni, 7 Mesi fa #2577

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Hi Dacker,
it seems just a problem related to == at the end. I will try on my site and let you know.

L.
L'Argomento è stato bloccato.

Re: Directing login to Community Builder 12 Anni, 7 Mesi fa #2578

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
So,
about ReDJ the new rule you set for preg_match is ok, and the redirection is right. Now should be the plugin to do the redirect.

When ReDJ sends you to:

t1631.org/index.php?option=com_comprofiler&task=login&return=aHR0cDovL3QxNjMxLm9yZy9ob21lL3VwY29taW5nLWV2ZW50cy9pY2FscmVwZWF0LmRldGFpbC8yMDExLzA5LzIzLzExMi8tL2RhbW9ucy1zZXZlbi1sYWtlcy1jYW1wb3V0

The return value is:

aHR0cDovL3QxNjMxLm9yZy9ob21lL3VwY29taW5nLWV2ZW50cy9pY2FscmVwZWF0LmRldGFpbC8yMDExLzA5LzIzLzExMi8tL2RhbW9ucy1zZXZlbi1sYWtlcy1jYW1wb3V0

And if you decode this you get:

t1631.org/home/upcoming-events/icalrepeat.detail/2011/09/23/112/-/damons-seven-lakes-campout

The problem is that at this time you still need to do the login, while I tought you need a redirect after the login. And this is the reason why after the login you are not redirected to destination.

In other words, when you plan on this:

t1631.org/index.php?option=com_comprofiler&task=login&return=aHR0cDovL3QxNjMxLm9yZy9ob21lL3VwY29taW5nLWV2ZW50cy9pY2FscmVwZWF0LmRldGFpbC8yMDExLzA5LzIzLzExMi8tL2RhbW9ucy1zZXZlbi1sYWtlcy1jYW1wb3V0

You have to do the login yet, but when you post the return value is gone and my plugin is not able to redirect you.
L'Argomento è stato bloccato.

Re: Directing login to Community Builder 12 Anni, 7 Mesi fa #2580

  • dacker
  • Offline
  • Fresh Boarder
  • Messaggi: 8
I found this over in the CB Forum and it now works: www.joomlapolis.com/forum/112-cb-122-general-discussion/126563-base64-login-redirect-not-working?limit=6&start=12

Actually, I just got it working, after looking through a lot of code.

As it turns out, the code to handle the redirects is actually properly built into CB. That isn't the issue. On line 1597 of comprofiler.php, this line properly handles redirects after login:

cbRedirect( cbSef( $return, false ), ( count( $alertmessages ) > 0 ? stripslashes( implode( '\n', $alertmessages ) ) : '' ) );



The issue is on the login page itself, and what is being passed into this function. The issue stems around a hidden field in the login form.

<input type="hidden" name="return" value="base64_value" />



For whatever reason, the only URL being built here is the URL of the homepage. So this is a very simple fix. Open mod_cblogin.php. Around line 678, find this:

echo '<input type="hidden" name="return" value="B:' . base64_encode( $login ) . '" />'."\n";



Comment out that existing echo statement for that hidden field, and do this instead:


$myReturn = JRequest::getVar('return', '', '_GET');

echo '<input type="hidden" name="return" value="B:'.$myReturn.'" />';




Don't worry about the "B:" thing; CB's internal code handles that fine.

This has solved the problem for me.

1. I'm logged in, and I copy a registered URL.
2. I logout.
3. I paste the private URL I copied into the browser and attempt to go there.
4. Joomla redirects to a URL with the base64 of the URL you were *trying* to access as a GET parameter with value stored in "return".
5. That value is read and placed into the hidden field of the form.
6. Upon logging in, you are redirected to the page you were trying to access.
L'Argomento è stato bloccato.

Re: Directing login to Community Builder 12 Anni, 7 Mesi fa #2581

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Thinking about it,
there's only one solution. When you plan on this page:

t1631.org/index.php?option=com_comprofiler&task=login&return=aHR0cDovL3QxNjMxLm9yZy9ob21lL3VwY29taW5nLWV2ZW50cy9pY2FscmVwZWF0LmRldGFpbC8yMDExLzA5LzIzLzExMi8tL2RhbW9ucy1zZXZlbi1sYWtlcy1jYW1wb3V0

You should "preserve" the return value with the post action. In this way there's the possibility to know where to redirect after login.

To do this, a way is to create a system plugin that catches the option=com_comprofiler&task=login, and add an hidden input field to login form filled with return_url value. In this way the information is still available when post login form.

This is not so difficult to do. As soon as I finish Tag Meta porting to Joomla 1.7 (there are too many users asking me for this), I will support you to do this if you still need.

Best regards,
Luigi
L'Argomento è stato bloccato.

Re: Directing login to Community Builder 12 Anni, 7 Mesi fa #2582

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Very glad to know now is fine, and thank you for details in solution.

I hope it will be useful for someone else in future.

Best regards,
Luigi
L'Argomento è stato bloccato.
  • Pagina:
  • 1
  • 2
Moderatori: admin
Tempo generazione pagina: 0.81 secondi
Cerca con Google
News
Chi è online
 153 visitatori online
Sponsor

slotmachineaamsonline.com è una guida alle migliori slot machine online legali in Italia. Sul sito trovi un elenco sempre aggiornato dei casino online con Slot machine e bonus slot, le ultime novità dal mondo delle slot online e le migliori strategie per vincere. Inoltre, è disponibile una sezione dedicata alle slot machine da BAR che finalmente sono disponibili nella versione online.