× R0.23 No Longer Supported

Joomdlehooks auto redirect bug and log out sync

11 years 6 months ago
red
Posts: 38
More
Topic Author
Joomdlehooks auto redirect bug and log out sync #1
Hey for a while now i have been trying to find out why auto-redirect is not working for me in joomla.

normaly, when a user that is logging into joomla he should stay the the same page he was. but when this plug-in is enabled, it redirects to the joomla home. this can be very frustrating if a user has dug into the site and has forgot to log in.

It also blocks any attempt to redirect the site after log-in.

it would also be nice to sync the log-out between joomla and moodle - if possible.

Please Log in or Create an account to join the conversation.

11 years 6 months ago 11 years 5 months ago by red.
red
Posts: 38
More
Topic Author
Joomdlehooks auto redirect bug and log out sync #2
another thing on the subject,
i was able to get a log-in form to appear in moodle's header with the following hack:
you need to download this joomla extension:
www.textarea.it/en/joomla-extensions.html k

it helps log-in to joomla externaly.

in the moodle header i put the following code:
<form action="/logme.php" method="post" name="form-login" id="form-login" >
	<ul>
		<li><input id="modlogin_username" type="text" name="user" value="Username"  onblur="if(this.value=='') this.value='Username'" onfocus="if(this.value=='Username') this.value='';" class="inputbox" alt="username" size="15" />&nbsp;&nbsp;</li>
		<li><input id="modlogin_passwd" type="password" name="passw" value="Password" onblur="if(this.value=='') this.value='Password'" onfocus="if(this.value=='Password') this.value='';" class="inputbox" size="15" alt="password" />&nbsp;&nbsp;</li>
	</ul>
	<ul>
    	<li> <input id="modlogin_remember" type="checkbox" name="remember" class="inputbox" value="yes" alt="Remember Me" />&nbsp;&nbsp;
             <label for="modlogin_remember">Remember Me</label>&nbsp;&nbsp;</li>
        <li><input type="submit" name="Submit" class="button" value="Login" />&nbsp;&nbsp;</li>
	</ul>
	<br>
    <ul>
    	<li><a href="/create-an-account.html">Create an account</a>&nbsp;&#x2022;</li>
        <li><a href="/lost-password.html">Forgot your password?</a>&nbsp;</li>
    </ul>
    	
    <input type="hidden" name="return" value="<? echo($_SERVER['REQUEST_URI']); ?>"  />	
</form>
this routes to the logme.php file which resides on the root (joomla root).
<?php
   header( 'Location: http://www.YOUR SITE.com/index.php?user='.$_POST["user"].'&passw='.$_POST["passw"].'&return='.$_POST["return"] ) ;
?>

i tried modifying the redirect method to take me to the right page, but this works only when joomdlehooks is off. so for now you get routed back to joomla. just like from any page in joomla.

it would be great if the bug could be solved and then i can issue my hack to the auto-login plugin so it routs back even to the moodle page you were!

Please Log in or Create an account to join the conversation.

11 years 6 months ago
red
Posts: 38
More
Topic Author
Joomdlehooks auto redirect bug and log out sync #3
you need to fix your css for the forums.. its hard to read this way..

Please Log in or Create an account to join the conversation.

11 years 5 months ago
Antonio Durán
Posts: 7311
More
Joomdlehooks auto redirect bug and log out sync #4
Hi, first thanks for the feedback ;)

Them yes, you are right:
- Redirection will not work with Joomdle enabled
Why?
- I just realized yesterday that they way SSO is coded, all actions that should be done after the joomdlehooks plugin are not executed. One of them is the redirection.

I already put this on my list to try to find another way of doing SSO without this problems.

As for syncing log-out, what do you mean? There is already logout sync....
Or do you mean session sync?

As for the second post I am a little lost: do you want to login to Joomla from Moodle?

Please Log in or Create an account to join the conversation.

11 years 5 months ago
red
Posts: 38
More
Topic Author
Joomdlehooks auto redirect bug and log out sync #5
antonio wrote:

- I just realized yesterday that they way SSO is coded, all actions that should be done after the joomdlehooks plugin are not executed. One of them is the redirection.

I already put this on my list to try to find another way of doing SSO without this problems.

This would be much appreciated!
antonio wrote:

As for syncing log-out, what do you mean? There is already logout sync....
Or do you mean session sync?

simply put, when i log out of joomla the user in moodle is still online and vise versa... it would be nice to have joomla also log out of moodle.
antonio wrote:

As for the second post I am a little lost: do you want to login to Joomla from Moodle?

I have the same header for joomla and moodle. this header contains a log-in form that can be visible from all pages. the second post shows how to make it possible to log into joomla directly from a form in moodle. so you don't have to redirect to joomla's login page in order to log in from moodle.
once you fix the redirect issue, it will also be able to send you back to the link you visited

Please Log in or Create an account to join the conversation.

11 years 5 months ago
red
Posts: 38
More
Topic Author
Joomdlehooks auto redirect bug and log out sync #6
perhaps the real solution is making a login module that logs into both moodle and joomla at the same time...

Please Log in or Create an account to join the conversation.

11 years 5 months ago
Antonio Durán
Posts: 7311
More
Joomdlehooks auto redirect bug and log out sync #7
I don't know why single sign out is not working for you, but right now when a user logs out of any platform, they are automatically logged out from the other one. I have only tested this with the two platforms on the same domain, though.

As for the other issue: we would need a simple custom login module in Moodle that sends the data to Joomla to log in as usual.
But, this would not make them look alike. I mean, login block in moodle would be different from Joomla's.

Please Log in or Create an account to join the conversation.

11 years 5 months ago
red
Posts: 38
More
Topic Author
Joomdlehooks auto redirect bug and log out sync #8
Please take a look at what ive done in my site:
www.synthschool.com k (joomla)
www.synthschool.com/study k (moodle)

Please Log in or Create an account to join the conversation.

11 years 5 months ago
Antonio Durán
Posts: 7311
More
Joomdlehooks auto redirect bug and log out sync #9
It looks really nice :)

I am not really into 'hacking' joomla or moodle. I mean I always prefer solutions that do not involve modifying core Joomla or Moodle code.

But for sure your ideas will make us think of ways to getting the same goals my other means. Thanks for sharing! :)

Please Log in or Create an account to join the conversation.

11 years 5 months ago
red
Posts: 38
More
Topic Author
Joomdlehooks auto redirect bug and log out sync #10
Thats why i posted it here. Its not exactly hacking since i did not touch any core files, just the template header of moodle, and installed a plugin.

if there was some kind of joomdle API i maybe could have done something more elegant ;) hint hint ...

anyhow i agree its an ugly solution. thats why i posted it here. perhaps we can find a way to bring such a feature into production...

Please Log in or Create an account to join the conversation.