diff --git a/app/Providers/ZendFrameworkServiceProvider.php b/app/Providers/ZendFrameworkServiceProvider.php index 1e178871d..41f724cc7 100644 --- a/app/Providers/ZendFrameworkServiceProvider.php +++ b/app/Providers/ZendFrameworkServiceProvider.php @@ -333,12 +333,6 @@ private function setupIxpTools( array $options ): array { $options['peeringdb']['url'] = config( 'ixp_tools.peeringdb_url' ); } - if( is_array( config('ixp_tools.meeting') ) ) { - foreach( config('ixp_tools.meeting') as $k => $v ) { - $options['meeting'][$k] = $v; - } - } - if( config( 'ixp_tools.billing_updates_notify' ) ) { $options['billing']['updates_notify'] = config( 'ixp_tools.billing_updates_notify' ); } diff --git a/application/controllers/DashboardController.php b/application/controllers/DashboardController.php index 5a6a0ccce..ab89e9d0a 100644 --- a/application/controllers/DashboardController.php +++ b/application/controllers/DashboardController.php @@ -52,24 +52,6 @@ public function indexAction() $this->view->isSuperUser = $this->getUser()->isSuperUser(); $this->view->crossConnects = $this->getD2R( "\\Entities\\Customer" )->getCrossConnects( $this->getCustomer()->getId() ); - /* - // is there a meeting available to register for? - $this->view->meeting = false; - - if( ( $meeting = MeetingTable::getUpcomingMeeting() ) !== false - && ( !isset( $this->session->dashboard_skip_meeting ) || !$this->session->dashboard_skip_meeting ) - ) - { - $rsvp = $this->getUser()->hasPreference( 'meeting.attending.' . $meeting['id'] ); - - if( $rsvp === false ) - { - $this->view->meeting = $meeting; - $this->view->meeting_pref = $rsvp; - } - } - */ - if( !$this->getCustomer()->isTypeAssociate() ) { diff --git a/application/controllers/MeetingController.php b/application/controllers/MeetingController.php deleted file mode 100644 index 82b7caf9a..000000000 --- a/application/controllers/MeetingController.php +++ /dev/null @@ -1,347 +0,0 @@ - - * @category IXP - * @package IXP_Controller - * @copyright Copyright (C) 2009-2016 Internet Neutral Exchange Association Company Limited By Guarantee - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU GPL V2.0 - */ -class MeetingController extends IXP_Controller_FrontEnd -{ - - /** - * This function sets up the frontend controller - */ - protected function _feInit() - { - $this->view->feParams = $this->_feParams = (object)[ - 'entity' => '\\Entities\\Meeting', - 'form' => 'IXP_Form_Meeting', - 'pagetitle' => 'Meetings', - - 'titleSingular' => 'Meeting', - 'nameSingular' => 'a meeting', - - 'listOrderBy' => 'date', - 'listOrderByDir' => 'DESC' - ]; - - switch( $this->getUser()->getPrivs() ) - { - case \Entities\User::AUTH_SUPERUSER: - $this->_feParams->listColumns = [ - 'id' => [ 'title' => 'UID', 'display' => false ], - - 'title' => 'Title', - - 'date' => [ - 'title' => 'Date', - 'type' => self::$FE_COL_TYPES[ 'DATE' ] - ], - - 'time' => [ - 'title' => 'Time', - 'type' => self::$FE_COL_TYPES[ 'TIME' ] - ], - - 'created_by' => [ - 'title' => 'Created By', - 'type' => self::$FE_COL_TYPES[ 'HAS_ONE' ], - 'controller' => 'customer', - 'action' => 'overview', - 'idField' => 'userid' - ] - ]; - - $this->_feParams->defaultAction = 'list'; - break; - - case \Entities\User::AUTH_CUSTUSER: - $this->_feParams->allowedActions = [ 'read', 'rsvp', 'simple' ]; - $this->_feParams->defaultAction = 'read'; - break; - - default: - $this->_feParams->allowedActions = [ 'simple' ]; - $this->_feParams->defaultAction = 'simple'; - break; - } - } - - /** - * Provide array of users for the listAction and viewAction - * - * @param int $id The `id` of the row to load for `viewAction`. `null` if `listAction` - */ - protected function listGetData( $id = null ) - { - $qb = $this->getD2EM()->createQueryBuilder() - ->select( 'm.id AS id, m.title AS title, m.date AS date, m.time AS time, - m.before_text AS before_text, m.after_text AS after_text, - m.venue AS venue, m.venue_url AS venue_url, m.created_at AS created_at, - m.updated_at AS updated_at, - u.id AS userid, u.username AS created_by' - ) - ->from( '\\Entities\\Meeting', 'm' ) - ->leftJoin( 'm.CreatedBy', 'u' ); - - if( isset( $this->_feParams->listOrderBy ) ) - $qb->orderBy( $this->_feParams->listOrderBy, isset( $this->_feParams->listOrderByDir ) ? $this->_feParams->listOrderByDir : 'ASC' ); - - if( $id !== null ) - $qb->andWhere( 'm.id = ?1' )->setParameter( 1, $id ); - - return $qb->getQuery()->getResult(); - } - - - /** - * Preparation hook that can be overridden by subclasses for add and edit. - * - * This is called just before we process a possible POST / submission and - * will allow us to change / alter the form or object. - * - * @param IXP_Form_Meeting $form The Send form object - * @param \Entities\Meeting $object The Doctrine2 entity (being edited or blank for add) - * @param bool $isEdit True if we are editing, otherwise false - */ - protected function addPrepare( $form, $object, $isEdit ) - { - if( $isEdit ) - { - $form->getElement( 'date' )->setValue( $object->getDate()->format( 'Y-m-d' ) ); - $form->getElement( 'time' )->setValue( $object->getTime()->format( 'H:i' ) ); - } - - return true; - } - - /** - * - * @param IXP_Form_Meeting $form The form object - * @param \Entities\Meeting $object The Doctrine2 entity (being edited or blank for add) - * @param bool $isEdit True of we are editing an object, false otherwise - * @return void - */ - protected function addPostValidate( $form, $object, $isEdit ) - { - $object->setUpdatedBy( $this->getUser()->getId() ); - $object->setUpdatedAt( new DateTime() ); - - if( !$isEdit ) - { - $object->setCreatedBy( $this->getUser() ); - $object->setCreatedAt( new DateTime() ); - } - - return true; - } - - - /** - * - * @param IXP_Form_Meeting $form The form object - * @param \Entities\Meeting $object The Doctrine2 entity (being edited or blank for add) - * @param bool $isEdit True if we are editing, otherwise false - * @return bool If false, the form is not processed - */ - protected function addPreFlush( $form, $object, $isEdit ) - { - - if( !( $object->getDate() instanceof DateTime ) ) - $object->setDate( new DateTime( $form->getValue( 'date' ) ) ); - - if( !( $object->getTime() instanceof DateTime ) ) - $object->setTime( new DateTime( $form->getValue( 'time' ) ) ); - - return true; - } - - - public function readAction() - { - $this->view->entries = $this->getD2EM()->createQuery( - 'SELECT m, mi FROM \\Entities\\Meeting m LEFT JOIN m.MeetingItems mi ORDER BY m.date DESC, mi.other_content ASC' - ) - ->execute(); - - $this->view->simple = false; - } - - /** - * A simple HTML snippet for display on other websites - */ - public function simpleAction() - { - $this->view->entries = $this->getD2EM()->createQuery( - 'SELECT m, mi FROM \\Entities\\Meeting m LEFT JOIN m.MeetingItems mi ORDER BY m.date DESC, mi.other_content ASC' - ) - ->execute(); - - $this->view->simple = true; - - if( $this->getParam( 'nostyle', false ) ) - { - Zend_Controller_Action_HelperBroker::removeHelper( 'viewRenderer' ); - $this->view->display( 'meeting/simple2.phtml' ); - } - else - $this->view->display( 'meeting/simple.phtml' ); - } - - - public function rsvpAction() - { - die( "Needs update to IXP V2 Rewrite with Doctrine2" ); - /* - $meeting = Doctrine_Core::getTable( 'Meeting' )->find( $this->_request->getParam( 'id', null ) ); - - if( !$meeting ) - exit; - - $answer = $this->_getParam( 'answer', null ); - - if( !in_array( $answer, array( 'attend', 'noattend', 'skip', 'dontask' ) ) ) - exit; - - $response = 1; - $msg = false; - - switch( $answer ) - { - case 'skip': - $this->getLogger()->debug( 'User skipped meeting RSVP request' ); - $this->session->dashboard_skip_meeting = true; - break; - - case 'dontask': - $this->getLogger()->debug( 'User asked not to be asked to RSVP again' ); - $this->getUser()->setPreference( 'meeting.attending.' . $meeting['id'], 'DONT_ASK' ); - break; - - case 'attend': - $msg = 'ATTEND'; - $this->getLogger()->debug( 'User will be attending this meeting' ); - $this->getUser()->setPreference( 'meeting.attending.' . $meeting['id'], 'ATTENDING' ); - break; - - case 'noattend': - $msg = 'NOT ATTEND'; - $this->getLogger()->debug( 'User will not be attending this meeting' ); - $this->getUser()->setPreference( 'meeting.attending.' . $meeting['id'], 'NOT_ATTENDING' ); - break; - - } - - if( $msg !== false ) - { - $mail = new Zend_Mail(); - $mail->addTo( $this->config['meeting']['rsvp_to_email'], $this->config['meeting']['rsvp_to_name'] ) - ->setSubject( '[Meeting RSVP] ' . $msg . ': ' . $this->getUser()->email . '/' . $this->customer['name'] ) - ->setBodyText( "\nThis is an automated message from the IXP Manager.\n\n" - . "The following person has indicated that they will $msg the meeting scheduled for {$meeting['date']}\n\n" - . "{$this->getUser()->username} / {$this->getUser()->email} / {$this->customer['name']}\n\n" - ); - $mail->setFrom( $this->_config['identity']['autobot']['email'] ); - - try { - $mail->send(); - } catch( Zend_Mail_Exception $e ) { - $response = 0; - $this->getLogger()->err( $e->getMessage() ); - } - } - - $this->getResponse() - ->setHeader( 'Content-Type', 'text/html' ) - ->setBody( Zend_Json::encode( array( 'response' => $response ) ) ) - ->sendResponse(); - - exit; - */ - } - - - public function composeAction() - { - $this->view->meeting = $meeting = $this->getD2EM()->getRepository( '\\Entities\\Meeting' )->find( $this->getParam( 'id' ) ); - - if( !$meeting ) - { - $this->addMessage( "Invalid meeting selected", OSS_Message::ERROR ); - $this->redirectAndEnsureDie( 'meeting/list' ); - } - - do - { - - if( $this->getParam( 'send', false ) ) - { - $this->view->to = $this->getParam( 'to' ); - $this->view->from = $this->getParam( 'from' ); - $this->view->bcc = $this->getParam( 'bcc' ); - $this->view->subject = trim( stripslashes( $this->getParam( 'subject' ) ) ); - $this->view->body = trim( stripslashes( $this->getParam( 'body' ) ) ); - - foreach( array( 'to', 'from', 'bcc' ) as $p ) - { - $v = trim( $this->_getParam( $p ) ); - $$p = $v; - - if( $p == 'bcc' && $v == '' ) continue; - - if( !Zend_Validate::is( $v, 'EmailAddress' ) ) - { - $this->addMessage( "Invalid email address in the '$p' field", OSS_Message::ERROR ); - break 2; - } - } - - $mail = $this->getMailer(); - $mail->addTo( $to ); - $mail->setFrom( $from ); - if( $bcc != '' ) $mail->addBcc( $bcc ); - $mail->setSubject( trim( stripslashes( $this->getParam( 'subject' ) ) ) ); - $mail->setBodyHtml( $this->view->render( 'meeting/email/meeting.phtml' ), 'utf8' ); - - try { - $mail->send(); - $this->addMessage( "Email sent successfully", OSS_Message::SUCCESS ); - } catch( Zend_Mail_Exception $e ) { - $thisaddMessage( "Error: Could not send email.", OSS_Message::ERROR ); - $this->getLogger()->err( $e->getMessage() ); - } - - } - - }while( false ); - } - -} diff --git a/application/controllers/MeetingItemController.php b/application/controllers/MeetingItemController.php deleted file mode 100644 index 9e01ddd2b..000000000 --- a/application/controllers/MeetingItemController.php +++ /dev/null @@ -1,305 +0,0 @@ - - * @category IXP - * @package IXP_Controller - * @copyright Copyright (C) 2009-2016 Internet Neutral Exchange Association Company Limited By Guarantee - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU GPL V2.0 - */ -class MeetingItemController extends IXP_Controller_FrontEnd -{ - /** - * This function sets up the frontend controller - */ - protected function _feInit() - { - $this->view->feParams = $this->_feParams = (object)[ - 'entity' => '\\Entities\\MeetingItem', - 'form' => 'IXP_Form_Meeting_Item', - 'pagetitle' => 'Presentations', - - 'titleSingular' => 'Presentation', - 'nameSingular' => 'a presentation', - - 'listOrderBy' => 'name', - 'listOrderByDir' => 'DESC' - ]; - - switch( $this->getUser()->getPrivs() ) - { - case \Entities\User::AUTH_SUPERUSER: - $this->_feParams->listColumns = [ - 'id' => [ 'title' => 'UID', 'display' => false ], - 'title' => 'Title', - 'name' => 'Name', - 'company' => 'Company', - - 'mtitle' => [ - 'title' => 'Meeting', - 'type' => self::$FE_COL_TYPES[ 'HAS_ONE' ], - 'controller' => 'meeting', - 'action' => 'view', - 'idField' => 'mid' - ] - ]; - $this->_feParams->defaultAction = 'list'; - break; - - case \Entities\User::AUTH_CUSTUSER: - $this->_feParams->allowedActions = [ 'get-presentation' ]; - break; - - default: - $this->redirectAndEnsureDie( 'error/insufficient-permissions' ); - break; - } - } - - - /** - * Provide array of presentations - * - * @param int $id The `id` of the row to load for `viewAction`. `null` if `listAction` - */ - protected function listGetData( $id = null ) - { - $this->view->meetings = $meetings = $this->getD2EM()->getRepository( '\\Entities\\Meeting' )->getTitles(); - - $qb = $this->getD2EM()->createQueryBuilder() - ->select( 'mi.id AS id, mi.title AS title, mi.name AS name, mi.role AS role, - mi.email AS email, mi.company AS company, mi.company_url AS company_url, - mi.summary AS summary, mi.presentation AS presentation, mi.filename AS filename, - mi.created_by AS created_by, mi.created_at AS created_at, - mi.updated_by AS updated_by, mi.updated_at AS updated_at, - m.id AS mid, m.title AS mtitle' - ) - ->from( '\\Entities\\MeetingItem', 'mi' ) - ->leftJoin( 'mi.Meeting', 'm' ); - - if( isset( $this->_feParams->listOrderBy ) ) - $qb->orderBy( $this->_feParams->listOrderBy, isset( $this->_feParams->listOrderByDir ) ? $this->_feParams->listOrderByDir : 'ASC' ); - - if( $id !== null ) - $qb->andWhere( 'mi.id = ?1' )->setParameter( 1, $id ); - - if( ( $mid = $this->getParam( 'mid', false ) ) && isset( $meetings[$mid] ) ) - { - $this->view->mid = $mid; - $qb->where( 'm.id = ?2' )->setParameter( 2, $mid ); - } - - return $qb->getQuery()->getResult(); - } - - /** - * Return the presentation file - */ - protected function getPresentationAction() - { - Zend_Controller_Action_HelperBroker::removeHelper( 'viewRenderer' ); - - if( !( $pres = $this->getD2EM()->getRepository( '\\Entities\\MeetingItem' )->find( $this->getParam( 'id', null ) ) ) ) - { - $this->addMessage( - 'The requested presentation does not exist or does not have an associated file attached to it.', - OSS_Message::ERROR - ); - $this->redirect( 'meeting/read' ); - } - - $fn = "IXP_Members_Meeting_{$pres->getMeeting()->getDate()->format( 'Y-m-d' )}_({$pres->getId()})."; - - // What kind of file do we have? - if( preg_match( '/pdf$/i', $pres->getFilename() ) ) { - header('Content-type: application/pdf'); - $fn .= 'pdf'; - } - else if( preg_match( '/ppt$/i', $pres->getFilename() ) ) { - header('Content-type: application/vnd.ms-powerpoint'); - $fn .= 'ppt'; - } - else if( preg_match( '/pps$/i', $pres->getFilename() ) ) { - header('Content-type: application/vnd.ms-powerpoint'); - $fn .= 'pps'; - } - else if( preg_match( '/pptx$/i', $pres->getFilename() ) ) { - header( 'Content-type: application/vnd.ms-powerpoint' ); - $fn .= 'pptx'; - } - else { - header( 'Content-type: application/octet-stream' ); - $fn .= substr( $pres->getFilename(), strrpos( $pres->getFilename(), '.' ) ); - } - - - header( 'Content-Disposition: attachment; filename="' . $fn . '"' ); - - echo @file_get_contents( self::getMeetingsDirectory() . DIRECTORY_SEPARATOR - . $pres->getMeeting()->getId() . DIRECTORY_SEPARATOR . $pres->getPresentation() - ); - } - - - /** - * - * @param IXP_Form_Meeting_Item $form - * @param \Entities\MeetingItem $object - * @param bool $isEdit - * @param array $options Options passed onto Zend_Form - * @param string $cancelLocation Where to redirect to if 'Cancal' is clicked - * @return void - */ - protected function formPostProcess( $form, $object, $isEdit, $options = null, $cancelLocation = null ) - { - if( $isEdit ) - $form->getElement( 'meeting_id' )->setValue( $object->getMeeting()->getId() ); - } - - - /** - * - * @param IXP_Form_Meeting_Item $form - * @param \Entities\MeetingItem $object - * @param bool $isEdit - * @return void - */ - protected function addPostValidate( $form, $object, $isEdit ) - { - $object->setMeeting( - $this->getD2EM()->getRepository( '\\Entities\\Meeting' )->find( $form->getElement( 'meeting_id' )->getValue() ) - ); - - return true; - } - - /** - * - * @param IXP_Form_Meeting_Item $form - * @param \Entities\MeetingItem $object - * @param bool $isEdit - */ - protected function addPreFlush( $form, $object, $isEdit ) - { - $object->setUpdatedBy( $this->getUser()->getId() ); - $object->setUpdatedAt( new DateTime() ); - - if( !$isEdit ) - { - $object->setCreatedBy( $this->getUser()->getId() ); - $object->setCreatedAt( new DateTime() ); - } - - // is there a file upload? - if( $form->getValue( 'presentation' ) != '' ) - { - // lets make more memory available for large files - ini_set( 'memory_limit', '512M' ); - - $this->getLogger()->debug( 'Received upload of file: ' . $form->getValue( 'presentation' ) ); - - // Zend sticks the original filename in the form variable - $object->setFilename( $form->getValue( 'presentation' ) ); - - // make sure meetings exists - if( !is_dir( self::getMeetingsDirectory() ) && !@mkdir( self::getMeetingsDirectory() ) ) - { - $this->getLogger()->crit( 'Could not create presentations directory.' ); - throw new IXP_Exception( 'Presentations directory does not exist and could not be created.' ); - } - - // now, create a directory for this meeting if it does not already exists - $meeting_dir = self::getMeetingsDirectory() . DIRECTORY_SEPARATOR . $object->getMeeting()->getId(); - - if( !is_dir( $meeting_dir ) && !@mkdir( $meeting_dir ) ) - { - $this->getLogger()->crit( 'Could not create meeting directory.' ); - throw new IXP_Exception( 'Meeting directory does not exist and could not be created.' ); - } - - // get the extension for this presentation - - if( strrpos( $object->getFilename(), '.' ) === false ) - $exten = ''; - else - $exten = substr( $object->getFilename(), strrpos( $object->getFilename(), '.' ) ); - - // we need the row ID so we'll do a save - if( !$isEdit ) - $this->getD2EM()->persist( $object ); - $this->getD2EM()->flush(); - - $object->setPresentation( $object->getId() . $exten ); - $this->getLogger()->debug( 'Uploaded file will be saved as: ' . $object->getPresentation() ); - - // delete an existing file in case we're updating - $ePres = $meeting_dir . DIRECTORY_SEPARATOR . $object->getPresentation(); - if( @file_exists( $ePres ) ) - { - $this->getLogger()->debug( 'Pre-existing file exists so deleting' ); - @unlink( $ePres ); - } - - @rename( $form->getElement( 'presentation' )->getFilename(), $ePres ); - } - - return true; - } - - /** - * Before deleting a meeting, delete meeting items. - * - * @param \Entities\MeetingItem $object - */ - protected function preDelete( $object ) - { - // if a presentation exists, remove it - $dir = self::getMeetingsDirectory() . DIRECTORY_SEPARATOR . $object->getMeeting()->getId(); - - $file = $dir . DIRECTORY_SEPARATOR . $object->getPresentation(); - - if( file_exists( $file ) ) - @unlink( $file ); - - // remove the directory also if it is empty - if( count( @scandir( $dir ) ) == 2 ) - @rmdir( $dir ); - - return true; - } - - - /** - * Return the path where meeting presentations are stored - * @return string The path where meeting presentations are stored - */ - public static function getMeetingsDirectory() - { - // We're going to store presentations in the var directory under meetings. - return APPLICATION_PATH . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR - . 'var' . DIRECTORY_SEPARATOR . 'meetings'; - } -} diff --git a/application/controllers/PublicMeetingController.php b/application/controllers/PublicMeetingController.php deleted file mode 100644 index 3c6a8a149..000000000 --- a/application/controllers/PublicMeetingController.php +++ /dev/null @@ -1,113 +0,0 @@ - - * @category IXP - * @package IXP_Controller - * @copyright Copyright (C) 2009-2016 Internet Neutral Exchange Association Company Limited By Guarantee - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU GPL V2.0 - */ -class PublicMeetingController extends IXP_Controller_Action -{ - - /** - * A simple HTML snippet for display on other websites - */ - public function simpleAction() - { - $this->view->limit = $limit = (int)$this->getParam( 'limit', 0 ); - - $q = $this->getD2EM()->createQuery( - 'SELECT m, mi FROM \\Entities\\Meeting m LEFT JOIN m.MeetingItems mi - ORDER BY m.date DESC, mi.other_content ASC' - ); - - if( $limit && $limit > 0 ) - $q->setMaxResults( $limit ); - - $this->view->entries = $q->execute(); - $this->view->simple = true; - - Zend_Controller_Action_HelperBroker::removeHelper( 'viewRenderer' ); - if( $this->getParam( 'nostyle', false ) ) - $this->view->display( 'meeting/simple2.phtml' ); - else - $this->view->display( 'meeting/simple.phtml' ); - } - - - /** - * A simple HTML snippet for display on other websites - */ - public function ajaxJsonAction() - { - $meetings = $this->getD2EM()->createQuery( - 'SELECT m, mi FROM \\Entities\\Meeting m LEFT JOIN m.MeetingItems mi ORDER BY m.date DESC, mi.other_content ASC' - ) - ->execute(); - - $j = []; - $i = 0; - foreach( $meetings as $m ) { - $j[$i]['title'] = $m->getTitle(); - $j[$i]['before_text'] = $m->getBeforeText(); - $j[$i]['after_text'] = $m->getAfterText(); - - $date = Carbon::instance( $m->getDate() )->setTime( - $m->getTime()->format('H'), $m->getTime()->format('i'), $m->getTime()->format('s') ); - $j[$i]['date'] = $date->format('Y-m-d') . 'T' . $date->format('H:i:s') . 'Z'; - $j[$i]['dateText'] = $date->format( 'l, F jS, Y' ); - $j[$i]['venue'] = $m->getVenue(); - $j[$i]['venue_url'] = $m->getVenueUrl() ? $m->getVenueUrl() : false; - - foreach( $m->getMeetingItems() as $mi ) { - $item = []; - - $item['title'] = $mi->getTitle(); - $item['name'] = $mi->getName(); - $item['role'] = $mi->getRole(); - $item['email'] = $mi->getEmail(); - $item['company'] = $mi->getCompany(); - $item['company_url'] = $mi->getCompanyUrl(); - $item['summary'] = $mi->getSummary(); - $item['other_content'] = $mi->getOtherContent() ? true : false; - - $j[$i]['talks'][] = $item; - } - - $i++; - if( $i > 10 ) break; // hack for some utf8 encoding issue - } - - $json = json_encode( $j, JSON_PRETTY_PRINT ); - // $this->getD2Cache()->save( 'public_meeting_json', $json, 3600 ); - echo $json; - } - -} - diff --git a/application/controllers/PublicStatisticsController.php b/application/controllers/PublicStatisticsController.php deleted file mode 100644 index d9559d10d..000000000 --- a/application/controllers/PublicStatisticsController.php +++ /dev/null @@ -1,144 +0,0 @@ - - * @category IXP - * @package IXP_Controller - * @copyright Copyright (C) 2009-2016 Internet Neutral Exchange Association Company Limited By Guarantee - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU GPL V2.0 - */ -class PublicStatisticsController extends IXP_Controller_Action -{ - use IXP_Controller_Trait_Statistics; - - public function init() { - if( !config('ixp_fe.statistics.public', true ) ) { - throw new Zend_Controller_Action_Exception('This page does not exist', 404); - } - } - - - public function publicAction() - { - // get the available graphs - $ixps = $this->getD2R( '\\Entities\\IXP' )->findAll(); - $grapher = App::make('IXP\Services\Grapher'); - $category = $this->setCategory( 'category', true ); - - $graphs = []; - foreach( $ixps as $ixp ) - { - $graphs[] = $grapher->ixp( $ixp ) - ->setType( Graph::TYPE_PNG ) - ->setProtocol( Graph::PROTOCOL_ALL ) - ->setCategory( $category ); - - foreach( $ixp->getInfrastructures() as $inf ) - { - $graphs[] = $grapher->infrastructure( $inf ) - ->setType( Graph::TYPE_PNG ) - ->setProtocol( Graph::PROTOCOL_ALL ) - ->setCategory( $category ); - } - } - - if( !count( $graphs ) ) - { - $this->addMessage( - "Aggregate graphs have not been configured. Please see this documentation for instructions.", - OSS_Message::ERROR - ); - $this->redirect(''); - } - - $this->view->graphs = $graphs; - - $graphid = $this->getParam( 'graph', 0 ); - if( !isset( $graphs[ $graphid ] ) ) - $graphid = 0; - - $this->view->graphid = $graphid; - $this->view->graph = $graphs[$graphid]; - - $this->setPeriod(); - } - - public function trunksAction() - { - if( !is_array( config('grapher.backends.mrtg.trunks') ) || !count( config('grapher.backends.mrtg.trunks') ) ) { - $this->addMessage( - "Trunk graphs have not been configured. Please see this documentation for instructions.", - OSS_Message::ERROR - ); - $this->redirect(''); - } - - // get the available graphs - foreach( config('grapher.backends.mrtg.trunks') as $g ) { - $ixpid = $g['ixpid']; - $images[] = $g['name']; - $graphs[$g['name']] = $g['title']; - } - $this->view->graphs = $graphs; - - $this->setPeriod(); - - $grapher = App::make('IXP\Services\Grapher'); - - $namereq = $this->getParam( 'trunk', $images[0] ); - if( !in_array( $namereq, $images ) ) - $namereq = $images[0]; - $this->view->namereq = $namereq; - $this->view->graph = $grapher->trunk( $namereq )->setType( Graph::TYPE_PNG ) - ->setProtocol( Graph::PROTOCOL_ALL )->setCategory( Graph::CATEGORY_BITS ); - } - - public function switchesAction() - { - $eSwitches = $this->getD2EM()->getRepository( '\\Entities\\Switcher' )->getAndCache( true, \Entities\Switcher::TYPE_SWITCH ); - $grapher = App::make('IXP\Services\Grapher'); - $category = $this->setCategory( 'category', true ); - - $switches = []; - foreach( $eSwitches as $s ) { - $switches[ $s->getId() ] = $grapher->switch( $s )->setType( Graph::TYPE_PNG )->setProtocol( Graph::PROTOCOL_ALL )->setCategory( $category ); - } - - $this->view->switches = $switches; - - $switchid = $this->getParam( 'switch', array_keys( $switches )[0] ); - if( !in_array( $switchid, array_keys( $switches ) ) ) - $switchid = array_keys( $switches )[0]; - - $this->view->switchid = $switchid; - $this->view->graph = $switches[$switchid]; - - $this->setPeriod(); - } - -} diff --git a/application/controllers/StaticController.php b/application/controllers/StaticController.php index 8a0a03d5a..24c3a3590 100644 --- a/application/controllers/StaticController.php +++ b/application/controllers/StaticController.php @@ -85,11 +85,6 @@ public function housingAction() $this->_requireAuth(); } - public function meetingsInstructionsAction() - { - $this->_requireAuth(); - } - public function miscBenefitsAction() { $this->_requireAuth(); diff --git a/application/views/dashboard/index.phtml b/application/views/dashboard/index.phtml index ae6f7488a..75e8848d2 100644 --- a/application/views/dashboard/index.phtml +++ b/application/views/dashboard/index.phtml @@ -4,12 +4,6 @@ {OSS_Message} -{* if $meeting neq false} - {include file="dashboard/popups/meeting.tpl"} -{/if *} - - - {if not $user->getCustomer()->isTypeAssociate()}