Fix abstract passwords in host/domain manage planel logins
This commit is contained in:
@@ -49,14 +49,16 @@ class Model_Service extends ORMOSB {
|
||||
/**
|
||||
* Return the object of the product plugin
|
||||
*/
|
||||
public function plugin() {
|
||||
public function plugin($type='') {
|
||||
if (! $this->product->prod_plugin_file)
|
||||
return NULL;
|
||||
|
||||
if (! is_numeric($this->product->prod_plugin_data))
|
||||
throw new Kohana_Exception('Missing plugin_id for :product (:type)',array(':product'=>$this->product->id,':type'=>$this->product->prod_plugin_file));
|
||||
|
||||
return ORM::factory(sprintf('service_plugin_%s',$this->product->prod_plugin_file),array('service_id'=>$this->id));
|
||||
$o = ORM::factory(sprintf('service_plugin_%s',$this->product->prod_plugin_file),array('service_id'=>$this->id));
|
||||
|
||||
return $type ? $o->$type : $o;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -36,6 +36,37 @@ abstract class Model_Service_Plugin extends ORMOSB {
|
||||
*/
|
||||
abstract public function service_view();
|
||||
|
||||
/**
|
||||
* The table attributes that provide username/password values
|
||||
*/
|
||||
abstract public function username_value();
|
||||
abstract public function password_value();
|
||||
|
||||
public function manage_button() {
|
||||
static $k = '';
|
||||
|
||||
// If $k is already set, we've rendered this JS
|
||||
if ($k)
|
||||
return;
|
||||
|
||||
$k = Random::char();
|
||||
Session::instance()->set('manage_button',$k);
|
||||
|
||||
Script::add(array('type'=>'stdin','data'=>'
|
||||
$(document).ready(function() {
|
||||
var x=0;
|
||||
$("button[name=submit]").click(function() {
|
||||
var t=$(this).val().split(":");
|
||||
if (x++) { alert("Please refresh the page"); return false; }
|
||||
$.getJSON("'.URL::site('user/service/ajaxmanage/'.$this->service_id).'", { k: "'.$k.'",t: t[1] }, function(data) {
|
||||
$.each(data, function(key, val) { $("#"+key+"_"+t[0]+"_"+t[1]).val(val); });
|
||||
}).error(function() { alert("There was a problem with the request"); return false; }).success(
|
||||
function() { $("form[id=id_"+t[0]+"_"+t[1]+"]").submit(); });
|
||||
});
|
||||
});'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get specific service details for use in other modules
|
||||
* For Example: Invoice
|
||||
|
Reference in New Issue
Block a user