Customizing SMF > SMF Coding Discussion

How to hide password fields in user profile?

(1/1)

MrMike:
How can I hide the password fields in the user profile screen? I'd like to make them disappear completely.

I'm building a site that's integrating SMF with another login system and I want users to only be able to change their password from the application, not from within SMF (I'm handling all the registration and password functions on the application end).

So...what's the best way to hide or remove the password fields in the user profile screen?

Kindred:
hiding it will only mask the potential problem...
What you should do, instead, is use the integration functions, so that a password change in your system or in SMF will be mirrored.

However... if you must do it, you can remove the display of the password field by commenting out the code in profile.template.php

MrMike:

--- Quote from: Kindred on June 22, 2012, 11:06:03 AM ---hiding it will only mask the potential problem...
What you should do, instead, is use the integration functions, so that a password change in your system or in SMF will be mirrored.
--- End quote ---

After a little thought I realized you were absolutely right- I was going about it the wrong way. And when I'm wrong, I'm wrong. :)

So...I've rewritten all the authentication, registration, and login functions to use the SMF user system.  Everything works with the exception of one or two minor snags.

The one thing I cannot seem to get around is the redirection to the forum upon login. I searched the forum here and I've tried loads of the suggested fixes, but none of them seem to work for me. No matter what I do, when a user logs in I want them to go to the site home page, but they're taken to the forum instead.

I've tried all the suggestions in this post and this post as well as several others. Using this line in the login form does not seem to work:

 $_SESSION['login_url'] = 'http://domain.com' . $_SERVER['PHP_SELF'];   

The code shown in the ssi_login() function page doesn't seem to work for me either.

I've tried all of the following with multiple variations, with and without the $_SESSION var (I include the SSI.php file before this code):


--- Code: ---ssi_login();    // nope

ssi_login('http://domain.com/');    // nope

$foo = 'http://domain.com/';
ssi_login($foo);      // nope
--- End code ---

I still can't redirect  the user no matter what I try.  What am I doing wrong??



Navigation

[0] Message Index

Go to full version