Пример #1
0
         closedir($dh);
     }
     //show only template required in this style
     $bkup_templates = array_intersect(array_keys($tpls_all), $bkup_templates);
     break;
 case '2':
     // make as default
     //check _GET Csrf token
     if (isset($_REQUEST['home']) && !kleeja_check_form_key_get('adm_start_actions')) {
         kleeja_admin_err($lang['INVALID_GET_KEY'], true, $lang['ERROR'], true, basename(ADMIN_PATH) . '?cp=start', 2);
     }
     //
     //check if this style depend on other style and
     //check kleeja version that required by this style
     //
     if (($style_info = kleeja_style_info($style_id)) != false) {
         if (isset($style_info['depend_on']) && !file_exists(PATH . 'styles/' . $style_info['depend_on'])) {
             kleeja_admin_err(sprintf($lang['DEPEND_ON_NO_STYLE_ERR'], $style_info['depend_on']));
         }
         if (isset($style_info['kleeja_version']) && version_compare(strtolower($style_info['kleeja_version']), strtolower(KLEEJA_VERSION), '>')) {
             kleeja_admin_err(sprintf($lang['KLJ_VER_NO_STYLE_ERR'], $style_info['kleeja_version']));
         }
         //is this style require some plugins to be installed
         if (isset($style_info['plugins_required'])) {
             $plugins_required = array_map('trim', explode(',', $style_info['plugins_required']));
             $query = array('SELECT' => 'plg_name', 'FROM' => "{$dbprefix}plugins");
             $result = $SQL->build($query);
             if ($SQL->num_rows($result) != 0) {
                 $plugins_required = array_flip($plugins_required);
                 while ($row = $SQL->fetch_array($result)) {
                     if (in_array($row['plg_name'], $plugins_required)) {
Пример #2
0
         }
     }
     //update
     $update_query = array('UPDATE' => "{$dbprefix}plugins", 'SET' => "plg_disabled = {$action}", 'WHERE' => "plg_id=" . $plg_id);
     $SQL->build($update_query);
     if ($SQL->affected()) {
         delete_cache(array('data_plugins', 'data_config'));
     }
     //show msg
     kleeja_admin_info($lang['PLGUIN_DISABLED_ENABLED'], false, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&smt=' . $current_smt);
     break;
     //Delete plguin
 //Delete plguin
 case '3':
     //check if there is style require this plugin
     if (($style_info = kleeja_style_info($config['style'])) != false) {
         $plugins_required = array_map('trim', explode(',', $style_info['plugins_required']));
         if (in_array($_GET['pn'], $plugins_required)) {
             kleeja_admin_err($lang['PLUGIN_REQ_BY_STYLE_ERR']);
         }
     }
     $stylee = "admin_plugin_mfile";
     $action = basename(ADMIN_PATH) . '?cp=' . basename(__FILE__, '.php') . '&m=3&un=1&pn=' . htmlspecialchars($_GET['pn']) . '&do_plg=' . $plg_id . '&' . $GET_FORM_KEY;
     $for_unistalling = true;
     //after submit
     if (isset($_GET['un'])) {
         if (isset($_POST['_fmethod']) && $_POST['_fmethod'] == '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, str_replace('un=1', '', $action));
             } else {
                 $plg->info = $ftpinfo = array('host' => $_POST['ftp_host'], 'port' => $_POST['ftp_port'], 'user' => $_POST['ftp_user'], 'pass' => $_POST['ftp_pass'], 'path' => $_POST['ftp_path']);