Social engine is based on MVC structure so sometimes user wants only logged-in user can view some pages like 'Create a Blog' page only visible to logged-in user If non logged-in user trying to access that page than user redirect to require user login form.
For achieve this you need to add this following code in any controllers file under specific action:
if( !$this->_helper->requireUser->isValid() ) return;
Example: (Blog Module -> indexcontroller.php)
<?php
class Blog_IndexController extends Core_Controller_Action_Standard
{
public function createAction()
{
if( !$this->_helper->requireUser->isValid() ) return;
According to above example if any non logged-in user trying to access the blogs create page than user redirect to require user login form.
For achieve this you need to add this following code in any controllers file under specific action:
if( !$this->_helper->requireUser->isValid() ) return;
Example: (Blog Module -> indexcontroller.php)
<?php
class Blog_IndexController extends Core_Controller_Action_Standard
{
public function createAction()
{
if( !$this->_helper->requireUser->isValid() ) return;
According to above example if any non logged-in user trying to access the blogs create page than user redirect to require user login form.
0 Comments