PageRenderTime 104ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/phpmyfaq/admin/index.php

https://github.com/cyrke/phpMyFAQ
PHP | 668 lines | 504 code | 63 blank | 101 comment | 82 complexity | 524f0b8be147770a37bed16658167f25 MD5 | raw file
Possible License(s): LGPL-2.1, LGPL-3.0, MPL-2.0-no-copyleft-exception
  1. <?php
  2. /**
  3. * The main admin backend index file
  4. *
  5. * PHP Version 5.3
  6. *
  7. * This Source Code Form is subject to the terms of the Mozilla Public License,
  8. * v. 2.0. If a copy of the MPL was not distributed with this file, You can
  9. * obtain one at http://mozilla.org/MPL/2.0/.
  10. *
  11. * @category phpMyFAQ
  12. * @package Administraion
  13. * @author Thorsten Rinne <thorsten@phpmyfaq.de>
  14. * @author Bastian Poettner <bastian@poettner.net>
  15. * @author Meikel Katzengreis <meikel@katzengreis.com>
  16. * @author Minoru TODA <todam@netjapan.co.jp>
  17. * @author Matteo Scaramuccia <matteo@phpmyfaq.de>
  18. * @copyright 2002-2012 phpMyFAQ Team
  19. * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
  20. * @link http://www.phpmyfaq.de
  21. * @since 2002-09-16
  22. */
  23. define('PMF_ROOT_DIR', dirname(__DIR__));
  24. //
  25. // Check if config/database.php exist -> if not, redirect to installer
  26. //
  27. if (!file_exists(PMF_ROOT_DIR . '/config/database.php')) {
  28. header("Location: ".str_replace('admin/index.php', '', $_SERVER['SCRIPT_NAME']).'install/setup.php');
  29. exit();
  30. }
  31. //
  32. // Define the named constant used as a check by any included PHP file
  33. //
  34. define('IS_VALID_PHPMYFAQ', null);
  35. //
  36. // Bootstrap phpMyFAQ and start the PHP session
  37. //
  38. require_once PMF_ROOT_DIR.'/inc/Bootstrap.php';
  39. PMF_Init::cleanRequest();
  40. session_name(PMF_Session::PMF_COOKIE_NAME_AUTH);
  41. session_start();
  42. // get language (default: english)
  43. $Language = new PMF_Language($faqConfig);
  44. $LANGCODE = $Language->setLanguage($faqConfig->get('main.languageDetection'), $faqConfig->get('main.language'));
  45. // Preload English strings
  46. require_once (PMF_ROOT_DIR.'/lang/language_en.php');
  47. $faqConfig->setLanguage($Language);
  48. if (isset($LANGCODE) && PMF_Language::isASupportedLanguage($LANGCODE)) {
  49. // Overwrite English strings with the ones we have in the current language
  50. if (! file_exists(PMF_ROOT_DIR . '/lang/language_' . $LANGCODE . '.php')) {
  51. $LANGCODE = 'en';
  52. }
  53. require_once PMF_ROOT_DIR . '/lang/language_' . $LANGCODE . '.php';
  54. } else {
  55. $LANGCODE = 'en';
  56. }
  57. //
  58. // Initalizing static string wrapper
  59. //
  60. PMF_String::init($LANGCODE);
  61. //
  62. // Set actual template set name
  63. //
  64. PMF_Template::setTplSetName($faqConfig->get('main.templateSet'));
  65. //
  66. // Initialize attachment factory
  67. //
  68. PMF_Attachment_Factory::init(
  69. $faqConfig->get('records.attachmentsStorageType'),
  70. $faqConfig->get('records.defaultAttachmentEncKey'),
  71. $faqConfig->get('records.enableAttachmentEncryption')
  72. );
  73. //
  74. // Initiazile caching
  75. //
  76. PMF_Cache::init($faqConfig);
  77. //
  78. // Create a new FAQ object
  79. //
  80. $faq = new PMF_Faq($faqConfig);
  81. //
  82. // use mbstring extension if available and when possible
  83. //
  84. $valid_mb_strings = array('ja', 'en', 'uni');
  85. $mbLanguage = ($PMF_LANG['metaLanguage'] != 'ja') ? 'uni' : $PMF_LANG['metaLanguage'];
  86. if (function_exists('mb_language') && in_array($mbLanguage, $valid_mb_strings)) {
  87. mb_language($mbLanguage);
  88. mb_internal_encoding('utf-8');
  89. }
  90. //
  91. // Get user action
  92. //
  93. $action = PMF_Filter::filterInput(INPUT_GET, 'action', FILTER_SANITIZE_STRING);
  94. if (is_null($action)) {
  95. $action = PMF_Filter::filterInput(INPUT_POST, 'action', FILTER_SANITIZE_STRING);
  96. }
  97. // authenticate current user
  98. $auth = null;
  99. $error = '';
  100. $faqusername = PMF_Filter::filterInput(INPUT_POST, 'faqusername', FILTER_SANITIZE_STRING);
  101. $faqpassword = PMF_Filter::filterInput(INPUT_POST, 'faqpassword', FILTER_SANITIZE_STRING);
  102. $faqremember = PMF_Filter::filterInput(INPUT_POST, 'faqrememberme', FILTER_SANITIZE_STRING);
  103. // Set username via SSO
  104. if ($faqConfig->get('security.ssoSupport') && isset($_SERVER['REMOTE_USER'])) {
  105. $faqusername = trim($_SERVER['REMOTE_USER']);
  106. $faqpassword = '';
  107. }
  108. // Login via local DB or LDAP or SSO
  109. if (!is_null($faqusername) && !is_null($faqpassword)) {
  110. $user = new PMF_User_CurrentUser($faqConfig);
  111. if (!is_null($faqremember) && 'rememberMe' === $faqremember) {
  112. $user->enableRememberMe();
  113. }
  114. if ($faqConfig->get('security.ldapSupport')) {
  115. $authLdap = new PMF_Auth_Ldap($faqConfig);
  116. $user->addAuth($authLdap, 'ldap');
  117. }
  118. if ($faqConfig->get('security.ssoSupport')) {
  119. $authSso = new PMF_Auth_Sso($faqConfig);
  120. $user->addAuth($authSso, 'sso');
  121. }
  122. if ($user->login($faqusername, $faqpassword)) {
  123. // login, if user account is NOT blocked
  124. if ($user->getStatus() != 'blocked') {
  125. $auth = true;
  126. } else {
  127. $error = $PMF_LANG['ad_auth_fail'];
  128. $user = null;
  129. }
  130. } else {
  131. // error
  132. $logging = new PMF_Logging($faqConfig);
  133. $logging->logAdmin($user, 'Loginerror\nLogin: '.$faqusername.'\nErrors: ' . implode(', ', $user->errors));
  134. $error = $PMF_LANG['ad_auth_fail'];
  135. $user = null;
  136. }
  137. } else {
  138. // Try to authenticate with cookie information
  139. $user = PMF_User_CurrentUser::getFromCookie($faqConfig);
  140. // authenticate with session information
  141. if (! $user instanceof PMF_User_CurrentUser) {
  142. $user = PMF_User_CurrentUser::getFromSession($faqConfig);
  143. }
  144. if ($user instanceof PMF_User_CurrentUser) {
  145. $auth = true;
  146. } else {
  147. $user = null;
  148. }
  149. }
  150. // get user rights
  151. $permission = array();
  152. if (isset($auth)) {
  153. // read all rights, set them FALSE
  154. $allRights = $user->perm->getAllRightsData();
  155. foreach ($allRights as $right) {
  156. $permission[$right['name']] = false;
  157. }
  158. // check user rights, set them TRUE
  159. $allUserRights = $user->perm->getAllUserRights($user->getUserId());
  160. foreach ($allRights as $right) {
  161. if (in_array($right['right_id'], $allUserRights))
  162. $permission[$right['name']] = true;
  163. }
  164. }
  165. // logout
  166. if ($action == 'logout' && $auth) {
  167. $user->deleteFromSession();
  168. $user = null;
  169. $auth = null;
  170. $ssoLogout = $faqConfig->get('security.ssoLogoutRedirect');
  171. if ($faqConfig->get('security.ssoSupport') && !empty ($ssoLogout)) {
  172. header ("Location: $ssoLogout");
  173. }
  174. }
  175. //
  176. // Get current admin user and group id - default: -1
  177. //
  178. if (isset($user) && is_object($user)) {
  179. $currentAdminUser = $user->getUserId();
  180. if ($user->perm instanceof PMF_Perm_Medium) {
  181. $currentAdminGroups = $user->perm->getUserGroups($currentAdminUser);
  182. } else {
  183. $currentAdminGroups = array(-1);
  184. }
  185. if (0 == count($currentAdminGroups)) {
  186. $currentAdminGroups = array(-1);
  187. }
  188. }
  189. //
  190. // Get action from _GET and _POST first
  191. $_ajax = PMF_Filter::filterInput(INPUT_GET, 'ajax', FILTER_SANITIZE_STRING);
  192. if (is_null($_ajax)) {
  193. $_ajax = PMF_Filter::filterInput(INPUT_POST, 'ajax', FILTER_SANITIZE_STRING);
  194. }
  195. // if performing AJAX operation, needs to branch before header.php
  196. if (isset($auth) && in_array(true, $permission)) {
  197. if (isset($action) && isset($_ajax)) {
  198. if ($action == 'ajax') {
  199. switch ($_ajax) {
  200. // Link verification
  201. case 'verifyURL':
  202. require_once 'ajax.verifyurl.php';
  203. break;
  204. case 'onDemandURL':
  205. require_once 'ajax.ondemandurl.php';
  206. break;
  207. // Configuration management
  208. case 'config_list':
  209. require_once 'ajax.config_list.php';
  210. break;
  211. case 'config':
  212. require_once 'ajax.config.php';
  213. break;
  214. // Tags management
  215. case 'tags_list':
  216. require_once 'ajax.tags_list.php';
  217. break;
  218. // Comments
  219. case 'comment':
  220. require 'ajax.comment.php';
  221. break;
  222. // Records
  223. case 'records':
  224. require 'ajax.records.php';
  225. break;
  226. case 'recordSave':
  227. require 'record.save.php';
  228. break;
  229. case 'recordAdd':
  230. require 'record.add.php';
  231. break;
  232. // Search
  233. case 'search':
  234. require 'ajax.search.php';
  235. break;
  236. // Users
  237. case 'user':
  238. require 'ajax.user.php';
  239. break;
  240. // Groups
  241. case 'group':
  242. require 'ajax.group.php';
  243. break;
  244. // Interface translation
  245. case 'trans':
  246. require 'ajax.trans.php';
  247. break;
  248. case 'att':
  249. require 'ajax.attachment.php';
  250. break;
  251. case 'autosave':
  252. require 'ajax.autosave.php';
  253. break;
  254. }
  255. exit();
  256. }
  257. }
  258. }
  259. // are we running a PMF export file request?
  260. switch($action) {
  261. case 'exportfile':
  262. require 'export.file.php';
  263. exit();
  264. break;
  265. case 'reportexport':
  266. require 'report.export.php';
  267. exit();
  268. break;
  269. }
  270. // Header of the admin page including the navigation
  271. require_once 'header.php';
  272. // User is authenticated
  273. if (isset($auth) && in_array(true, $permission)) {
  274. if (!is_null($action)) {
  275. // the various sections of the admin area
  276. switch ($action) {
  277. // functions for user administration
  278. case 'user': require_once 'user.php'; break;
  279. case 'group': require_once 'group.php'; break;
  280. // functions for record administration
  281. case 'viewinactive':
  282. case 'viewactive':
  283. case 'view': require_once 'record.show.php'; break;
  284. case 'searchfaqs': require_once 'record.search.php'; break;
  285. case "takequestion":
  286. case "editentry":
  287. case 'copyentry':
  288. case "editpreview": require_once 'record.edit.php'; break;
  289. case "insertentry": require_once 'record.add.php'; break;
  290. case "saveentry": require_once 'record.save.php'; break;
  291. case "delentry": require_once 'record.delete.php'; break;
  292. case "delatt": require_once 'record.delatt.php'; break;
  293. case "question": require_once 'record.questions.php'; break;
  294. case 'comments': require_once 'record.comments.php'; break;
  295. // news administraion
  296. case 'news':
  297. case 'addnews':
  298. case 'editnews':
  299. case 'savenews':
  300. case 'updatenews':
  301. case 'deletenews': require_once 'news.php'; break;
  302. // category administration
  303. case 'content':
  304. case 'category':
  305. case 'savecategory':
  306. case 'updatecategory':
  307. case 'removecategory':
  308. case 'changecategory':
  309. case 'pastecategory': require_once 'category.main.php'; break;
  310. case "addcategory": require_once 'category.add.php'; break;
  311. case "editcategory": require_once 'category.edit.php'; break;
  312. case "translatecategory": require_once 'category.translate.php'; break;
  313. case "deletecategory": require_once 'category.delete.php'; break;
  314. case "cutcategory": require_once 'category.cut.php'; break;
  315. case "movecategory": require_once 'category.move.php'; break;
  316. case "showcategory": require_once 'category.showstructure.php'; break;
  317. // glossary
  318. case 'glossary':
  319. case 'saveglossary':
  320. case 'updateglossary':
  321. case 'deleteglossary': require_once 'glossary.main.php'; break;
  322. case 'addglossary': require_once 'glossary.add.php'; break;
  323. case 'editglossary': require_once 'glossary.edit.php'; break;
  324. // adminlog administration
  325. case 'adminlog':
  326. case 'deleteadminlog': require_once 'adminlog.php'; break;
  327. // functions for password administration
  328. case "passwd": require_once 'pwd.change.php'; break;
  329. // functions for session administration
  330. case "viewsessions": require_once 'stat.main.php'; break;
  331. case "sessionbrowse": require_once 'stat.browser.php'; break;
  332. case "viewsession": require_once 'stat.show.php'; break;
  333. case "statistics": require_once 'stat.ratings.php'; break;
  334. case "searchstats": require_once 'stat.search.php'; break;
  335. case 'reports': require_once 'report.main.php'; break;
  336. case 'reportview': require_once 'report.view.php'; break;
  337. // functions for config administration
  338. case 'config': require_once 'configuration.php'; break;
  339. case 'updateinstance':
  340. case 'instances': require_once 'instances.php'; break;
  341. case 'editinstance': require_once 'instances.edit.php'; break;
  342. case 'stopwordsconfig': require_once 'stopwordsconfig.main.php'; break;
  343. // functions for backup administration
  344. case 'backup': require_once 'backup.main.php'; break;
  345. case 'restore': require_once 'backup.import.php'; break;
  346. // functions for FAQ export
  347. case "export": require_once 'export.main.php'; break;
  348. // translation tools
  349. case "transedit": require_once 'trans.edit.php'; break;
  350. case "translist": require_once 'trans.list.php'; break;
  351. case "transadd": require_once 'trans.add.php'; break;
  352. // attachment administration
  353. case "attachments": require_once "att.main.php"; break;
  354. default: print "Error"; break;
  355. }
  356. } else {
  357. // start page with some information about the FAQ
  358. $faqTableInfo = $faqConfig->getDb()->getTableStatus();
  359. $faqSystem = new PMF_System();
  360. ?>
  361. <header>
  362. <h2><?php print $PMF_LANG['ad_pmf_info']; ?></h2>
  363. </header>
  364. <table class="table table-striped">
  365. <tbody>
  366. <tr>
  367. <td><strong><a href="?action=config"><?php print $PMF_LANG['msgMode']; ?></a></strong></td>
  368. <td>
  369. <?php if ($faqConfig->get('main.maintenanceMode')): ?>
  370. <span class="label label-important"><?php print $PMF_LANG['msgMaintenanceMode']; ?></span>
  371. <?php else: ?>
  372. <span class="label label-success"><?php print $PMF_LANG['msgOnlineMode']; ?></span>
  373. <?php endif; ?>
  374. </td>
  375. </tr>
  376. <tr>
  377. <td><strong><a href="?action=viewsessions"><?php print $PMF_LANG["ad_start_visits"]; ?></a></strong></td>
  378. <td><?php print $faqTableInfo[PMF_Db::getTablePrefix() . "faqsessions"]; ?></td>
  379. </tr>
  380. <tr>
  381. <td><strong><a href="?action=view"><?php print $PMF_LANG["ad_start_articles"]; ?></a></strong></td>
  382. <td><?php print $faqTableInfo[PMF_Db::getTablePrefix() . "faqdata"]; ?></td>
  383. </tr>
  384. <tr>
  385. <td><strong><a href="?action=comments"><?php print $PMF_LANG["ad_start_comments"]; ?></strong></a></td>
  386. <td><?php print $faqTableInfo[PMF_Db::getTablePrefix() . "faqcomments"]; ?></td>
  387. </tr>
  388. <tr>
  389. <td><strong><a href="?action=question"><?php print $PMF_LANG["msgOpenQuestions"]; ?></strong></a></td>
  390. <td><?php print $faqTableInfo[PMF_Db::getTablePrefix() . "faqquestions"]; ?></td>
  391. </tr>
  392. <tr>
  393. <td><strong><a href="?action=news"><?php print $PMF_LANG["msgNews"]; ?></strong></a></td>
  394. <td><?php print $faqTableInfo[PMF_Db::getTablePrefix() . "faqnews"]; ?></td>
  395. </tr>
  396. <tr>
  397. <td><strong><a href="?action=user&user_action=listallusers"><?php print $PMF_LANG['admin_mainmenu_users']; ?></strong></a></td>
  398. <td><?php print $faqTableInfo[PMF_Db::getTablePrefix() . 'faquser'] - 1; ?></td>
  399. </tr>
  400. </tbody>
  401. </table>
  402. </section>
  403. <section class="row-fluid">
  404. <div class="span5">
  405. <header>
  406. <h3><?php print $PMF_LANG['ad_online_info']; ?></h3>
  407. </header>
  408. <?php
  409. $version = PMF_Filter::filterInput(INPUT_POST, 'param', FILTER_SANITIZE_STRING);
  410. if (!is_null($version) && $version == 'version') {
  411. $json = file_get_contents('http://www.phpmyfaq.de/api/version');
  412. $result = json_decode($json);
  413. if ($result instanceof stdClass) {
  414. $installed = $faqConfig->get('main.currentVersion');
  415. $available = $result->stable;
  416. printf(
  417. '<p class="alert alert-%s">%s <a href="http://www.phpmyfaq.de" target="_blank">phpmyfaq.de</a>:<br/><strong>phpMyFAQ %s</strong>',
  418. (-1 == version_compare($installed, $available)) ? 'danger' : 'info',
  419. $PMF_LANG['ad_xmlrpc_latest'],
  420. $available
  421. );
  422. // Installed phpMyFAQ version is outdated
  423. if (-1 == version_compare($installed, $available)) {
  424. print '<br />' . $PMF_LANG['ad_you_should_update'];
  425. }
  426. }
  427. } else {
  428. ?>
  429. <p>
  430. <form action="index.php" method="post">
  431. <input type="hidden" name="param" value="version" />
  432. <button class="btn btn-primary" type="submit">
  433. <i class="icon-check icon-white"></i> <?php print $PMF_LANG["ad_xmlrpc_button"]; ?>
  434. </button>
  435. </form>
  436. </p>
  437. <?php
  438. }
  439. ?>
  440. </p>
  441. </div>
  442. <div class="span5">
  443. <header>
  444. <h3><?php print $PMF_LANG['ad_online_verification'] ?></h3>
  445. </header>
  446. <?php
  447. $getJson = PMF_Filter::filterInput(INPUT_POST, 'getJson', FILTER_SANITIZE_STRING);
  448. if (!is_null($getJson) && 'verify' === $getJson) {
  449. $faqSystem = new PMF_System();
  450. $localHashes = $faqSystem->createHashes();
  451. $remoteHashes = file_get_contents(
  452. 'http://www.phpmyfaq.de/api/verify/' . $faqConfig->get('main.currentVersion')
  453. );
  454. if (!is_array($remoteHashes)) {
  455. echo '<p class="alert alert-danger">phpMyFAQ version mismatch - no verification possible.</p>';
  456. } else {
  457. $diff = array_diff(
  458. json_decode($localHashes, true),
  459. json_decode($remoteHashes, true)
  460. );
  461. if (0 !== count($diff)) {
  462. printf('<p class="alert alert-danger">%s</p>', $PMF_LANG["ad_verification_notokay"]);
  463. print '<ul>';
  464. foreach ($diff as $file => $hash) {
  465. if ('created' === $file) {
  466. continue;
  467. }
  468. printf(
  469. '<li><span class="pmf-popover" data-original-title="SHA-1" data-content="%s">%s</span></li>',
  470. $hash,
  471. $file
  472. );
  473. }
  474. print '</ul>';
  475. } else {
  476. printf('<p class="alert alert-success">%s</p>', $PMF_LANG["ad_verification_okay"]);
  477. }
  478. }
  479. } else {
  480. ?>
  481. <p>
  482. <form action="index.php" method="post">
  483. <input type="hidden" name="getJson" value="verify" />
  484. <button class="btn btn-primary" type="submit">
  485. <i class="icon-certificate icon-white"></i> <?php print $PMF_LANG["ad_verification_button"] ?>
  486. </button>
  487. </form>
  488. </p>
  489. <?php
  490. }
  491. ?>
  492. <script>$(function(){ $('span[class="pmf-popover"]').popover();});</script>
  493. </div>
  494. </section>
  495. <section class="row-fluid">
  496. <header>
  497. <h3><?php print $PMF_LANG['ad_system_info']; ?></h3>
  498. </header>
  499. <div class="pmf-system-information">
  500. <table class="table table-striped">
  501. <tbody>
  502. <?php
  503. $systemInformation = array(
  504. 'phpMyFAQ Version' => $faqSystem->getVersion(),
  505. 'Server Software' => $_SERVER['SERVER_SOFTWARE'],
  506. 'PHP Version' => PHP_VERSION,
  507. 'Register Globals' => ini_get('register_globals') == 1 ? 'on' : 'off',
  508. 'safe Mode' => ini_get('safe_mode') == 1 ? 'on' : 'off',
  509. 'Open Basedir' => ini_get('open_basedir') == 1 ? 'on' : 'off',
  510. 'DB Server' => PMF_Db::getType(),
  511. 'DB Client Version' => $faqConfig->getDb()->clientVersion(),
  512. 'DB Server Version' => $faqConfig->getDb()->serverVersion(),
  513. 'Webserver Interface' => strtoupper(@php_sapi_name()),
  514. 'PHP Extensions' => implode(', ', get_loaded_extensions())
  515. );
  516. foreach ($systemInformation as $name => $info): ?>
  517. <tr>
  518. <td class="span3"><strong><?php print $name ?></strong></td>
  519. <td><?php print $info ?></td>
  520. </tr>
  521. <?php endforeach; ?>
  522. </tbody>
  523. </table>
  524. </div>
  525. <p>phpMyFAQ uses <a href="http://glyphicons.com/">Glyphicons</a>.</p>
  526. <div style="font-size: 5px; text-align: right; color: #f5f5f5">NOTE: Art is resistance.</div>
  527. </section>
  528. <?php
  529. }
  530. // User is authenticated, but has no rights
  531. } elseif (isset($auth) && !in_array(true, $permission)) {
  532. ?>
  533. <header>
  534. <h2><?php print $PMF_LANG['ad_pmf_info']; ?></h2>
  535. </header>
  536. <p class="error"><?php print $PMF_LANG['err_NotAuth'] ?></p>
  537. <?php
  538. // User is NOT authenticated
  539. } else {
  540. ?>
  541. <header>
  542. <h2>phpMyFAQ Login</h2>
  543. </header>
  544. <?php
  545. if (isset($error) && 0 < strlen($error)) {
  546. $message = sprintf(
  547. '<p class="alert alert-error">%s%s</p>',
  548. '<a class="close" data-dismiss="alert" href="#">&times;</a>',
  549. $error
  550. );
  551. } else {
  552. $message = sprintf('<p>%s</p>', $PMF_LANG['ad_auth_insert']);
  553. }
  554. if ($action == 'logout') {
  555. $message = sprintf(
  556. '<p class="alert alert-success">%s%s</p>',
  557. '<a class="close" data-dismiss="alert" href="#">&times;</a>',
  558. $PMF_LANG['ad_logout']
  559. );
  560. }
  561. if (isset($_SERVER['HTTPS']) || !$faqConfig->get('security.useSslForLogins')) {
  562. ?>
  563. <?php print $message ?>
  564. <form class="form-horizontal" action="index.php" method="post">
  565. <div class="control-group">
  566. <label class="control-label" for="faqusername"><?php print $PMF_LANG["ad_auth_user"]; ?></label>
  567. <div class="controls">
  568. <input type="text" name="faqusername" id="faqusername" required="required" />
  569. </div>
  570. </div>
  571. <div class="control-group">
  572. <label class="control-label" for="faqpassword"><?php print $PMF_LANG["ad_auth_passwd"]; ?></label>
  573. <div class="controls">
  574. <input type="password" name="faqpassword" id="faqpassword" required="required" />
  575. </div>
  576. </div>
  577. <div class="control-group">
  578. <div class="controls">
  579. <label class="checkbox">
  580. <input type="checkbox" id="faqrememberme" name="faqrememberme" value="rememberMe">
  581. <?php print $PMF_LANG['rememberMe'] ?>
  582. </label>
  583. </div>
  584. </div>
  585. <div class="form-actions">
  586. <button class="btn btn-primary" type="submit">
  587. <?php print $PMF_LANG["ad_auth_ok"]; ?>
  588. </button>
  589. </div>
  590. <?php
  591. } else {
  592. printf('<p><a href="https://%s%s">%s</a></p>',
  593. $_SERVER['HTTP_HOST'],
  594. $_SERVER['REQUEST_URI'],
  595. $PMF_LANG['msgSecureSwitch']);
  596. }
  597. ?>
  598. </form>
  599. <?php
  600. }
  601. ?>
  602. </div>
  603. <?php
  604. require 'footer.php';
  605. $faqConfig->getDb()->close();