Fix abstract passwords in host/domain manage planel logins
This commit is contained in:
@@ -58,31 +58,26 @@ class Model_Service_Plugin_Host extends Model_Service_Plugin {
|
||||
->set('so',$this);
|
||||
}
|
||||
|
||||
public function username_value() {
|
||||
return $this->host_username;
|
||||
}
|
||||
|
||||
public function password_value() {
|
||||
return $this->host_password;
|
||||
}
|
||||
|
||||
/**
|
||||
* This provides us with a manage button to jump to the hosting server
|
||||
* to manage the domain.
|
||||
*/
|
||||
public function manage_button() {
|
||||
$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() {
|
||||
if (x++) { alert("Please refresh the page"); return false; }
|
||||
$.getJSON("'.URL::site('user/service/ajaxmanage/'.$this->service_id).'", { k: "'.$k.'" }, function(data) {
|
||||
$.each(data, function(key, val) { $("#"+key).val(val); });
|
||||
}).error(function() { alert("There was a problem with the request"); return false; }).success(function() { $("#manage").submit(); });
|
||||
});
|
||||
});'
|
||||
));
|
||||
public function manage_button($t='') {
|
||||
parent::manage_button($t);
|
||||
|
||||
// @todo Convert this to a Static_List display
|
||||
if ($this->service->queue == 'PROVISION')
|
||||
return _('To Be Provisioned');
|
||||
|
||||
return ($this->host_username AND $this->host_password) ? $this->host_server->manage_button($this->host_username,substr(md5($this->host_password),0,8),$this->name()) : '';
|
||||
return ($this->username_value() AND $this->password_value()) ? $this->host_server->manage_button($this,$t) : _('Please contact us');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user