Skip to content

Instantly share code, notes, and snippets.

@suissa
Created April 15, 2011 13:41
Show Gist options
  • Save suissa/921711 to your computer and use it in GitHub Desktop.
Save suissa/921711 to your computer and use it in GitHub Desktop.
<?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