//check data ...
 if (empty($_POST['sitename']) || empty($_POST['siteurl']) || empty($_POST['sitemail']) || empty($_POST['username']) || empty($_POST['password']) || empty($_POST['email'])) {
     echo $lang['EMPTY_FIELDS'];
     echo $footer_inst;
     exit;
 }
 if (strpos($_POST['email'], '@') === false) {
     echo $lang['WRONG_EMAIL'];
     echo $footer_inst;
     exit;
 }
 //connect .. for check
 $SQL = new SSQL($dbserver, $dbuser, $dbpass, $dbname);
 include_once '../includes/usr.php';
 include_once '../includes/functions_alternative.php';
 $usrcp = new usrcp();
 $user_salt = substr(kleeja_base64_encode(pack("H*", sha1(mt_rand()))), 0, 7);
 $user_pass = $usrcp->kleeja_hash_password($_POST['password'] . $user_salt);
 $user_name = $SQL->escape($_POST['username']);
 $user_mail = $SQL->escape($_POST['email']);
 $config_sitename = $SQL->escape($_POST['sitename']);
 $config_siteurl = $SQL->escape($_POST['siteurl']);
 $config_sitemail = $SQL->escape($_POST['sitemail']);
 $config_style = $SQL->escape($_POST['style']);
 $config_urls_type = in_array($_POST['urls_type'], array('id', 'filename', 'direct')) ? $_POST['urls_type'] : 'id';
 $clean_name = $usrcp->cleanusername($SQL->escape($user_name));
 /// ok .. we will get sqls now ..
 include 'includes/install_sqls.php';
 include 'includes/default_values.php';
 $err = $dots = 0;
 $errors = '';
Example #2
0
function update_clean_name()
{
    global $SQL, $dbprefix, $_path, $lang;
    include_once $_path . 'includes/usr.php';
    $usrcp = new usrcp();
    $last_id_was = 0;
    $user_per_refresh = 100;
    $is = isset($_GET['is_us']) ? intval($_GET['is_us']) : 0;
    $num_users = isset($_GET['num_users']) ? intval($_GET['num_users']) : 0;
    $loop = isset($_GET['loop']) ? intval($_GET['loop']) + 1 : 1;
    $query = array('SELECT' => 'COUNT(id) AS total_users', 'FROM' => "{$dbprefix}users");
    $result = $SQL->build($query);
    if ($is == 0) {
        $result = $SQL->build($query);
        $num_users = 0;
        $n_fetch = $SQL->fetch_array($result);
        $num_users = $n_fetch['total_users'];
    }
    $query = array('SELECT' => 'id, clean_name, name', 'FROM' => "{$dbprefix}users", 'WHERE' => 'id > ' . $is, 'ORDER BY' => 'id ASC', 'LIMIT' => $user_per_refresh);
    $result = $SQL->build($query);
    while ($row = $SQL->fetch_array($result)) {
        $last_id_was = $row['id'];
        if ($row['clean_name'] == '') {
            $update_query = array('UPDATE' => "{$dbprefix}users", 'SET' => "clean_name = '" . $SQL->escape($usrcp->cleanusername($row['name'])) . "'", 'WHERE' => "id=" . $row['id']);
            $SQL->build($update_query);
        }
    }
    $SQL->freeresult($result);
    global $update_msgs_arr;
    $update_msgs_arr[] = '<span style="color:green;">' . $lang['RC6_1_CNV_CLEAN_NAMES'] . ' [ <strong>' . $loop . ' -> ' . ceil($num_users / $user_per_refresh) . '</strong> ] </span>';
    if ($num_users > $last_id_was) {
        $url = 'update.php?step=update_now&amp;complet_up_func=1&amp;action_file_do=' . htmlspecialchars($_GET['action_file_do']) . '&amp;is_us=' . $last_id_was . '&amp;num_users=' . $num_users . '&amp;loop=' . $loop . '&amp;lang=' . htmlspecialchars($_GET['lang']);
        echo '<meta http-equiv="refresh" content="4; url=' . $url . '" />';
    }
}
Example #3
0
if (defined('IN_ADMIN')) {
    include PATH . 'includes/functions_adm.php';
} else {
    include PATH . 'includes/KljUploader.php';
    $kljup = new KljUploader();
}
//fix intregation problems
if (empty($script_encoding)) {
    $script_encoding = 'windows-1256';
}
// start classes ..
$SQL = new SSQL($dbserver, $dbuser, $dbpass, $dbname);
//no need after now
unset($dbpass);
$tpl = new kleeja_style();
$usrcp = new usrcp();
//then get caches
include PATH . 'includes/cache.php';
//getting dynamic configs
$query = array('SELECT' => 'c.name, c.value', 'FROM' => "{$dbprefix}config c", 'WHERE' => 'c.dynamic = 1');
$result = $SQL->build($query);
while ($row = $SQL->fetch_array($result)) {
    $config[$row['name']] = $row['value'];
}
$SQL->freeresult($result);
//check user or guest
$usrcp->kleeja_check_user();
//+ configs of the current group
$config = array_merge($config, (array) $d_groups[$usrcp->group_id()]['configs']);
//no tpl caching in dev stage
if (defined('DEV_STAGE')) {
require PATH . 'includes/KljUploader.php';
require PATH . 'includes/usr.php';
require PATH . 'includes/pager.php';
require PATH . 'includes/functions.php';
require PATH . 'includes/functions_display.php';
//fix intregation problems
if (empty($script_encoding)) {
    $script_encoding = 'widnows-1256';
}
// start classes ..
$SQL = new SSQL($dbserver, $dbuser, $dbpass, $dbname);
//no need after now
unset($dbpass);
$tpl = new kleeja_style();
$kljup = new KljUploader();
$usrcp = new usrcp();
//then get caches
require PATH . 'includes/cache.php';
//check user or guest
$usrcp->kleeja_check_user();
//no tpl caching in dev stage
if (defined('DEV_STAGE')) {
    $tpl->caching = false;
}
//check if admin (true/false)
$is_admin = $usrcp->admin();
//kleeja session id
$klj_session = $SQL->escape(session_id());
// for gzip : php.net
//fix bug # 181
//we stopped this in development stage cuz it's will hide notices