Esempio n. 1
0
/**
 * kitForm
 *
 * @author Ralf Hertsch <*****@*****.**>
 * @link http://phpmanufaktur.de
 * @copyright 2011 - 2012
 * @license MIT License (MIT) http://www.opensource.org/licenses/MIT
 */
// include class.secure.php to protect this file and the whole CMS!
if (defined('WB_PATH')) {
    if (defined('LEPTON_VERSION')) {
        include WB_PATH . '/framework/class.secure.php';
    }
} else {
    $oneback = "../";
    $root = $oneback;
    $level = 1;
    while ($level < 10 && !file_exists($root . '/framework/class.secure.php')) {
        $root .= $oneback;
        $level += 1;
    }
    if (file_exists($root . '/framework/class.secure.php')) {
        include $root . '/framework/class.secure.php';
    } else {
        trigger_error(sprintf("[ <b>%s</b> ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR);
    }
}
// end include class.secure.php
require_once WB_PATH . '/modules/' . basename(dirname(__FILE__)) . '/class.backend.php';
$tool = new formBackend();
$tool->action();
 public function __construct()
 {
     global $I18n;
     $this->page_link = ADMIN_URL . '/admintools/tool.php?tool=kit_form';
     $this->template_path = LEPTON_PATH . '/modules/' . basename(dirname(__FILE__)) . '/htt/';
     $this->img_url = LEPTON_URL . '/modules/' . basename(dirname(__FILE__)) . '/images/';
     date_default_timezone_set(cfg_time_zone);
     $this->lang = $I18n;
     // use another table prefix or change protocol limit?
     if (file_exists(LEPTON_PATH . '/modules/' . basename(dirname(__FILE__)) . '/config.json')) {
         $config = json_decode(file_get_contents(LEPTON_PATH . '/modules/' . basename(dirname(__FILE__)) . '/config.json'), true);
         if (isset($config['table_prefix'])) {
             self::$table_prefix = $config['table_prefix'];
         }
         if (isset($config['protocol_limit'])) {
             self::$protocol_limit = (int) $config['protocol_limit'];
         }
     }
 }