示例#1
0
$tempp1 = $getURL->lsGetseg(1);
$tempp2 = $getURL->lsGetseg(2);
$tempp3 = $getURL->lsGetseg(3);
$tempp4 = $getURL->lsGetseg(4);
$tempp5 = $getURL->lsGetseg(5);
$tempp6 = $getURL->lsGetseg(6);
// Check if we want caching
if (!is_dir(APP_PATH . LS_CACHE_DIRECTORY)) {
    mkdir(APP_PATH . LS_CACHE_DIRECTORY, 0755);
}
// define file better for caching
$cachedefinefile = APP_PATH . LS_CACHE_DIRECTORY . '/define.php';
if (!file_exists($cachedefinefile)) {
    $allsettings = "<?php\n";
    // Get the general settings out the database
    $result = $lsdb->query('SELECT varname, value FROM ' . DB_PREFIX . 'jrc_setting');
    while ($row = $result->fetch_assoc()) {
        // collect each record into a define
        // Now check if sting contains html and do something about it!
        if (strlen($row['value']) != strlen(filter_var($row['value'], FILTER_SANITIZE_STRING))) {
            $defvar = 'htmlspecialchars_decode("' . htmlspecialchars($row['value']) . '")';
        } else {
            $defvar = "'" . $row["value"] . "'";
        }
        $allsettings .= "define('LS_" . strtoupper($row['varname']) . "', " . $defvar . ");\n";
    }
    $allsettings .= "?>";
    LS_base::lsWriteinCache($cachedefinefile, $allsettings, '');
}
// Now include the created definefile
include_once $cachedefinefile;
示例#2
0
        }
        if (!preg_match('/^([a-zA-Z0-9\\-_])+$/', $_POST['username'])) {
            $errors .= 'Please insert a valid username (A-Z,a-z,0-9,-_).';
        }
        if (count($errors) == 0) {
            // MySQL/i connection
            if (DB_USER && DB_PASS) {
                $lsdb = new ls_mysql(DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT);
                $lsdb->set_charset("utf8");
            }
            // The new password encrypt with hash_hmac
            $passcrypt = hash_hmac('sha256', $_POST['pass'], DB_PASS_HASH);
            $lsdb->query('INSERT INTO ' . DB_PREFIX . 'jrc_user SET
	username = "******",
	password = "******",
	email = "' . smartsql($_POST['email']) . '",
	name = "' . smartsql($_POST['name']) . '",
	time = NOW(),
	access = 1');
            $lsdb->query('UPDATE ' . DB_PREFIX . 'jrc_setting SET value = "' . smartsql($_POST['email']) . '" WHERE varname = "email"');
            @$lsdb->query('ALTER DATABASE ' . DB_NAME . ' DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci');
            // Finally close all db connections
            $lsdb->ls_close();
            // confirm
            include_once '../class/class.postmail.php';
            $email_body = 'URL: ' . FULL_SITE_DOMAIN . '<br />Email: ' . $_POST['email'];
            // Send the email to the customer
            $mail = new PHPMailer();
            // defaults to using php "mail()"
            $body = str_ireplace("[\\]", "", $email_body);
            $mail->SetFrom($_POST['email']);
示例#3
0
$tempp1 = $getURL->lsGetseg(1);
$tempp2 = $getURL->lsGetseg(2);
$tempp3 = $getURL->lsGetseg(3);
$tempp4 = $getURL->lsGetseg(4);
$tempp5 = $getURL->lsGetseg(5);
$tempp6 = $getURL->lsGetseg(6);
// Check if we want caching
if (!is_dir(APP_PATH . LS_CACHE_DIRECTORY)) {
    mkdir(APP_PATH . LS_CACHE_DIRECTORY, 0755);
}
// define file better for caching
$cachedefinefile = APP_PATH . LS_CACHE_DIRECTORY . '/define.php';
if (!file_exists($cachedefinefile)) {
    $allsettings = "<?php\n";
    // Get the general settings out the database
    $result = $lsdb->query('SELECT varname, value FROM ' . DB_PREFIX . 'setting');
    while ($row = $result->fetch_assoc()) {
        // collect each record into a define
        // Now check if sting contains html and do something about it!
        if (strlen($row['value']) != strlen(filter_var($row['value'], FILTER_SANITIZE_STRING))) {
            $defvar = 'htmlspecialchars_decode("' . htmlspecialchars($row['value']) . '")';
        } else {
            $defvar = "'" . $row["value"] . "'";
        }
        $allsettings .= "define('LS_" . strtoupper($row['varname']) . "', " . $defvar . ");\n";
    }
    $allsettings .= "?>";
    LS_base::lsWriteinCache($cachedefinefile, $allsettings, '');
}
// Now include the created definefile
include_once $cachedefinefile;