$lst_reg = empty($stat_last_user) ? $lang['UNKNOWN'] : $stat_last_user; $files_number = $stat_files + $stat_imgs; $files_sizes = readable_size($stat_sizes); $users_number = $stat_users; # other info about php, mysql, php.ini $php_version = isset($NO_PHPINFO) || !function_exists('phpinfo') ? phpversion() : 'php ' . phpversion(); $mysql_version = 'MYSQL ' . $SQL->version(); $file_uploads_ini = function_exists('ini_get') ? @ini_get('file_uploads') : @get_cfg_var('file_uploads'); $max_file_uploads_ini = function_exists('ini_get') ? @ini_get('max_file_uploads') : @get_cfg_var('max_file_uploads'); $upload_max_filesize = function_exists('ini_get') ? @ini_get('upload_max_filesize') : @get_cfg_var('upload_max_filesize'); $post_max_size = function_exists('ini_get') ? @ini_get('post_max_size') : @get_cfg_var('post_max_size'); $max_execution_time = function_exists('ini_get') ? @ini_get('max_execution_time') : @get_cfg_var('max_execution_time'); $memory_limit = function_exists('ini_get') ? @ini_get('memory_limit') : @get_cfg_var('memory_limit'); $s_last_google = $stat_last_google == 0 ? '[ ? ]' : kleeja_date($stat_last_google); $s_google_num = $stat_google_num; $s_last_bing = $stat_last_bing == 0 ? '[ ? ]' : kleeja_date($stat_last_bing); $s_bing_num = $stat_bing_num; $usernamelang = sprintf($lang['KLEEJA_CP_W'], $user->data['name']); #size board by percent $per = $stat_sizes / ($config['total_size'] * 1048576); $per1 = round($per * 100, 2); $per1 = $per1 >= 100 ? 100 : ($per1 == 0 ? 1 : $per1); #ppl must know about kleeja version! $kleeja_version = '<a href="' . ADMIN_PATH . '?cp=p_check_update" title="' . $lang['R_CHECK_UPDATE'] . '">' . KLEEJA_VERSION . '</a>'; // // admin messages system // @ see how to do it beneath // $ADM_NOTIFICATIONS = array(); # show note: useing IE6 ! and he is admin ? omg ! $u_agent = !empty($_SERVER['HTTP_USER_AGENT']) ? htmlspecialchars((string) strtolower($_SERVER['HTTP_USER_AGENT'])) : (function_exists('getenv') ? getenv('HTTP_USER_AGENT') : '');
$nums_rows = 0; $n_fetch = $SQL->fetch($result); $nums_rows = $n_fetch['total_users']; //pagination $currentPage = isset($_GET['page']) ? intval($_GET['page']) : 1; $Pager = new pagination($perpage, $nums_rows, $currentPage); $start = $Pager->get_start_row(); $no_results = false; $arr = array(); if ($nums_rows > 0) { $query['SELECT'] = 'id, name, founder, group_id, last_visit'; $query['LIMIT'] = "{$start}, {$perpage}"; $result = $SQL->build($query); while ($row = $SQL->fetch($result)) { $userfile = $config['siteurl'] . ($config['mod_writer'] ? 'fileuser-' . $row['id'] . '.html' : 'ucp.php?go=fileuser&id=' . $row['id']); $arr[$row['id']] = array('id' => $row['id'], 'name' => $row['name'], 'userfile_link' => $userfile, 'delusrfile_link' => $row['founder'] && (int) $user->data['founder'] == 0 ? false : ADMIN_PATH . '?cp=' . basename(__FILE__, '.php') . '&deleteuserfile=' . $row['id'] . (isset($_GET['page']) ? '&page=' . intval($_GET['page']) : ''), 'delusr_link' => $user->data['id'] == $row['id'] || $row['founder'] && (int) $user->data['founder'] == 0 ? false : ADMIN_PATH . '?cp=' . basename(__FILE__, '.php') . '&del_user='******'id'] . (isset($_GET['page']) ? '&page=' . intval($_GET['page']) : ''), 'editusr_link' => $row['founder'] && (int) $user->data['founder'] == 0 ? false : ADMIN_PATH . '?cp=' . basename(__FILE__, '.php') . '&smt=edit_user&uid=' . $row['id'] . (isset($_GET['page']) ? '&page=' . intval($_GET['page']) : ''), 'founder' => (int) $row['founder'], 'last_visit' => empty($row['last_visit']) ? $lang['NOT_YET'] : kleeja_date($row['last_visit']), 'group' => get_group_name($row['group_id'])); } $SQL->free($result); } else { $no_results = true; } //pages $total_pages = $Pager->get_total_pages(); $page_nums = $Pager->print_nums(ADMIN_PATH . '?cp=' . basename(__FILE__, '.php') . (isset($_GET['search_id']) ? '&search_id=' . htmlspecialchars($_GET['search_id']) : '') . (isset($_GET['qg']) ? '&qg=' . intval($_GET['qg']) : '') . (isset($_GET['smt']) ? '&smt=' . $current_smt : ''), 'onclick="javascript:get_kleeja_link($(this).attr(\'href\'), \'#content\'); return false;"'); $show_results = true; break; #editing a user, form #editing a user, form case 'edit_user': //is exists ? if (!isset($userid)) {
$query['WHERE'] = 'r.time > ' . intval(time() - 3600 * 24); } $result = $SQL->build($query); //pagination $nums_rows = $SQL->num_rows($result); $currentPage = isset($_GET['page']) ? intval($_GET['page']) : 1; $Pager = new SimplePager($perpage, $nums_rows, $currentPage); $start = $Pager->getStartRow(); $no_results = false; $del_nums = array(); if ($nums_rows > 0) { $query['LIMIT'] = "{$start}, {$perpage}"; $result = $SQL->build($query); while ($row = $SQL->fetch_array($result)) { //make new lovely arrays !! $arr[] = array('id' => $row['id'], 'name' => $row['name'], 'mail' => $row['mail'], 'url' => $row['url'], 'text' => $row['text'], 'human_time' => kleeja_date($row['time']), 'time' => kleeja_date($row['time'], false), 'ip' => $row['ip'], 'sent' => $row['id'] == $msg_sent, 'ip_finder' => 'http://www.ripe.net/whois?form_type=simple&full_query_string=&searchtext=' . htmlspecialchars($row['ip']) . '&do_search=Search'); $del[$row['id']] = isset($_POST['del_' . $row['id']]) ? $_POST['del_' . $row['id']] : ''; $sen[$row['id']] = isset($_POST['v_' . $row['id']]) ? $_POST['v_' . $row['id']] : ''; //when submit !! if (isset($_POST['submit'])) { if ($del[$row['id']]) { $del_nums[] = $row['id']; } } if (isset($_POST['reply_submit'])) { if ($sen[$row['id']]) { $to = $row['mail']; $subject = $lang['REPLY_REPORT'] . ':' . $config['sitename']; $message = "\n " . $lang['WELCOME'] . " " . $row['name'] . "\r\n " . $lang['U_REPORT_ON'] . " " . $config['sitename'] . "\r\n " . $lang['BY_EMAIL'] . " : " . $row['mail'] . "\r\n" . $lang['ADMIN_REPLIED'] . ": \r\n" . $sen[$row['id']] . "\r\n\r\n kleeja.com"; $send = send_mail($to, $message, $subject, $config['sitemail'], $config['sitename']); if ($send) {
$url_file = $config['mod_writer'] ? $config['siteurl'] . "down-" . $id . ".html" : $config['siteurl'] . "do.php?down=" . $id; } if (!empty($config['livexts'])) { $livexts = explode(',', $config['livexts']); if (in_array($type, $livexts)) { if (isset($_GET['filename'])) { $url_filex = $config['mod_writer'] ? $config['siteurl'] . "downexf-" . $fname2 . ".html" : $config['siteurl'] . "do.php?downexf=" . $fname; } else { $url_filex = $config['mod_writer'] ? $config['siteurl'] . "downex-" . $id . ".html" : $config['siteurl'] . "do.php?downex=" . $id; } redirect($url_filex, false); } } $REPORT = $config['mod_writer'] ? $config['siteurl'] . "report-" . $id . ".html" : $config['siteurl'] . "go.php?go=report&id=" . $id; $seconds_w = $config['sec_down']; $time = kleeja_date($time); $size = Customfile_size($size); $file_ext_icon = file_exists('images/filetypes/' . $type . '.png') ? 'images/filetypes/' . $type . '.png' : 'images/filetypes/file.png'; $sty = 'download'; $title = $name . ' ' . $lang['DOWNLAOD']; } else { //file not exists ($hook = kleeja_run_hook('not_exists_qr_downlaod_file')) ? eval($hook) : null; //run hook kleeja_err($lang['FILE_NO_FOUNDED']); } ($hook = kleeja_run_hook('b4_showsty_downlaod_id_filename')) ? eval($hook) : null; //run hook //add http reffer to session to prevent errors with some browsers ! if (isset($_GET['filename'])) { $_SESSION['HTTP_REFERER'] = $config['siteurl'] . ($config['mod_writer'] ? "downloadf" . $fname . ".html" : "do.php?filename=" . $fname);
$usrcp->logout_cp(); if (isset($_GET['_ajax_'])) { //echo_ajax(999, ''); } redirect($config['siteurl']); $SQL->close(); exit; } } $gt = kleeja_filesize(PATH . 'includes/st' . 'yl' . 'e.php'); if (!empty($gt) && $gt != 10235) { exit(kleeja_base64_decode('V2hlcmUgVGhlIENvcHlyaWdodHMgOikgLi4u')); } !defined('LAST_VISIT') ? define('LAST_VISIT', time() - 3600 * 12) : ''; //last visit $last_visit = defined('LAST_VISIT') && preg_match('/[0-9]{10}/', LAST_VISIT) ? kleeja_date(LAST_VISIT) : false; //path of admin extensions $path_adm = PATH . 'includes/adm'; //exception extentions $ext_expt = array(); $ext_expt[] = 'start'; $ext_expt[] = 'php_info'; $ext_expt[] = 'b_lgoutcp'; $ext_expt[] = 'i_exts'; //confirm msgs $ext_confirm = array(); //$ext_confirm[] = 'repair'; //formkey extension, Csrf protection $GET_FORM_KEY_GLOBAL = kleeja_add_form_key_get('GLOBAL_FORM_KEY'); $ext_formkey = array(); //$ext_formkey[] = 'repair';
: <?php echo $file['uploads']; ?> </span> <span><?php echo $lang['FILESIZE']; ?> : <?php echo readable_size($file['size']); ?> </span> <span><?php echo $lang['FILEDATE']; ?> : <?php echo kleeja_date($file['time']); ?> </span> </div> </div> </div> <?php } ?> <?php if ($user_himself) { ?> <p class="kcheck"> <input id="del_<?php echo $file['id']; ?>
$num = 0; #if Kleeja is integtared with other user system, we dont want make alot of queries $ids_and_names = $files_list = array(); while ($row = $SQL->fetch($result)) { $userfile = $config['siteurl'] . ($config['mod_writer'] ? 'fileuser-' . $row['user'] . '.html' : 'ucp.php?go=fileuser&id=' . $row['user']); #for username from integrated user system if ($row['user'] != '-1' and (int) $config['user_system'] != 1) { if (!in_array($row['user'], $ids_and_names)) { $row['username'] = $usrcp->usernamebyid($row['user']); $ids_and_names[$row['user']] = $row['username']; } else { $row['username'] = $ids_and_names[$row['user']]; } } #files array $files_list[$row['id']] = array('id' => $row['id'], 'name' => "<a title=\" " . ($row['real_filename'] == '' ? $row['name'] : $row['real_filename']) . "\" href=\"./" . PATH . $row['folder'] . "/" . $row['name'] . "\" target=\"blank\">" . ($row['real_filename'] == '' ? strlen($row['name']) > 20 ? substr($row['name'], 0, 20) . '...' : $row['name'] : (strlen($row['real_filename']) > 20 ? substr($row['real_filename'], 0, 20) . '...' : $row['real_filename'])) . "</a>", 'size' => readable_size($row['size']), 'ups' => $row['uploads'], 'direct' => $row['id_form'] == 'direct' ? true : false, 'time_human' => kleeja_date($row['time']), 'time' => kleeja_date($row['time'], false), 'type' => $row['type'], 'typeicon' => file_exists(PATH . "images/filetypes/" . $row['type'] . ".png") ? PATH . "images/filetypes/" . $row['type'] . ".png" : PATH . 'images/filetypes/file.png', 'folder' => $row['folder'], 'report' => $row['report'] > 4 ? "<span style=\"color:red;font-weight:bold\">" . $row['report'] . "</span>" : $row['report'], 'user' => $row['user'] == '-1' ? $lang['GUST'] : '<a href="' . $userfile . '" target="_blank">' . $row['username'] . '</a>', 'ip' => '<a href="http://www.ripe.net/whois?form_type=simple&full_query_string=&searchtext=' . $row['user_ip'] . '&do_search=Search" target="_new">' . $row['user_ip'] . '</a>', 'showfilesbyip' => ADMIN_PATH . '?cp=h_search&s_input=1&s_value=' . $row['user_ip']); $del[$row['id']] = isset($_POST['del_' . $row['id']]) ? $_POST['del_' . $row['id']] : ''; } $SQL->free($result); } else { //no result .. $no_results = true; } #update f_lastvisit if (!$is_search) { if (filter_exists('f_lastvisit', 'filter_uid')) { update_filter('f_lastvisit', time()); } else { insert_filter('lastvisit', time(), false, false, '', 'f_lastvisit'); } }
$most_online = 1; // 1 == you $on_muoe = time(); } else { list($most_online, $on_muoe) = @explode(':', $config['most_user_online_ever']); } //ok .. go on $titlee = $lang['STATS']; $stylee = 'stats'; $files_st = $stat_files; $imgs_st = $stat_imgs; $users_st = $stat_users; $sizes_st = Customfile_size($stat_sizes); $lst_dl_st = (int) $config['del_f_day'] <= 0 ? false : kleeja_date($stat_last_f_del); $lst_reg = empty($stat_last_user) ? $lang['UNKNOWN'] : $stat_last_user; $on_muoe = kleeja_date($on_muoe); ($hook = kleeja_run_hook('stats_go_page')) ? eval($hook) : null; //run hook break; // // Page for redirect to downloading a file // [!] depreacted from 1rc6+, see do.php // // // Page for redirect to downloading a file // [!] depreacted from 1rc6+, see do.php // case 'down': //go.php?go=down&n=$1&f=$2&i=$3 if (isset($_GET['n'])) { $url_file = (int) $config['mod_writer'] == 1 ? $config['siteurl'] . 'download' . intval($_GET['i']) . '.html' : $config['siteurl'] . 'do.php?id=' . intval($_GET['n']);
$no_results = false; $query['LIMIT'] = "{$start}, {$perpage}"; ($hook = kleeja_run_hook('qr_select_files_in_fileuser')) ? eval($hook) : null; //run hook $result = $SQL->build($query); $i = $currentPage * $perpage - $perpage; $tdnumi = $num = $files_num = $imgs_num = 0; while ($row = $SQL->fetch_array($result)) { ++$i; $file_info = array('::ID::' => $row['id'], '::NAME::' => $row['name'], '::DIR::' => $row['folder'], '::FNAME::' => $row['real_filename']); $is_image = in_array(strtolower(trim($row['type'])), array('gif', 'jpg', 'jpeg', 'bmp', 'png')) ? true : false; $url = $is_image ? kleeja_get_link('image', $file_info) : kleeja_get_link('file', $file_info); $url_thumb = $is_image ? kleeja_get_link('thumb', $file_info) : kleeja_get_link('thumb', $file_info); $url_fileuser = $is_image ? $url : (file_exists("images/filetypes/" . $row['type'] . ".png") ? "images/filetypes/" . $row['type'] . ".png" : 'images/filetypes/file.png'); //make new lovely arrays !! $arr[] = array('id' => $row['id'], 'name_img' => $row['real_filename'] == '' ? strlen($row['name']) > 40 ? substr($row['name'], 0, 40) . '...' : $row['name'] : (strlen($row['real_filename']) > 40 ? substr($row['real_filename'], 0, 40) . '...' : $row['real_filename']), 'url_thumb_img' => '<a title="' . ($row['real_filename'] == '' ? $row['name'] : $row['real_filename']) . '" href="' . $url . '" onclick="window.open(this.href,\'_blank\');return false;"><img src="' . $url_fileuser . '" alt="' . $row['type'] . '" /></a>', 'name_file' => '<a title="' . ($row['real_filename'] == '' ? $row['name'] : $row['real_filename']) . '" href="' . $url . '" onclick="window.open(this.href,\'_blank\');return false;">' . ($row['real_filename'] == '' ? strlen($row['name']) > 40 ? substr($row['name'], 0, 40) . '...' : $row['name'] : (strlen($row['real_filename']) > 40 ? substr($row['real_filename'], 0, 40) . '...' : $row['real_filename'])) . '</a>', 'url_thumb_file' => '<a title="' . ($row['real_filename'] == '' ? $row['name'] : $row['real_filename']) . '" href="' . $url . '" onclick="window.open(this.href,\'_blank\');return false;"><img src="' . $url_fileuser . '" alt="' . $row['type'] . '" /></a>', 'file_type' => $row['type'], 'uploads' => $row['uploads'], 'tdnum' => $tdnumi == 0 ? '<ul>' : '', 'tdnum2' => $tdnumi == 4 ? '</ul>' : '', 'href' => $url, 'size' => Customfile_size($row['size']), 'time' => !empty($row['time']) ? kleeja_date($row['time']) : '...', 'thumb_link' => $is_image ? $url_thumb : $url_fileuser, 'is_image' => $is_image); $tdnumi = $tdnumi == 2 ? 0 : $tdnumi + 1; if (isset($_POST['submit_files']) && $user_himself) { ($hook = kleeja_run_hook('submit_in_fileuser')) ? eval($hook) : null; //run hook //check for form key if (!kleeja_check_form_key('fileuser', 1800)) { kleeja_info($lang['INVALID_FORM_KEY']); } if ($_POST['del_' . $row['id']]) { //delete from folder .. @kleeja_unlink($row['folder'] . '/' . $row['name']); //delete thumb if (file_exists($row['folder'] . '/thumbs/' . $row['name'])) { @kleeja_unlink($row['folder'] . '/thumbs/' . $row['name']); }
$result = $SQL->build($query); $nums_rows = 0; $n_fetch = $SQL->fetch_array($result); $nums_rows = $n_fetch['total_users']; //pagination $currentPage = isset($_GET['page']) ? intval($_GET['page']) : 1; $Pager = new SimplePager($perpage, $nums_rows, $currentPage); $start = $Pager->getStartRow(); $no_results = false; if ($nums_rows > 0) { $query['SELECT'] = 'id, name, founder, group_id, last_visit'; $query['LIMIT'] = "{$start}, {$perpage}"; $result = $SQL->build($query); while ($row = $SQL->fetch_array($result)) { $userfile = $config['siteurl'] . ($config['mod_writer'] ? 'fileuser-' . $row['id'] . '.html' : 'ucp.php?go=fileuser&id=' . $row['id']); $arr[] = array('id' => $row['id'], 'name' => $row['name'], 'userfile_link' => $userfile, 'delusrfile_link' => $row['founder'] && (int) $userinfo['founder'] == 0 ? false : basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&deleteuserfile=' . $row['id'] . (isset($_GET['page']) ? '&page=' . intval($_GET['page']) : ''), 'delusr_link' => $userinfo['id'] == $row['id'] || $row['founder'] && (int) $userinfo['founder'] == 0 ? false : basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&del_user='******'id'] . (isset($_GET['page']) ? '&page=' . intval($_GET['page']) : ''), 'editusr_link' => $row['founder'] && (int) $userinfo['founder'] == 0 ? false : basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&smt=edit_user&uid=' . $row['id'] . (isset($_GET['page']) ? '&page=' . intval($_GET['page']) : ''), 'founder' => (int) $row['founder'], 'last_visit' => empty($row['last_visit']) ? $lang['NOT_YET'] : kleeja_date($row['last_visit']), 'group' => str_replace(array('{lang.ADMINS}', '{lang.USERS}', '{lang.GUESTS}'), array($lang['ADMINS'], $lang['USERS'], $lang['GUESTS']), $d_groups[$row['group_id']]['data']['group_name'])); } $SQL->freeresult($result); } else { $no_results = true; } //pages $total_pages = $Pager->getTotalPages(); $page_nums = $Pager->print_nums(basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . (isset($_GET['search_id']) ? '&search_id=' . htmlspecialchars($_GET['search_id']) : '') . (isset($_GET['qg']) ? '&qg=' . intval($_GET['qg']) : '') . (isset($_GET['smt']) ? '&smt=' . $current_smt : ''), 'onclick="javascript:get_kleeja_link($(this).attr(\'href\'), \'#content\'); return false;"'); $show_results = true; break; #editing a user, form #editing a user, form case 'edit_user': //is exists ? if (!isset($userid)) {