public function beforeFilter(Event $event)
 {
     // Allow only the view and index actions.
     //debug($event->subject()->request->params['action']); die;
     if ($this->Auth != null) {
         $this->Auth->allow(['media']);
         // $this->Auth->allow(['explore']);
     }
     if (!($event->subject()->request->params['action'] == 'media')) {
         parent::beforeFilter($event);
     }
 }
 public function initialize()
 {
     parent::initialize();
     $this->loadComponent('RequestHandler');
 }