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;
|
||||
|
Reference in New Issue
Block a user