Example #1
0
 /**
  * Check configuration data by contacting FACT-Finder servers.
  *
  * @param array $configData
  *
  * @return array
  */
 public function checkConfigData($configData)
 {
     $dataArray = $this->_getCompleteFieldsetData($configData);
     $data = new Varien_Object($dataArray);
     $errors = array();
     if (stripos($data->getAddress(), 'http://') === 0 || strpos($data->getAddress(), '/') !== false) {
         $errors[] = Mage::helper('factfinder')->__('The server name should contain only the IP address or the domain - no "http://" or any slashes!');
     } elseif (!is_numeric($data->getPort())) {
         $errors[] = Mage::helper('factfinder')->__('The value for "port" must be an integer!');
     } elseif (intval($data->getPort()) < 80) {
         //is there any http port lower 80?
         $errors[] = Mage::helper('factfinder')->__('The value for "port" must be an integer greater or equals 80!');
     }
     if ($data->getAuthPassword() != '' && $data->getAuthUser() == '') {
         $errors[] = Mage::helper('factfinder')->__('A user name must be provided if a password is to be used.');
     }
     if (count($errors) == 0) {
         $checkStatusHandler = Mage::getSingleton('factfinder/handler_status', $dataArray);
         if (!$checkStatusHandler->checkStatus()) {
             $errors = $checkStatusHandler->getErrorMessages();
         }
     }
     return $errors;
 }