* @license ./docs/license.txt * */ // not for directly open if (!defined('IN_ADMIN')) { exit; } #turn time-limit off @set_time_limit(0); #get current case $case = false; if (isset($_GET['case'])) { $case = htmlspecialchars($_GET['case']); } #set form ket $GET_FORM_KEY = kleeja_add_form_key_get('REPAIR_FORM_KEY'); //check _GET Csrf token if ($case && in_array($case, array('clearc', 'sync_files', 'sync_images', 'sync_users', 'tables', 'sync_sizes', 'status_file'))) { if (!kleeja_check_form_key_get('REPAIR_FORM_KEY')) { kleeja_admin_err($lang['INVALID_GET_KEY'], true, $lang['ERROR'], true, basename(ADMIN_PATH), 2); } } switch ($case) { default: # Get real number from database right now $all_files = get_actual_stats('files'); $all_images = get_actual_stats('imgs'); $all_users = get_actual_stats('users'); $all_sizes = Customfile_size(get_actual_stats('sizes')); #links $del_cache_link = basename(ADMIN_PATH) . '?cp=r_repair&case=clearc&' . $GET_FORM_KEY;
} @closedir($dh); } # hurry, hurry section, get languages $hurry_lang_link = ADMIN_PATH . '?cp=g_users&smt=general&smt=group_data&' . $GET_FORM_KEY . '&lang_change='; $hurry_langs_list = array(); if ($dh = @opendir(PATH . 'lang')) { while (($file = @readdir($dh)) !== false) { if (strpos($file, '.') === false && $file != '..' && $file != '.') { $hurry_langs_list[] = $file; } } @closedir($dh); } # hurry, hurry section, links $del_cache_link = ADMIN_PATH . '?cp=r_repair&case=clearc&' . kleeja_add_form_key_get('REPAIR_FORM_KEY'); # get stats filter so we can draw a chart for the user $stats_chart = false; $cf_query = array('SELECT' => 'f.filter_uid, f.filter_value, f.filter_time', 'FROM' => "{$dbprefix}filters f", 'WHERE' => "f.filter_type = 'stats_for_acp'", 'ORDER BY' => 'f.filter_time DESC'); $cf_result = $SQL->build($cf_query); $cf_num = $SQL->num($cf_result); if ($cf_num > 4) { $stats_chart = 'arrayOfDataMulti = new Array('; $comma = false; #get currently right now stats, not cached one $prv_files = get_actual_stats('files'); $prev_imgs = get_actual_stats('imgs'); $prev_date = date('d-n-Y'); while ($row = $SQL->fetch($cf_result)) { #jump today if ($prev_date == $row['filter_uid']) {
} //prevent notice if (!isset($_GET['sty_t'])) { $_GET['sty_t'] = null; } #current secondary menu action $current_smt = isset($_GET['smt']) ? preg_match('![a-z0-9_]!i', trim($_GET['smt'])) ? trim($_GET['smt']) : 'general' : 'general'; switch ($_GET['sty_t']) { default: case 'st': //for style .. $stylee = "admin_styles"; $action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&sty_t=st' . '&smt=' . $current_smt; $edit_tpl_action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&sty_t=style_orders&style_id=' . $config['style'] . '&smt=' . $current_smt . '&method=1&tpl_choose='; $show_all_tpls_action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&style_choose=' . $config['style'] . '&method=1' . '&smt=' . $current_smt; $GET_FORM_KEY = kleeja_add_form_key_get('adm_style_del_edit'); $H_FORM_KEYS2 = kleeja_add_form_key('adm_style_order_add'); $H_FORM_KEYS3 = kleeja_add_form_key('adm_style_order_bkup'); //kleeja depend on its users .. and kleeja love them .. so let's tell them about that .. $klj_d_s = $lang['KLJ_MORE_STYLES'][rand(0, sizeof($lang['KLJ_MORE_STYLES']) - 1)]; //get styles $arr = array(); if ($dh = @opendir(PATH . 'styles')) { while (($file = @readdir($dh)) !== false) { if (strpos($file, '.') === false && $file != '..' && $file != '.') { $arr[] = array('style_name' => $file, 'is_default' => $config['style'] == $file ? true : false, 'link_show_tpls' => basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&sty_t=st&style_choose=' . $file . '&method=1&smt=curstyle', 'link_mk_default' => basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&sty_t=st&style_choose=' . $file . '&method=2&smt=curstyle'); } } @closedir($dh); } //after submit
// not for directly open if (!defined('IN_ADMIN')) { exit; } //for style .. $current_template = "users.php"; $current_smt = isset($_GET['smt']) ? preg_match('![a-z0-9_]!i', trim($_GET['smt'])) ? trim($_GET['smt']) : 'general' : 'general'; $action = ADMIN_PATH . '?cp=' . basename(__FILE__, '.php') . (isset($_GET['page']) ? '&page=' . intval($_GET['page']) : ''); $action .= isset($_GET['search_id']) ? '&search_id=' . htmlspecialchars($_GET['search']) : ''; $action .= (isset($_GET['qg']) ? '&qg=' . intval($_GET['qg']) : '') . '&smt=' . $current_smt; $action_all = ADMIN_PATH . '?cp=' . basename(__FILE__, '.php') . '&smt=' . $current_smt . (isset($_GET['page']) ? '&page=' . intval($_GET['page']) : ''); //if not noraml user system $user_not_normal = (int) $config['user_system'] != 1 ? true : false; $is_search = $affected = $is_asearch = $GE_INFO = false; $isn_search = true; $GET_FORM_KEY = kleeja_add_form_key_get('adm_users'); $H_FORM_KEYS = kleeja_add_form_key('adm_users'); $H_FORM_KEYS2 = kleeja_add_form_key('adm_users_newuser'); $H_FORM_KEYS3 = kleeja_add_form_key('adm_users_newgroup'); $H_FORM_KEYS4 = kleeja_add_form_key('adm_users_delgroup'); $H_FORM_KEYS5 = kleeja_add_form_key('adm_users_editacl'); $H_FORM_KEYS6 = kleeja_add_form_key('adm_users_editdata'); $H_FORM_KEYS7 = kleeja_add_form_key('adm_users_editexts'); $H_FORM_KEYS8 = kleeja_add_form_key('adm_users_edituser'); // // Check form key // if (isset($_POST['submit'])) { if (!kleeja_check_form_key('adm_users')) { kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1); }
!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'; ($hook = kleeja_run_hook('begin_admin_page')) ? eval($hook) : null; //run hook // //We hide list of admin menu and show only if there is auth. // $SHOW_LIST = true; //get adm extensions if (($dh = @opendir($path_adm)) !== false) { while (($file = readdir($dh)) !== false) { if (strpos($file, '.php') !== false) { $adm_extensions[] = str_replace('.php', '', $file); } }
} } if (!$icon) { $icon = file_get_contents($STYLE_PATH_ADMIN . 'images/default_plguin_icon.png'); } header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Accept-Ranges: bytes'); header('Content-Length: ' . strlen($icon)); header('Content-Type: image/png'); echo $icon; $SQL->close(); exit; } #security vars $H_FORM_KEYS = kleeja_add_form_key('adm_plugins'); $GET_FORM_KEY = kleeja_add_form_key_get('adm_plugins'); #initiate plugins class include PATH . 'includes/plugins.php'; $plg = new kplugins(); //return values of ftp from config, if not get suggested one $ftp_info = array('host', 'user', 'pass', 'path', 'port'); if (!empty($config['ftp_info'])) { $ftp_info = @unserialize($config['ftp_info']); } else { //todo : make sure to figure this from OS, and some other things $ftp_info['path'] = str_replace('/includes/adm', '', dirname(__FILE__)) . '/'; #mose if (strpos($ftp_info['path'], 'public_html') !== false) { $ftppath_parts = explode('public_html', $ftp_info['path']); $ftp_info['path'] = '/public_html' . $ftppath_parts[1]; } else {
//helpls kleeja to be up to date! //copyright 2007-2009 Kleeja.com .. //license http://opensource.org/licenses/gpl-license.php GNU Public License //$Author: $ , $Rev: $, $Date:: $ // not for directly open if (!defined('IN_ADMIN')) { exit; } //update in 5 steps so we can reduce the load and knows errors when they occurs $v = @unserialize($config['new_version']); if (!version_compare(strtolower(KLEEJA_VERSION), strtolower($v['version_number']), '<')) { //kleeja_admin_err($lang['U_LAST_VER_KLJ']); } #security vars $H_FORM_KEYS = kleeja_add_form_key('adm_aupdate'); $GET_FORM_KEY = kleeja_add_form_key_get('adm_aupdate'); $current_step = isset($_GET['astep']) ? preg_match('![a-z0-9_]!i', trim($_GET['astep'])) ? trim($_GET['astep']) : 'general' : 'general'; $action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&astep=' . $current_step; if ($current_step != 'general') { //check _GET Csrf token //remember to add token at every m=? request ! if (!kleeja_check_form_key_get('adm_aupdate')) { kleeja_admin_err($lang['INVALID_GET_KEY'], true, $lang['ERROR'], true, basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php'), 2); } } include PATH . 'includes/update.php'; //for style .. $stylee = 'admin_aupdate'; //$action = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') .'&sty_t=style_orders'; //class $ups = new kupdate();