Page 1 of 1

CustomContent $ccuser->property() not working [SOLVED]

Posted: Wed Apr 30, 2008 9:56 am
by Russ
CustomContent 1.5
FrontEndUsers 1.4.2
CMS Made Simple 1.2.4 "Greenland"
Local Install PHP 5, Apache 2 Mac 10.5.2

CustomContent $ccuser->property() does not appear to be working
Pages not cached, anyway it's in templates, so not problem with '->' being changed by WYSIWYG

These work...
{$ccuser->memberof('Group')}
{$customcontent_loginname}

Any using the property values don't seem to work {$ccuser->property('propertyname')}
e.g.
{$ccuser->property('firstname')} or {$ccuser->property('surname')}

I've also tried assigning variables, just in case e.g.
{capture assign='first_name'}{$ccuser->property('firstname')}{/capture}
{$first_name}

Am I doing something wrong or is it a bug report? Anyone with a quick fix?

Russ

SOLUTION:
It would seem that even if you are logged in, you still have to wrap the '{$ccuser->property('firstname')} ' stuff in
{if $ccuser->loggedin()}
{$ccuser->property('firstname')}
{/if}
Just putting {$ccuser->property('firstname')} will not work, at least not for me. Looking at the code it seems you have to use the loggedin function otherwise the '_uid' variable stays at -1 and does not get the real user id. Doesn't seem logical to me but it may be by design so i don't know if it is a bug or not?

Russ

Re: CustomContent $ccuser->property() not working [SOLVED]

Posted: Wed Jan 14, 2009 12:29 am
by kendo451
I just tested this in CustomContent 1.5.2 and it works fine, without being preceded by any other calls to CustomContent or FEU.

{$ccuser->property('firstname')}

Could be a bug that was fixed between 1.5.0 and 1.5.2.