Search

Friends

Atomspheric CO2 (PPM)

Archives

Blather

Uptime verified by Wormly.com

12 March 2013

Integrating Hero Framework accounts with Vanilla Forum using jsConnect

This is something of a hack, but it is pretty quick and easy. I've never used Smarty before, but it's pretty flexible (and slightly evil).

I put this in a Hero template called authenticate.thtml and mapped it to /authenticate. I installed the jsConnect module for Vanilla, set the secret and it was basically done. Seems to work for regular and embedded forums.

{strip} {assign var=secret value='985d2f9eb57a8b55db3c04c20272bce9308764b0'} {assign var=clientid value=$smarty.get.clientid} {assign var=callback value=$smarty.get.callback}

{if $loggedin} {assign var=member value=['uniqueid'=>$member.id,'name'=>$member.firstname|cat:' '|cat:$member.last_name, 'email'=>$member.email, 'roles'=>'member']} {assign var=empty value=ksort($member)}

{$member['signature'] = $member|@httpbuildquery|cat:$secret|@sha1}

{$member['clientid'] = $clientid} {else} {assign var=member value=['name'=>'', 'photourl'=>'']} {/if}

{$callback}({$member|@json_encode}) {/strip}

Comments

No comments yet.

Leave a comment

Sorry, the comment form is closed at this time.

0.064 seconds