} break; case 'plugins': //connect .. for check $SQL = new SSQL($dbserver, $dbuser, $dbpass, $dbname); //install built in plugins $pl_path = "includes/plugins"; include PATH . 'includes/plugins.php'; $XML = new kxml(); if (isset($_POST['datasubmit'])) { $p = $_POST['plugin_file']; if (empty($p)) { header('Location: ' . $_SERVER['PHP_SELF'] . '?step=end&' . getlang(1)); exit; } $plg = new kplugins(); //search for plugins foreach ($p as $file) { if (file_exists($pl_path . '/' . $file)) { $contents = @file_get_contents($pl_path . '/' . $file); $gtree = $XML->xml_to_array($contents); if ($gtree != false) { $plg_dsc = $gtree['kleeja']['info']['plugin_description']; if (isset($plg_dsc)) { if (is_array($plg_dsc['description']) && array_key_exists("attributes", $plg_dsc['description'])) { $plg_dsc['description'] = array($plg_dsc['description']); } $p_desc = array(); foreach ($plg_dsc['description'] as $in) { $p_desc[$in['attributes']['lang']] = $in['value']; }
$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 { $ftp_info['path'] = '/public_html/'; } $ftp_info['port'] = 21;