User Attributes - how would I do this
Permalink
Looking at the docs I can see it's really simple to pull user attributes based on the logged in user, using the magic method.
What I'd like to do is pull attributes information for a user but not logged in.
I'd like to match domain called, with that stored against the user as a user attribute I've created, to get the UserID and all the other user attributes for that user, which will be used in site presentation and display.
The attributes tables are bit hard to fathom late on a friday afternoon, so I'm hoping someone more experienced with C5 can help me :-)
Thank you in advance.
What I'd like to do is pull attributes information for a user but not logged in.
I'd like to match domain called, with that stored against the user as a user attribute I've created, to get the UserID and all the other user attributes for that user, which will be used in site presentation and display.
The attributes tables are bit hard to fathom late on a friday afternoon, so I'm hoping someone more experienced with C5 can help me :-)
Thank you in advance.
something like
Thanks Mnkras, I did look at that, but I need to get the User info by the 'domain name' user attribute I created. The site will be accessed anomymously but the content and presentation will be dependent on the domain name being accessed, which will be matched against one set of user information of which the domain name will be a user attribute.
It sounds off the wall but using C5 in this way could save me a lot of time for a little portal solution I've been asked to build.
Hope you or anyone else can help.
It sounds off the wall but using C5 in this way could save me a lot of time for a little portal solution I've been asked to build.
Hope you or anyone else can help.
Not as bad as I thought. This is the SQL that will lookup on a custom attribute, domain name in this instance, and return the userID. Once you have the UserID, getting other parameters is simple, though I couldn't get magic methods to work.
<?php $qry = "Select uID from atdefault myvals, attributekeys mykeys, userattributevalues vk where (mykeys.akID = vk.akID) "; $qry.= "and (myvals.avID = vk.avID) and mykey.akHandle = 'businessWebsiteURI' and myvals.value='". $accessDomain ."';"; ?>