Ejemplo n.º 1
0
 /**
  * Renders the captcha check
  *
  * @param PMF_Captcha $captcha
  * @param string      $action
  * @param string      $legend
  * @param boolean     $auth
  *
  * @return string
  */
 public function renderCaptcha(PMF_Captcha $captcha, $action, $legend, $auth = false)
 {
     $html = '';
     if (true === $this->_config->get('spam.enableCaptchaCode') && is_null($auth)) {
         $html .= '<div class="form-group">';
         $html .= '    <label class="col-sm-4 control-label"></label>';
         $html .= '    <div class="col-sm-8">';
         $html .= '        <p class="form-control-static">';
         $html .= $captcha->printCaptcha($action);
         $html .= '        </p>';
         $html .= sprintf('<p class="help-block"><a id="captcha-button" data-action="%s">Refresh Captcha</a></p>', $action);
         $html .= '    </div>';
         $html .= '</div>';
         $html .= '<div class="form-group">';
         $html .= sprintf('<label class="col-sm-4 control-label">%s</label>', $legend);
         $html .= '    <div class="controls">';
         $html .= '        <div class="col-sm-4">';
         $html .= sprintf('<input type="text" name="captcha" id="captcha" size="%d" required class="form-control">', $captcha->caplength);
         $html .= '            <span class="input-group-btn"><i class="glyphicon glyphicon-refresh"></i></span>';
         $html .= '        </div>';
         $html .= '    </div>';
         $html .= '</div>';
     }
     return $html;
 }
 /**
  * Renders the captcha check
  *
  * @param PMF_Captcha $captcha
  * @param string      $action
  * @param string      $legend
  * @param boolean     $auth
  *
  * @return string
  */
 public function renderCaptcha(PMF_Captcha $captcha, $action, $legend, $auth = false)
 {
     $html = '';
     if (true === $this->_config->get('spam.enableCaptchaCode') && is_null($auth)) {
         $html .= '<div class="control-group">';
         $html .= '    <label class="control-label"></label>';
         $html .= '    <div class="controls">';
         $html .= $captcha->printCaptcha($action);
         $html .= '      </div>';
         $html .= '</div>';
         $html .= '<div class="control-group">';
         $html .= sprintf('<label class="control-label">%s</label>', $legend);
         $html .= '    <div class="controls">';
         $html .= '        <div class="input-append">';
         $html .= sprintf('<input type="text" name="captcha" id="captcha" size="%d" required>', $captcha->caplength);
         $html .= sprintf('<a class="btn" id="captcha-button" data-action="%s"><i class="icon-refresh"></i></a>', $action);
         $html .= '        </div>';
         $html .= '    </div>';
         $html .= '</div>';
     }
     return $html;
 }
Ejemplo n.º 3
0
 /**
  * Renders the main navigation
  *
  * @param string $legend Text of the HTML Legend element
  * @param string $img    HTML code for the Captcha image
  * @param string $error  Error message
  * 
  * @return string
  */
 public function renderCaptcha(PMF_Captcha $captcha, $action, $legend, $error = '')
 {
     $html = '';
     if (PMF_Configuration::getInstance()->get('spam.enableCaptchaCode')) {
         if ($error != '') {
             $html .= sprintf('<div class="error">%s</div>', $error);
         }
         $html .= sprintf('<div class="captchaInfo">%s:</div>', $legend);
         $html .= sprintf('<div class="captchaImage">%s', $captcha->printCaptcha($action));
         $html .= sprintf('<div class="captchaRefresh"><a href="javascript:;" onclick="refreshCaptcha(\'%s\');">%s</a></div>', $action, 'click to refresh');
         $html .= '&nbsp; &nbsp;' . sprintf('<input type="text" name="captcha" id="captcha" class="captcha" size="%d" required="required" /><br/>', $captcha->caplength);
         $html .= '</div>';
     }
     return $html;
 }
Ejemplo n.º 4
0
/**
* $Id: ask.php,v 1.3.2.5.2.9 2006/04/25 12:07:24 matteo Exp $
*
* @author       Thorsten Rinne <*****@*****.**>
* @since        2002-09-17
* @copyright    (c) 2001-2006 phpMyFAQ Team
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*/
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($db, $sids, $pmf->language, $_SERVER['HTTP_USER_AGENT'], $_SERVER['REMOTE_ADDR']);
if (isset($_GET['gen'])) {
    $captcha->showCaptchaImg();
    exit;
}
Tracking('ask_question', 0);
$tree->buildTree();
$tpl->processTemplate('writeContent', array('msgQuestion' => $PMF_LANG['msgQuestion'], 'msgNewQuestion' => $PMF_LANG['msgNewQuestion'], 'writeSendAdress' => $_SERVER['PHP_SELF'] . '?' . $sids . 'action=savequestion', 'msgNewContentName' => $PMF_LANG['msgNewContentName'], 'msgNewContentMail' => $PMF_LANG['msgNewContentMail'], 'defaultContentMail' => getEmailAddress(), 'defaultContentName' => getFullUserName(), 'msgAskCategory' => $PMF_LANG['msgAskCategory'], 'printCategoryOptions' => $tree->printCategoryOptions(), 'msgAskYourQuestion' => $PMF_LANG['msgAskYourQuestion'], 'captchaFieldset' => printCaptchaFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('ask'), $captcha->caplength), 'msgNewContentSubmit' => $PMF_LANG['msgNewContentSubmit']));
$tpl->includeTemplate('writeContent', 'index');
Ejemplo n.º 5
0
 * @author     Thorsten Rinne <*****@*****.**>
 * @since      2002-09-16
 * @version    SVN: $Id$
 * @copyright  2002-2009 phpMyFAQ Team
 *
 * The contents of this file are subject to the Mozilla Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$faqsession->userTracking('send2friend', 0);
$cat = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT);
$id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$artlang = PMF_Filter::filterInput(INPUT_GET, 'artlang', FILTER_SANITIZE_STRING);
$send2friendLink = sprintf('http://%s%s?action=artikel&amp;cat=%d&amp;id=%d&amp;artlang=%s', $_SERVER['HTTP_HOST'], $_SERVER['PHP_SELF'], $cat, $id, urlencode($artlang));
$tpl->processTemplate('writeContent', array('msgSend2Friend' => $PMF_LANG['msgSend2Friend'], 'writeSendAdress' => $_SERVER['PHP_SELF'] . '?' . $sids . 'action=mailsend2friend', 'msgS2FReferrer' => 'link', 'msgS2FName' => $PMF_LANG['msgS2FName'], 'msgS2FEMail' => $PMF_LANG['msgS2FEMail'], 'defaultContentMail' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('email') : '', 'defaultContentName' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('display_name') : '', 'msgS2FFriends' => $PMF_LANG['msgS2FFriends'], 'msgS2FEMails' => $PMF_LANG['msgS2FEMails'], 'msgS2FText' => $PMF_LANG['msgS2FText'], 'send2friend_text' => PMF_htmlentities($PMF_CONF['main.send2friendText'], ENT_QUOTES, $PMF_LANG['metaCharset']), 'msgS2FText2' => $PMF_LANG['msgS2FText2'], 'send2friendLink' => $send2friendLink, 'msgS2FMessage' => $PMF_LANG['msgS2FMessage'], 'captchaFieldset' => printCaptchaFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('send2friend'), $captcha->caplength), 'msgS2FButton' => $PMF_LANG['msgS2FButton']));
$tpl->includeTemplate('writeContent', 'index');
Ejemplo n.º 6
0
 * under the License.
 *
 * @category  phpMyFAQ
 * @package   Frontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @author    Lars Tiedemann <*****@*****.**>
 * @copyright 2002-2010 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
 * @link      http://www.phpmyfaq.de
 * @since     2002-08-27
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($sids);
$oGlossary = new PMF_Glossary();
$oLnk = new PMF_Linkverifier();
$tagging = new PMF_Tags();
$relevant = new PMF_Relation();
$faqrating = new PMF_Rating();
$comment = new PMF_Comment();
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$currentCategory = $cat;
$record_id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$solution_id = PMF_Filter::filterInput(INPUT_GET, 'solution_id', FILTER_VALIDATE_INT);
$highlight = PMF_Filter::filterInput(INPUT_GET, 'highlight', FILTER_SANITIZE_STRIPPED);
$faqsession->userTracking('article_view', $record_id);
Ejemplo n.º 7
0
 * The contents of this file are subject to the Mozilla Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * @category  phpMyFAQ
 * @package   Frontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @copyright 2002-2010 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
 * @link      http://www.phpmyfaq.de
 * @since     2002-09-16
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$faqsession->userTracking('contact', 0);
$captcha = new PMF_Captcha($db, $Language);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$tpl->processTemplate('writeContent', array('msgContact' => $PMF_LANG['msgContact'], 'msgContactOwnText' => nl2br($faqconfig->get('main.contactInformations')), 'msgContactEMail' => $PMF_LANG['msgContactEMail'], 'writeSendAdress' => '?' . $sids . 'action=sendmail', 'msgNewContentName' => $PMF_LANG['msgNewContentName'], 'msgNewContentMail' => $PMF_LANG['msgNewContentMail'], 'defaultContentMail' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('email') : '', 'defaultContentName' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('display_name') : '', 'msgMessage' => $PMF_LANG['msgMessage'], 'msgS2FButton' => $PMF_LANG['msgS2FButton'], 'version' => $faqconfig->get('main.currentVersion'), 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('contact'))));
$tpl->includeTemplate('writeContent', 'index');
Ejemplo n.º 8
0
 * 
 * @category  phpMyFAQ
 * @package   Freontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @since     2002-09-16
 * @copyright 2002-2010 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
 * @link      http://www.phpmyfaq.de
 * @since     2002-09-17
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$faqsession->userTracking('sendmail_contact', 0);
$captcha = new PMF_Captcha($sids);
$name = PMF_Filter::filterInput(INPUT_POST, 'name', FILTER_SANITIZE_STRING);
$email = PMF_Filter::filterInput(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL);
$question = PMF_Filter::filterInput(INPUT_POST, 'question', FILTER_SANITIZE_STRIPPED);
$code = PMF_Filter::filterInput(INPUT_POST, 'captcha', FILTER_SANITIZE_STRING);
// If e-mail address is set to optional
if (!PMF_Configuration::getInstance()->get('main.optionalMailAddress') && is_null($email)) {
    $email = PMF_Configuration::getInstance()->get('main.administrationMail');
}
if (!is_null($name) && !is_null($email) && !is_null($question) && IPCheck($_SERVER['REMOTE_ADDR']) && checkBannedWord(PMF_String::htmlspecialchars($question)) && $captcha->checkCaptchaCode($code)) {
    $mail = new PMF_Mail();
    $mail->unsetFrom();
    $mail->setFrom($email, $name);
    $mail->addTo($faqconfig->get('main.administrationMail'));
    $mail->subject = 'Feedback: %sitename%';
    $mail->message = $question;
Ejemplo n.º 9
0
 * under the License.
 *
 * @category  phpMyFAQ
 * @package   Frontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @copyright 2002-2010 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
 * @link      http://www.phpmyfaq.de
 * @since     2002-09-16
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$faqsession->userTracking('sendmail_send2friend', 0);
$captcha = new PMF_Captcha($sids);
$name = PMF_Filter::filterInput(INPUT_POST, 'name', FILTER_SANITIZE_STRING);
$mailfrom = PMF_Filter::filterInput(INPUT_POST, 'mailfrom', FILTER_VALIDATE_EMAIL);
$mailto = PMF_Filter::filterInputArray(INPUT_POST, array('mailto' => array('filter' => FILTER_VALIDATE_EMAIL, 'flags' => FILTER_REQUIRE_ARRAY | FILTER_NULL_ON_FAILURE)));
$link = PMF_Filter::filterInput(INPUT_POST, 'link', FILTER_VALIDATE_URL);
$attached = PMF_Filter::filterInput(INPUT_POST, 'zusatz', FILTER_SANITIZE_STRIPPED);
$code = PMF_Filter::filterInput(INPUT_POST, 'captcha', FILTER_SANITIZE_STRING);
if (!is_null($name) && !is_null($mailfrom) && is_array($mailto) && IPCheck($_SERVER['REMOTE_ADDR']) && checkBannedWord(PMF_String::htmlspecialchars($attached)) && $captcha->checkCaptchaCode($code)) {
    // Backward compatibility: extract article info from the link, no template change required
    $cat = $id = $artlang = null;
    preg_match('`index\\.php\\?action=artikel&cat=(?<cat>[\\d]+)&id=(?<id>[\\d]+)&artlang=(?<artlang>[^$]+)$`', $link, $matches);
    if (isset($matches['cat'])) {
        $cat = (int) $matches['cat'];
    }
    if (isset($matches['id'])) {
        $id = (int) $matches['id'];
Ejemplo n.º 10
0
 * @link      http://www.phpmyfaq.de
 * @since     2002-09-16
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    $protocol = 'http';
    if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') {
        $protocol = 'https';
    }
    header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
// Check user permissions
if (-1 === $user->getUserId() && !$faqConfig->get('records.allowNewFaqsForGuests')) {
    header('Location:' . $faqSystem->getSystemUri($faqConfig) . '?action=login');
}
$captcha = new PMF_Captcha($faqConfig);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
try {
    $faqsession->userTracking('new_entry', 0);
} catch (PMF_Exception $e) {
    // @todo handle the exception
}
// Get possible user input
$selectedQuestion = PMF_Filter::filterInput(INPUT_GET, 'question', FILTER_VALIDATE_INT);
$selectedCategory = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT);
$question = $readonly = '';
if (!is_null($selectedQuestion)) {
Ejemplo n.º 11
0
 * under the License.
 *
 * @category  phpMyFAQ
 * @package   Frontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @author    Matteo Scaramuccia <*****@*****.**>
 * @copyright 2006-2010 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
 * @link      http://www.phpmyfaq.de
 * @since     2006-07-23
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($db, $Language);
$comment = new PMF_Comment();
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$oNews = new PMF_News();
$news_id = PMF_Filter::filterInput(INPUT_GET, 'newsid', FILTER_VALIDATE_INT);
if (is_null($news_id)) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$faqsession->userTracking('news_view', $id);
// Define the header of the page
$writeNewsHeader = $faqconfig->get('main.titleFAQ') . $PMF_LANG['msgNews'];
Ejemplo n.º 12
0
<?php

/**
* $Id: contact.php,v 1.3.2.4.2.2 2006/04/25 12:07:24 matteo Exp $
*
* @author       Thorsten Rinne <*****@*****.**>
* @since        2002-09-16
* @copyright    (c) 2001-2006 phpMyFAQ Team
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*/
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
Tracking('contact', 0);
$captcha = new PMF_Captcha($db, $sids, $pmf->language, $_SERVER['HTTP_USER_AGENT'], $_SERVER['REMOTE_ADDR']);
if (isset($_GET['gen'])) {
    $captcha->showCaptchaImg();
    exit;
}
$tpl->processTemplate('writeContent', array('msgContact' => $PMF_LANG['msgContact'], 'msgContactOwnText' => unhtmlentities($PMF_CONF['msgContactOwnText']), 'msgContactEMail' => $PMF_LANG['msgContactEMail'], 'writeSendAdress' => $_SERVER['PHP_SELF'] . '?' . $sids . 'action=sendmail', 'msgNewContentName' => $PMF_LANG['msgNewContentName'], 'msgNewContentMail' => $PMF_LANG['msgNewContentMail'], 'defaultContentMail' => getEmailAddress(), 'defaultContentName' => getFullUserName(), 'msgMessage' => $PMF_LANG['msgMessage'], 'msgS2FButton' => $PMF_LANG['msgS2FButton'], 'version' => $PMF_CONF['version'], 'captchaFieldset' => printCaptchaFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('contact'), $captcha->caplength)));
$tpl->includeTemplate('writeContent', 'index');
Ejemplo n.º 13
0
 * 
 * @category  phpMyFAQ
 * @package   Frontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @author    Anatoliy Belsky <*****@*****.**>
 * @author    Jürgen Kuza <*****@*****.**>
 * @copyright 2002-2010 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
 * @link      http://www.phpmyfaq.de
 * @since     2002-09-17
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($db, $Language);
$captcha->setSessionId($sids);
$username = PMF_Filter::filterInput(INPUT_POST, 'username', FILTER_SANITIZE_STRING);
$usermail = PMF_Filter::filterInput(INPUT_POST, 'usermail', FILTER_VALIDATE_EMAIL);
$usercat = PMF_Filter::filterInput(INPUT_POST, 'rubrik', FILTER_VALIDATE_INT);
$content = PMF_Filter::filterInput(INPUT_POST, 'content', FILTER_SANITIZE_STRIPPED);
$code = PMF_Filter::filterInput(INPUT_POST, 'captcha', FILTER_SANITIZE_STRING);
$code = is_null($code) ? PMF_Filter::filterInput(INPUT_GET, 'code', FILTER_SANITIZE_STRING, 42) : $code;
$domail = PMF_Filter::filterInput(INPUT_GET, 'domail', FILTER_VALIDATE_INT);
$thankyou = PMF_Filter::filterInput(INPUT_GET, 'thankyou', FILTER_VALIDATE_INT);
// If e-mail address is set to optional
if (!PMF_Configuration::getInstance()->get('main.optionalMailAddress') && is_null($usermail)) {
    $usermail = PMF_Configuration::getInstance()->get('main.administrationMail');
}
function sendAskedQuestion($username, $usermail, $usercat, $content)
{
Ejemplo n.º 14
0
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * @category  phpMyFAQ
 * @package   Frontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @copyright 2002-2010 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
 * @link      http://www.phpmyfaq.de
 * @since     2002-09-16
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$faqsession->userTracking('send2friend', 0);
$cat = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT);
$id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$artlang = PMF_Filter::filterInput(INPUT_GET, 'artlang', FILTER_SANITIZE_STRIPPED);
$send2friendLink = sprintf('%s/index.php?action=artikel&amp;cat=%d&amp;id=%d&amp;artlang=%s', $faqconfig->get('main.referenceURL'), (int) $cat, (int) $id, urlencode($artlang));
$tpl->processTemplate('writeContent', array('msgSend2Friend' => $PMF_LANG['msgSend2Friend'], 'writeSendAdress' => '?' . $sids . 'action=mailsend2friend', 'msgS2FReferrer' => 'link', 'msgS2FName' => $PMF_LANG['msgS2FName'], 'msgS2FEMail' => $PMF_LANG['msgS2FEMail'], 'defaultContentMail' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('email') : '', 'defaultContentName' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('display_name') : '', 'msgS2FFriends' => $PMF_LANG['msgS2FFriends'], 'msgS2FEMails' => $PMF_LANG['msgS2FEMails'], 'msgS2FText' => $PMF_LANG['msgS2FText'], 'send2friend_text' => $faqconfig->get('main.send2friendText'), 'msgS2FText2' => $PMF_LANG['msgS2FText2'], 'send2friendLink' => $send2friendLink, 'msgS2FMessage' => $PMF_LANG['msgS2FMessage'], 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('send2friend')), 'msgS2FButton' => $PMF_LANG['msgS2FButton']));
$tpl->includeTemplate('writeContent', 'index');
Ejemplo n.º 15
0
 * under the License.
 *
 * @category  phpMyFAQ
 * @package   Frontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @author    Matteo Scaramuccia <*****@*****.**>
 * @copyright 2006-2012 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
 * @link      http://www.phpmyfaq.de
 * @since     2006-07-23
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($db, $Language);
$comment = new PMF_Comment();
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$oNews = new PMF_News($db, $Language);
$newsId = PMF_Filter::filterInput(INPUT_GET, 'newsid', FILTER_VALIDATE_INT);
if (is_null($newsId)) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$faqsession->userTracking('news_view', $id);
// Define the header of the page
$newsMainHeader = $faqconfig->get('main.titleFAQ') . $PMF_LANG['msgNews'];
Ejemplo n.º 16
0
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * @category  phpMyFAQ
 * @package   Frontend
 * @author    Matteo Scaramuccia <*****@*****.**>
 * @copyright 2006-2010 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
 * @link      http://www.phpmyfaq.de
 * @since     2006-11-12
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($db, $Language);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$translationLanguage = PMF_Filter::filterInput(INPUT_POST, 'translation', FILTER_SANITIZE_STRIPPED, $LANGCODE);
if (!PMF_Language::isASupportedLanguage($translationLanguage)) {
    $translationLanguage = $LANGCODE;
}
$faqSource['id'] = 'writeSourceFaqId';
$faqSource['lang'] = $translationLanguage;
$faqSource['title'] = 'writeSourceTitle';
$faqSource['content'] = 'writeSourceContent';
$faqSource['keywords'] = 'writeSourceKeywords';
$faqsession->userTracking('new_translation_entry', 0);
Ejemplo n.º 17
0
<?php

/**
* $Id: writecomment.php,v 1.3.2.6.2.7 2006/04/25 12:07:24 matteo Exp $
*
* @author       Thorsten Rinne <*****@*****.**>
* @since        2002-08-29
* @copyright    (c) 2001-2006 phpMyFAQ Team
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*/
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($db, $sids, $pmf->language, $_SERVER['HTTP_USER_AGENT'], $_SERVER['REMOTE_ADDR']);
if (isset($_GET['gen'])) {
    $captcha->showCaptchaImg();
    exit;
}
Tracking('write_comment', $_GET['id']);
$tpl->processTemplate('writeContent', array('msgCommentHeader' => $PMF_LANG['msgWriteComment'], 'writeSendAdress' => $_SERVER['PHP_SELF'] . '?' . $sids . 'action=savecomment', 'ID' => $_GET['id'], 'LANG' => $_GET['artlang'], 'writeThema' => getThema($_GET['id'], $_GET['artlang']), 'msgNewContentName' => $PMF_LANG['msgNewContentName'], 'msgNewContentMail' => $PMF_LANG['msgNewContentMail'], 'defaultContentMail' => getEmailAddress(), 'defaultContentName' => getFullUserName(), 'msgYourComment' => $PMF_LANG['msgYourComment'], 'msgNewContentSubmit' => $PMF_LANG['msgNewContentSubmit'], 'captchaFieldset' => printCaptchaFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('writecomment'), $captcha->caplength), 'copyright_eintrag' => unhtmlentities($PMF_CONF['copyright_eintrag'])));
$tpl->includeTemplate('writeContent', 'index');
Ejemplo n.º 18
0
 *
 * The contents of this file are subject to the Mozilla Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$faqsession->userTracking('new_entry', 0);
// Get possible user input
$inputQuestion = PMF_Filter::filterInput(INPUT_GET, 'question', FILTER_VALIDATE_INT);
$inputCategory = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT);
$question = $readonly = '';
if (!is_null($inputQuestion)) {
    $oQuestion = $faq->getQuestion($inputQuestion);
    $question = $oQuestion['question'];
    if (PMF_String::strlen($question)) {
        $readonly = ' readonly="readonly"';
    }
Ejemplo n.º 19
0
 * @package   Frontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @copyright 2002-2014 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
 * @link      http://www.phpmyfaq.de
 * @since     2002-09-16
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    $protocol = 'http';
    if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') {
        $protocol = 'https';
    }
    header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($faqConfig);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
try {
    $faqsession->userTracking('send2friend', 0);
} catch (PMF_Exception $e) {
    // @todo handle the exception
}
$cat = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT);
$id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$artlang = PMF_Filter::filterInput(INPUT_GET, 'artlang', FILTER_SANITIZE_STRIPPED);
$send2friendLink = sprintf('%s/index.php?action=artikel&amp;cat=%d&amp;id=%d&amp;artlang=%s', $faqConfig->get('main.referenceURL'), (int) $cat, (int) $id, urlencode($artlang));
$captchaHelper = new PMF_Helper_Captcha($faqConfig);
/**
 * Snippet for writing a comment
 *
 * PHP Version 5.3
 *
 * This Source Code Form is subject to the terms of the Mozilla Public License,
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
 * obtain one at http://mozilla.org/MPL/2.0/.
 *
 * @category  phpMyFAQ
 * @package   Frontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @copyright 2002-2015 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
 * @link      http://www.phpmyfaq.de
 * @since     2002-08-29
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    $protocol = 'http';
    if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') {
        $protocol = 'https';
    }
    header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($faqConfig);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
Ejemplo n.º 21
0
 * The contents of this file are subject to the Mozilla Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * @category  phpMyFAQ
 * @package   Frontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @copyright 2002-2010 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
 * @link      http://www.phpmyfaq.de
 * @since     2002-09-17
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$faqsession->userTracking('ask_question', 0);
$categoryLayout = new PMF_Category_Layout(new PMF_Category_Tree_Helper(new PMF_Category_Tree($categoryData)));
$tpl->processTemplate('writeContent', array('msgQuestion' => $PMF_LANG['msgQuestion'], 'msgNewQuestion' => $PMF_LANG['msgNewQuestion'], 'writeSendAdress' => '?' . $sids . 'action=savequestion', 'msgNewContentName' => $PMF_LANG['msgNewContentName'], 'msgNewContentMail' => $PMF_LANG['msgNewContentMail'], 'defaultContentMail' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('email') : '', 'defaultContentName' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('display_name') : '', 'msgAskCategory' => $PMF_LANG['msgAskCategory'], 'printCategoryOptions' => $categoryLayout->renderOptions(), 'msgAskYourQuestion' => $PMF_LANG['msgAskYourQuestion'], 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('ask')), 'msgNewContentSubmit' => $PMF_LANG['msgNewContentSubmit']));
$tpl->includeTemplate('writeContent', 'index');
 * This Source Code Form is subject to the terms of the Mozilla Public License,
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
 * obtain one at http://mozilla.org/MPL/2.0/.
 *
 * @category  phpMyFAQ
 * @package   Frontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @author    Elger Thiele <*****@*****.**>
 * @copyright 2008-2015 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
 * @link      http://www.phpmyfaq.de
 * @since     2008-01-25
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    $protocol = 'http';
    if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') {
        $protocol = 'https';
    }
    header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$faqsession->userTracking('registration', 0);
$captcha = new PMF_Captcha($faqConfig);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$captchaHelper = new PMF_Helper_Captcha($faqConfig);
$tpl->parse('writeContent', array('msgRegistration' => $PMF_LANG['msgRegistration'], 'msgRegistrationCredentials' => $PMF_LANG['msgRegistrationCredentials'], 'msgRegistrationNote' => $PMF_LANG['msgRegistrationNote'], 'lang' => $LANGCODE, 'loginname' => $PMF_LANG["ad_user_loginname"], 'realname' => $PMF_LANG["ad_user_realname"], 'email' => $PMF_LANG["ad_entry_email"], 'submitRegister' => $PMF_LANG['submitRegister'], 'captchaFieldset' => $captchaHelper->renderCaptcha($captcha, 'register', $PMF_LANG['msgCaptcha'], $auth)));
$tpl->merge('writeContent', 'index');
Ejemplo n.º 23
0
require_once 'lang/language_en.php';
if (PMF_Language::isASupportedLanguage($ajaxlang)) {
    $languageCode = trim($ajaxlang);
    require_once 'lang/language_' . $languageCode . '.php';
} else {
    $languageCode = 'en';
    require_once 'lang/language_en.php';
}
//Load plurals support for selected language
$plr = new PMF_Language_Plurals($PMF_LANG);
//
// Initalizing static string wrapper
//
PMF_String::init($languageCode);
// Check captcha
$captcha = new PMF_Captcha($db, $Language);
//$captcha->setSessionId($sids);
// Send headers
$http = PMF_Helper_Http::getInstance();
$http->setContentType('application/json');
$http->addHeader();
// Set session
$faqsession = new PMF_Session($db, $Language);
$network = new PMF_Network();
if (!$network->checkIp($_SERVER['REMOTE_ADDR'])) {
    $message = array('error' => $PMF_LANG['err_bannedIP']);
}
if ('savevoting' !== $action && !$captcha->checkCaptchaCode($code)) {
    $message = array('error' => $PMF_LANG['msgCaptcha']);
}
if (isset($message['error'])) {
Ejemplo n.º 24
0
 * License for the specific language governing rights and limitations
 * under the License.
 * 
 * @category  phpMyFAQ
 * @package   Frontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @copyright 2002-2010 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
 * @link      http://www.phpmyfaq.de
 * @since     2002-09-16
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($db, $Language);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$faqsession->userTracking('new_entry', 0);
// Get possible user input
$inputQuestion = PMF_Filter::filterInput(INPUT_GET, 'question', FILTER_VALIDATE_INT);
$inputCategory = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT);
$question = $readonly = '';
if (!is_null($inputQuestion)) {
    $faqQuestions = new PMF_Faq_Questions();
    $question = $faqQuestions->fetch($inputQuestion);
    if (PMF_String::strlen($question->question)) {
        $readonly = ' readonly="readonly"';
Ejemplo n.º 25
0
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
// Settings
$selectSize = 10;
$defaultUserAction = 'list';
$defaultUserStatus = 'blocked';
$loginMinLength = 4;
$loginInvalidRegExp = '/(^[^a-z]{1}|[\\W])/i';
$errorMessages = array('addUser_password' => $PMF_LANG['ad_user_error_password'], 'addUser_passwordsDontMatch' => $PMF_LANG['ad_user_error_passwordsDontMatch'], 'addUser_loginExists' => $PMF_LANG["ad_adus_exerr"], 'addUser_loginInvalid' => $PMF_LANG['ad_user_error_loginInvalid'], 'addUser_noEmail' => $PMF_LANG['ad_user_error_noEmail'], 'addUser_noRealName' => $PMF_LANG['ad_user_error_noRealName'], 'delUser' => $PMF_LANG['ad_user_error_delete'], 'delUser_noId' => $PMF_LANG['ad_user_error_noId'], 'delUser_protectedAccount' => $PMF_LANG['ad_user_error_protectedAccount'], 'updateUser' => $PMF_LANG['ad_msg_mysqlerr'], 'updateUser_noId' => $PMF_LANG['ad_user_error_noId'], 'updateRights' => $PMF_LANG['ad_msg_mysqlerr'], 'updateRights_noId' => $PMF_LANG['ad_user_error_noId']);
$captcha = new PMF_Captcha($sids);
$loginname = PMF_Filter::filterInput(INPUT_POST, 'loginname', FILTER_SANITIZE_STRING);
$lastname = PMF_Filter::filterInput(INPUT_POST, 'lastname', FILTER_SANITIZE_STRING);
$email = PMF_Filter::filterInput(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL);
$code = PMF_Filter::filterInput(INPUT_POST, 'captcha', FILTER_SANITIZE_STRING);
if (!$captcha->checkCaptchaCode($code)) {
    $captchaError = $PMF_LANG['captchaError'];
}
if (!is_null($loginname) && !is_null($lastname) && !is_null($email) && !isset($captchaError)) {
    $user = new PMF_User();
    $message = '';
    $messages = array();
    // check input data
    $user_name = $loginname;
    $user_realname = $lastname;
    $user_password = '';
Ejemplo n.º 26
0
 * 
 * @category  phpMyFAQ 
 * @package   Frontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @author    Jürgen Kuza <*****@*****.**>
 * @author    Matteo Scaramuccia <*****@*****.**>
 * @copyright 2002-2010 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
 * @link      http://www.phpmyfaq.de
 * @since     2002-09-16
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($sids);
$username = PMF_Filter::filterInput(INPUT_POST, 'username', FILTER_SANITIZE_STRING);
$usermail = PMF_Filter::filterInput(INPUT_POST, 'usermail', FILTER_VALIDATE_EMAIL);
$faqid = PMF_Filter::filterInput(INPUT_POST, 'faqid', FILTER_VALIDATE_INT);
$faqlanguage = PMF_Filter::filterInput(INPUT_POST, 'faqlanguage', FILTER_SANITIZE_STRING);
$thema = PMF_Filter::filterInput(INPUT_POST, 'thema', FILTER_SANITIZE_STRIPPED);
$content = PMF_Filter::filterInput(INPUT_POST, 'content', FILTER_SANITIZE_STRIPPED);
$tr_content = PMF_Filter::filterInput(INPUT_POST, 'translated_content', FILTER_SANITIZE_STRING);
$contentlink = PMF_Filter::filterInput(INPUT_POST, 'contentlink', FILTER_VALIDATE_URL);
$keywords = PMF_Filter::filterInput(INPUT_POST, 'keywords', FILTER_SANITIZE_STRIPPED);
$code = PMF_Filter::filterInput(INPUT_POST, 'captcha', FILTER_SANITIZE_STRING);
$categories = PMF_Filter::filterInputArray(INPUT_POST, array('rubrik' => array('filter' => FILTER_VALIDATE_INT, 'flags' => FILTER_REQUIRE_ARRAY)));
// If e-mail address is set to optional
if (!PMF_Configuration::getInstance()->get('main.optionalMailAddress') && is_null($usermail)) {
    $usermail = PMF_Configuration::getInstance()->get('main.administrationMail');
}
Ejemplo n.º 27
0
 * compliance with the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * @category  phpMyFAQ
 * @package   Frontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @copyright 2002-2010 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
 * @link      http://www.phpmyfaq.de
 * @since     2002-08-29
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($db, $Language);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$artlang = PMF_Filter::filterInput(INPUT_GET, 'artlang', FILTER_SANITIZE_STRIPPED);
$faqsession->userTracking('write_comment', $id);
$tpl->processTemplate('writeContent', array('msgCommentHeader' => $PMF_LANG['msgWriteComment'], 'writeSendAdress' => '?' . $sids . 'action=savecomment', 'ID' => $id, 'LANG' => $artlang, 'writeThema' => $faq->getRecordTitle($id), 'msgNewContentName' => $PMF_LANG['msgNewContentName'], 'msgNewContentMail' => $PMF_LANG['msgNewContentMail'], 'defaultContentMail' => getEmailAddress(), 'defaultContentName' => getFullUserName(), 'msgYourComment' => $PMF_LANG['msgYourComment'], 'msgNewContentSubmit' => $PMF_LANG['msgNewContentSubmit'], 'captchaFieldset' => PMF_Helper_Captcha::getInstance()->renderFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('writecomment'))));
$tpl->includeTemplate('writeContent', 'index');
Ejemplo n.º 28
0
/**
 * Contact page
 *
 * @package   phpMyFAQ
 * @author    Thorsten Rinne <*****@*****.**>
 * @since     2002-09-16
 * @version   SVN: $Id$
 * @copyright 2002-2009 phpMyFAQ Team
 *
 * The contents of this file are subject to the Mozilla Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$faqsession->userTracking('contact', 0);
$captcha = new PMF_Captcha($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$tpl->processTemplate('writeContent', array('msgContact' => $PMF_LANG['msgContact'], 'msgContactOwnText' => nl2br(PMF_htmlentities($faqconfig->get('main.contactInformations'), ENT_QUOTES, $PMF_LANG['metaCharset'])), 'msgContactEMail' => $PMF_LANG['msgContactEMail'], 'writeSendAdress' => '?' . $sids . 'action=sendmail', 'msgNewContentName' => $PMF_LANG['msgNewContentName'], 'msgNewContentMail' => $PMF_LANG['msgNewContentMail'], 'defaultContentMail' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('email') : '', 'defaultContentName' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('display_name') : '', 'msgMessage' => $PMF_LANG['msgMessage'], 'msgS2FButton' => $PMF_LANG['msgS2FButton'], 'version' => $faqconfig->get('main.currentVersion'), 'captchaFieldset' => printCaptchaFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('contact'), $captcha->caplength)));
$tpl->includeTemplate('writeContent', 'index');
Ejemplo n.º 29
0
 * License for the specific language governing rights and limitations
 * under the License.
 * 
 * @copyright phpMyFAQ
 * @package   Frontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @copyright 2002-2010 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/MPL-1.1.html Mozilla Public License Version 1.1
 * @link      http://www.phpmyfaq.de
 * @since     2002-08-29
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$captcha = new PMF_Captcha($db, $Language);
$captcha->setSessionId($sids);
$type = PMF_Filter::filterInput(INPUT_POST, 'type', FILTER_SANITIZE_STRING);
$code = PMF_Filter::filterInput(INPUT_POST, 'captcha', FILTER_SANITIZE_STRING);
$faqid = PMF_Filter::filterInput(INPUT_POST, 'id', FILTER_VALIDATE_INT, 0);
$newsid = PMF_Filter::filterInput(INPUT_POST, 'newsid', FILTER_VALIDATE_INT);
$user = PMF_Filter::filterInput(INPUT_POST, 'user', FILTER_SANITIZE_STRING);
$mail = PMF_Filter::filterInput(INPUT_POST, 'mail', FILTER_VALIDATE_EMAIL);
$comment = PMF_Filter::filterInput(INPUT_POST, 'comment', FILTER_SANITIZE_STRIPPED);
$message = '';
switch ($type) {
    case 'news':
        $id = $newsid;
        $msgWriteComment = $PMF_LANG['newsWriteComment'];
        break;
    case 'faq':
 *
 * This Source Code Form is subject to the terms of the Mozilla Public License,
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
 * obtain one at http://mozilla.org/MPL/2.0/.
 *
 * @category  phpMyFAQ
 * @package   Frontend
 * @author    Thorsten Rinne <*****@*****.**>
 * @copyright 2002-2015 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
 * @link      http://www.phpmyfaq.de
 * @since     2002-09-16
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    $protocol = 'http';
    if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') {
        $protocol = 'https';
    }
    header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$faqsession->userTracking('contact', 0);
$captcha = new PMF_Captcha($faqConfig);
$captcha->setSessionId($sids);
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$captchaHelper = new PMF_Helper_Captcha($faqConfig);
$tpl->parse('writeContent', array('msgContact' => $PMF_LANG['msgContact'], 'msgContactOwnText' => nl2br($faqConfig->get('main.contactInformations')), 'msgContactEMail' => $PMF_LANG['msgContactEMail'], 'msgNewContentName' => $PMF_LANG['msgNewContentName'], 'msgNewContentMail' => $PMF_LANG['msgNewContentMail'], 'lang' => $Language->getLanguage(), 'defaultContentMail' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('email') : '', 'defaultContentName' => $user instanceof PMF_User_CurrentUser ? $user->getUserData('display_name') : '', 'msgMessage' => $PMF_LANG['msgMessage'], 'msgS2FButton' => $PMF_LANG['msgS2FButton'], 'version' => $faqConfig->get('main.currentVersion'), 'captchaFieldset' => $captchaHelper->renderCaptcha($captcha, 'contact', $PMF_LANG['msgCaptcha'], $auth)));
$tpl->merge('writeContent', 'index');