} /* --- modul --- */ $list = false; $mod_title = 'mod.messages'; // obsah switch ($a) { /* --- nova zprava --- */ case 'new': // titulek $mod_title = 'mod.messages.new'; // odeslani if (isset($_POST['receiver'])) { // nacteni dat $receiver = _post('receiver'); $subject = _htmlStr(_wsTrim(_cutStr(_post('subject'), 22, false))); $text = _htmlStr(_wsTrim(_cutStr(_post('text'), 16384, false))); // kontrola a odeslani do { /* --- kontrola --- */ // text if ($text === '') { $message = _formMessage(2, $_lang['mod.messages.error.notext']); break; } // predmet if ($subject === '') { $message = _formMessage(2, $_lang['mod.messages.error.nosubject']); break; } // prijemce if ($receiver !== '') {
} // typ, domov, text $posttarget = intval($_POST['_posttarget']); $posttype = intval($_POST['_posttype']); $text = DB::esc(_htmlStr(_wsTrim(_cutStr($_POST['text'], $posttype != 4 ? 16384 : 255, false)))); // domovsky prispevek if ($posttype != 4) { _checkKeys('_POST', array('_xhome')); $xhome = intval($_POST['_xhome']); } else { $xhome = -1; } // predmet if ($xhome == -1 and $posttype != 4) { _checkKeys('_POST', array('subject')); $subject = DB::esc(_htmlStr(_wsTrim(_cutStr($_POST['subject'], $posttype == 5 ? 48 : 22, false)))); } else { $subject = ""; } // plugin flag if ($posttype == 8) { if (!isset($_POST['_pluginflag'])) { die; } $pluginflag = intval($_POST['_pluginflag']); } else { $pluginflag = 0; } // vyplneni prazdnych poli if ($subject == "" and $xhome == -1 and $posttype != 4) { $subject = "-";
if ($newpassword == $newpassword_confirm) { if ($newpassword != "") { $passwordchange = true; $newpassword = _md5Salt($newpassword); } else { $errors[] = $_lang['mod.settings.error.badnewpass']; } } else { $errors[] = $_lang['mod.settings.error.newpassnosame']; } } else { $errors[] = $_lang['mod.settings.error.badcurrentpass']; } } // note $note = DB::esc(_htmlStr(_wsTrim(mb_substr($_POST['note'], 0, 1024)))); // language if (_language_allowcustom) { $language = DB::esc(_anchorStr($_POST['language'], false)); if (!@file_exists(_indexroot . "plugins/languages/" . $language . ".php")) { $language = ""; } } // extend $extra = array(); _extend('call', 'mod.settings.submit', array('query' => &$extra, 'current_query' => $query, 'errors' => &$errors)); /* -- ulozeni nebo seznam chyb -- */ if (count($errors) == 0) { // extra polozky if (_loginright_administration) { $extra['wysiwyg'] = $wysiwyg;
if (!_checkboxLoad("delete")) { /* - uprava - */ // nacteni promennych // jmeno hosta if ($query['guest'] != "") { $guest = $_POST['guest']; if (mb_strlen($guest) > 24) { $guest = mb_substr($guest, 0, 24); } $guest = _anchorStr($guest, false); } else { $guest = ""; } $text = DB::esc(_htmlStr(_wsTrim(_cutStr($_POST['text'], $query['type'] != 4 ? 16384 : 255, false)))); if ($query['xhome'] == -1 and $query['type'] != 4) { $subject = DB::esc(_htmlStr(_wsTrim(_cutStr($_POST['subject'], $query['type'] == 5 ? 48 : 22, false)))); } else { $subject = ""; } // vyplneni prazdnych poli if ($subject == "" and $query['xhome'] == -1 and $query['type'] != 4) { $subject = "-"; } if ($guest == null and $query['guest'] != "") { $guest = $_lang['posts.anonym']; } // ulozeni if ($text != "") { DB::query("UPDATE `" . _mysql_prefix . "-posts` SET text='" . $text . "',subject='" . $subject . "'" . (isset($guest) ? ",guest='" . $guest . "'" : '') . " WHERE id=" . $id); define('_redirect_to', 'index.php?m=editpost&id=' . $id . '&saved'); return;