Ejemplo n.º 1
0
                             }
                         }
                         $SQL->freeresult($result);
                         $plugins_required = array_flip($plugins_required);
                         if (sizeof($plugins_required)) {
                             kleeja_admin_err(sprintf($lang['PLUGINS_REQ_NO_STYLE_ERR'], implode(', ', $plugins_required)));
                         }
                     }
                 }
                 //make it as default
                 update_config('style', $style_id);
                 update_config('style_depend_on', isset($style_info['depend_on']) ? $style_info['depend_on'] : '');
                 //delete all cache to get new style
                 delete_cache('', true);
                 //show msg
                 kleeja_admin_info(sprintf($lang['STYLE_NOW_IS_DEFAULT'], htmlspecialchars($style_id)), true, '', true, basename(ADMIN_PATH) . '?cp=' . (isset($_REQUEST['home']) ? 'start' : basename(__FILE__, '.php')));
                 break;
         }
     }
     break;
 case 'style_orders':
     //style id ..
     $style_id = str_replace('..', '', htmlspecialchars($_GET['style_id']));
     $redirect_to = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&style_choose=' . $style_id . '&method=1';
     if (empty($_GET['tpl_choose'])) {
         #redirect($redirect_to);
     }
     //edit or del tpl
     if (isset($_GET['tpl_choose']) && !empty($_GET['tpl_choose']) && isset($_GET['style_id']) && isset($_GET['method'])) {
         //check _GET Csrf token
         if (!kleeja_check_form_key_get('adm_style_del_edit')) {
Ejemplo n.º 2
0
         $SQL->build($insert_query);
         #done
         $ADDED_EXT = $GE_INFO = 2;
         delete_cache('data_groups');
     }
     #if submit/update
     if (isset($_POST['editexts'])) {
         $ext_ids = $_POST['size'];
         if (is_array($ext_ids)) {
             foreach ($ext_ids as $e_id => $e_val) {
                 $update_query = array('UPDATE' => "{$dbprefix}groups_exts", 'SET' => "size=" . intval($e_val) * 1024, 'WHERE' => "ext_id=" . intval($e_id) . " AND group_id=" . $req_group);
                 $SQL->build($update_query);
             }
             #delete cache ..
             delete_cache('data_groups');
             kleeja_admin_info($lang['UPDATED_EXTS'], true, '', true, $action);
         }
     }
     #show exts
     $query = array('SELECT' => 'ext_id, ext, size', 'FROM' => "{$dbprefix}groups_exts", 'WHERE' => 'group_id=' . $req_group, 'ORDER BY' => 'ext_id ASC');
     $result = $SQL->build($query);
     $exts = array();
     while ($row = $SQL->fetch($result)) {
         $exts[] = array('ext_id' => $row['ext_id'], 'ext_name' => $row['ext'], 'ext_size' => round((int) $row['size'] / 1024), 'ext_icon' => file_exists(PATH . "images/filetypes/" . $row['ext'] . ".png") ? PATH . "images/filetypes/" . $row['ext'] . ".png" : PATH . 'images/filetypes/file.png');
     }
     $SQL->free($result);
     break;
     #show users (from search keyword)
 #show users (from search keyword)
 case 'show_su':
     $filter = get_filter($_GET['search_id'], 'filter_uid');
Ejemplo n.º 3
0
                $send = send_mail($to, $message, $subject, $config['sitemail'], $config['sitename']);
                if ($send) {
                    //
                    //We will redirect to pages of results and show info msg there !
                    //
                    kleeja_admin_info($lang['IS_SEND_MAIL'], true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&page=' . (isset($_GET['page']) ? intval($_GET['page']) : 1) . '&sent=' . $row['id']);
                } else {
                    kleeja_admin_err($lang['ERR_SEND_MAIL'], true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&page=' . (isset($_GET['page']) ? intval($_GET['page']) : 1) . '&sent=' . $row['id']);
                }
            }
        }
    }
    $SQL->freeresult($result);
} else {
    $no_results = true;
}
//if deleted
if (sizeof($del_nums)) {
    $query_del = array('DELETE' => "{$dbprefix}reports", 'WHERE' => "id IN('" . implode("', '", $del_nums) . "')");
    $SQL->build($query_del);
}
$total_pages = $Pager->getTotalPages();
$page_nums = $Pager->print_nums(basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php'), 'onclick="javascript:get_kleeja_link($(this).attr(\'href\'), \'#content\'); return false;"');
//after submit
if (isset($_POST['submit'])) {
    $text = $SQL->affected() ? $lang['REPORTS_UPDATED'] : $lang['NO_UP_CHANGE_S'];
    $text .= '<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . $action . '\'); check_msg_and_reports();", 2000);</script>' . "\n";
    kleeja_admin_info($text, true, '', true, $action);
}
//secondary menu
$go_menu = array('general' => array('name' => $lang['R_REPORTS'], 'link' => basename(ADMIN_PATH) . '?cp=f_reports&amp;smt=general', 'goto' => 'general', 'current' => $current_smt == 'general'), 'show_h24' => array('name' => $lang['SHOW_FROM_24H'], 'link' => basename(ADMIN_PATH) . '?cp=f_reports&amp;smt=show_h24', 'goto' => 'show_h24', 'current' => $current_smt == 'show_h24'), 'del_d30' => array('name' => $lang['DELETE_EARLIER_30DAYS'], 'link' => basename(ADMIN_PATH) . '?cp=f_reports&amp;smt=del_d30', 'goto' => 'del_d30', 'current' => $current_smt == 'del_d30', 'confirm' => true), 'del_all' => array('name' => $lang['DELETE_ALL'], 'link' => basename(ADMIN_PATH) . '?cp=f_reports&amp;smt=del_all', 'goto' => 'del_all', 'current' => $current_smt == 'del_all', 'confirm' => true));
Ejemplo n.º 4
0
         //if there is a zip?
         $text = sprintf($lang['PLUGIN_DELETED_ZIPPED'], '<a target="_blank"  href="' . basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&amp;do_plg=' . $plg->plg_id . '&amp;m=6&amp;fn=' . $plg->zipped_files . '&amp;smt=' . $current_smt . '">', '</a>');
         $text .= '<br /><br /><a  onclick="javascript:get_kleeja_link(this.href); return false;"  href="' . basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&amp;smt=' . $current_smt . '">' . $lang['GO_BACK_BROWSER'] . '</a>';
         kleeja_admin_info($text, false, '', true, false);
     }
     break;
 case '4':
     //plugin instructions
     $query = array('SELECT' => 'p.plg_name, p.plg_ver, p.plg_instructions', 'FROM' => "{$dbprefix}plugins p", 'WHERE' => "p.plg_id=" . $plg_id);
     $result = $SQL->fetch_array($SQL->build($query));
     if (empty($result)) {
         redirect(basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php'));
     }
     $info = unserialize(kleeja_base64_decode($result['plg_instructions']));
     $info = isset($info[$config['language']]) ? $info[$config['language']] : $info['en'];
     kleeja_admin_info('<h3>' . $result['plg_name'] . ' &nbsp;' . $result['plg_ver'] . ' : </h3>' . $info . '<br /><a   onclick="javascript:get_kleeja_link(this.href); return false;" href="' . basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&amp;smt=' . $current_smt . '">' . $lang['GO_BACK_BROWSER'] . '</a>');
     break;
     //downaloding zipped changes ..
 //downaloding zipped changes ..
 case 6:
     if (!isset($_GET['fn'])) {
         kleeja_admin_err($lang['ERROR']);
     }
     $_f = preg_replace('![^a-z0-9]!', '', $_GET['fn']);
     $name = 'changes_of_' . $_f . '.zip';
     if (!file_exists(PATH . 'cache/' . $name)) {
         kleeja_admin_err($lang['ERROR']);
     }
     if (is_browser('mozilla')) {
         $h_name = "filename*=UTF-8''" . rawurlencode(htmlspecialchars_decode($name));
     } else {
Ejemplo n.º 5
0
$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
        $update_query = array('UPDATE' => "{$dbprefix}stats", 'SET' => "ex_header = '" . $SQL->escape($ex_header) . "', ex_footer = '" . $SQL->escape($ex_footer) . "'");
        $SQL->build($update_query);
        if ($SQL->affected()) {
            $affected = true;
            //delete cache ..
            delete_cache('data_extra');
        }
    } else {
        $ex_header = htmlspecialchars($ex_header);
        $ex_footer = htmlspecialchars($ex_footer);
    }
}
$SQL->free($result);
//after submit
if (isset($_POST['submit'])) {
    kleeja_admin_info($affected ? $lang['EXTRA_UPDATED'] : $lang['NO_UP_CHANGE_S'], true, '', true, $action);
}
//secondary menu
$go_menu = array('he' => array('name' => $lang['ADD_HEADER_EXTRA'], 'link' => ADMIN_PATH . '?cp=extra&amp;smt=he', 'goto' => 'he', 'current' => $current_smt == 'he'), 'fe' => array('name' => $lang['ADD_FOOTER_EXTRA'], 'link' => ADMIN_PATH . '?cp=extra&amp;smt=fe', 'goto' => 'fe', 'current' => $current_smt == 'fe'));
Ejemplo n.º 6
0
        $sizes += $row['size'];
    }
    $SQL->freeresult($result);
    if ($num == 0) {
        kleeja_admin_err($lang['ADMIN_DELETE_FILES_NOF']);
    } else {
        //update number of stats
        $update_query = array('UPDATE' => "{$dbprefix}stats", 'SET' => "sizes=sizes-{$sizes}, files=files-{$num}");
        $SQL->build($update_query);
        if ($SQL->affected()) {
            delete_cache('data_stats');
        }
        //delete all files in just one query
        $query_del = array('DELETE' => "{$dbprefix}files", 'WHERE' => "id IN (" . implode(',', $ids) . ")");
        $SQL->build($query_del);
        kleeja_admin_info(sprintf($lang['ADMIN_DELETE_FILES_OK'], $num));
    }
}
//
//begin default files page
//
$query = array('SELECT' => 'COUNT(f.id) AS total_files', 'FROM' => "{$dbprefix}files f", 'ORDER BY' => 'f.id ');
#if user system is default, we use users table
if ((int) $config['user_system'] == 1) {
    $query['JOINS'] = array(array('LEFT JOIN' => "{$dbprefix}users u", 'ON' => 'u.id=f.user'));
}
//posts search ..
if (isset($_POST['search_file'])) {
    redirect(basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&search=' . kleeja_base64_encode(serialize($_POST)));
    $SQL->close();
    exit;
Ejemplo n.º 7
0
        $sizes += $row['size'];
    }
    $SQL->freeresult($result);
    if ($num == 0) {
        kleeja_admin_err($lang['ADMIN_DELETE_NO_FILE']);
    } else {
        //update number of stats
        $update_query = array('UPDATE' => "{$dbprefix}stats", 'SET' => "sizes=sizes-{$sizes}, files=files-{$num}");
        $SQL->build($update_query);
        if ($SQL->affected()) {
            delete_cache('data_stats');
        }
        //delete all files in just one query
        $d_query = array('DELETE' => "{$dbprefix}files", 'WHERE' => "user="******"/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,4})\$/i", trim(strtolower($_POST['lmail'])))) {
                $ERRORS[] = $lang['WRONG_EMAIL'];
            } else {
                if (strlen(trim($_POST['lname'])) < 2 || strlen(trim($_POST['lname'])) > 100) {
                    $ERRORS[] = str_replace('4', '2', $lang['WRONG_NAME']);
                } else {
                    if ($SQL->num_rows($SQL->query("SELECT * FROM `{$dbprefix}users` WHERE clean_name='" . trim($SQL->escape($usrcp->cleanusername($_POST["lname"]))) . "'")) != 0) {
                        $ERRORS[] = $lang['EXIST_NAME'];
                    } else {
Ejemplo n.º 8
0
    //undone yet
    //....
    //.....
    //
    case '4':
        //fucntions callbacks
        if (file_exists(PATH . 'cache/sqlupdate_' . $v['version_number'] . 'php')) {
            $re = $ups->update_core('4', $v);
            if ($re == 'updated') {
                kleeja_admin_info('<span style="color:green;">' . $lang['INST_UPDATE_CUR_VER_IS_UP'] . '</span>', true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&amp;astep=6&amp;' . $GET_FORM_KEY, 10);
                //'<span style="color:green;">' . $lang['INST_UPDATE_CUR_VER_IS_UP']. '</span>'
            }
        }
        # code...
        break;
    case '5':
        //notes
        if (file_exists(PATH . 'cache/sqlupdate_' . $v['version_number'] . 'php')) {
            $re = $ups->update_core('3', $v);
            if ($re == 'updated') {
                kleeja_admin_info('<span style="color:green;">' . $lang['INST_UPDATE_CUR_VER_IS_UP'] . '</span>', true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&amp;astep=6&amp;' . $GET_FORM_KEY, 10);
                //'<span style="color:green;">' . $lang['INST_UPDATE_CUR_VER_IS_UP']. '</span>'
            }
        }
        # code...
        break;
    case '6':
        //delete temp files
        # code..
        break;
}
             $text = sprintf($lang['PLUGIN_DELETED_ZIPPED'], '<a href="' . basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&amp;do_plg=' . $plg->plg_id . '&amp;m=6&amp;fn=' . $plg->zipped_files . '">', '</a>');
             $text .= '<br /><br /><a href="' . basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '">' . $lang['GO_BACK_BROWSER'] . '</a>';
         }
         $stylee = "admin_info";
     }
     break;
 case '4':
     //plugin instructions
     $query = array('SELECT' => 'p.plg_name, p.plg_ver, p.plg_instructions', 'FROM' => "{$dbprefix}plugins p", 'WHERE' => "p.plg_id=" . $plg_id);
     $result = $SQL->fetch_array($SQL->build($query));
     if (empty($result)) {
         redirect(basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php'));
     }
     $info = unserialize(kleeja_base64_decode($result['plg_instructions']));
     $info = isset($info[$config['language']]) ? $info[$config['language']] : $info['en'];
     kleeja_admin_info('<h3>' . $result['plg_name'] . ' &nbsp;' . $result['plg_ver'] . ' : </h3>' . $info . '<br /><a href="' . basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '">' . $lang['GO_BACK_BROWSER'] . '</a>');
     break;
 case '5':
     //plugins exporting
     if (!isset($plg_id)) {
         kleeja_admin_err($lang['ERROR']);
     }
     //get plugin information
     $query = array('SELECT' => '*', 'FROM' => "{$dbprefix}plugins", 'WHERE' => "plg_id=" . $plg_id);
     $result = $SQL->build($query);
     if ($SQL->num_rows($result) > 0) {
         $arr = array();
         $row = $SQL->fetch_array($result);
         //start xml
         $name = $row['plg_name'] . '-' . str_replace('.', '-', $row['plg_ver']) . '.klj';
         if (is_browser('mozilla')) {
Ejemplo n.º 10
0
    ($hook = kleeja_run_hook('after_submit_adm_config')) ? eval($hook) : null;
    //run hook
    //empty ..
    /*
    if (empty($_POST['sitename']) || empty($_POST['siteurl']) || empty($_POST['foldername']) || empty($_POST['filesnum']))
    {
    	$text	= $lang['EMPTY_FIELDS'];
    	$stylee	= "admin_err";
    }
    elseif (!is_numeric($_POST['filesnum']) || !is_numeric($_POST['sec_down']))
    {
    	$text	= $lang['NUMFIELD_S'];
    	$stylee	= "admin_err";
    }
    else
    {
    */
    #delete cache ..
    delete_cache('data_config');
    #some configs need refresh page ..
    $need_refresh_configs = array('language');
    foreach ($need_refresh_configs as $l) {
        if (isset($_POST[$l]) and $_POST[$l] != $config[$l]) {
            header('Location: ' . basename(ADMIN_PATH));
            exit;
        }
    }
    kleeja_admin_info($lang['CONFIGS_UPDATED'], true, '', true, basename(ADMIN_PATH) . '?cp=options', 3);
    //}
}
#submit