예제 #1
0
파일: o_langs.php 프로젝트: Saleh7/Kleeja
}
//english as default
if (!isset($_REQUEST['lang'])) {
    $_REQUEST['lang'] = 'en';
}
$lang_id = preg_replace('![^a-z]!', '', $_REQUEST['lang']);
//for style ..
$stylee = "admin_langs";
$action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&page=' . (isset($_GET['page']) ? intval($_GET['page']) : 1) . '&lang=' . $lang_id;
$action2 = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php');
$H_FORM_KEYS = kleeja_add_form_key('adm_langs');
//
// Check form key
//
if (isset($_POST['submit'])) {
    if (!kleeja_check_form_key('adm_langs')) {
        kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 3);
    }
}
//get languages
$lngfiles = '';
if ($dh = @opendir(PATH . 'lang')) {
    while (($file = readdir($dh)) !== false) {
        if (strpos($file, '.') === false && $file != '..' && $file != '.') {
            $lngfiles .= '<option ' . ($lang_id == $file ? 'selected="selected"' : '') . ' value="' . $file . '">' . $file . '</option>' . "\n";
        }
    }
    closedir($dh);
}
$query = array('SELECT' => '*', 'FROM' => "{$dbprefix}lang", 'WHERE' => "lang_id='" . $lang_id . "'", 'ORDER BY' => 'word DESC');
$result = $SQL->build($query);
예제 #2
0
파일: extra.php 프로젝트: omtim/kleeja
*
*/
// not for directly open
if (!defined('IN_ADMIN')) {
    exit;
}
//for style ..
$current_template = 'extra.php';
$current_smt = isset($_GET['smt']) ? preg_match('![a-z0-9_]!i', trim($_GET['smt'])) ? trim($_GET['smt']) : 'he' : 'he';
$action = ADMIN_PATH . '?cp=extra&amp;smt=' . $current_smt;
$H_FORM_KEYS = kleeja_add_form_key('adm_extra');
//
// Check form key
//
if (isset($_POST['submit'])) {
    if (!kleeja_check_form_key('adm_extra')) {
        kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
    }
}
$query = array('SELECT' => 'ex_header,ex_footer', 'FROM' => "{$dbprefix}stats");
$result = $SQL->build($query);
//is there any change !
$affected = false;
while ($row = $SQL->fetch($result)) {
    $ex_header = isset($_POST['ex_header']) ? $_POST['ex_header'] : $row['ex_header'];
    $ex_footer = isset($_POST['ex_footer']) ? $_POST['ex_footer'] : $row['ex_footer'];
    //when submit !!
    if (isset($_POST['submit'])) {
        $ex_header = htmlspecialchars_decode($ex_header);
        $ex_footer = htmlspecialchars_decode($ex_footer);
        //update
예제 #3
0
파일: l_rules.php 프로젝트: Saleh7/Kleeja
*
*/
// not for directly open
if (!defined('IN_ADMIN')) {
    exit;
}
//for style ..
$stylee = "admin_rules";
$action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php');
$affected = false;
$H_FORM_KEYS = kleeja_add_form_key('adm_rules');
//
// Check form key
//
if (isset($_POST['submit'])) {
    if (!kleeja_check_form_key('adm_rules')) {
        kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
    }
}
$query = array('SELECT' => 'rules', 'FROM' => "{$dbprefix}stats");
$result = $SQL->build($query);
while ($row = $SQL->fetch_array($result)) {
    $rulesw = isset($_POST['rules_text']) ? $_POST['rules_text'] : $row['rules'];
    $rules = htmlspecialchars($rulesw);
    //when submit
    if (isset($_POST['submit'])) {
        //update
        $update_query = array('UPDATE' => "{$dbprefix}stats", 'SET' => "rules = '" . $SQL->real_escape($rulesw) . "'");
        $SQL->build($update_query);
        if ($SQL->affected()) {
            $affected = true;
예제 #4
0
파일: index.php 프로젝트: Saleh7/Kleeja
//get languge of admin
get_lang('acp');
//
//need to login again
//
if (empty($_SESSION['ADMINLOGIN']) || $_SESSION['ADMINLOGIN'] != md5(sha1($config['h_key']) . $usrcp->name() . $config['siteurl']) || (empty($_SESSION['USER_SESS']) || $_SESSION['USER_SESS'] != session_id()) || (empty($_SESSION['ADMINLOGIN_T']) || $_SESSION['ADMINLOGIN_T'] < time())) {
    if (isset($_GET['go']) && $_GET['go'] == 'login') {
        if (isset($_POST['submit'])) {
            //login
            $ERRORS = array();
            $pass_field = 'lpass_' . preg_replace('/[^0-9]/', '', sha1($klj_session . sha1($config['h_key']) . $_POST['kid']));
            if (empty($_POST['lname']) || empty($_POST[$pass_field])) {
                $ERRORS[] = $lang['EMPTY_FIELDS'];
            } elseif (!user_can('enter_acp')) {
                $ERRORS[] = $lang['U_NOT_ADMIN'];
            } elseif (!kleeja_check_form_key('admin_login')) {
                $ERRORS[] = $lang['INVALID_FORM_KEY'];
            }
            if (!sizeof($ERRORS)) {
                if ($f = $usrcp->data($_POST['lname'], $_POST[$pass_field], false, $adm_time, true)) {
                    $_SESSION['USER_SESS'] = session_id();
                    $_SESSION['ADMINLOGIN'] = md5(sha1($config['h_key']) . $usrcp->name() . $config['siteurl']);
                    //to make sure, sometime setting time from fucntions doesnt work
                    $_SESSION['ADMINLOGIN_T'] = time() + $adm_time;
                    redirect('./' . basename(ADMIN_PATH) . '?cp=' . $go_to);
                    $SQL->close();
                    exit;
                } else {
                    //Wrong entries
                    $ERRORS[] = $lang['LOGIN_ERROR'];
                }
예제 #5
0
파일: m_styles.php 프로젝트: Saleh7/Kleeja
     }
     $tpl_content = '';
     if ($filename = @fopen($tpl_path, 'w')) {
         @fwrite($filename, $tpl_content);
         @fclose($filename);
     }
     $link = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&amp;style_choose=' . $style_id . '&amp;method=1';
     $text = $lang['TPL_CREATED'] . '<br /> <a href="' . $link . '">' . $lang['GO_BACK_BROWSER'] . '</a><meta HTTP-EQUIV="REFRESH" content="1; url=' . $link . '">' . "\n";
     $stylee = "admin_info";
 }
 //return bakup template
 if (isset($_POST['submit_bk_tpl'])) {
     //
     // Check form key
     //
     if (!kleeja_check_form_key('adm_style_order_bkup')) {
         kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $redirect_to, 1);
     }
     //style id
     $style_id = str_replace('..', '', $SQL->escape($_POST['style_id']));
     $tpl_name = str_replace('..', '', $SQL->escape($_POST['tpl_choose']));
     include_once PATH . 'includes/bk_templates.php';
     if (!isset($bkup_templates[$tpl_name])) {
         redirect(basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&style_choose=' . $style_id . '&method=1');
         exit;
     }
     $tpl_path = PATH . 'styles/' . $style_id . '/' . $tpl_name;
     if (is_writable($tpl_path)) {
         if ($filename = @fopen($tpl_path, 'w')) {
             @fwrite($filename, kleeja_base64_decode($bkup_templates[$tpl_name]));
             @fclose($filename);
예제 #6
0
파일: m_styles.php 프로젝트: omtim/kleeja
         $text .= '<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . $link . '\');", 2000);</script>' . "\n";
         $current_template = 'info.php';
     } else {
         $text = sprintf($lang['T_ISNT_WRITEABLE'], $tpl_name);
         $text .= '<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . $link . '\');", 2000);</script>' . "\n";
         $current_template = 'err.php';
         //kleeja_admin_err(, true,'', true, $link, 5);
     }
     //kleeja_admin_info(, true,'', true, $link, 5);
 }
 //new template file
 if (isset($_POST['submit_new_tpl'])) {
     //
     // Check form key
     //
     if (!kleeja_check_form_key('adm_style_order_add')) {
         kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $redirect_to, 1);
     }
     //style id
     $style_id = str_replace('..', '', $SQL->escape($_POST['style_id']));
     //tpl name
     $tpl_name = str_replace(array('..', '.html', '.php'), '', $_POST['new_tpl']);
     $tpl_path = PATH . 'styles/' . $style_id . '/' . $tpl_name . '.html';
     //same name, exists before, let's edit it
     if (file_exists($tpl_path)) {
         $tpl_path = PATH . 'styles/' . $style_id . '/' . str_replace('.html', substr(uniqid('_'), 0, 5) . '.html', $tpl_name);
     }
     $tpl_content = '';
     if ($filename = @fopen($tpl_path, 'w')) {
         @fwrite($filename, $tpl_content);
         @fclose($filename);
예제 #7
0
//for style ..
$stylee = "admin_exts";
$action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&amp;page=' . (isset($_GET['page']) ? intval($_GET['page']) : 1);
$action_new_ext = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&amp;add_new_ext=1';
$H_FORM_KEYS = kleeja_add_form_key('adm_exts');
$H_FORM_KEYS2 = kleeja_add_form_key('adm_exts_new_ext');
//
// Check form key
//
if (isset($_POST['submit'])) {
    if (!kleeja_check_form_key('adm_exts')) {
        kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
    }
}
if (isset($_GET['add_new_ext'])) {
    if (!kleeja_check_form_key('adm_exts_new_ext')) {
        kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
    }
}
//show exts
$query = array('SELECT' => '*', 'FROM' => "{$dbprefix}exts");
$result_p = $SQL->build($query);
//pager
$nums_rows = $SQL->num_rows($result_p);
$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['LIMIT'] = "{$start}, {$perpage}";
    $result = $SQL->build($query);
예제 #8
0
*
*/
// not for directly open
if (!defined('IN_ADMIN')) {
    exit;
}
//for style ..
$stylee = "admin_ban";
$action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php');
$affected = false;
$H_FORM_KEYS = kleeja_add_form_key('adm_ban');
//
// Check form key
//
if (isset($_POST['submit'])) {
    if (!kleeja_check_form_key('adm_ban')) {
        kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
    }
}
$query = array('SELECT' => 'ban', 'FROM' => "{$dbprefix}stats");
$result = $SQL->build($query);
while ($row = $SQL->fetch_array($result)) {
    $ban = isset($_POST["ban_text"]) ? htmlspecialchars($_POST['ban_text']) : $row['ban'];
    //when submit
    if (isset($_POST['submit'])) {
        //update
        $update_query = array('UPDATE' => "{$dbprefix}stats", 'SET' => "ban='" . $SQL->escape($ban) . "'");
        $SQL->build($update_query);
        if ($SQL->affected()) {
            $affected = true;
            delete_cache('data_ban');
예제 #9
0
파일: ucp.php 프로젝트: omtim/kleeja
     ($hook = $plugin->run_hook('get_pass_logon_before')) ? eval($hook) : null;
     //run hook
     kleeja_info($lang['LOGINED_BEFORE']);
 }
 #set variables
 $t_rmail = p('rmail', 'mail', false);
 #no submit yet
 if (!ip('submit')) {
     ($hook = $plugin->run_hook('no_submit_get_pass')) ? eval($hook) : null;
     //run hook
 } else {
     $ERRORS = array();
     ($hook = $plugin->run_hook('submit_get_pass')) ? eval($hook) : null;
     //run hook
     //check for form key
     if (!kleeja_check_form_key('get_pass')) {
         $ERRORS['form_key'] = $lang['INVALID_FORM_KEY'];
     }
     if (!kleeja_check_captcha()) {
         $ERRORS['captcha'] = $lang['WRONG_VERTY_CODE'];
     }
     if (!$t_rmail) {
         $ERRORS['rmail'] = $lang['WRONG_EMAIL'];
     } else {
         #if email not exists
         $query_chk = array('SELECT' => 'u.mail', 'FROM' => "{$dbprefix}users u", 'WHERE' => "u.mail='" . strtolower($SQL->escape($t_rmail)) . "'");
         ($hook = $plugin->run_hook('get_pass_query_chk')) ? eval($hook) : null;
         //run hook
         $result_chk = $SQL->build($query_chk);
         if (!$SQL->num($result_chk)) {
             $ERRORS['no_rmail'] = $lang['WRONG_DB_EMAIL'];
예제 #10
0
$page_action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . $url_pg . $url_or . $url_sea . $url_lst;
$ord_action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . $url_pg . $url_sea . $url_lst;
$page2_action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . $url_or2 . $url_sea . $url_lst;
$action = $page_action;
$is_search = $affected = false;
$H_FORM_KEYS = kleeja_add_form_key('adm_files');
//
// Check form key
//
if (isset($_POST['submit'])) {
    if (!kleeja_check_form_key('adm_files')) {
        kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
    }
}
if (isset($_POST['search_file'])) {
    if (!kleeja_check_form_key('adm_files_search')) {
        kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, basename(ADMIN_PATH) . '?cp=h_search', 1);
    }
}
//
//Delete all user files [only one user]
//
if (isset($_GET['deletefiles'])) {
    $query = array('SELECT' => 'id,size,name,folder', 'FROM' => "{$dbprefix}files AS f");
    $search = kleeja_base64_decode($_GET['deletefiles']);
    $search = unserialize($search);
    $search['filename'] = !isset($search['filename']) ? '' : $search['filename'];
    $search['username'] = !isset($search['username']) ? '' : $search['username'];
    $search['than'] = !isset($search['than']) ? 1 : $search['than'];
    $search['size'] = !isset($search['size']) ? '' : $search['size'];
    $search['ups'] = !isset($search['ups']) ? '' : $search['ups'];
예제 #11
0
파일: messages.php 프로젝트: omtim/kleeja
if (!defined('IN_ADMIN')) {
    exit;
}
//for style ..
$current_template = 'messages.php';
$current_smt = isset($_GET['smt']) ? preg_match('![a-z0-9_]!i', trim($_GET['smt'])) ? trim($_GET['smt']) : 'general' : 'general';
$action = ADMIN_PATH . '?cp=messages&amp;page=' . (isset($_GET['page']) ? intval($_GET['page']) : 1) . '&amp;smt=' . $current_smt;
$msg_sent = isset($_GET['sent']) ? intval($_GET['sent']) : false;
$H_FORM_KEYS = kleeja_add_form_key('adm_messages');
$there_queue = preg_match('!:del_[a-z0-9]{0,3}messages:!i', $config['queue']);
print_r($_POST);
//
// Check form key
//
if (isset($_POST['submit'])) {
    if (!kleeja_check_form_key('adm_messages')) {
        kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
    }
}
#add delete process to the queue
if ($current_smt == 'del_d30' || $current_smt == 'del_all') {
    if (strpos($config['queue'], ':' . $current_smt . 'messages:') !== false) {
        kleeja_admin_err($lang['DELETE_PROCESS_IN_WORK'], true, $lang['ERROR'], true, ADMIN_PATH . '?cp=messages', 1);
    } else {
        update_config('queue', $config['queue'] . ':' . $current_smt . 'messages:');
        kleeja_admin_info($lang['DELETE_PROCESS_QUEUED'], true, '', true, ADMIN_PATH . '?cp=messages');
    }
}
$query = array('SELECT' => 'c.*', 'FROM' => "`{$dbprefix}messages` c", 'ORDER BY' => 'c.id DESC');
if ($current_smt == 'show_h24') {
    $query['WHERE'] = 'c.time > ' . intval(time() - 3600 * 24);
    exit;
}
//for style ..
$stylee = "admin_configs";
//words
$action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php');
$n_submit = $lang['UPDATE_CONFIG'];
$options = '';
$SHOW_CH_STAGE = isset($_GET['type']) ? false : true;
$CONFIGEXTEND = false;
$H_FORM_KEYS = kleeja_add_form_key('adm_configs');
//
// Check form key
//
if (isset($_POST['submit'])) {
    if (!kleeja_check_form_key('adm_configs')) {
        $redirect_url = $action . (isset($_GET['type']) ? '&amp;type=' . htmlspecialchars($_GET['type']) : '');
        kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $redirect_url, 1);
    }
}
switch ($SHOW_CH_STAGE) {
    //
    //box of config types
    //
    case true:
        $query = array('SELECT' => 'DISTINCT(type)', 'FROM' => "{$dbprefix}config", 'WHERE' => '`option` != \'\'', 'ORDER BY' => 'display_order');
        $result = $SQL->build($query);
        $icons_path = $STYLE_PATH_ADMIN . 'images/config_icons/';
        $default_icon = $icons_path . 'default.png';
        $typesnavi = array();
        while ($row = $SQL->fetch_array($result)) {
예제 #13
0
파일: aupdate.php 프로젝트: omtim/kleeja
        $siteurl_parts = explode('/', $ftp_info['host']);
        $ftp_info['host'] = $siteurl_parts[0];
    }
}
switch ($current_step) {
    default:
        //general
        $not_writable = false;
        //check if not writable then we need ftp
        if (!is_writable(PATH)) {
            $not_writable = true;
            //kleeja_admin_info($lang['KLJ_DIR_NOT_WR']);
        }
        //save ftp info in database
        if (isset($_POST['_fmethod']) && $_POST['_fmethod'] == 'kftp') {
            if (!kleeja_check_form_key('adm_aupdate', 3600)) {
                kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
            }
            $ups->save_f_method('kftp');
            $ups->f_method = 'kftp';
            if (empty($_POST['ftp_host']) || empty($_POST['ftp_port']) || empty($_POST['ftp_user']) || empty($_POST['ftp_pass'])) {
                kleeja_admin_err($lang['EMPTY_FIELDS'], true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php'));
            } else {
                $ups->info = $ftpinfo = array('host' => $_POST['ftp_host'], 'port' => $_POST['ftp_port'], 'user' => $_POST['ftp_user'], 'pass' => $_POST['ftp_pass'], 'path' => $_POST['ftp_path']);
                $ftpinfo['pass'] = '';
                update_config('ftp_info', serialize($ftpinfo), false);
                if (!$ups->check_connect()) {
                    kleeja_admin_err($lang['LOGIN_ERROR'], true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '?#!cp=' . basename(__FILE__, '.php'));
                } else {
                    //. '&amp;' . $GET_FORM_KEY
                    $ups->atend();
예제 #14
0
파일: users.php 프로젝트: omtim/kleeja
    if (!kleeja_check_form_key('adm_users_newgroup')) {
        kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
    }
}
if (isset($_POST['editacl'])) {
    if (!kleeja_check_form_key('adm_users_editacl')) {
        kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
    }
}
if (isset($_POST['editdata'])) {
    if (!kleeja_check_form_key('adm_users_editdata')) {
        kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
    }
}
if (isset($_POST['newext']) or isset($_POST['editexts'])) {
    if (!kleeja_check_form_key('adm_users_editexts')) {
        kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
    }
}
//
//delete all user files [only one user]
//
if (isset($_GET['deleteuserfile'])) {
    //check _GET Csrf token
    if (!kleeja_check_form_key_get('adm_users')) {
        kleeja_admin_err($lang['INVALID_GET_KEY'], true, $lang['ERROR'], true, $action_all, 2);
    }
    //is exists ?
    if (!$SQL->num($SQL->query("SELECT * FROM {$dbprefix}users WHERE id=" . intval($_GET['deleteuserfile'])))) {
        redirect($action_all);
    }
예제 #15
0
파일: j_plugins.php 프로젝트: Saleh7/Kleeja
    $cache->clean('__changes_files__');
    //redirect(basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php'));
    //show first page of plugins
} elseif (!isset($_GET['do_plg'])) {
    //for style ..
    $stylee = "admin_plugins";
    $current_smt = isset($_GET['smt']) ? preg_match('![a-z0-9_]!i', trim($_GET['smt'])) ? trim($_GET['smt']) : 'general' : 'general';
    $action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&amp;smt=' . $current_smt;
    $no_plugins = false;
    //kleeja depend on its users .. and kleeja love them .. so let's tell them about that ..
    $klj_d_s = $lang['KLJ_MORE_PLUGINS'][rand(0, sizeof($lang['KLJ_MORE_PLUGINS']) - 1)];
    //
    // Check form key
    //
    if (isset($_POST['submit_new_plg'])) {
        if (!kleeja_check_form_key('adm_plugins', 3600)) {
            kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
        }
    }
    //empty array of icons
    $plugins_icons = array();
    //get plugins
    $query = array('SELECT' => 'p.plg_id, p.plg_name, plg_icon, p.plg_disabled, p.plg_ver, p.plg_ver, p.plg_author, p.plg_dsc, p.plg_instructions', 'FROM' => "{$dbprefix}plugins p");
    $result = $SQL->build($query);
    if ($SQL->num_rows($result) > 0) {
        $arr = array();
        $i = 1;
        while ($row = $SQL->fetch_array($result)) {
            $desc = unserialize(kleeja_base64_decode($row['plg_dsc']));
            $arr[] = array('i' => $i % 3 == 0, 'plg_id' => $row['plg_id'], 'plg_name' => str_replace('-', ' ', $row['plg_name']) . ($row['plg_disabled'] == 1 ? ' [ x ]' : ''), 'plg_disabled' => (int) $row['plg_disabled'] == 1 ? true : false, 'plg_ver' => $row['plg_ver'], 'plg_author' => $row['plg_author'], 'plg_dsc' => isset($desc[$config['language']]) ? $desc[$config['language']] : $desc['en'], 'plg_instructions' => trim($row['plg_instructions']) == '' ? false : true, 'plg_icon_url' => basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&amp;iconp=' . $row['plg_id']);
            $i++;
예제 #16
0
 $NOT_USER = !$usrcp->name() ? true : false;
 //no error yet
 $ERRORS = false;
 //_post
 $t_cname = isset($_POST['cname']) ? htmlspecialchars($_POST['cname']) : '';
 $t_cmail = isset($_POST['cmail']) ? htmlspecialchars($_POST['cmail']) : '';
 $t_ctext = isset($_POST['ctext']) ? htmlspecialchars($_POST['ctext']) : '';
 ($hook = kleeja_run_hook('no_submit_call_go_page')) ? eval($hook) : null;
 //run hook
 if (isset($_POST['submit'])) {
     //after sumit
     $ERRORS = array();
     ($hook = kleeja_run_hook('submit_call_go_page')) ? eval($hook) : null;
     //run hook
     //check for form key
     if (!kleeja_check_form_key('call')) {
         $ERRORS['form_key'] = $lang['INVALID_FORM_KEY'];
     }
     if (!kleeja_check_captcha()) {
         $ERRORS['captcha'] = $lang['WRONG_VERTY_CODE'];
     }
     if (empty($_POST['cname']) && $NOT_USER || empty($_POST['ctext'])) {
         $ERRORS['cname'] = $lang['EMPTY_FIELDS'] . ' : ' . (empty($_POST['cname']) && $NOT_USER ? ' [ ' . $lang['YOURNAME'] . ' ] ' : '') . (empty($_POST['ctext']) ? '  [ ' . $lang['TEXT'] . ' ] ' : '');
     }
     if (isset($_POST['cmail']) && !preg_match("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,4})\$/i", trim(strtolower($_POST['cmail']))) && $NOT_USER) {
         $ERRORS['cmail'] = $lang['WRONG_EMAIL'];
     }
     if (strlen($_POST['ctext']) > 300) {
         $ERRORS['ctext'] = $lang['NO_ME300TEXT'];
     }
     ($hook = kleeja_run_hook('submit_call_go_page2')) ? eval($hook) : null;
예제 #17
0
파일: images.php 프로젝트: omtim/kleeja
if (!isset($images_cp_perpage) || !$images_cp_perpage) {
    #you can add this varibale to config.php
    $images_cp_perpage = 25;
}
#style template
$current_template = 'img.php';
$action = ADMIN_PATH . '?cp=' . basename(__FILE__, '.php') . (isset($_GET['page']) ? '&amp;page=' . intval($_GET['page']) : '') . (isset($_GET['last_visit']) ? '&amp;last_visit=' . intval($_GET['last_visit']) : '');
$action_search = ADMIN_PATH . "?cp=h_search";
$H_FORM_KEYS = kleeja_add_form_key('adm_img_ctrl');
$is_search = false;
//
// after submit
//
if (isset($_POST['submit'])) {
    #check form key
    if (!kleeja_check_form_key('adm_img_ctrl')) {
        kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
    }
    foreach ($_POST as $key => $value) {
        if (preg_match('/del_(?P<digit>\\d+)/', $key)) {
            $del[$key] = $value;
        }
    }
    $sizes = $num = 0;
    foreach ($del as $key => $id) {
        $query = array('SELECT' => '*', 'FROM' => "{$dbprefix}files", 'WHERE' => '`id` = ' . intval($id));
        $result = $SQL->build($query);
        while ($row = $SQL->fetch($result)) {
            #delete image from folder ..
            @kleeja_unlink(PATH . $row['folder'] . '/' . $row['name']);
            #delete thumb
예제 #18
0
파일: f_reports.php 프로젝트: Saleh7/Kleeja
// not for directly open
if (!defined('IN_ADMIN')) {
    exit;
}
//for style ..
$stylee = "admin_reports";
$current_smt = isset($_GET['smt']) ? preg_match('![a-z0-9_]!i', trim($_GET['smt'])) ? trim($_GET['smt']) : 'general' : 'general';
$action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&amp;page=' . (isset($_GET['page']) ? intval($_GET['page']) : 1) . '&amp;smt=' . $current_smt;
$msg_sent = isset($_GET['sent']) ? intval($_GET['sent']) : false;
$H_FORM_KEYS = kleeja_add_form_key('adm_reports');
$there_queue = preg_match('!:del_[a-z0-9]{0,3}reports:!i', $config['queue']);
//
// Check form key
//
if (isset($_POST['submit'])) {
    if (!kleeja_check_form_key('adm_reports')) {
        kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
    }
}
#add delete process to the queue
if ($current_smt == 'del_d30' || $current_smt == 'del_all') {
    if (strpos($config['queue'], ':' . $current_smt . 'reports:') !== false) {
        kleeja_admin_err($lang['DELETE_PROCESS_IN_WORK'], true, $lang['ERROR'], true, basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php'), 1);
    } else {
        update_config('queue', $config['queue'] . ':' . $current_smt . 'reports:');
        kleeja_admin_info($lang['DELETE_PROCESS_QUEUED'], true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php'));
    }
}
$query = array('SELECT' => '*', 'FROM' => "{$dbprefix}reports r", 'ORDER BY' => 'r.id DESC');
if ($current_smt == 'show_h24') {
    $query['WHERE'] = 'r.time > ' . intval(time() - 3600 * 24);
예제 #19
0
파일: e_calls.php 프로젝트: Saleh7/Kleeja
// not for directly open
if (!defined('IN_ADMIN')) {
    exit;
}
//for style ..
$stylee = "admin_calls";
$current_smt = isset($_GET['smt']) ? preg_match('![a-z0-9_]!i', trim($_GET['smt'])) ? trim($_GET['smt']) : 'general' : 'general';
$action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&amp;page=' . (isset($_GET['page']) ? intval($_GET['page']) : 1) . '&amp;smt=' . $current_smt;
$msg_sent = isset($_GET['sent']) ? intval($_GET['sent']) : false;
$H_FORM_KEYS = kleeja_add_form_key('adm_calls');
$there_queue = preg_match('!:del_[a-z0-9]{0,3}calls:!i', $config['queue']);
//
// Check form key
//
if (isset($_POST['submit'])) {
    if (!kleeja_check_form_key('adm_calls')) {
        kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
    }
}
#add delete process to the queue
if ($current_smt == 'del_d30' || $current_smt == 'del_all') {
    if (strpos($config['queue'], ':' . $current_smt . 'calls:') !== false) {
        kleeja_admin_err($lang['DELETE_PROCESS_IN_WORK'], true, $lang['ERROR'], true, basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php'), 1);
    } else {
        update_config('queue', $config['queue'] . ':' . $current_smt . 'calls:');
        kleeja_admin_info($lang['DELETE_PROCESS_QUEUED'], true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php'));
    }
}
$query = array('SELECT' => 'c.*', 'FROM' => "`{$dbprefix}call` c", 'ORDER BY' => 'c.id DESC');
if ($current_smt == 'show_h24') {
    $query['WHERE'] = 'c.time > ' . intval(time() - 3600 * 24);
예제 #20
0
파일: search.php 프로젝트: omtim/kleeja
    unset($s['search_file'], $s['k_form_key'], $s['k_form_time']);
    foreach ($s as $key => $v) {
        if ($s[$key] == '') {
            unset($s[$key]);
        }
    }
    $d = serialize($s);
    if ($search_id = insert_filter('file_search', $d)) {
        $filter = get_filter($search_id);
        redirect(ADMIN_PATH . "?cp=c_files&search_id=" . $filter['filter_uid'], false);
    } else {
        kleeja_admin_err($lang['ERROR_TRY_AGAIN'], true, $lang['ERROR'], true, ADMIN_PATH . '?cp=h_search', 1);
    }
}
if (isset($_POST['search_user'])) {
    if (!kleeja_check_form_key('adm_users_search')) {
        kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, ADMIN_PATH . '?cp=h_search&smt=users', 1);
    }
    #delete all searches greater than 10
    $s_del = array('SELECT' => "filter_id", 'FROM' => "{$dbprefix}filters", 'WHERE' => "filter_type='user_search' AND filter_user="******"filter_id DESC", 'LIMIT' => '5, 18446744073709551615');
    $result = $SQL->build($s_del);
    $ids = '';
    while ($row = $SQL->fetch($result)) {
        $ids .= ($ids != '' ? ', ' : '') . $row['filter_id'];
    }
    $SQL->free($result);
    if ($ids != '') {
        $query_del = array('DELETE' => "{$dbprefix}filters", 'WHERE' => "filter_id IN('" . implode("', '", $ids) . "')");
        $SQL->build($query_del);
    }
    #add as a user_search filter
예제 #21
0
* @license ./docs/license.txt
*
*/
// not for directly open
if (!defined('IN_ADMIN')) {
    exit;
}
//for style ..
$stylee = "admin_backup";
$action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php');
$H_FORM_KEYS = kleeja_add_form_key('adm_bckup');
//
// Check form key
//
if (isset($_POST['submit'])) {
    if (!kleeja_check_form_key('adm_bckup')) {
        kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
    }
}
$query = 'SHOW TABLE STATUS';
$result = $SQL->query($query);
$i = 0;
while ($row = $SQL->fetch_array($result)) {
    //make new lovely arrays !!
    $size[$row['Name']] = round($row['Data_length'] / 1024, 2);
}
$SQL->freeresult($result);
//
//Use hook in admin/index.php to add your tables here
//
$tables_sho = isset($tables_sho) && is_array($tables_sho) ? $tables_sho : array();