0
votes

I have a website and within it, Social Engine 4.1.4 is just a sub-module. I am using the login system of Social Engine in my website. When a user login and then comes back to the site homepage, I want to show his login status. I mean, that if the user is logged in SE4, then I should greet him with his name. How can I do the same.

My site is not using Zend Framework. Since the session data is stored in the table engine4_core_session, I was thinking of a way to decode the serialized data column in some way by getting the specific user row through the *session_id*. I'm not getting the way to decode the data.

1

1 Answers

1
votes

Hi you get de name in socialengine 4 :

in the controller you get this:

 public function indexAction()
  {
     $viewer = Engine_Api::_()->user()->getViewer();
     $fields = Engine_Api::_()->fields()->getFieldsValuesByAlias($viewer);
     $this->view->name = $fields["first_name"] ." ". $fields["last_name"];
     $viewer->getTitle();
  }

in your view print this:

<h1><?php echo $this->name; ?></h1>