AAAAhome/academiac/www/libraries/joomla/form/rules/email.php 0000644 00000005665 15137266554 0017373 0 ustar 00 tag for the form field object.
* @param mixed $value The form field value to validate.
* @param string $group The field name group control value. This acts as as an array container for the field.
* For example if the field has name="foo" and the group value is set to "bar" then the
* full field name would end up being "bar[foo]".
* @param JRegistry &$input An optional JRegistry object with the entire data set to validate against the entire form.
* @param object &$form The form object for which the field is being tested.
*
* @return boolean True if the value is valid, false otherwise.
*
* @since 11.1
* @throws JException on invalid rule.
*/
public function test(&$element, $value, $group = null, &$input = null, &$form = null)
{
// If the field is empty and not required, the field is valid.
$required = ((string) $element['required'] == 'true' || (string) $element['required'] == 'required');
if (!$required && empty($value))
{
return true;
}
// Test the value against the regular expression.
if (!parent::test($element, $value, $group, $input, $form))
{
return false;
}
// Check if we should test for uniqueness.
$unique = ((string) $element['unique'] == 'true' || (string) $element['unique'] == 'unique');
if ($unique)
{
// Get the database object and a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// Build the query.
$query->select('COUNT(*)');
$query->from('#__users');
$query->where('email = ' . $db->quote($value));
// Get the extra field check attribute.
$userId = ($form instanceof JForm) ? $form->getValue('id') : '';
$query->where($db->quoteName('id') . ' <> ' . (int) $userId);
// Set and query the database.
$db->setQuery($query);
$duplicate = (bool) $db->loadResult();
// Check for a database error.
if ($db->getErrorNum())
{
JError::raiseWarning(500, $db->getErrorMsg());
}
if ($duplicate)
{
return false;
}
}
return true;
}
}
home/academiac/www/libraries/joomla/html/html/email.php 0000644 00000006577 15137273700 0017200 0 ustar 00 ' . JText::_('JLIB_HTML_CLOAKING') . '' . "";
return $replacement;
}
/**
* Convert encoded text
*
* @param string $text Text to convert
*
* @return string The converted text.
*
* @since 11.1
*/
protected static function _convertEncoding($text)
{
$text = html_entity_decode($text);
// Replace vowels with character encoding
$text = str_replace('a', 'a', $text);
$text = str_replace('e', 'e', $text);
$text = str_replace('i', 'i', $text);
$text = str_replace('o', 'o', $text);
$text = str_replace('u', 'u', $text);
$text = htmlentities($text, ENT_QUOTES, 'UTF-8', false);
return $text;
}
}
home/academiac/www/administrator/components/com_chronoforms/form_actions/email/email.php 0000604 00000040122 15137274152 0026025 0 ustar 00 'Email', 'tooltip' => 'Send an E-mail message.');
function load($clear){
if($clear){
$action_params = array(
'to' => '',
'cc' => '',
'bcc' => '',
'subject' => '',
'fromname' => '',
'fromemail' => '',
'replytoname' => '',
'replytoemail' => '',
'enabled' => 0,
'action_label' => '',
'recordip' => 1,
'replace_nulls' => 0,
'attachments' => '',
'sendas' => 'html',
'content1' => 'Enter your email message content here manually or use the auto template generation button.',
'dto' => '',
'dcc' => '',
'dbcc' => '',
'dsubject' => '',
'dfromname' => '',
'dfromemail' => '',
'dreplytoname' => '',
'dreplytoemail' => '',
'encrypt_enabled' => 0,
'gpg_sec_key' => ''
);
}
return array('action_params' => $action_params);
}
function run($form, $actiondata){
$email_params = new JParameter($actiondata->params);
$email_body = $actiondata->content1;
ob_start();
eval("?>".$email_body);
$email_body = ob_get_clean();
//build email template from defined fields and posted fields
$replace_nulls = (bool)$email_params->get('replace_nulls', 0);
$email_body = $form->curly_replacer($email_body, $form->data, '.', $replace_nulls);
//add the IP if so
if($email_params->get('recordip', 1)){
if(strpos($email_body, '{IPADDRESS}') !== false){
}else{
$email_body .= "
\n\nSubmitted by {IPADDRESS}";
}
$email_body = str_replace('{IPADDRESS}', $_SERVER['REMOTE_ADDR'], $email_body);
}
if($email_params->get('sendas', "html") == "html"){
$email_body = "
| \n"; $output .= "\t\t\t".$this->field_replacer($field[$field['tag'].'_'.$field['type'].'_'.$field_id.'_code']); $output .= "\n\t\t | \n\t|
| \n"; $output .= "\t\t\t".'Hidden #'.$field_id; $output .= "\n\t\t | \n\t\t\n"; $output .= "\t\t\t".'{'.$field[$field['tag'].'_'.$field['type'].'_'.$field_id.'_input_name'].'}'; $output .= "\n\t\t | \n\t
| \n"; $output .= "\t\t\t".$field[$field['tag'].'_'.$field['type'].'_'.$field_id.'_label_text'].""; $output .= "\n\t\t | \n\t\t\n"; $output .= "\t\t\t".'{'.$field[$field['tag'].'_'.$field['type'].'_'.$field_id.'_input_name'].'}'; $output .= "\n\t\t | \n\t