• Welcome to Simple Machines Community Forum. Please login or sign up.
January 21, 2022, 11:32:05 AM

News:

SMF 2.1 RC4 has been released! Try it out and help us test! :) Read more.


other areas to change login/register/logout links

Started by chadness, December 31, 2004, 10:47:20 AM

Previous topic - Next topic

chadness

In the readme for the mambo login form, it mentions changing the login2 to mambo_login (as well as the logout and registration links) in the link in themedirectory/languages/index.english.php but I found there were a few other files in the default template I had to change as well.  One change was in BoardIndex.template.php - there is a link to login2 there that needs to be changed to mambo_login.  This shows up at the bottom of the forum if you aren't logged in in the default template.  Another was Login.template.php, which you are routed to if you put in the incorrect password.  There were a couple of places to change it in there, plus a change for the register link.

Hope this makes sense to everyone, and I hope I didn't miss any :)

PaulEarley

I am using the default theme/template for SMF (1.0, but says 1.0rc) The bridge instructions for the mod_smf_login.php instruct you to change in your template:
1) ?action=register to ?option=com_smf_registration&task register
2) action=login2 to action=mambo_login
3) action=logout to action=mambo_logout

So I grepped the SMF files for the default SMF installation and found the following occurrences of each:
1) Register change = 6 Files, 7 occurrences
2) login change = 10 files, 14 occurrences
3) logout = 5 files, 6 occurrences

Here is my question:
Should the changes noted in the login module be made in ALL of these files?

Thanks
Paul Earley

[Unknown]

IMHO, why not hit the source and just add a redirect to login/logout/register?  I know the point is to change SMF and Mambo as little as possible, and I'm working to make this more of a possibility with 1.1... but, really now, won't it be simpler to make the change to SMF?

Example:
redirecexit('action=mambo_login');

-[Unknown]

Janner

I must admit to being a little confused by these changes:

If I do everything strictly as per the instructions I end up with two possible registration processes. If I follow the link from the login module I am routed through the Mambo registration form (./index.php?option=com_smf_registration&task=register). However, if I follow one of the links from the forum area of the site I go through the SMF registration (./index.php?option=com_smf&Itemid=92&?action=register).

So, what are the implications? Will each and every registration be handled the same, regardless of which route it takes? Will they all be added to both the Mambo and SMF user tables?

Looking at some of the other sites that are running this bridge, there doesn't appear to be a clear convention. Some have it with the two distinct options. Others have changed all the registration links to point to the Mambo option, whilst others have changed all the links to the SMF option.

Apart from cionsistency on your site, does it actually make any difference?

Orstio

QuoteLooking at some of the other sites that are running this bridge, there doesn't appear to be a clear convention. Some have it with the two distinct options. Others have changed all the registration links to point to the Mambo option, whilst others have changed all the links to the SMF option.

Apart from cionsistency on your site, does it actually make any difference?

There is no clear convention, because different people want different things.

Some want for there to be a single registration, but separate logins.  Some want their forum to show wrapped in Mambo, others do not.  Some want their forum to show wrapped in Mambo, but have separate logins and registrations.

It all depends upon what you want.

QuoteSo, what are the implications? Will each and every registration be handled the same, regardless of which route it takes? Will they all be added to both the Mambo and SMF user tables?

Not necessarily.  It all depends on what you want.  If you want every registration to be handled the same, then you need to change all the registration links to be the same.

PaulEarley

Ok, so assuming I want one login/logout/registration for mambo/SMF I should make changes throughout SMF (all occurences) or make changes as directed by [Unknown], to wit:

redirecexit('action=mambo_login');

[Unknown], being somewhat new to php, where should this mod occur?
Paul Earley

Janner

Quote from: Orstio on January 12, 2005, 06:34:14 AM
Some want their forum to show wrapped in Mambo, others do not.  Some want their forum to show wrapped in Mambo, but have separate logins and registrations.
From the readme in the bridge file, I was under the impression that using the Mambo wrapper was a definite no-no:

QuoteDon't try to open your SMF in your wrapper component:  It will
not function correctly (logging in and out will not work properly, despite the fact that it LOOKS like everything is working
fine EXCEPT logging in and out.)

chadness

I think when he says wrapped in Mambo, he means running it inside of Mambo as a component, not using the wrapper component.  As in, putting a Component menu item that you use to run it, instead of using a Wrapper menu item that points to the external SMF URL.  The terminology is just a little confused.

chadness

Quote from: [Unknown] on January 12, 2005, 01:55:18 AM
IMHO, why not hit the source and just add a redirect to login/logout/register?  I know the point is to change SMF and Mambo as little as possible, and I'm working to make this more of a possibility with 1.1... but, really now, won't it be simpler to make the change to SMF?

Example:
redirecexit('action=mambo_login');

-[Unknown]
Oh, sure, if you want to be all fancy like that :)
Honestly, I didn't think of it, and wouldn't have known how to do it easily, but that makes a lot more sense for those like me who want everything to be run inside of Mambo.

jorgen

I'll try, but what file (and where in that file) would I modify in SMF?

Orstio

QuoteFrom the readme in the bridge file, I was under the impression that using the Mambo wrapper was a definite no-no:

QuoteI think when he says wrapped in Mambo, he means running it inside of Mambo as a component, not using the wrapper component.  As in, putting a Component menu item that you use to run it, instead of using a Wrapper menu item that points to the external SMF URL.  The terminology is just a little confused.

Chadness is correct.  Please do not confuse "wrapped in Mambo" with "using the wrapper component".

[Unknown]

Sorry, you'd put that in LogInOut.php, after:

// Perform the actual logging-in.
function Login2()
{
global $txt, $db_prefix, $scripturl, $user_info;
global $cookiename, $maintenance, $ID_MEMBER;
global $modSettings, $scripturl, $context, $sc, $sourcedir;


And then find:
// Log the user out.
function Logout()
{
global $db_prefix, $sourcedir, $ID_MEMBER, $context;


And add after:
redirectexit('action=mambo_logout');

How do I modify files?

-[Unknown]

PaulEarley

The two changes, in login2 and SMF Logout seem like a better way to go for my integrated mambo/SMF login/out/registration. If I make these changes, I assume I revert my SMF code changes (in about 20 places) and then only have these two (if, as Orsito points put, I desire a totally integrated mambo/SMF site).

I have noticed one other item that puzzles me. On my site, despite diverting to mambo login/logout, when I ask for a new password, I must make profile changes in the SMF profile page. This means when I display "Your Profile" on the Mambo site, I must use the SMF "Your Profile" page. This works, but is counter-intuitive. (Divert login process to mambo but use SMF profile update process). Is this because of the one way SMF --> mambo user info copy?

Janner

Quote from: [Unknown] on January 13, 2005, 04:07:19 AM
Sorry, you'd put that in LogInOut.php, after:

// Perform the actual logging-in.
function Login2()
{
global $txt, $db_prefix, $scripturl, $user_info;
global $cookiename, $maintenance, $ID_MEMBER;
global $modSettings, $scripturl, $context, $sc, $sourcedir;


And then find:
// Log the user out.
function Logout()
{
global $db_prefix, $sourcedir, $ID_MEMBER, $context;


And add after:
redirectexit('action=mambo_logout');

How do I modify files?

-[Unknown]

Gives me the following error when trying to login:

Fatal error: Call to undefined function: redirecexit() in /usr/.[removed some stuff./Sources/LogInOut.php on line 90

Kindred

Janner,

it's a mistype...

redirecexit('action=mambo_login');


should read

redirectexit('action=mambo_login');


([unknown] missed a "T" in tyuping redirect)
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."


Orstio

QuoteI have noticed one other item that puzzles me. On my site, despite diverting to mambo login/logout, when I ask for a new password, I must make profile changes in the SMF profile page. This means when I display "Your Profile" on the Mambo site, I must use the SMF "Your Profile" page. This works, but is counter-intuitive. (Divert login process to mambo but use SMF profile update process). Is this because of the one way SMF --> mambo user info copy?

The login process is not really diverted to Mambo.  It is diverted to the script MOS_SMF.php instead of to Loginout.php.  MOS_SMF.php has the most important parts of both the SMF login and the Mambo login, with some more code to make them play nice together.  The login, even though it is named "mambo_login", is basically done through SMF but still sets the Mambo cookie.

Without writing a completely new integrated profile mananger (which would most likely turn out to be 99% the SMF profile anyway), the SMF profile is the best solution.  It already has everything you need:  It's just a matter of making a link to it.

Kindred

However, to truly bridge, we need to add a couple more connections.
Specifically, we need

1) to have the user edit his password in the SMF profile and have it changed on the mambo side as well...

2) A user deleted in SMF gets removed form mambo as well...


there's probably a few other features, but I think those are key to making a true integration.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

[Unknown]

Password changes are going to be more centralized in 1.1, if possible.  Deleting members is easy - deleteMembers in ManageMembers.php.

-[Unknown]

Orstio

Quote1) to have the user edit his password in the SMF profile and have it changed on the mambo side as well...

That's already done in v2.11.  Try it.  ;)

mindfriction

Argh help! Someone please!  :-[

Im getting completely lost in the versioning of SMF and the SMF/Mambo bridge. Can someone please point me in the right direction for the current, up-to-date bridge which suits the SMF 1.0.1 update ?

Thanks in advance 

Janner

Quote from: mindfriction on January 16, 2005, 11:40:06 AM
Argh help! Someone please!  :-[

Im getting completely lost in the versioning of SMF and the SMF/Mambo bridge. Can someone please point me in the right direction for the current, up-to-date bridge which suits the SMF 1.0.1 update ?

Thanks in advance 
v2.11 of Orstio's Bridge can be found here: http://mamboforge.net/projects/mos-smf/

[Unknown] has recently released an alternative. More information on this can be found here: www.simplemachines.org/community/index.php?topic=22965.0

mindfriction

Thanks Janner!


Umm Im still getting that issue where when I login using the mambo login page it only logs me into mambo, and SMF complains there's no such user. I've crawled through a number of posts, whats the general concensus or fix to have 1 login and 1 registration?

Thanks in advance

Orstio

http://mamboforge.net/projects/mos-smf/

Download the file mos2smf.zip.  Follow the instructions to move your MOS users over to SMF.

mindfriction

Hi Orstio :),

Ive made the

Quotechange:

action=login2

to:

action=mambo_login

change:

action=logout

to:

action=mambo_logout

changes as suggested in the readme.txt, although in another thread by [Unknown] he mentions making changes in the template files is not the best option. Anyway I then clicked the register on the mambo page and once again got the mambo registration and once again could only log into mambo--with SMF complaing no such user. Im just trying the

Quoteredirectexit('action=mambo_logout');

suggestion..see if that works *fingers crossed*


Orstio

If the user does not exist in SMF, it will not work.  You can make all the changes to your theme that you want, and it still will not work.

You must run the mos2smf script to migrate your Mambo users over to SMF.  That is the only way it will work.

mindfriction

Ok, well ive only just started the site so there is no users apart from the default admins created by Mambo and SMF respetcively on their initial installs. So your telling me there's no central registration module which will register the new coming users so they can login in once on my homepage http://www.yac.org.au/mambo451/ and be logged into the Mambo site AND SMF Messageboard ?

Orstio

January 16, 2005, 12:58:57 PM #27 Last Edit: January 16, 2005, 01:00:33 PM by Orstio
QuoteOk, well ive only just started the site so there is no users apart from the default admins created by Mambo and SMF respetcively on their initial installs. So your telling me there's no central registration module which will register the new coming users so they can login in once on my homepage http://www.yac.org.au/mambo451/ and be logged into the Mambo site AND SMF Messageboard ?

Did you read the bridge instructions at all?

There are two main components, and the login module.

The first component is the com_smf component.  It displays the forum wrapped in Mambo.  It also handles telling Mambo where you have SMF installed, so it is an essential component.

The next is the com_smf_registration component, that registers new users into both Mambo and SMF at the same time.

Then there is the login module, which logs in users that exist in both Mambo and SMF. (Usernames and passwords must be the same.  This is case sensitive, so they must be EXACTLY the same.)

If you are trying to login with a username and password that does not exist in SMF, you will have the error that you are seeing.

mindfriction

Thanks for being patient with me.
I did read the installation instructions, added the forum the main menu, made the 2 suggested link changes in the index.template.php and then added the com_smf_registration component to the main menu 'Register'. And all clicking on the 'Register' link in the main menu does is return a blank page as you can see here http://www.yac.org.au/mambo451/.

Ok I may be a dummy Orstio, but im trying my best to get this working, hence it 5am where I am..what on earth am I overlooking ? PLease help

Thanks

Orstio

QuoteI did read the installation instructions, added the forum the main menu, made the 2 suggested link changes in the index.template.php and then added the com_smf_registration component to the main menu 'Register'.

From the instructions for the registration component:

QuoteYou should not link this as a component to your menu, as the query string will not come out correctly.

That is why it returns a blank page.

This is what it is supposed to look like:

http://www.yac.org.au/mambo451/index.php?option=com_smf_registration&task=register

Your forum is not in your main menu.  It might be in your user menu; but nothing will work from there.

http://www.yac.org.au/mambo451/index.php?option=com_smf

mindfriction

January 16, 2005, 02:02:51 PM #30 Last Edit: January 16, 2005, 02:07:34 PM by mindfriction
Ok, so I have the forum their but it can only be seen by registered users; I set the access to 'Registered' in Mambo admin. Ive now changed the forum to purely a public main menu item. Sorry i sound dense, im ok with PHP but im having a hard time configuring this :[

The problem is I initially created my template using the extensions from Dreamweaver I downloaded from mamboforge, and that automatically created the login form you can see on my homepage down the left hand side. I thought adding the code (below) from the readme.txt, was going to adapt this login to become the new bridge login? Obviouxly not. So, if you can please, please tell me how do I  replace this current login on the homepage with the new bridged login/ registration?

<?php 
global $sc$context;

if (!
defined('SMF')){
  require (
$mosConfig_absolute_path."/administrator/components/com_smf/config.smf.php");
  require (
$smf_path."/SSI.php");
}

$sc = &$context['session_id'];
$_SESSION['USER_AGENT'] = $_SERVER['HTTP_USER_AGENT'];

?>




Janner

January 16, 2005, 02:06:48 PM #31 Last Edit: January 16, 2005, 02:09:13 PM by Janner
Quote from: mindfriction on January 16, 2005, 02:02:51 PM
How do I  replace the current login on the homepage with the new bridged login/ registration?
First install the module via the Mambo ACP. Then publish it to your site in the same way that you would any other module.

Of course, you will also need to unpublish the regular Mambo login module.

I am assuming that you have already installed the two Mambo components that are part of the Bridge?

Orstio

QuoteOk, so I have the forum their but it can only be seen by registered users; I set the access to 'Registered' in Mambo admin.

Right.  That's a problem.  Before a registered member logs in, that person is just a guest.  How can that guest access SMF in order to login, when Mambo is denying access?

QuoteThe problem is I initially created my template using the extensions from Dreamweaver I downloaded from mamboforge, and that automatically created the login form you can see on my homepage down the left hand side. I thought adding the code (below) from the readme.txt, was going to adapt this login to become the new bridge login? Obviouxly not. So, if you can please, please tell me how do I  replace this current login on the homepage with the new bridged login/ registration?

From the login module installation readme:

Quote1)  Unzip the package.
2) Upload MOS_SMF.php to your SMFSources directory.
3) Go to your Mambo control panel and install the module.
4) Go to your Mambo template, and add the following code, right before the </head> tag:

<?php
global $sc, $context;

if (!defined('SMF')){
  require ($mosConfig_absolute_path."/administrator/components/com_smf/config.smf.php");
  require ($smf_path."/SSI.php");
}

$sc = &$context['session_id'];
$_SESSION['USER_AGENT'] = $_SERVER['HTTP_USER_AGENT'];

?>

5) publish the module.

What you are looking for is #5:  Publish the module.  You will probably want to unpublish the default login module as well.  There's no need for both.

mindfriction

Ok cheers guys,

Ive just unpublished the default login module, im now looking into publishing the bridge moduel, you see im still getting the hang of Mambo ;)..Ive come leaps and bounds since i installed it 2 days ago thanks to people like you :D

Kindred

Although, I did discover a work-around for the resgitered/non registered issue...

Make a menu item for the SMF forums...  make it public... make it UNpublished
(mambo has now assigned an optionID to this component)

Now, make a LINK-URL to the same location that mambo assigned to the component...
make the link to the URL a registered menu item...

i.e. the component is addressed at index.php?option=com_smf&Itemid=40
now make a link to that same URL...

(Don't make a new component-link in your menu....  I originally did that, but it got mambo confused...)
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: