Skip to content

Commit

Permalink
Merge branch 'add-as112-active-config-var' of git://github.com/rowant…
Browse files Browse the repository at this point in the history
…horpe/IXP-Manager into rowanthorpe-add-as112-active-config-var
  • Loading branch information
barryo committed Jun 29, 2015
2 parents 14497bf + 5ff31e2 commit ad6cf91
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 14 deletions.
9 changes: 9 additions & 0 deletions application/configs/application.ini.dist
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ reseller.enabled = true
;;
reseller.no_billing_for_resold_customers = true

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Specifies whether to display and enable control of AS112 functionality for customers
;;
;; See https://github.com/inex/IXP-Manager/wiki/AS112
;;

as112_ui_active = true

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; We use Minify to bundle and compress CSS and JS in
Expand Down
1 change: 1 addition & 0 deletions application/controllers/CustomerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ protected function formPostProcess( $form, $object, $isEdit, $options = null, $c

$form->enableResller( $this->resellerMode() );
$form->setMultiIXP( $this->multiIXP(), $isEdit );
$form->setAs112client( $this->as112UiActive(), $isEdit );

if( $this->resellerMode() )
{
Expand Down
4 changes: 2 additions & 2 deletions application/controllers/VlanInterfaceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ protected function _feInit()
'ipv6canping' => 'Monitoring Enabled via IPv6 ICMP',
'ipv4monitorrcbgp' => 'Monitor Route Collector IPv4 BGP Session',
'ipv6monitorrcbgp' => 'Monitor Route Collector IPv6 BGP Session',
'as112client' => 'AS112 Client',
'busyhost' => 'Busy Host?',
'notes' => 'Notes'
]
],
( $this->as112UiActive() ? ['as112client' => 'AS112 Client'] : [] )
);

break;
Expand Down
9 changes: 7 additions & 2 deletions application/views/customer/detail.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,13 @@
<td><strong>Route Server Client:</strong></td>
<td id="value">{if $vli->getRsclient()}Yes{else}No{/if}</td>
<td></td>
<td><strong>AS112 Client:</strong></td>
<td id="value">{if $vli->getAs112client()}Yes{else}No{/if}</td>
{if $as112UiActive}
<td><strong>AS112 Client:</strong></td>
<td id="value">{if $vli->getAs112client()}Yes{else}No{/if}</td>
{else}
<td></td>
<td></td>
{/if}
</tr>

</table>
Expand Down
6 changes: 4 additions & 2 deletions application/views/customer/overview-tabs/overview.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
<td colspan="2">
{if not $cust->isTypeAssociate()}
<span class="label label-{if $rsclient}success{else}important{/if}">RS Client</span>
&nbsp;&nbsp;&nbsp;
<span class="label label-{if $as112client}success{else}important{/if}">AS112</span>
{if $as112UiActive}
&nbsp;&nbsp;&nbsp;
<span class="label label-{if $as112client}success{else}important{/if}">AS112</span>
{/if}
{/if}
</td>
</tr>
Expand Down
9 changes: 7 additions & 2 deletions application/views/customer/overview-tabs/ports/port.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,13 @@
<td><strong>Route Server Client:</strong></td>
<td id="value">{if $vli->getRsclient()}Yes{else}No{/if}</td>
<td></td>
<td><strong>AS112 Client:</strong></td>
<td id="value">{if $vli->getAs112client()}Yes{else}No{/if}</td>
{if $as112UiActive}
<td><strong>AS112 Client:</strong></td>
<td id="value">{if $vli->getAs112client()}Yes{else}No{/if}</td>
{else}
<td></td>
<td></td>
{/if}
</tr>

</table>
Expand Down
4 changes: 3 additions & 1 deletion application/views/virtual-interface/forms/add-wizard.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
{$element->irrdbfilter}
{$element->mcastenabled}
{$element->rsclient}
{$element->as112client}
{if $as112UiActive}
{$element->as112client}
{/if}

</fieldset>

Expand Down
4 changes: 3 additions & 1 deletion application/views/vlan-interface/forms/vlan-interface.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

{$element->maxbgpprefix}
{$element->rsclient}
{$element->as112client}
{if $as112UiActive}
{$element->as112client}
{/if}
{$element->busyhost}

</div>
Expand Down
5 changes: 3 additions & 2 deletions library/IXP/Controller/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ public function __construct(
$this->view->registerClass( 'SWITCHPORT', '\\Entities\\SwitchPort' );
$this->view->registerClass( 'VLAN', '\\Entities\\Vlan' );

$this->view->resellerMode = $this->resellerMode();
$this->view->multiIXP = $this->multiIXP();
$this->view->resellerMode = $this->resellerMode();
$this->view->multiIXP = $this->multiIXP();
$this->view->as112UiActive = $this->as112UiActive();

if( $this->getAuth()->hasIdentity() && $this->getUser()->getPrivs() == Entities\User::AUTH_SUPERUSER )
$this->superUserSetup();
Expand Down
5 changes: 3 additions & 2 deletions library/IXP/Controller/CliAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ public function __construct(
$this->view->registerClass( 'SWITCHPORT', '\\Entities\\SwitchPort' );
$this->view->registerClass( 'VLAN', '\\Entities\\Vlan' );

$this->view->resellerMode = $this->resellerMode();
$this->view->multiIXP = $this->multiIXP();
$this->view->resellerMode = $this->resellerMode();
$this->view->multiIXP = $this->multiIXP();
$this->view->as112UiActive = $this->as112UiActive();
}


Expand Down
14 changes: 14 additions & 0 deletions library/IXP/Controller/Trait/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ protected function multiIXP()
return ( isset( $this->_options['multiixp']['enabled'] ) && $this->_options['multiixp']['enabled'] );
}

/**
* Checks if as112 is activated in the UI.
*
* To enable as112 in the UI set as112_ui_active to true in application.ini
*
* @see https://github.com/inex/IXP-Manager/wiki/AS112
*
* @return bool
*/
protected function as112UiActive()
{
return ( isset( $this->_options['as112_ui_active'] ) && $this->_options['as112_ui_active'] );
}


/**
* Loads a customer object via an optional posted / getted `shortname` parameter.
Expand Down

0 comments on commit ad6cf91

Please sign in to comment.