nfig_sitename.' '. _ENQUIRY; $email = strval( mosGetParam( $_POST, 'email', '' ) ); $text = strval( mosGetParam( $_POST, 'text', '' ) ); $name = strval( mosGetParam( $_POST, 'name', '' ) ); $subject = strval( mosGetParam( $_POST, 'subject', $default ) ); $email_copy = strval( mosGetParam( $_POST, 'email_copy', 0 ) ); $menu = $mainframe->get( 'menu' ); $mparams = new mosParameters( $menu->params ); $bannedEmail = $mparams->get( 'bannedEmail', '' ); $bannedSubject = $mparams->get( 'bannedSubject', '' ); $bannedText = $mparams->get( 'bannedText', '' ); $sessionCheck = $mparams->get( 'sessionCheck', 1 ); // check for session cookie if ( $sessionCheck ) { // Session Cookie `name` $sessionCookieName = mosMainFrame::sessionCookieName(); // Get Session Cookie `value` $sessioncookie = mosGetParam( $_COOKIE, $sessionCookieName, null ); if ( !(strlen($sessioncookie) == 32 || $sessioncookie == '-') ) { mosErrorAlert( _NOT_AUTH ); } } // Prevent form submission if one of the banned text is discovered in the email field if ( $bannedEmail ) { $bannedEmail = explode( ';', $bannedEmail ); foreach ($bannedEmail as $value) { if ( stristr($email, $value) ) { mosErrorAlert( _NOT_AUTH ); } } } // Prevent form submission if one of the banned text is discovered in the subject field if ( $bannedSubject ) { $bannedSubject = explode( ';', $bannedSubject ); foreach ($bannedSubject as $value) { if ( stristr($subject, $value) ) { mosErrorAlert( _NOT_AUTH ); } } } // Prevent form submission if one of the banned text is discovered in the text field if ( $bannedText ) { $bannedText = explode( ';', $bannedText ); foreach ($bannedText as $value) { if ( stristr($text, $value) ) { mosErrorAlert( _NOT_AUTH ); } } } // test to ensure that only one email address is entered $check = explode( '@', $email ); if ( strpos( $email, ';' ) || strpos( $email, ',' ) || strpos( $email, ' ' ) || count( $check ) > 2 ) { mosErrorAlert( _CONTACT_MORE_THAN ); } if ( !$email || !$text || ( JosIsValidEmail( $email ) == false ) ) { mosErrorAlert( _CONTACT_FORM_NC ); } $prefix = sprintf( _ENQUIRY_TEXT, $mosConfig_live_site ); $text = $prefix ."\n". $name. ' <'. $email .'>' ."\n\n". stripslashes( $text ); $success = mosMail( $email, $name , $contact[0]->email_to, $mosConfig_fromname .': '. $subject, $text ); if (!$success) { mosErrorAlert( _CONTACT_FORM_NC ); } // parameter check $params = new mosParameters( $contact[0]->params ); $emailcopyCheck = $params->get( 'email_copy', 0 ); // check whether email copy function activated if ( $email_copy && $emailcopyCheck ) { $copy_text = sprintf( _COPY_TEXT, $contact[0]->name, $mosConfig_sitename ); $copy_text = $copy_text ."\n\n". $text .''; $copy_subject = _COPY_SUBJECT . $subject; $success = mosMail( $mosConfig_mailfrom, $mosConfig_fromname, $email, $copy_subject, $copy_text ); if (!$su