Enhanced Moodle plugin in 1.5

Support specific to the Moodle plugin (http://moodle.org/).

Moderator: hwevers

Forum rules
Please post all the bugs you encounter on our issue tracker.

Enhanced Moodle plugin in 1.5

Postby hwevers on Tue Jul 06, 2010 7:38 pm



Later: The newly released version of Jfusion 1.5 contains a revoked Moodle plugin. Installation/activation of the DSLO support extension for Moodle (formerly caled reversed dual login) is now build in. One click to install (and deinstall) and also (de)activation via the Jfusion Moodle plugin or, if you wish, in Moodles admin. No need to install the attacjhed Moodle plugin anymore

Henk
User avatar
hwevers
Developer
Developer
 
Posts: 870
Joined: Fri May 02, 2008 10:06 am
Location: The netherlands

Re: Enhanced Moodle plugin in 1.5

Postby jfusiontest on Mon Jul 12, 2010 9:55 pm

Hi Henk,

I have been testing the new moodle DSSO plugin and wanted to point out a few problems (there are too many to list in tracker for now).

1. The moodle lang folder needs to be UNDER the moodle/install_module/source/auth/jfusion folder.

2. You must have made some changes to the config variables that didn't get changed in the auth.php file:
change jf_cookie_verifyhost to jf_verifyhost
change jf_cookie_leavealone to jf_leavealone

3. The moodle lange file $string['auth_jfusiondescription'] needs \ before the " like this: \"CURL setup\"
4. add global $CFG; to LoginJoomla function.
5. line 371: change $params['jf_verifyhost']; to $params_verifyhost;
6. line change $params_loginpath = $params_logoutpath."/"; to $params_loginpath = $params_loginpath."/";
7. moved line $params_joomlaactive = $this->config->jf_enabled; to above if ($params_joomlaactive == '0')

I think that is about all of those minor errors, and once fixed, then logging into both Moodle and Joomla from Moodle worked fine, however logging out didn't. To fix this I made this changed line 59:
$status= $helper->RemoteLogoutUrl($curl_options); to $status= $helper->RemoteLogout($curl_options); Then, I had to change $leavealonearr[$i]['value'] = $cinfo[1]; from 1 to 0 in the model.curl.php file. I don't know if this is the best way, but it DOES work now for logging out of both with no errors.


Thanks for all the hard work on this.
Char
User avatar
jfusiontest
JFusion Newbie II
JFusion Newbie II
 
Posts: 14
Joined: Mon Jun 01, 2009 5:27 pm

Re: Enhanced Moodle plugin in 1.5

Postby hwevers on Tue Jul 13, 2010 11:23 pm

Char,
Thank you for taking the trouble to test this Moodle extension and to report your findings.
Please keep on doing this :-)

Alas, when committing my code I mas a pretty serious error and committed old code. I have tried to correct this just before release of version 1.5, but I didn't got it right. I did commit corrections just after the release though, so some of your corrections are already in the SVN, readfy for next release. As I use Moodle on my own website The problems after upgrade were clear. So let me walk through your remarks and tell you what I did.

jfusiontest wrote:1. The moodle lang folder needs to be UNDER the moodle/install_module/source/auth/jfusion folder.

I need to have a really close look at this. The idea was to get the language file into <moodle root>/lang
So can you tell me what went wrong on your system?

variables that didn't get changed in the auth.php file:
change jf_cookie_verifyhost to jf_verifyhost
change jf_cookie_leavealone to jf_leavealone

Yes, missed a few...
3. The moodle lange file $string['auth_jfusiondescription'] needs \ before the " like this: \"CURL setup\"

Oops....
4. add global $CFG; to LoginJoomla function.

Sure, already in the SVN from rev 2231
5. line 371: change $params['jf_verifyhost']; to $params_verifyhost;
[/quote
Oops again
6. line change $params_loginpath = $params_logoutpath."/"; to $params_loginpath = $params_loginpath."/";

More oops...
7. moved line $params_joomlaactive = $this->config->jf_enabled; to above if ($params_joomlaactive == '0')

Yes caught that in rev 2231
I think that is about all of those minor errors, and once fixed, then logging into both Moodle and Joomla from Moodle worked fine, however logging out didn't. To fix this I made this changed line 59:
$status= $helper->RemoteLogoutUrl($curl_options); to $status= $helper->RemoteLogout($curl_options); Then, I had to change $leavealonearr[$i]['value'] = $cinfo[1]; from 1 to 0 in the model.curl.php file. I don't know if this is the best way, but it DOES work now for logging out of both with no errors.

Well, I am glad that it did work for you, but what you actually did was using a brute force logout, starting a new session for Joomla. (to the user this looks like he is logged out). This has been changed in 1.5 to actually logging out and triggering JFusion to logout of all other software with active jfusion plugins.
You will find some changes to the code in the latest SVN to get the logout perform as designed.

Thank you for taking time to test this new extension and let me know if the changes worked for you
Henk
User avatar
hwevers
Developer
Developer
 
Posts: 870
Joined: Fri May 02, 2008 10:06 am
Location: The netherlands

Re: Enhanced Moodle plugin in 1.5

Postby jfusiontest on Thu Jul 15, 2010 6:03 pm

Hi Henk,

I just tested the latest SVN version. Everything looks great, except I still can't logout of Moodle. However, when I do a logout check from Jfusion CPanel it works fine. Could you post an image of your Moodle config settings for the Jfusion plugin? Maybe I don't have those set correctly.

As for the lang folder, nothing "went wrong", however Moodle reads the lang files for plugins that are in lang folders under the plugin folder, and this is the preferred method--this becomes even more important in Moodle 2.0. (By the way, I've also tested in Moodle 2.0 making a few minor updates, and except for the same logging out problem, it works fine).
User avatar
jfusiontest
JFusion Newbie II
JFusion Newbie II
 
Posts: 14
Joined: Mon Jun 01, 2009 5:27 pm

Re: Enhanced Moodle plugin in 1.5

Postby hwevers on Thu Jul 15, 2010 9:12 pm

Just to br sure:
1- does login from moodle logs in to joomla as well?
2- does logging out from moodle logs out from joomla as well ?
3- does logging in from joomla logs in to moodle as well?
4- does logging out from joomla logs out from moodle as well?

which one does not work ?

Tx
Henk
User avatar
hwevers
Developer
Developer
 
Posts: 870
Joined: Fri May 02, 2008 10:06 am
Location: The netherlands

Re: Enhanced Moodle plugin in 1.5

Postby jfusiontest on Fri Jul 16, 2010 12:32 am

It was logging out of Moodle that was the problem, everthing else was fine, however, I just looked again at my moodle auth config and I had not set Moodle as Master (it is set in Joomla as master). That must have been the problem, ALL is working now!

Thanks.
User avatar
jfusiontest
JFusion Newbie II
JFusion Newbie II
 
Posts: 14
Joined: Mon Jun 01, 2009 5:27 pm

Re: Enhanced Moodle plugin in 1.5

Postby hwevers on Fri Jul 16, 2010 11:46 am

Char,

Actually it should work in both master and slave mode. I tested again and on my system is does. I think that saving your configuration did the trick after thos changes in paramer names.

As for the difference between master and slave mode DSLO on Moodle: After posting username and password the code is checking for a valid user in Moodles database. If the user is valid, he is loggend in to Moodle and the model.cirl routines are used to login to Joomla. from there JFusion finds out who started the login and will login to all slaves that are active.
However when a valid user cannot be found, the code reacts differently for master and slave. If in master mode the user is warned that the login is invalid. In slave mode the code tries to login to Joomla. If a valid user is found (eventually from some other plugin set as master) the a new record is created in Moodle and the user is logged in to Moodle. Pretty sophisticated procedures. If all integrations have this DSLO support then after registering at the master you can login on any integration, if the user already exists there or not.
In our 2.0 version DSLO is extended to DSSO, meaning that you can register on any integration. There will be no masters or slaves any more.
Thank you for testing
Henk
User avatar
hwevers
Developer
Developer
 
Posts: 870
Joined: Fri May 02, 2008 10:06 am
Location: The netherlands

Re: Enhanced Moodle plugin in 1.5

Postby jfusiontest on Mon Aug 02, 2010 4:12 pm

Hi Henk,

I just wanted to report a couple of things. Everything is working great, but I am still getting an error message when logging out of Moodle (see above):

Undefined offset 1 in ............administrator/components/con_jfusion/models/modle.curl.php on line 728

Also, if you only have jfusion enabled in moodle, you will still get your "disable registration" error message in the JFusion cpanel because you will have jfusion set as auth--to fix this I made this change:

in admin.../comp../jfusion/plugins/moodle/admin.php
line 138 to not get the error message when moodle is slave and jfusion is set as auth.
$query = "SELECT value FROM #__config WHERE name = 'auth' and value !='jfusion'";
User avatar
jfusiontest
JFusion Newbie II
JFusion Newbie II
 
Posts: 14
Joined: Mon Jun 01, 2009 5:27 pm

Re: Enhanced Moodle plugin in 1.5

Postby hwevers on Tue Aug 03, 2010 5:45 pm

jfusiontest wrote:Hi Henk,

I just wanted to report a couple of things. Everything is working great, but I am still getting an error message when logging out of Moodle (see above):

Undefined offset 1 in ............administrator/components/con_jfusion/models/modle.curl.php on line 728

Also, if you only have jfusion enabled in moodle, you will still get your "disable registration" error message in the JFusion cpanel because you will have jfusion set as auth--to fix this I made this change:

in admin.../comp../jfusion/plugins/moodle/admin.php
line 138 to not get the error message when moodle is slave and jfusion is set as auth.
$query = "SELECT value FROM #__config WHERE name = 'auth' and value !='jfusion'";



Thank you for testing. I cannot reproduce the error you have in model.curl. Did you put anything in the leave_alone parameter in Moodles Jfusion auth setup?

If not can you replace in model.curl.php line 718:
Code: Select all
        if ($leavealone) {

with:
Code: Select all
if (trim($leavealone)) {


and test again?
If you still have the error, just put the following line before line 718 just before you logout:
Code: Select all
echo "leavealone=";print_r($leavealone);echo "!"; die('stopped');

and let me know what you get.

As for the disable registration error, thanks! I should have thought about that. I have committed your change to our SVN.
Henk
User avatar
hwevers
Developer
Developer
 
Posts: 870
Joined: Fri May 02, 2008 10:06 am
Location: The netherlands

Re: Enhanced Moodle plugin in 1.5

Postby jfusiontest on Wed Aug 04, 2010 8:14 pm

Yes, I have leavealone set. The first didn't work, and I don't like the second one much. How about something like this:

for($i=0; isset($leavealonearr[$i]); $i++){
foreach ($lines as $line) {
$cinfo = explode('=', $line);
$leavealonearr[$i]['name'] = $cinfo[0];
$leavealonearr[$i]['value'] = $cinfo[1];
$i++;
}
}
User avatar
jfusiontest
JFusion Newbie II
JFusion Newbie II
 
Posts: 14
Joined: Mon Jun 01, 2009 5:27 pm

Next

Return to Moodle

Who is online

Users browsing this forum: No registered users and 0 guests

cron