Added Node Session
This commit is contained in:
@@ -52,5 +52,41 @@ class Controller_Node extends Controller_TemplateDefault_View {
|
||||
$this->response->headers('Content-Type','application/json');
|
||||
$this->response->body($google->json());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return details of a specific node SESSION in the ACTIVITY LOG
|
||||
* @param $id NODE,SESSION_ID,SESSION_START_DATE
|
||||
*/
|
||||
public function action_session() {
|
||||
$id = $this->request->param('id');
|
||||
|
||||
if (substr_count($id,',') != 2) {
|
||||
SystemMessage::add(array(
|
||||
'title'=>_('Invalid ID'),
|
||||
'body'=>sprintf(_('The session ID %s is invalid'),$id),
|
||||
'type'=>'error',
|
||||
));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
list($nid,$sid,$start) = explode(',',$id,3);
|
||||
|
||||
$no = ORM::factory('NODE',$nid);
|
||||
if (! $no->loaded()) {
|
||||
SystemMessage::add(array(
|
||||
'title'=>_('Invalid Node'),
|
||||
'body'=>sprintf(_('The Node ID %s is invalid'),$nid),
|
||||
'type'=>'error',
|
||||
));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Block::add(array(
|
||||
'title'=>sprintf(_('Session %s Detail for Node %s'),$sid,$no->display('NODE_NAME')),
|
||||
'body'=>View::factory(sprintf('%s/clientsession',strtolower($this->request->controller())))->set('o',$no->actlog_session($sid,$start)),
|
||||
));
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user