News:

Join the Facebook Fan Page.

Main Menu

Member info

Started by 0x00000000, August 02, 2018, 04:06:01 PM

Previous topic - Next topic

0x00000000

Hi,

At the login attempt I tried to check user's data.
Well, there is code
$user = $context['default_username'];
loadMemberData($user, true, 'normal');
loadMemberContext($user);


After this I use this to echo some data
$memberContext[$user]['avatar']['href'];

Problem is that I won't get any info about member.. Any idea how it can be done?
Thanks in advance.

Arantor

What are you trying to check where?

0x00000000

At the login attempt via username input I need to check for example his avatar and show inside form for login.
To explain: When I enter wrong password, near this error message I need to show avatar or something else data of this member.


Arantor

Um... why?

If I were a member of your forum and I realised you did this, I'd actually be removing my account because it actually leaks data about a user that they didn't know before.

0x00000000

It's something like a Google login or Facebook login..

Arantor

And both of them have long been condemned by security experts for doing the same thing.

0x00000000

My question is about showing user avatar at the wrong password attempt..
I try to learn how to use loadMemberData and show it. I would be very grateful to tell me a one of methods to do this.

Cheers.

Arantor

Yes, and I'm saying this is fundamentally a bad idea and not to do it. (And I'm formerly of the dev team of SMF. It's not like this hasn't been suggested before.)

That said I assume your problem is that you're not bringing $memberContext into scope, and you're assuming every user has an avatar.

Advertisement: