Ejemplo n.º 1
0
    // Overwrite English strings with the ones we have in the current language,
    // but don't include UTF-8 encoded files, these will break the captcha images
    require_once 'lang/language_' . $LANGCODE . '.php';
} else {
    $LANGCODE = 'en';
}
//Load plurals support for selected language
$plr = new PMF_Language_Plurals($PMF_LANG);
//
// Initalizing static string wrapper
//
PMF_String::init($PMF_LANG["metaCharset"], $LANGCODE);
/**
 * Initialize attachment factory
 */
PMF_Attachment_Factory::init($faqconfig->get('main.attachmentsStorageType'), $faqconfig->get('main.defaultAttachmentEncKey'), $faqconfig->get('main.enableAttachmentEncryption'));
//
// Get user action
//
$action = PMF_Filter::filterInput(INPUT_GET, 'action', FILTER_SANITIZE_STRING, 'main');
//
// Authenticate current user
//
$auth = null;
$error = '';
$faqusername = PMF_Filter::filterInput(INPUT_POST, 'faqusername', FILTER_SANITIZE_STRING);
$faqpassword = PMF_Filter::filterInput(INPUT_POST, 'faqpassword', FILTER_SANITIZE_STRING);
if (!is_null($faqusername) && !is_null($faqpassword)) {
    $user = new PMF_User_CurrentUser();
    if ($faqconfig->get('main.ldapSupport')) {
        $authLdap = new PMF_Auth_AuthLdap();
Ejemplo n.º 2
0
 * @link      http://www.phpmyfaq.de
 * @since     2002-09-17
 */
define('PMF_ROOT_DIR', dirname(__DIR__));
//
// Define the named constant used as a check by any included PHP file
//
define('IS_VALID_PHPMYFAQ', null);
//
// Bootstrapping
//
require PMF_ROOT_DIR . '/inc/Bootstrap.php';
/**
 * Initialize attachment factory
 */
PMF_Attachment_Factory::init($faqConfig->get('records.attachmentsStorageType'), $faqConfig->get('records.defaultAttachmentEncKey'), $faqConfig->get('records.enableAttachmentEncryption'));
$currentSave = PMF_Filter::filterInput(INPUT_POST, 'save', FILTER_SANITIZE_STRING);
$currentAction = PMF_Filter::filterInput(INPUT_GET, 'action', FILTER_SANITIZE_STRING);
$currentToken = PMF_Filter::filterInput(INPUT_POST, 'csrf', FILTER_SANITIZE_STRING);
$Language = new PMF_Language($faqConfig);
$LANGCODE = $Language->setLanguage($faqConfig->get('main.languageDetection'), $faqConfig->get('main.language'));
require_once PMF_ROOT_DIR . '/lang/language_en.php';
if (isset($LANGCODE) && PMF_Language::isASupportedLanguage($LANGCODE)) {
    require_once PMF_ROOT_DIR . '/lang/language_' . $LANGCODE . '.php';
} else {
    $LANGCODE = 'en';
}
$auth = false;
$user = PMF_User_CurrentUser::getFromSession($faqConfig);
if ($user) {
    $auth = true;
Ejemplo n.º 3
0
 /**
  * Migrate
  * 
  * @param integer $migrationType how to migrate
  * @param array   $options       migration options
  * 
  * @return boolean
  */
 public function doMigrate($migrationType, $options)
 {
     switch ($migrationType) {
         case PMF_Attachment_Migration::MIGRATION_TYPE1:
             PMF_Attachment_Factory::init(PMF_Attachment::STORAGE_TYPE_FILESYSTEM, '', false);
             $this->migrateFromOldFormatToFs();
             // FIXME should attachment settings update be triggered here?
             break;
         case PMF_Attachment_Migration::MIGRATION_TYPE2:
             /**
              * Awaiting new default key here
              */
             if (isset($options['defaultKey']) && !empty($options['defaultKey'])) {
                 PMF_Attachment_Factory::init(PMF_Attachment::STORAGE_TYPE_FILESYSTEM, $options['defaultKey'], true);
                 $this->migrateFromOldFormatToFs();
             } else {
                 $this->error[] = 'Default key required to be set for this option';
             }
             break;
         case PMF_Attachment_Migration::MIGRATION_TYPE3:
             // TODO implement this
             $this->error[] = 'not implemented';
             break;
         case PMF_Attachment_Migration::MIGRATION_TYPE4:
             //TODO implenemt this
             $this->error[] = 'not implemented';
             break;
         default:
             $this->error[] = 'Nothing to do';
             break;
     }
     return empty($this->error);
 }