$separator = validate($_POST['separator'], 'separator'); $offset = (int) validate($_POST['offset'], 'offset', "/[0-9]/i"); $file_name = $_FILES['file']['tmp_name']; $result = array(); try { $bulk = new DomainBulkAction($file_name, $customerid); $result = $bulk->doImport($separator, $offset); } catch (Exception $e) { standard_error('domain_import_error', $e->getMessage()); } // @FIXME find a way to display $result['notice'] here somehow, // as it might be important if you've reached your maximum allocation of domains // update customer/admin counters updateCounters(false); $result_str = $result['imported'] . ' / ' . $result['all']; standard_success('domain_import_successfully', $result_str, array('filename' => $filename, 'action' => '', 'page' => 'domains')); } else { $customers = makeoption($lng['panel']['please_choose'], 0, 0, true); $result_customers_stmt = Database::prepare("\n\t\t\t\tSELECT `customerid`, `loginname`, `name`, `firstname`, `company`\n\t\t\t\tFROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = '" . (int) $userinfo['adminid'] . "' ") . " ORDER BY `name` ASC"); $params = array(); if ($userinfo['customers_see_all'] == '0') { $params['adminid'] = $userinfo['adminid']; } Database::pexecute($result_customers_stmt, $params); while ($row_customer = $result_customers_stmt->fetch(PDO::FETCH_ASSOC)) { $customers .= makeoption(getCorrectFullUserDetails($row_customer) . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid']); } $domain_import_data = (include_once dirname(__FILE__) . '/lib/formfields/admin/domains/formfield.domains_import.php'); $domain_import_form = htmlform::genHTMLForm($domain_import_data); $title = $domain_import_data['domain_import']['title']; $image = $domain_import_data['domain_import']['image'];
$isnewerversion = 1; } else { // nothing new $isnewerversion = 0; } // anzeige über version-status mit ggfls. formular // zum update schritt #1 -> download if ($isnewerversion == 1) { $text = 'There is a newer version available. Update to version <b>' . $_version . '</b> now?<br/>(Your current version is: ' . $version . ')'; $hiddenparams = '<input type="hidden" name="newversion" value="' . $_version . '" />'; $yesfile = $filename . '?s=' . $s . '&page=getdownload'; eval("echo \"" . getTemplate("misc/question_yesno", true) . "\";"); exit; } elseif ($isnewerversion == 0) { // all good standard_success('noupdatesavail'); } else { standard_error('customized_version'); } } } // error (something weird came from version.froxlor.org) redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 5)); } elseif ($page == 'getdownload') { // retreive the new version from the form $newversion = isset($_POST['newversion']) ? $_POST['newversion'] : null; // valid? if ($newversion !== null) { // define files to get $toLoad = str_replace('{version}', $newversion, RELEASE_URI); $toCheck = str_replace('{version}', $newversion, MD5SUM_URI);
* @package Panel * @version $Id$ */ define('AREA', 'admin'); /** * Include our init.php, which manages Sessions, Language etc. */ $need_db_sql_data = true; $need_root_db_sql_data = true; require "./lib/init.php"; if (($page == 'settings' || $page == 'overview') && $userinfo['change_serversettings'] == '1') { $settings_data = loadConfigArrayDir('./actions/admin/settings/'); $settings = loadSettings(&$settings_data, &$db); if (isset($_POST['send']) && $_POST['send'] == 'send') { if (processForm(&$settings_data, &$_POST, array('filename' => $filename, 'action' => $action, 'page' => $page))) { standard_success('settingssaved', '', array('filename' => $filename, 'action' => $action, 'page' => $page)); } } else { $fields = buildForm(&$settings_data); eval("echo \"" . getTemplate("settings/settings") . "\";"); } } elseif ($page == 'rebuildconfigs' && $userinfo['change_serversettings'] == '1') { if (isset($_POST['send']) && $_POST['send'] == 'send') { $log->logAction(ADM_ACTION, LOG_INFO, "rebuild configfiles"); inserttask('1'); inserttask('4'); inserttask('5'); redirectTo('admin_index.php', array('s' => $s)); } else { ask_yesno('admin_configs_reallyrebuild', $filename, array('page' => $page)); }
eval("echo \"" . getTemplate("settings/settings_form_begin") . "\";"); eval("echo \$settings_page;"); eval("echo \"" . getTemplate("settings/settings_form_end") . "\";"); } } elseif ($page == 'rebuildconfigs' && $userinfo['change_serversettings'] == '1') { if (isset($_POST['send']) && $_POST['send'] == 'send') { $log->logAction(ADM_ACTION, LOG_INFO, "rebuild configfiles"); inserttask('1'); inserttask('5'); inserttask('9'); inserttask('10'); # Using nameserver, insert a task which rebuilds the server config if ($settings['system']['bind_enable']) { inserttask('4'); } standard_success('rebuildingconfigs', '', array('filename' => 'admin_index.php')); } else { ask_yesno('admin_configs_reallyrebuild', $filename, array('page' => $page)); } } elseif ($page == 'updatecounters' && $userinfo['change_serversettings'] == '1') { if (isset($_POST['send']) && $_POST['send'] == 'send') { $log->logAction(ADM_ACTION, LOG_INFO, "updated resource-counters"); $updatecounters = updateCounters(true); $customers = ''; foreach ($updatecounters['customers'] as $customerid => $customer) { eval("\$customers.=\"" . getTemplate("settings/updatecounters_row_customer") . "\";"); } $admins = ''; foreach ($updatecounters['admins'] as $adminid => $admin) { eval("\$admins.=\"" . getTemplate("settings/updatecounters_row_admin") . "\";"); }
$backup_dbs = isset($_POST['backup_dbs']) ? intval($_POST['backup_dbs']) : 0; $backup_mail = isset($_POST['backup_mail']) ? intval($_POST['backup_mail']) : 0; $backup_web = isset($_POST['backup_web']) ? intval($_POST['backup_web']) : 0; if ($backup_dbs != '1') { $backup_dbs = '0'; } if ($backup_mail != '1') { $backup_mail = '0'; } if ($backup_web != '1') { $backup_web = '0'; } $task_data = array('customerid' => $userinfo['customerid'], 'uid' => $userinfo['guid'], 'gid' => $userinfo['guid'], 'loginname' => $userinfo['loginname'], 'destdir' => $path, 'backup_dbs' => $backup_dbs, 'backup_mail' => $backup_mail, 'backup_web' => $backup_web); // schedule backup job inserttask('20', $task_data); standard_success('backupscheduled'); } else { if (!empty($existing_backupJob)) { $action = "abort"; $row = unserialize($entry['data']); $row['path'] = makeCorrectDir(str_replace($userinfo['documentroot'], "/", $row['destdir'])); $row['backup_web'] = $row['backup_web'] == '1' ? $lng['panel']['yes'] : $lng['panel']['no']; $row['backup_mail'] = $row['backup_mail'] == '1' ? $lng['panel']['yes'] : $lng['panel']['no']; $row['backup_dbs'] = $row['backup_dbs'] == '1' ? $lng['panel']['yes'] : $lng['panel']['no']; } $pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']); $backup_data = (include_once dirname(__FILE__) . '/lib/formfields/customer/extras/formfield.backup.php'); $backup_form = htmlform::genHTMLForm($backup_data); $title = $backup_data['backup']['title']; $image = $backup_data['backup']['image']; if (!empty($existing_backupJob)) {