/**
  * @see Form::readFormParameters()
  */
 public function readFormParameters()
 {
     parent::readFormParameters();
     if (isset($_POST['subject'])) {
         $this->subject = StringUtil::trim($_POST['subject']);
     }
     if (isset($_POST['text'])) {
         $this->text = MessageUtil::stripCrap(StringUtil::trim($_POST['text']));
     }
     if (isset($_POST['activeTab'])) {
         $this->activeTab = $_POST['activeTab'];
     }
     // wysiwyg
     if (isset($_POST['wysiwygEditorMode'])) {
         $this->wysiwygEditorMode = intval($_POST['wysiwygEditorMode']);
     }
     if (isset($_POST['wysiwygEditorHeight'])) {
         $this->wysiwygEditorHeight = intval($_POST['wysiwygEditorHeight']);
     }
     // settings
     $this->enableSmilies = $this->enableHtml = $this->enableBBCodes = $this->parseURL = $this->showSignature = 0;
     if (isset($_POST['parseURL'])) {
         $this->parseURL = intval($_POST['parseURL']);
     }
     if (isset($_POST['enableSmilies'])) {
         $this->enableSmilies = intval($_POST['enableSmilies']);
     }
     $this->enableSmilies = intval($this->enableSmilies && WCF::getUser()->getPermission('user.' . $this->permissionType . '.canUseSmilies'));
     if (isset($_POST['enableHtml'])) {
         $this->enableHtml = intval($_POST['enableHtml']);
     }
     $this->enableHtml = intval($this->enableHtml && WCF::getUser()->getPermission('user.' . $this->permissionType . '.canUseHtml'));
     if (isset($_POST['enableBBCodes'])) {
         $this->enableBBCodes = intval($_POST['enableBBCodes']);
     }
     $this->enableBBCodes = intval($this->enableBBCodes && WCF::getUser()->getPermission('user.' . $this->permissionType . '.canUseBBCodes'));
     if (isset($_POST['showSignature'])) {
         $this->showSignature = intval($_POST['showSignature']);
     }
     // stop shouting
     if (StringUtil::length($this->subject) >= MESSAGE_SUBJECT_STOP_SHOUTING && StringUtil::toUpperCase($this->subject) == $this->subject) {
         $this->subject = StringUtil::wordsToUpperCase(StringUtil::toLowerCase($this->subject));
     }
 }
Exemplo n.º 2
0
 */
 $error = 0;
 if (!$_POST["subject"]) {
     $error++;
     $page .= "<center><br><font color=#FF0000>{$lang['No_Subject']}<br></font></center>";
 }
 if (!$_POST["text"]) {
     $error++;
     $page .= "<center><br><font color=#FF0000>{$lang['No_Text']}<br></font></center>";
 }
 if ($error == 0) {
     $page .= "<center><font color=#00FF00>Nachricht erfolgreich verschickt!<br></font></center>";
     require_once WCF_DIR . 'lib/data/message/bbcode/MessageParser.class.php';
     $parser = MessageParser::getInstance();
     $parser->setOutputType('text/html');
     $message = MessageUtil::stripCrap(StringUtil::trim($_POST['text']));
     $message = $parser->parse($message);
     //query para agregar un mensaje
     require_once LW_DIR . 'lib/data/message/MessageEditor.class.php';
     $recipentID = intval($_GET['id']);
     $subject = escapeString(StringUtil::encodeHTML($_POST['subject']));
     MessageEditor::create($recipentID, $subject, $message);
     /*doquery("INSERT INTO {{table}} SET
     				`message_owner`='".intval($_GET['id'])."',
     				`message_sender`='{$user['id']}',
     				`message_time`='".time()."',
     				`message_type`='1',
     				`message_from`='{$user['username']} [{$user['galaxy']}:{$user['system']}:{$user['planet']}]',
     				`message_subject`='".WCF::getDB()->escapeString(StringUtil::encodeHTML($_POST['subject']))."',
     				`message_text`='".WCF::getDB()->escapeString($message)."'"
     				,'messages');