Example #1
0
function _HCM_mailform($adresa = "", $priloha = false, $predmet = null)
{
    // priprava
    $result = "";
    $_SESSION[_sessionprefix . 'hcm_' . SL::$hcmUid . '_mail_receiver'] = @implode(",", _arrayRemoveValue(@explode(";", trim($adresa)), ""));
    if (_boolean($priloha)) {
        $rfile = array($GLOBALS['_lang']['hcm.mailform.att'], "<input type='file' name='att' />");
        $att = true;
    } else {
        $rfile = array('');
        $att = false;
    }
    if (isset($predmet)) {
        $rsubject = " value='" . _htmlStr($predmet) . "'";
    } else {
        $rsubject = "";
    }
    $rcaptcha = _captchaInit();
    // zprava
    $msg = '';
    if (isset($_GET['hcm_mr_' . SL::$hcmUid])) {
        switch ($_GET['hcm_mr_' . SL::$hcmUid]) {
            case 1:
                $msg = _formMessage(1, $GLOBALS['_lang']['hcm.mailform.msg.done']);
                break;
            case 2:
                $msg = _formMessage(2, $GLOBALS['_lang']['hcm.mailform.msg.failure']);
                break;
            case 3:
                $msg = _formMessage(3, $GLOBALS['_lang']['hcm.mailform.msg.failure2']);
                break;
            case 4:
                $msg = _formMessage(3, $GLOBALS['_lang']['xsrf.msg']);
                break;
        }
    }
    // predvyplneni odesilatele
    if (_loginindicator) {
        $sender = _loginemail;
    } else {
        $sender = "&#64;";
    }
    $result .= "<div class='anchor'><a name='hcm_mform_" . SL::$hcmUid . "'></a></div>\n" . $msg . _formOutput("mform" . SL::$hcmUid, _indexroot . "remote/hcm/mform.php?_return=" . urlencode(_indexOutput_url) . ($att ? "' enctype='multipart/form-data" : ''), array(array($GLOBALS['_lang']['hcm.mailform.sender'], "<input type='text' class='inputsmall' name='sender' value='" . $sender . "' /><input type='hidden' name='fid' value='" . SL::$hcmUid . "' />"), array($GLOBALS['_lang']['posts.subject'], "<input type='text' class='inputsmall' name='subject'" . $rsubject . " />"), $rcaptcha, array($GLOBALS['_lang']['hcm.mailform.text'], "<textarea class='areasmall' name='text' rows='9' cols='33'></textarea>", true), $rfile), array("text", "sender"), $GLOBALS['_lang']['hcm.mailform.send']);
    return $result;
}
Example #2
0
                    $userdata = DB::query("SELECT email,password,salt,username FROM `" . _mysql_prefix . "-users` WHERE username='******' AND email='" . $email . "'");
                    if (DB::size($userdata) != 0) {
                        // odeslani emailu
                        $userdata = DB::row($userdata);
                        $link = _url . "/index.php?m=lostpass&link&user="******"&hash=" . md5($userdata['email'] . $userdata['salt'] . $userdata['password']);
                        $text_tags = array("*domain*", "*username*", "*link*", "*date*", "*ip*");
                        $text_contents = array(_getDomain(), $userdata['username'], $link, _formatTime(time()), _userip);
                        if (_mail($userdata['email'], str_replace('*domain*', _getDomain(), $_lang['mod.lostpass.mail.subject']), str_replace($text_tags, $text_contents, $_lang['mod.lostpass.mail.text']), "Content-Type: text/plain; charset=UTF-8\n" . _sysMailHeader())) {
                            $module .= _formMessage(1, $_lang['mod.lostpass.cmailsent']);
                            _iplogUpdate(7);
                            $sent = true;
                        } else {
                            $module .= _formMessage(3, $_lang['hcm.mailform.msg.failure2']);
                        }
                    } else {
                        $module .= _formMessage(2, $_lang['mod.lostpass.notfound']);
                    }
                } else {
                    $module .= _formMessage(2, $_lang['captcha.failure2']);
                }
            } else {
                $module .= _formMessage(3, str_replace('*limit*', _lostpassexpire / 60, $_lang['mod.lostpass.limit']));
            }
        }
        // formular
        if (!$sent) {
            $captcha = _captchaInit();
            $module .= _formOutput("lostpassform", "index.php?m=lostpass", array(array($_lang['login.username'], "<input type='text' name='username' class='inputsmall' maxlength='24'" . _restorePostValue('username') . " />"), array($_lang['global.email'], "<input type='text' name='email' class='inputsmall' " . _restorePostValue('email', '@') . " />"), $captcha), array("username", "email"), $_lang['global.send']);
        }
        break;
}
Example #3
0
if (_template_autoheadings == 1) {
    $module .= "<h1>" . $_lang['mod.editpost'] . "</h1><div class='hr'><hr /></div>";
}
// zpetny odkaz
$module .= "<p><a href='" . $backlink . "'>&lt; " . $_lang['global.return'] . "</a></p>";
// zprava
if (isset($_GET['saved']) and $message == "") {
    $message = _formMessage(1, $_lang['global.saved']);
}
$module .= $message;
// formular
if ($continue) {
    // pole
    $inputs = array();
    $module .= _jsLimitLength($query['type'] != 4 ? 16384 : 255, "postform", "text");
    if ($query['guest'] != "") {
        $inputs[] = array($_lang['posts.guestname'], "<input type='text' name='guest' class='inputsmall' value='" . $query['guest'] . "' />");
    }
    if ($query['xhome'] == -1 and $query['type'] != 4) {
        $inputs[] = array($_lang[$query['type'] != 5 ? 'posts.subject' : 'posts.topic'], "<input type='text' name='subject' class='input" . ($query['type'] == 5 ? 'medium' : 'small') . "' maxlength='" . ($query['type'] == 5 ? 48 : 22) . "' value='" . $query['subject'] . "' />");
    }
    $inputs[] = array($_lang['posts.text'], "<textarea name='text' class='areamedium' rows='5' cols='33'>" . $query['text'] . "</textarea>", true);
    // formoutput
    $module .= _formOutput('postform', 'index.php?m=editpost&amp;id=' . $id, $inputs, null, $_lang['global.save'], _getPostformControls("postform", "text", $nobbcode) . ($query['type'] != 6 || $query['xhome'] != -1 ? "<br /><br /><label><input type='checkbox' name='delete' value='1' /> " . $_lang['mod.editpost.delete'] . "</label>" : ''));
} else {
    /*neplatny vstup*/
    if (!$scriptbreak) {
        $module .= _formMessage(3, $_lang['global.badinput']);
        $found = false;
    }
}
Example #4
0
            $groupselect_items = DB::query("SELECT id,title FROM `" . _mysql_prefix . "-groups` WHERE `blocked`=0 AND reglist=1 ORDER BY title");
            if (DB::size($groupselect_items) != 0) {
                $groupselect_content = "";
                while ($groupselect_item = DB::row($groupselect_items)) {
                    $groupselect_content .= "<option value='" . $groupselect_item['id'] . "'" . ($groupselect_item['id'] == _defaultgroup ? " selected='selected'" : '') . ">" . $groupselect_item['title'] . "</option>\n";
                }
                $groupselect = array($_lang['global.group'], "<select name='group'>" . $groupselect_content . "</select>");
            }
        }
        // priprava podminek
        if (SL::$settings['rules'] != "") {
            $rules = array("<div class='hr'><hr /></div><h2>" . $_lang['mod.reg.rules'] . "</h2>" . SL::$settings['rules'] . "<br /><label><input type='checkbox' name='agreement' value='1'" . _checkboxActivate(isset($_POST['agreement'])) . " /> " . $_lang['mod.reg.rules.agreement'] . "</label><div class='hr'><hr /></div><br />", "", true);
        } else {
            $rules = array(null);
        }
        // formular
        $captcha = _captchaInit();
        $module .= "<p class='bborder'>" . $_lang['mod.reg.p'] . (_registration_confirm ? ' ' . $_lang['mod.reg.confirm.extratext'] : '') . "</p>";
        $module .= $message . _formOutput("regform", "index.php?m=reg", array(array($_lang['login.username'], "<input type='text' name='username' class='inputsmall' maxlength='24'" . _restorePostValue('username') . " />"), array($_lang['login.password'], "<input type='password' name='password' class='inputsmall' />"), array($_lang['login.password'] . " (" . $_lang['global.check'] . ")", "<input type='password' name='password2' class='inputsmall' />"), array($_lang['global.email'], "<input type='text' name='email' class='inputsmall' " . _restorePostValue('email', '@') . " />"), array($_lang['mod.settings.massemail'], "<input type='checkbox' name='massemail' value='1' checked='checked' /> " . $_lang['mod.settings.massemail.label']), $groupselect, $captcha, $rules), array("username", "email", "password", "password2"), $_lang['mod.reg.submit' . (_registration_confirm ? '2' : '')]);
        break;
        // uspesna registrace
    // uspesna registrace
    case 1:
        $module .= "<p>" . str_replace("*username*", $username, $_lang['mod.reg.done']) . "</p>";
        break;
        // odeslano potvrzeni
    // odeslano potvrzeni
    case 2:
        $module .= _formMessage(1, str_replace('*email*', $email, $_lang['mod.reg.confirm.sent']));
        break;
}
Example #5
0
function _HCM_sbox($id = null)
{
    // priprava
    $result = "";
    $id = intval($id);
    // nacteni dat shoutboxu
    $sboxdata = DB::query("SELECT * FROM `" . _mysql_prefix . "-sboxes` WHERE id=" . $id);
    if (DB::size($sboxdata) != 0) {
        $sboxdata = DB::row($sboxdata);
        $rcontinue = true;
    } else {
        $rcontinue = false;
    }
    // sestaveni kodu
    if ($rcontinue) {
        $result = "\n    <div class='anchor'><a name='hcm_sbox_" . SL::$hcmUid . "'></a></div>\n    <div class='sbox'>\n    <div class='sbox-content'>\n    " . ($sboxdata['title'] != "" ? "<div class='sbox-title'>" . $sboxdata['title'] . "</div>" : '') . "<div class='sbox-item'" . ($sboxdata['title'] == "" ? " style='border-top:none;'" : '') . ">";
        // formular na pridani
        if ($sboxdata['locked'] != 1 and _publicAccess($sboxdata['public'])) {
            // priprava bunek
            // $captcha = _captchaInit();
            if (!_loginindicator) {
                $inputs[] = array($GLOBALS['_lang']['posts.guestname'], "<input type='text' name='guest' class='sbox-input' maxlength='22' />");
            }
            $inputs[] = array($GLOBALS['_lang']['posts.text'], "<input type='text' name='text' class='sbox-input' maxlength='255' /><input type='hidden' name='_posttype' value='4' /><input type='hidden' name='_posttarget' value='" . $id . "' />");
            if (!_loginindicator) {
                $inputs[1][2] = true;
                // $inputs[] = $captcha;
            }
            $result .= _formOutput("hcm_sboxform_" . SL::$hcmUid, _indexroot . "remote/post.php?_return=" . urlencode(_indexOutput_url . "#hcm_sbox_" . SL::$hcmUid), $inputs, null, null);
        } else {
            if ($sboxdata['locked'] != 1) {
                $result .= $GLOBALS['_lang']['posts.loginrequired'];
            } else {
                $result .= "<img src='" . _templateImage("icons/lock.png") . "' alt='locked' class='icon' /> " . $GLOBALS['_lang']['posts.locked2'];
            }
        }
        $result .= "\n</div>\n<div class='sbox-posts'>";
        // vypis prispevku
        $sposts = DB::query("SELECT id,text,author,guest,time,ip FROM `" . _mysql_prefix . "-posts` WHERE home=" . $id . " AND type=4 ORDER BY id DESC");
        if (DB::size($sposts) != 0) {
            while ($spost = DB::row($sposts)) {
                // nacteni autora
                if ($spost['author'] != -1) {
                    $author = _linkUser($spost['author'], "post-author' title='" . _formatTime($spost['time']), false, false, 16, ":");
                } else {
                    $author = "<span class='post-author-guest' title='" . _formatTime($spost['time']) . ", ip=" . _showIP($spost['ip']) . "'>" . $spost['guest'] . ":</span>";
                }
                // odkaz na spravu
                if (_postAccess($spost)) {
                    $alink = " <a href='index.php?m=editpost&amp;id=" . $spost['id'] . "'><img src='" . _templateImage("icons/edit.png") . "' alt='edit' class='icon' /></a>";
                } else {
                    $alink = "";
                }
                // kod polozky
                $result .= "<div class='sbox-item'>" . $author . $alink . " " . _parsePost($spost['text'], true, false, false) . "</div>\n";
            }
        } else {
            $result .= "\n<div class='sbox-item'>" . $GLOBALS['_lang']['posts.noposts'] . "</div>\n";
        }
        $result .= "\n  </div>\n  </div>\n  </div>\n  ";
    }
    return $result;
}