Work on Email and other major consistency work
This commit is contained in:
@@ -116,44 +116,19 @@ class Controller_Reseller_SSL extends Controller_SSL {
|
||||
public function action_renew() {
|
||||
$so = ORM::factory('Service',Request::current()->param('id'));
|
||||
|
||||
if (! $so->loaded() OR ! Auth::instance()->authorised($so->account)) {
|
||||
SystemMessage::factory()
|
||||
->title('SSL Certificate not updated')
|
||||
->type('error')
|
||||
->body('Either the Service doesnt exist, or you are not authorised to see it');
|
||||
|
||||
HTTP::redirect('welcome');
|
||||
}
|
||||
if (! $so->loaded() OR ! Auth::instance()->authorised($so->account))
|
||||
throw HTTP_Exception::factory(403,'Service either doesnt exist, or you are not authorised to see it');
|
||||
|
||||
$so->plugin()->renew();
|
||||
|
||||
HTTP::redirect(URL::link('user','service/view/'.$so->id));
|
||||
}
|
||||
|
||||
private function add_edit($id=NULL,$output='') {
|
||||
$sco = ORM::factory('SSL_CA',$id);
|
||||
|
||||
if ($_POST) {
|
||||
// Entry updated
|
||||
if ($sco->values($_POST)->check()) {
|
||||
try {
|
||||
$sco->save();
|
||||
SystemMessage::factory()
|
||||
->title('Record updated')
|
||||
->type('success')
|
||||
->body(_('Your Charge record has been recorded/updated.'));
|
||||
|
||||
} catch (ORM_Validation_Exception $e) {
|
||||
$errors = $e->errors('models');
|
||||
|
||||
SystemMessage::factory()
|
||||
->title('Record NOT updated')
|
||||
->type('error')
|
||||
->body(join('<br/>',array_values($errors)));
|
||||
|
||||
$sco->reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($_POST AND $sco->values($_POST)->changed() AND ! ($this->save($sco)))
|
||||
$sco->reload();
|
||||
|
||||
return View::factory('ssl/reseller/add_edit')
|
||||
->set('o',$sco);
|
||||
|
Reference in New Issue
Block a user