/** * Override the save module function so we can generate the private key and certificate * * @param mixed $settings * @param mixed $deleteFirst * @return boolean */ public function SaveModuleSettings($settings=array(), $deleteFirst=true) { // save settings if (!parent::SaveModuleSettings($settings, $deleteFirst)) { return false; } // update configuration file $this->UpdateConfig(); // create new private key and certificate if ($this->GenerateKeyAndCertificate()) { // cert was generated, notify user that they need to upload certificate in iDeal dashboard $this->SetError(GetLang('IdealCertGenerated', array('certFile' => GetConfig('ShopPath') . $this->_certFile))); } else { // Only possible to update issuers (requests) once certificate has been uploaded $this->UpdateIssuers(); } return !$this->HasErrors(); }
public function SaveModuleSettings($settings=array(), $deleteFirst=true) { // validate the prefix $prefix = trim($settings['referenceprefix']); if ($prefix) { $prefix = isc_strtoupper(isc_substr($prefix, 0, 1)); if (!preg_match("/[a-zA-Z0-9]/", $prefix)) { $this->SetError(GetLang('BPAYInvalidPrefix')); $prefix = ""; } } $settings['referenceprefix'] = $prefix; $return = parent::SaveModuleSettings($settings, $deleteFirst); if ($this->HasErrors()) { return false; } else { return $ret; } }