Example #1
0
 /**
  * Send a simple mail to a user, headers like "From" are set automatically
  * 
  * @param string $to
  * @param string $subject
  * @param string $message
  * @return boolean
  */
 public static function send($to, $subject, $message)
 {
     $setup = Tx_Ajaxlogin_Utility_TypoScript::getSetup();
     $setup = Tx_Extbase_Utility_TypoScript::convertTypoScriptArrayToPlainArray($setup);
     if (empty($setup['settings']['notificationMail']['from'])) {
         throw new Exception('[Ajaxlogin]: No sender was set in the plugin TS setup', 876421);
     }
     $headers = array('From: ' . $setup['settings']['notificationMail']['from']);
     return array($headers, $to, $subject, $message);
     return t3lib_div::plainMailEncoded($to, $subject, $message, implode(LF, $headers));
 }
 public function isValid($value)
 {
     $setup = Tx_Ajaxlogin_Utility_TypoScript::getSetup();
     $setup = Tx_Extbase_Utility_TypoScript::convertTypoScriptArrayToPlainArray($setup);
     $object = trim($this->options['object']);
     $property = trim($this->options['property']);
     $pattern = trim($setup['settings']['validation'][$object][$property]['pattern']);
     $message = trim($setup['settings']['validation'][$object][$property]['message']);
     if (!preg_match($pattern, $value)) {
         $this->addError($message, 1307626687);
         return false;
     }
     return true;
 }
Example #3
0
 protected static function initialize()
 {
     $objectManager = t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager');
     self::$configurationManager = $objectManager->get('Tx_Extbase_Configuration_ConfigurationManager');
 }