$nstd_q = $db->query("SELECT `design_id`, `aktive`, `design_name` FROM `cc" . $n . "_desigs` WHERE `design_id` = '" . $id . "'"); if (!$db->num_rows($nstd_q)) { error_msg('Das Template wurde nicht in der Datenbank gefunden!'); exit; } $nstd = $db->fetch_array($nstd_q); if ($nstd['aktive'] == 1 || $nstd['design_id'] == 1) { error_msg('Sie versuchen das Standardtemplate zu löschen, das ist nicht möglich!'); exit; } $ftp = new ftp($ftphost, $ftpuser, $ftppassword, $ftproot, $ftpport); if (!$ftp->lito_root) { error_msg('FTP Daten scheinen nicht zu stimmen!'); exit; } $ftp->req_remove('themes/' . $nstd['design_name']); $ftp->req_remove('images/' . $nstd['design_name']); $ftp->req_remove('css/' . $nstd['design_name']); $ftp->disconnect(); $db->query("DELETE FROM `cc" . $n . "_desigs` WHERE `design_id` = '" . $id . "'"); $aktive_q = $db->query("SELECT `design_id` FROM `cc" . $n . "_desigs` WHERE `aktive` = 1"); $aktive = $db->fetch_array($aktive_q); $db->query("UPDATE `cc" . $n . "_users` SET `design_id` = '" . $aktive['design_id'] . "' WHERE `design_id` = '" . $id . "'"); $action = 'main'; } if ($action == 'new') { if (!(isset($_POST['name']) && isset($_POST['mail']) && isset($_POST['description']) && isset($_POST['author']) && isset($_POST['copy']) && isset($_POST['web']))) { error_msg('Es wurden nicht alle nötigen Daten übergeben.'); exit; } if (!preg_match('!^[a-z_\\-]*$!', $_POST['name'])) {
} $old_tree = $ftp->list_files('acp/tmp'); $zip = new PclZip(LITO_ROOT_PATH . "acp/tmp/" . $_POST['remote'] . '.zip'); $zip->extract(PCLZIP_OPT_PATH, LITO_ROOT_PATH . 'acp/tmp'); $new_tree = $ftp->list_files('acp/tmp'); foreach ($new_tree as $node) { if (!in_array($node, $old_tree)) { $new = $node; } } if (!isset($new)) { error_msg('Der Name des neuen Ordners konnte nicht ermittelt werden! Bitte versuchen sie den Inhalt des acp/tmp Ordners zu l�schen'); exit; } if ($ftp->exists('acp/tmp/' . $new . '_up')) { $ftp->req_remove('acp/tmp/' . $new . '_up'); } $ftp->copy_req('acp/tmp/' . $new, 'acp/tmp/' . $new . '_up'); all_delete(LITO_ROOT_PATH . 'acp/tmp/' . $new); $ftp->disconnect(); unlink(LITO_ROOT_PATH . "acp/tmp/" . $_POST['remote'] . '.zip'); $action = 'scan_new'; } if ($action == "scan_new") { // first scan acp modules $return = array(); $allow_url_fopen = intval(ini_get('allow_url_fopen')); $tpl->assign('url_open', $allow_url_fopen); $MODDIR = LITO_ROOT_PATH . "acp/tmp/"; $setup_filename = ""; $modules_acp_counter = 0;