Esempio n. 1
0
         }
     }
     if (!$error && display_plugin('api', 'open_uc_plugin', $settings['connect_uc'], 0)) {
         $uid = uc_user_register($username, $password, $email);
         if ($uid <= 0) {
             $error = true;
             $sysmsg[] = 'UC: ' . __('add_user_error');
         }
     }
     if (!$error) {
         $ins = array('username' => $username, 'password' => $md5_pwd, 'email' => $email, 'qq' => $qq, 'gid' => $gid, 'credit' => $credit, 'wealth' => $wealth, 'rank' => $rank, 'exp' => $exp, 'is_locked' => $is_locked, 'reg_time' => $timestamp, 'reg_ip' => $onlineip);
         $db->query("insert into {$tpf}users set " . $db->sql_array($ins) . ";");
         $rs = $db->fetch_one_array("select count(*) as total from {$tpf}users ");
         if ($rs['total']) {
             $stats['users_count'] = (int) $rs['total'];
             stats_cache($stats);
         }
         unset($rs);
         $sysmsg[] = __('add_user_success');
         redirect(urr(ADMINCP, "item=users&menu=user&action=index"), $sysmsg);
     } else {
         redirect('back', $sysmsg);
     }
 } else {
     $q = $db->query("select gid,group_name,group_type from {$tpf}groups order by gid asc");
     $groups = array();
     while ($rs = $db->fetch_array($q)) {
         $rs['txtcolor'] = $rs['group_type'] ? 'txtblue' : '';
         $groups[] = $rs;
     }
     $db->free($q);
Esempio n. 2
0
function main_stats()
{
    global $db, $tpf;
    $stats['user_folders_count'] = (int) @$db->result_first("select count(*) from {$tpf}folders");
    $stats['user_files_count'] = (int) @$db->result_first("select count(*) from {$tpf}files");
    $stats['users_count'] = (int) @$db->result_first("select count(*) from {$tpf}users ");
    $stats['users_locked_count'] = (int) @$db->result_first("select count(*) from {$tpf}users where is_locked=1");
    $stats['extract_code_count'] = (int) @$db->result_first("select count(*) from {$tpf}extracts");
    $stats['all_files_count'] = (int) @$db->result_first("select count(*) from {$tpf}files");
    $storage_count_tmp = (double) @$db->result_first("select sum(file_size) from {$tpf}files");
    $stats['user_storage_count'] = get_size($storage_count_tmp);
    $stats['total_storage_count'] = get_size($storage_count_tmp);
    $stats['users_open_count'] = $stats['users_count'] - $stats['users_locked_count'];
    $stats['stat_time'] = TS;
    stats_cache($stats);
}
Esempio n. 3
0
$charset_arr = array('gbk' => 'gbk', 'utf-8' => 'utf8');
$db_charset = $charset_arr[strtolower($configs['charset'])];
header("Content-Type: text/html; charset={$charset}");
require_once PHPDISK_ROOT . 'includes/core/core.phpdisk.php';
phpdisk_core::init_core();
$db = phpdisk_core::init_db_connect();
$setting_file = PHPDISK_ROOT . 'system/settings.inc.php';
file_exists($setting_file) ? require_once $setting_file : settings_cache();
//init base env
require_once PHPDISK_ROOT . 'system/adminset.inc.php';
$file = PHPDISK_ROOT . 'system/global/plugin_settings.inc.php';
file_exists($file) ? require_once $file : plugin_cache();
$file = PHPDISK_ROOT . 'system/global/group_settings.inc.php';
file_exists($file) ? require_once $file : group_settings_cache();
$file = PHPDISK_ROOT . 'system/global/stats.inc.php';
file_exists($file) ? require_once $file : stats_cache();
unset($file);
// debug
$settings[open_cache] = 1;
//(int)$settings[open_cache];
//
require PHPDISK_ROOT . 'includes/class/cache_file.class.php';
$C['gz']['open'] = $settings['gzipcompress'];
phpdisk_core::gzcompress_open();
$arr = phpdisk_core::init_lang_tpl();
$user_tpl_dir = $arr['user_tpl_dir'];
$admin_tpl_dir = $arr['admin_tpl_dir'];
$auth[is_fms] = $arr['fms'];
$C['lang_type'] = $arr['lang_name'];
if ($settings[open_switch_tpls]) {
    $tpl_sw = select_tpl();
Esempio n. 4
0
    unset($rs);
}
$C[last_file] = get_last_file(15);
$C[hot_file] = get_hot_file(15);
if ($auth[is_fms]) {
    $C[links_arr] = get_friend_link();
    $C[last_users] = get_last_user_list(5);
    $C[last_one] = index_last();
    $C[ann_list] = get_announces();
    $C[index_tags] = get_last_tag();
    $C[commend_file] = get_commend_file(15);
}
require_once template_echo('phpdisk', $user_tpl_dir);
$f = PHPDISK_ROOT . "./system/global/stats.inc.php";
if (!file_exists($f) || $timestamp - @filemtime($f) > 3600) {
    stats_cache();
}
sitemap::build();
include PHPDISK_ROOT . "./includes/footer.inc.php";
function get_last_user_list($num = 10)
{
    global $db, $tpf;
    $q = $db->query("select username,reg_time from {$tpf}users order by userid desc limit {$num}");
    $last_users = array();
    while ($rs = $db->fetch_array($q)) {
        $rs[a_space] = urr("space", "username=" . rawurlencode($rs[username]));
        $rs[reg_time] = date('Y-m-d', $rs[reg_time]);
        $last_users[] = $rs;
    }
    $db->free($q);
    unset($rs);