More minor fixes
This commit is contained in:
@@ -14,6 +14,7 @@ class Controller_Admin_Ssl extends Controller_Ssl {
|
||||
|
||||
protected $secure_actions = array(
|
||||
'add'=>3,
|
||||
'adduser'=>3,
|
||||
'edit'=>3,
|
||||
'list'=>3,
|
||||
'listchildca'=>3,
|
||||
@@ -29,6 +30,28 @@ class Controller_Admin_Ssl extends Controller_Ssl {
|
||||
->body($this->add_edit());
|
||||
}
|
||||
|
||||
public function action_adduser() {
|
||||
$so = ORM::factory('SSL');
|
||||
|
||||
if ($this->request->post()) {
|
||||
$so->account_id = (string)Auth::instance()->get_user();
|
||||
|
||||
// Set our values, so that our filters have data
|
||||
$so->values($this->request->post());
|
||||
|
||||
$this->save($so);
|
||||
|
||||
if ($so->saved())
|
||||
HTTP::redirect(URL::link('user','ssl/view/'.$so->id));
|
||||
}
|
||||
|
||||
Block::factory()
|
||||
->type('form-horizontal')
|
||||
->title('SSL Certificate')
|
||||
->title_icon('fa-certificate')
|
||||
->body(View::factory('ssl/admin/adduser')->set('o',$so)->set('mode','add'));
|
||||
}
|
||||
|
||||
public function action_edit() {
|
||||
list($id,$output) = Table::page(__METHOD__);
|
||||
|
||||
|
@@ -12,6 +12,7 @@
|
||||
class Model_SSL_CA extends Model_SSL {
|
||||
// Relationships
|
||||
protected $_belongs_to = array(
|
||||
'account'=>array(),
|
||||
'parent'=>array('model'=>'ssl_ca','foreign_key'=>'ssl_ca_id'),
|
||||
);
|
||||
protected $_has_many = array(
|
||||
|
@@ -329,7 +329,7 @@ abstract class lnApp_Model_SSL extends ORM {
|
||||
return $result;
|
||||
|
||||
$x = $this;
|
||||
while (! is_null($x->ssl_ca_id) AND $x->id != $x->ssl_ca_id AND $x=$x->ca)
|
||||
while (! is_null($x->ssl_ca_id) AND (! $x instanceof Model_SSL_CA OR $x->id != $x->ssl_ca_id) AND $x=$x->ca)
|
||||
array_push($result,$x);
|
||||
|
||||
return $result;
|
||||
|
18
modules/ssl/views/ssl/admin/adduser.php
Normal file
18
modules/ssl/views/ssl/admin/adduser.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<div class="row">
|
||||
<fieldset class="col-md-6">
|
||||
<legend>CSR Data</legend>
|
||||
<?php echo Form::textarea('csr',$o->csr,array('divclass'=>'col-md-12','placeholder'=>'Certificate Sign Request','style'=>'font-family: monospace; font-size: 95%;','rows'=>Form::textarea_rows($o->csr))); ?>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="col-md-6">
|
||||
<legend>Certificate Data</legend>
|
||||
<?php echo Form::textarea('cert',$o->cert,array('divclass'=>'col-md-12','placeholder'=>'Public Certificate','style'=>'font-family: monospace; font-size: 95%;','rows'=>Form::textarea_rows($o->cert))); ?>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-offset-1">
|
||||
<button type="submit" class="btn btn-primary">Save changes</button>
|
||||
<button type="button" class="btn btn-default">Cancel</button>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user