Fix abstract passwords in host/domain manage planel logins
This commit is contained in:
@@ -14,14 +14,14 @@ class Model_Domain_Registrar extends ORMOSB {
|
||||
/**
|
||||
* The button that provides a login to the Registrar to manage the domain license
|
||||
*/
|
||||
public function manage_button($u,$p,$d) {
|
||||
public function manage_button(Model_Service_Plugin_Domain $spdo,$t) {
|
||||
$c = sprintf('Service_Domain_%s',$this->file);
|
||||
if (! class_exists($c))
|
||||
return '';
|
||||
|
||||
$po = new $c($this->id);
|
||||
|
||||
return $po->manage_button($u,$p,$d);
|
||||
return $po->manage_button($spdo,$t);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@@ -57,16 +57,26 @@ class Model_Service_Plugin_Domain extends Model_Service_Plugin {
|
||||
->set('so',$this);
|
||||
}
|
||||
|
||||
public function username_value() {
|
||||
return $this->registrar_username;
|
||||
}
|
||||
|
||||
public function password_value() {
|
||||
return $this->registrar_password;
|
||||
}
|
||||
|
||||
/**
|
||||
* This provides us with a manage button to jump to the registrar
|
||||
* to manage the domain.
|
||||
*/
|
||||
public function manage_button() {
|
||||
return ($this->registrar_username AND $this->registrar_password) ? $this->domain_registrar->manage_button($this->registrar_username,$this->registrar_password,$this->name()) : _('Please contact us');
|
||||
public function manage_button($t='') {
|
||||
parent::manage_button($t);
|
||||
|
||||
return ($this->username_value() AND $this->password_value()) ? $this->domain_registrar->manage_button($this,$t) : _('Please contact us');
|
||||
}
|
||||
|
||||
public function manage_dns_button() {
|
||||
return $this->service_plugin_host->manage_button();
|
||||
return $this->service_plugin_host->manage_button('service_plugin_host');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@@ -37,7 +37,7 @@ abstract class Service_Domain {
|
||||
/**
|
||||
* Our HTML button that will enable us to manage this domain.
|
||||
*/
|
||||
abstract public function manage_button($u,$p,$d);
|
||||
abstract public function manage_button(Model_Service_Plugin_Domain $spdo,$t);
|
||||
|
||||
/**
|
||||
* Return an instance of this class
|
||||
|
@@ -16,17 +16,18 @@ class Service_Domain_TPP extends Service_Domain {
|
||||
private $login_pass_field = 'password';
|
||||
|
||||
// Our required abstract classes
|
||||
public function manage_button($u,$p,$d) {
|
||||
public function manage_button(Model_Service_Plugin_Domain $spdo,$t) {
|
||||
$debug = FALSE;
|
||||
$output = '';
|
||||
|
||||
$output .= Form::open(
|
||||
sprintf('%s/%s',$this->so->whitelabel_url,'execute/logon'),
|
||||
array('target'=>'tpp','method'=>'post')
|
||||
$debug ? 'debug/site' : sprintf('%s/%s',$this->so->whitelabel_url,'execute/logon'),
|
||||
array('target'=>'tpp','method'=>'post','id'=>sprintf('id_%s_%s',$spdo->service_id,$t))
|
||||
);
|
||||
$output .= Form::input($this->login_user_field,$u,array('type'=>'hidden'));
|
||||
$output .= Form::input($this->login_pass_field,$p,array('type'=>'hidden'));
|
||||
$output .= Form::button('submit',_('Manage'),array('class'=>'form_button'));
|
||||
$output .= Form::input($this->login_user_field,$spdo->username_value(),array('type'=>'hidden','id'=>sprintf('u_%s_%s',$spdo->service_id,$t)));
|
||||
$output .= Form::input($this->login_pass_field,substr(md5($spdo->password_value()),0,8),array('type'=>'hidden','id'=>sprintf('p_%s_%s',$spdo->service_id,$t)));
|
||||
$output .= Form::close();
|
||||
$output .= Form::button('submit',_('Manage'),array('class'=>'form_button','value'=>sprintf('%s:%s',$spdo->service_id,$t)));
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
Reference in New Issue
Block a user