This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/modules/ssl/classes/controller/admin/ssl.php

60 lines
1.5 KiB
PHP
Raw Normal View History

2011-12-16 23:31:35 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides Admin SSL functions
*
* @package OSB
* @subpackage SSL
* @category Controllers/Admin
* @author Deon George
* @copyright (c) 2010 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Controller_Admin_SSL extends Controller_TemplateDefault_Admin {
protected $secure_actions = array(
'list'=>TRUE,
'update'=>TRUE,
);
public function action_list() {
Block::add(array(
'title'=>_('SSL Services'),
'body'=>Table::display(
ORM::factory('ssl_ca')->find_all(),
25,
array(
'id'=>array('label'=>'ID','url'=>'admin/ssl/update/'),
'sign_cert'=>array('label'=>'Cert'),
'issuer()'=>array('label'=>'Issuer'),
'expires()'=>array('label'=>'Expires'),
),
array(
'page'=>TRUE,
'type'=>'select',
'form'=>'admin/ssl/update',
)),
));
}
public function action_update() {
$id = $this->request->param('id');
$so = ORM::factory('ssl_ca',$id);
if (! $so->loaded())
Request::current()->redirect('welcome/index');
if ($_POST) {
if (! $so->values($_POST)->update()->saved())
throw new Kohana_Exception('Failed to save updates to plugin data for record :record',array(':record'=>$so->id()));
}
Block::add(array(
'title'=>sprintf('%s %s:%s',_('Update SSL Service'),$so->id,$so->display('sign_cert')),
'body'=>View::factory('ssl/admin/update')
->set('so',$so)
->set('mediapath',Route::get('default/media'))
));
}
}
?>