One of our clients has a large eLearning website that we maintain.
They’re based out of Bangkok, so they flew me up for some onsite work, part of which culminated in this plugin here.
eFront is a Learning Management System, similar to Moodle.
Its billed as a User Friendly Learning System, although having used it, I’d say thats a bit of a white lie!
More on eFront here – http://www.efrontlearning.net/
eFrontWPI Plugin Overview
This plugin provides single login functionality for WordPress / BBPress and eFront
It will optionally create an eFront user if one does not exist (option to set this in plugin settings).
For login to function the WordPress user and password must be the same as the eFront username and password.
Plugin is based on the v1 api provided by eFront. Should work with v2 also.
To use the v2 api, simply change the eFront URL to the appropriate URI
IMPORTANT NOTE:
This plugin requires cURL (php5_curl) to be installed as a pre-requisite.
Instructions
Upload this folder into your wordpress / bbpress plugins folder.
Typically ->
[your wordpress folder]/wp-content/plugins/
Activate plugin, then go to eFrontWPI Plugin Settings, and enter the appropriate data:
* eFront URL should be the full URI for the eFront API on your server.
eg
http://www.yourservername.com/eFront/www/api.php
or
http://www.yourservername.com/eFront/www/api2.php
* Admin Login
The eFront Admin user (suggest create a user for the API to use)
* Admin Pass
The eFront Admin user pass
* Create User checkbox
Check if you want a user automatically created.
* Current eFront token
This is a read only field which shows the current eFront API token (if any).
This is a good way to check if the plugin is working – if you have a token, it should be working.
Download here – eFrontWPI v1.0
13 Comments to “eFrontWPI – WordPress integration Plugin for eFront”
Post comment
Archives
- May 2012
- April 2012
- March 2012
- December 2011
- November 2011
- October 2011
- September 2011
- July 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
Categories
- Apple
- Arcade Machines
- Badges
- BMW
- China Related
- Cool Hunting
- Exploits
- Firmware
- Food
- General Talk
- government
- IP Cam
- iPhone
- Lasers
- legislation
- MODx
- MySQL
- requirements
- Reviews
- Service Issues
- Tao Bao
- Technical Mumbo Jumbo
- Things that will get me censored
- Travel
- Uncategorized
- Useful Info
Most Popular Posts
- Samsung N310 (Samsung Go) Hackintosh Installation on Snow Leopard (11712)
- IPCam Hacking - pt#2 (9303)
- eFrontWPI - Wordpress integration Plugin for eFront (7577)
- BMW Keys and Transponders E36 E38 E46 etc (EWS2) (7131)
- IP Cam Hacking – pt#5 (6178)
Tags
Recent Comments
-
HenryX: If you have any problems about motocycle , I can answer you. I am a local Shanghaier with a 5 years’...
-
Johnny E: Hi Lawrence.. i have a 1999 Bmw E46 320i, i had to change the engine because it was broken, and now i...
-
Lawrence Sheed: Zoneminder is a video monitoring capture system. I have an IP Camera pointed at the entrance, and...
-
Shaun Wallace: That is pretty cool, and cheap too! I may order one thanks to your recommendation. What is zone...
-
Hector: My country doesn’t require a license for MOPEDS & no highway sticker. Liability and the cost of...
Recent Trackbacks
- eFront Blog: 5 things you (perhaps) don’t know about eFront
- SISTEMAS O.R.P: Recuperar una cámara Zaapa CIP-RW después de un fallo de actualización
- Blog - DO Bots: Brookstone Rover AC13
- How can I stop Pop3 Brute Force attacks: need to create a regex, and add it to fail2ban Here is a guide....
- shanghailoz is our latest member! -:



ICP Permit
Webmail
Newsletters
Support

Thank you so much for creating this!
I went ahead and installed the plugin and received the token indicating that it’s working properly. I created a user in wordpress and nothing appeared in the eFront user screen. I then logged out of both and returned to the admin panel and tried again. Still nothing.
I also tested api.php with http:/website/efront/www/api.php?action=token and received the token.
Can you think of anything I may have missed?
eFront Version: 3.6.7 Community
Wordpress Version: 3.0.4
What API are you using? api1 or api2?
Do you have php5_curl installed?
Have you checked the create a user box?
Its not difficult code really, the gist of it is that it adds a hook into the authenticate filter in WordPress.
If the user can login, it tries to login to eFront also (via the eFront API).
If the user doesn’t exist it will create a new eFront user (if set to do so in the plugin admin in WordPress)
It will then attempt to login with the new user account in eFront.
eFront login works on a cookie basis.
If you are still having issues, suggest Firefox and Firebug, then take a look at cookies before and after login to see if the cookie is indeed being created.
Its possible a newer version of either WordPress or eFront have depreciated one of the calls I use; let me know what you see so I can update the plugin if necessary.
Lawrence.
One other thought –
eFront uses a hard coded cookie key – that may have changed.
If so, I’ll probably need to add that in as a variable to be set in the plugin admin also.
Check to see if this is still the same in your version of efront.
//G_MD5KEY from eFront libraries/globals.php
//eFront needs a cookie also.
define(“G_MD5KEY”, ‘cDWQR#$Rcxsc’);
I think its probably going to be the cookie..
I think I’ll need to make a minor change to load the eFront libraries/global.php directly, so that any change would use their md5 salt du jour.
I’ve made some small changes to do so – see below for what to change.
Can you try this in your side and see if this works (or gives an error), then let me know!
Then I can either remedy,or update the plugin zip file to include this.
Open eFrontWPI.php in the wordpress plugins folder, and change the eFrontWPI_set_cookie code to the below.
function eFrontWPI_set_cookie($username,$password) {
//G_MD5KEY from eFront libraries/globals.php
//eFront needs a cookie also.
//define(“G_MD5KEY”, ‘cDWQR#$Rcxsc’);
global $eFrontWPI_options;
$myfile = $eFrontWPI_options['path'] . ‘/libraries/globals.php’;
if (($file_handle = @fopen($myfile, ‘r’)) === false) {
//Can’t find the globals file
return new WP_Error(‘eFrontWPI_server_error’, __(‘eFrontWPI: Attempted to load globals.php file, but failed. Does this path look correct: ‘.$myfile));
}
else {
@include $myfile;
//define(“G_MD5KEY”, ‘cDWQR#$Rcxsc’) should be defined from above include..
}
setcookie(“cookie_login”, $username,time()+3600,’/');
setcookie(“cookie_password”, md5($password.G_MD5KEY),time()+3600,’/');
}
I’ve tried both APIs and tested manually.
I do have Curl installed and verified in phpinfo.
I tested with and without the create user option.
I replaced
eFrontWPI_set_cookie($username,$password);
return;
with your fix and I now receive a 500 error when trying to login.
This is how I placed it in eFrontWPI.php
if (strpos($result, ‘user does not exist’) == true ) {
if ($eFrontWPI_options['create_login'] == ‘yes’) {
//Add the user if possible.
eFrontWPI_perform_action (“create_user&login=”.$username.”&password=”.$password.”&name=”.($user->first_name).”&surname=”.($user->last_name).”&email=”.($user->user_email).”&languages=english”);
eFrontWPI_perform_action (“update_user&login=”.$username.”&password=”.$password.”&name=”.($user->first_name).”&surname=”.($user->last_name).”&email=”.($user->user_email).”&languages=english”);
}
}
function eFrontWPI_set_cookie($username,$password) {
//G_MD5KEY from eFront libraries/globals.php
//eFront needs a cookie also.
//define(“G_MD5KEY”, ‘cDWQR#$Rcxsc’);
global $eFrontWPI_options;
$myfile = $eFrontWPI_options['path'] . ‘/libraries/globals.php’;
if (($file_handle = @fopen($myfile, ‘r’)) === false) {
//Can’t find the globals file
return new WP_Error(‘eFrontWPI_server_error’, __(‘eFrontWPI: Attempted to load globals.php file, but failed. Does this path look correct: ‘.$myfile));
}
else {
@include $myfile;
//define(“G_MD5KEY”, ‘cDWQR#$Rcxsc’) should be defined from above include..
}
setcookie(“cookie_login”, $username,time()+3600,’/');
setcookie(“cookie_password”, md5($password.G_MD5KEY),time()+3600,’/');
}
}
function eFrontWPI_perform_action($action)
{
Make sure that you don’t just copy/paste it in.
Ensure that wordpress hasn’t munged the characters – especially the ‘s
If that doesn’t help, comment out all the added code with //at the start of each added line, and then uncomment section by section till it breaks, then fix appropriately.
eg uncomment if (..) { return wp_error… } see if that is ok. If so, then add in the else { @include .. } see if that works.
Its only 5 lines of code, shouldn’t take more than a few seconds to see where you’ve gone wrong (or I’ve missed something stunningly obvious).
Ok, it’s no longer throwing errors after trying again, I made a mistake. However, it’s still not adding the user to eFront. Any ideas?
Your crappy plugin corrupted my efront installation. I’m getting a session expired message and there is no way to get it fixed.
…and this is why no-one does stuff – all you get is ungrateful people like you complaining.
No, it did not corrupt your efront installation. You have the source code, all the plugin does is create an efront login cookie for you on login to wordpress. If you have an issue, either delete the cookie, or login from another browser. The only thing broken is your attitude.
How about – hey, i tried your plugin and have this issue, what could it be.
hi, Lawrence Sheed
i know users like Andy, dont let souch ungrateful people destroy your day, keep developing!!
thenk you
Hi lawrence,
Thanks for developing this.
However, i’m faced with the same issue, the session expiration issue. My user is connected to eFront. However, when i am trying to enter the administrator or related link, it shows that the session for my user had expired.
Any idea how to solve this? Much appreciated. Thank You.