示例#1
0
 *
 * The Initial Developer of the Original Code is released for external use
 * with permission from NetJapan, Inc. IT Administration Group.
 */
if (!defined('IS_VALID_PHPMYFAQ_ADMIN')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
header("Expires: Thu, 7 Apr 1977 14:47:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Content-type: text/html");
header("Vary: Negotiate,Accept");
$linkverifier = new PMF_Linkverifier($user->getLogin());
if ($linkverifier->isReady() == false) {
    if (count(ob_list_handlers()) > 0) {
        ob_clean();
    }
    print "disabled";
    exit;
}
$linkverifier->loadConfigurationFromDB();
$id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$lang = PMF_Filter::filterInput(INPUT_GET, 'lang', FILTER_SANITIZE_STRING);
$lookup = PMF_Filter::filterInput(INPUT_GET, 'lookup', FILTER_VALIDATE_INT);
if (count(ob_list_handlers()) > 0) {
    ob_clean();
}
?>
示例#2
0
 * @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);
// Get all data from the FAQ record
if (0 == $solution_id) {
示例#3
0
 * @author    Minoru TODA <*****@*****.**>
 * @copyright 2003-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     2003-02-23
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
printf("<h2>%s</h2>\n", $PMF_LANG['ad_entry_aor']);
if ($permission['editbt'] || $permission['delbt']) {
    $categoryRelations = new PMF_Category_Relations();
    $categoryData = new PMF_Category_Tree_DataProvider_SingleQuery($LANGCODE);
    $categoryLayout = new PMF_Category_Layout(new PMF_Category_Tree_Helper(new PMF_Category_Tree($categoryData)));
    $linkverifier = new PMF_Linkverifier($user->getLogin());
    $comment = new PMF_Comment();
    $faq = new PMF_Faq();
    if ($linkverifier->isReady()) {
        link_verifier_javascript();
    }
    $cond = $numCommentsByFaq = $numActiveByCat = array();
    $internalSearch = $linkState = $searchterm = '';
    $searchcat = $currentcategory = 0;
    $orderby = 1;
    $sortby = null;
    $linkState = PMF_Filter::filterInput(INPUT_POST, 'linkstate', FILTER_SANITIZE_STRING);
    $searchcat = PMF_Filter::filterInput(INPUT_POST, 'searchcat', FILTER_VALIDATE_INT);
    $searchterm = PMF_Filter::filterInput(INPUT_POST, 'searchterm', FILTER_SANITIZE_STRIPPED);
    if (!is_null($linkState)) {
        $cond[SQLPREFIX . 'faqdata.links_state'] = 'linkbad';
 }
 define('IS_VALID_PHPMYFAQ', null);
 require PMF_ROOT_DIR . '/inc/Bootstrap.php';
 // Preload English strings
 require_once PMF_ROOT_DIR . '/lang/language_en.php';
 if (LANGCODE != 'en' && PMF_Language::isASupportedLanguage(LANGCODE)) {
     // Overwrite English strings with the ones we have in the current language
     require_once PMF_ROOT_DIR . '/lang/language_' . LANGCODE . '.php';
 }
 //Load plurals support for selected language
 $plr = new PMF_Language_Plurals(LANGCODE);
 //
 // Initalizing static string wrapper
 //
 PMF_String::init(LANGCODE);
 $oLnk = new PMF_Linkverifier($faqConfig);
 $faq = new PMF_Faq($faqConfig);
 $totStart = microtime(true);
 // Read the data directly from the faqdata table (all faq records in all languages)
 $start = microtime(true);
 $output .= $isRequestedByWebLocalhost ? '' : "\n";
 $output .= 'Extracting faq records...';
 $faq->getAllRecords();
 $_records = $faq->faqRecords;
 $tot = count($_records);
 $end = microtime(true);
 $output .= ' #' . $tot . ', done in ' . round($end - $start, 4) . ' sec.' . ($isRequestedByWebLocalhost ? '' : "\n");
 $output .= $isRequestedByWebLocalhost ? '' : "\n";
 if ($isRequestedByWebLocalhost) {
     echo '<pre>';
 }
示例#5
0
        <div class="row">
            <div class="col-lg-12">
<?php 
if ($user->perm->checkRight($user->getUserId(), 'editbt') || $user->perm->checkRight($user->getUserId(), 'delbt')) {
    $searchcat = PMF_Filter::filterInput(INPUT_POST, 'searchcat', FILTER_VALIDATE_INT);
    $searchterm = PMF_Filter::filterInput(INPUT_POST, 'searchterm', FILTER_SANITIZE_STRIPPED);
    $category = new PMF_Category($faqConfig, [], false);
    $category->setUser($currentAdminUser);
    $category->setGroups($currentAdminGroups);
    $category->transform(0);
    // Set the Category for the helper class
    $categoryHelper = new PMF_Helper_Category();
    $categoryHelper->setCategory($category);
    $category->buildTree();
    $linkVerifier = new PMF_Linkverifier($faqConfig, $user->getLogin());
    ?>

                <form action="?action=view" method="post" class="form-horizontal" accept-charset="utf-8">

                    <div class="form-group">
                        <label class="col-lg-2 control-label"><?php 
    print $PMF_LANG["msgSearchWord"];
    ?>
:</label>
                        <div class="col-lg-4">
                            <input class="form-control" type="search" name="searchterm" autofocus
                                   value="<?php 
    print $searchterm;
    ?>
" />
示例#6
0
    ?>
        <td class="spacer">&nbsp;</td>
    </tr>
    </table>
<?php 
    print $_description;
}
// load parameters into array
enumScriptParameters();
?>
<h2><?php 
print $PMF_LANG['ad_linkcheck_config_title'];
?>
</h2>
<?php 
$linkverifier = new PMF_Linkverifier($user->getLogin());
if ($linkverifier->isReady() == false) {
    print $PMF_LANG['ad_linkcheck_config_disabled'];
    return;
}
showListTypeSelection();
$_admin = isset($permission['editconfig']) && $permission['editconfig'] ? true : false;
$rowcount = PMF_Filter::filterInput(INPUT_POST, 'rowcount', FILTER_VALIDATE_INT);
if (!is_null($rowcount)) {
    for ($i = 0; $i < $rowcount; $i++) {
        // load form posts
        $posts = array();
        foreach (array('id' => false, 'url' => '', 'reason' => '', 'enabled' => 'n', 'locked' => 'n', 'chown' => 'n', 'delete' => 'n') as $_key => $_default) {
            if (isset($_POST[$_key][$i])) {
                $posts[$_key] = $_POST[$_key][$i];
            } else {
示例#7
0
 // Add user permissions
 $faq->deletePermission('user', $record_id);
 $faq->addPermission('user', $record_id, $restricted_users);
 $category->deletePermission('user', $categories['rubrik']);
 $category->addPermission('user', $categories['rubrik'], $restricted_users);
 // Add group permission
 if ($faqconfig->get('security.permLevel') != 'basic') {
     $faq->deletePermission('group', $record_id);
     $faq->addPermission('group', $record_id, $restricted_groups);
     $category->deletePermission('group', $categories['rubrik']);
     $category->addPermission('group', $categories['rubrik'], $restricted_groups);
 }
 // All the other translations
 $languages = PMF_Filter::filterInput(INPUT_POST, 'used_translated_languages', FILTER_SANITIZE_STRING);
 if ($faqconfig->get('main.enableGoogleTranslation') === true && !empty($languages)) {
     $linkverifier = new PMF_Linkverifier($user->getLogin());
     $visits = PMF_Visits::getInstance();
     $languages = PMF_Filter::filterInput(INPUT_POST, 'used_translated_languages', FILTER_SANITIZE_STRING);
     $languages = explode(",", $languages);
     foreach ($languages as $translated_lang) {
         if ($translated_lang == $record_lang) {
             continue;
         }
         $translated_question = PMF_Filter::filterInput(INPUT_POST, 'question_translated_' . $translated_lang, FILTER_SANITIZE_STRING);
         $translated_answer = PMF_Filter::filterInput(INPUT_POST, 'answer_translated_' . $translated_lang, FILTER_SANITIZE_SPECIAL_CHARS);
         $translated_keywords = PMF_Filter::filterInput(INPUT_POST, 'keywords_translated_' . $translated_lang, FILTER_SANITIZE_STRING);
         $recordData = array_merge($recordData, array('lang' => $translated_lang, 'thema' => utf8_encode(html_entity_decode($translated_question)), 'content' => utf8_encode(html_entity_decode($translated_answer)), 'keywords' => utf8_encode($translated_keywords), 'author' => 'Google Translate', 'email' => $faqconfig->get('main.administrationMail')));
         // Create ChangeLog entry
         $faq->createChangeEntry($record_id, $user->getUserId(), nl2br($changed), $translated_lang, $revision_id);
         // save or update the FAQ record
         if ($faq->isAlreadyTranslated($record_id, $translated_lang)) {
示例#8
0
 * @link      http://www.phpmyfaq.de
 * @since     2005-09-30
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
header("Expires: Thu, 7 Apr 1977 14:47:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Content-type: text/html");
header("Vary: Negotiate,Accept");
header("Content-type: text/xml; charset=utf-8");
$linkverifier = new PMF_Linkverifier($user->getLogin());
if ($linkverifier->isReady() == false) {
    if (count(ob_list_handlers()) > 0) {
        ob_clean();
    }
    print "disabled";
    exit;
}
$linkverifier->loadConfigurationFromDB();
$id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$lang = PMF_Filter::filterInput(INPUT_GET, 'lang', FILTER_SANITIZE_STRING);
if (!(isset($id) && isset($lang))) {
    //header("X-DenyReason: id/lang bad");
    header("HTTP/1.0 401 Unauthorized");
    header("Status: 401 Unauthorized");
    exit;
示例#9
0
 * @since     2005-09-30
 */
use Symfony\Component\HttpFoundation\Response;
use PMF\Helper\ResponseWrapper;
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;
}
$response = new Response();
$responseWrapper = new ResponseWrapper($response);
$responseWrapper->addCommonHeaders();
$linkverifier = new PMF_Linkverifier($faqConfig, $user->getLogin());
if ($linkverifier->isReady() == false) {
    if (count(ob_list_handlers()) > 0) {
        ob_clean();
    }
    $response->setContent("disabled")->send();
    exit;
}
$id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$lang = PMF_Filter::filterInput(INPUT_GET, 'lang', FILTER_SANITIZE_STRING);
if (!(isset($id) && isset($lang))) {
    $response->setStatusCode(401)->send();
    exit;
}
$faq->faqRecord = null;
$faq->getRecord($id);
示例#10
0
 * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
 * @link      http://www.phpmyfaq.de
 * @since     2005-09-30
 */
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;
}
$httpHeader = new PMF_Helper_Http();
$httpHeader->setContentType('text/html');
$httpHeader->addHeader();
$linkverifier = new PMF_Linkverifier($faqConfig, $user->getLogin());
if ($linkverifier->isReady() == false) {
    if (count(ob_list_handlers()) > 0) {
        ob_clean();
    }
    print "disabled";
    exit;
}
$id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$artlang = PMF_Filter::filterInput(INPUT_GET, 'artlang', FILTER_SANITIZE_STRING);
$lookup = PMF_Filter::filterInput(INPUT_GET, 'lookup', FILTER_VALIDATE_INT);
if (count(ob_list_handlers()) > 0) {
    ob_clean();
}
?>
<!DOCTYPE html>
示例#11
0
文件: artikel.php 项目: noon/phpMyFAQ
 * 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);
$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);
// Get all data from the FAQ record
if (0 == $solution_id) {
示例#12
0
            </div>
        <header>

        <div class="row">
            <div class="col-lg-12">
<?php 
if ($user->perm->checkRight($user->getUserId(), 'editbt') || $user->perm->checkRight($user->getUserId(), 'delbt')) {
    $category = new PMF_Category($faqConfig, [], false);
    $category->setUser($currentAdminUser);
    $category->setGroups($currentAdminGroups);
    $category->transform(0);
    // Set the Category for the helper class
    $categoryHelper = new PMF_Helper_Category();
    $categoryHelper->setCategory($category);
    $category->buildTree();
    $linkverifier = new PMF_Linkverifier($faqConfig, $user->getLogin());
    if ($linkverifier->isReady()) {
        ?>
    <script type="text/javascript">
        <!--
        function getImageElement(id, lang)
        {
            return $('#imgurl_' + lang + '_' + id);
        }

        function getSpanElement(id, lang)
        {
            return $('#spanurl_' + lang + '_' + id);
        }

        function getDivElement(id, lang)