1 ruipedro17 Jul 19, 2006 15:53
3 ruipedro17 Jul 20, 2006 02:33
Hello!
I have a site created in CMS joomla.
Now I want to install b2evolution but I don’t know if it is possible integrate b2evolution with my site in joomla
(to make login in b2evolution on the basis of login with in joomla).
4 blueyed Jul 20, 2006 21:48
You could do it with a plugin.
There's a hook LoginAttempt which your plugin could provide as a method ("hook into").
I've just created a short page about it in the manual:
http://manual.b2evolution.net/PluginHooks#LoginAttempt
http://manual.b2evolution.net/Plugins/ldap_plugin
This is not very verbose, but the essence of it is: look into /plugins/_ldap.plugin.php in your b2evo directory.. ;)
5 ruipedro17 Jul 21, 2006 10:29
This post helped me very.
With this information already I obtain to know if the user exists in the database of b2evolution.
Now I have another problem.
What do I make so that users continue on (login) when they go for b2evolution (assumed that they had made login in the Joomla)?
Have I to create an instance of class Session?
6 blueyed Jul 21, 2006 19:14
You mean without being prompt with the b2evo login screen?
Then there's the AlternateAuthentication hook for this, where you would have to call $Session->set_User().
7 ruipedro17 Jul 24, 2006 12:19
Already I made small script (index_joomla_b2evo.php)
to serve of bridge between joomla and b2evo.
<?php
require_once dirname(__FILE__).'/conf/_config.php';
require_once $inc_path.'_main.inc.php';
include_once ("./plugins/_ldap.plugin.php");
$form_vars = ${"HTTP_".$HTTP_SERVER_VARS["REQUEST_METHOD"]."_VARS"};
$parm = $form_vars['parm'] ;
$check = $form_vars['check'] ;
$url = explode("|", $parm);
$f_username = $url[0];
$f_userpw = $url[1];
$ldap = new ldap_plugin();
$dados =Array("login"=>$f_username, "pass"=>$f_userpw,"pass_md5"=>$f_userpw);
$ldap->LoginAttempt($dados);
$db_row = $DB->get_var("SELECT * FROM evo_users WHERE user_login ='".$f_username."' and user_pass='".$f_userpw. "'" );
$User = new User($db_row);
$Session = new Session();
$Session->set_User($User);
header("Location: index.php");
?>
This script has a “error” that not yet obtained to decide
When I execute script browser presents me it following information:
---------------------------------------------------
An unexpected error has occured!
If this error persits, please report it to the administrator.
Go back to home page
Additional information about this error:
Requested Group from T_groups without ID!
--------------------------------------
Already I tried to decide this, but I did not obtain.
If I am not in error this message is presented when control to create the session for the user (to $Session->set_User (to $User);
They can help to me to exceed it this problem?
Tanks one more time.
8 yabba Jul 24, 2006 14:39
Ok, this is totally off the top of my head but your code could be tidied a tad (I don't think you want to be calling the ldap plugin though, I think you need to be checking against your joomala user table and creating a new user)
<?php
require_once dirname(__FILE__).'/conf/_config.php';
require_once $inc_path.'_main.inc.php';
param( 'parm', 'string' );
param( 'check', 'string' );
$url = explode("|", $parm);
$f_username = $url[0];
$f_userpw = $url[1];
$dados =Array("login"=>$f_username, "pass"=>$f_userpw,"pass_md5"=> md5($f_userpw) );
$Plugins->call_method( $Plugins->get_by_code( 'evo_ldap_auth'), 'LoginAttempt', $dados );
$db_row = $DB->query('SELECT * FROM T_users WHERE user_login =\''.$f_username.'\' and user_pass=\''.$f_userpw. '\'' );
$User = & new User($db_row);
$Session->set_User($User);
header_redirect('index.php');
?>
¥
9 ruipedro17 Jul 24, 2006 16:45
I do not understand the line
$Plugins->call_method( $Plugins->get_by_code( 'evo_ldap_auth'), 'LoginAttempt', $dados );
Already I tried this script, I continue the same with error:
-----------------------------------------
An unexpected error has occured!
If this error persits, please report it to the administrator.
Go back to home page
Additional information about this error:
Requested Group from T_groups without ID!
------------------------------------------
10 blueyed Jul 24, 2006 20:06
Why do you call (and even use) the ldap plugin??
The error is because of the fallback-Group, which the plugin uses, to assign a new user to and this uses $Settings->get('newusers_grp_ID') as default. Probably this return NULL/0 or something alike.
It's not meant to be used that way at all. You should rather create a new plugin and just install it...
btw: who's meant to call index_joomla_b2evo.php in your case?!
11 ruipedro17 Jul 24, 2006 21:41
I don’t know anything of plugins.
How do I can create one plugin?
Are there some documentation and examples?
What does plugins function of b2evo?
(btw: who's meant to call index_joomla_b2evo.php in your case?!)
Because it is the first file that must be loaded when comes of joomla.
12 blueyed Jul 25, 2006 00:43
Here's some documentation:
http://manual.b2evolution.net/CreatingPlugin
But the LDAP plugin itself is the best documentation in your case - that's what I've meant to say originally.
btw: who's meant to call index_joomla_b2evo.php in your case?!
Because it is the first file that must be loaded when comes of joomla.
Why would you want to have to call/link to a special file, instead of using b2evolution in the normal way?
If you create a plugin like the LDAP one, b2evo will trigger your plugin on the events that you hook (that means which are detected as a function of your plugin during install, or when you click "Reload plugins" on the b2evo plugins admin page - useful while developping and adding a new method).
13 ruipedro17 Jul 25, 2006 01:21
it is truth.
Only now and that I am to learn to work with plugins.
14 ruipedro17 Jul 25, 2006 01:29
which is the name of methodo executed before login form ?
15 blueyed Jul 25, 2006 19:08
Please read this thread again, from the beginning - with what you have learned in mind.. :)
16 abraham_asiedu May 19, 2009 09:56
I read the posts on how to integrate login at b2evolution with joomla, which is the situation i want to fix.
I downloaded the ldap plugin code like you suggested, but am pretty new to php, and need some kind of direction to get the plugin working for me.
What i want is that if someone logs in at the joomla end of my site, he is not prompted to login again at the b2evolution end.
Moreso, i would be glad if registration at b2evolution would automatically update joomla database tables, because I don't want to have orphaned user details which exist in one portion of the site but not in the other.
Thanks in advance... Ab :p
Please explain, what you want.
There's no "session variable".