Created
April 15, 2011 13:41
-
-
Save suissa/921711 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class User_Bootstrap extends Engine_Application_Bootstrap_Abstract | |
{ | |
public function __construct($application) | |
{ | |
parent::__construct($application); | |
// Add view helper and action helper paths | |
$this->initViewHelperPath(); | |
$this->initActionHelperPath(); | |
// Add main user javascript | |
//$headScript = new Zend_View_Helper_HeadScript(); | |
//$headScript->appendFile('application/modules/User/externals/scripts/core.js'); | |
// Get viewer | |
$viewer = Engine_Api::_()->user()->getViewer(); | |
// Check if they were disabled | |
if( $viewer->getIdentity() && !$viewer->enabled ) { | |
Engine_Api::_()->user()->getAuth()->clearIdentity(); | |
Engine_Api::_()->user()->setViewer(null); | |
} | |
// Check user online state | |
$table = Engine_Api::_()->getDbtable('online', 'user'); | |
$table->check($viewer); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment