public static function genHTMLForm($data = array()) { global $lng, $theme; $nob = false; self::$_form = ''; foreach ($data as $fdata) { $sections = $fdata['sections']; foreach ($sections as $section) { /* * here be section title & image */ $title = $section['title']; $image = $section['image']; if (isset($section['visible']) && $section['visible'] === false) { continue; } if (!isset($section['nobuttons']) || $section['nobuttons'] == false) { eval("self::\$_form .= \"" . getTemplate("misc/form/table_section", "1") . "\";"); } else { $nob = true; } $nexto = false; foreach ($section['fields'] as $fieldname => $fielddata) { if (isset($fielddata['visible']) && $fielddata['visible'] === false) { continue; } if ($nexto === false || isset($fielddata['next_to']) && $nexto['field'] != $fielddata['next_to']) { $label = $fielddata['label']; $desc = isset($fielddata['desc']) ? $fielddata['desc'] : ''; $style = isset($fielddata['style']) ? ' class="' . $fielddata['style'] . '"' : ''; $mandatory = self::_getMandatoryFlag($fielddata); $data_field = self::_parseDataField($fieldname, $fielddata); //$data_field = str_replace("\n", "", $data_field); $data_field = str_replace("\t", "", $data_field); if (isset($fielddata['has_nextto'])) { $nexto = array('field' => $fieldname); $data_field .= '{NEXTTOFIELD_' . $fieldname . '}'; } else { $nexto = false; } eval("self::\$_form .= \"" . getTemplate("misc/form/table_row", "1") . "\";"); } else { $data_field = self::_parseDataField($fieldname, $fielddata); //$data_field = str_replace("\n", "", $data_field); $data_field = str_replace("\t", "", $data_field); $data_field = $fielddata['next_to_prefix'] . $data_field; self::$_form = str_replace('{NEXTTOFIELD_' . $fielddata['next_to'] . '}', $data_field, self::$_form); $nexto = false; } } } } // add save/reset buttons at the end of the form if (!$nob) { eval("self::\$_form .= \"" . getTemplate("misc/form/table_end", "1") . "\";"); } return self::$_form; }
$qrywhere = ", "; } $stmt = Database::prepare($qrystart . " `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` SET\n\t\t\t\t`ssl_cert_file` = :ssl_cert_file,\n\t\t\t\t`ssl_key_file` = :ssl_key_file,\n\t\t\t\t`ssl_ca_file` = :ssl_ca_file,\n\t\t\t\t`ssl_cert_chainfile` = :ssl_cert_chainfile\n\t\t\t\t" . $qrywhere . " `domainid`= :domainid"); $params = array("ssl_cert_file" => $ssl_cert_file, "ssl_key_file" => $ssl_key_file, "ssl_ca_file" => $ssl_ca_file, "ssl_cert_chainfile" => $ssl_cert_chainfile, "domainid" => $id); Database::pexecute($stmt, $params); // insert task to re-generate webserver-configs (#1260) inserttask('1'); // back to domain overview redirectTo($filename, array('page' => 'domains', 's' => $s)); } $stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "`\n\t\t\tWHERE `domainid`= :domainid"); Database::pexecute($stmt, array("domainid" => $id)); $result = $stmt->fetch(PDO::FETCH_ASSOC); $do_insert = false; // if no entry can be found, behave like we have empty values if (!is_array($result) || !isset($result['ssl_cert_file'])) { $result = array('ssl_cert_file' => '', 'ssl_key_file' => '', 'ssl_ca_file' => '', 'ssl_cert_chainfile' => ''); $do_insert = true; } $result = htmlentities_array($result); $ssleditor_data = (include_once dirname(__FILE__) . '/lib/formfields/customer/domains/formfield.domain_ssleditor.php'); $ssleditor_form = htmlform::genHTMLForm($ssleditor_data); $title = $ssleditor_data['domain_ssleditor']['title']; $image = $ssleditor_data['domain_ssleditor']['image']; eval("echo \"" . getTemplate("domains/domain_ssleditor") . "\";"); } } elseif ($page == 'domaindnseditor' && $userinfo['dnsenabled'] == '1' && Settings::Get('system.dnsenabled') == '1') { require_once __DIR__ . '/dns_editor.php'; } elseif ($page == 'sslcertificates') { require_once __DIR__ . '/ssl_certificates.php'; }
// insert task to re-generate the cron.d-file inserttask('99'); redirectTo($filename, array('page' => $page, 's' => $s)); } else { // interval $interval_nfo = explode(' ', $result['interval']); $interval_value = $interval_nfo[0]; $interval_interval = ''; $interval_interval .= makeoption($lng['cronmgmt']['minutes'], 'MINUTE', $interval_nfo[1]); $interval_interval .= makeoption($lng['cronmgmt']['hours'], 'HOUR', $interval_nfo[1]); $interval_interval .= makeoption($lng['cronmgmt']['days'], 'DAY', $interval_nfo[1]); $interval_interval .= makeoption($lng['cronmgmt']['weeks'], 'WEEK', $interval_nfo[1]); $interval_interval .= makeoption($lng['cronmgmt']['months'], 'MONTH', $interval_nfo[1]); // end of interval $change_cronfile = false; if (substr($result['module'], 0, strpos($result['module'], '/')) != 'froxlor') { $change_cronfile = true; } $cronjobs_edit_data = (include_once dirname(__FILE__) . '/lib/formfields/admin/cronjobs/formfield.cronjobs_edit.php'); $cronjobs_edit_form = htmlform::genHTMLForm($cronjobs_edit_data); $title = $cronjobs_edit_data['cronjobs_edit']['title']; $image = $cronjobs_edit_data['cronjobs_edit']['image']; eval("echo \"" . getTemplate('cronjobs/cronjob_edit') . "\";"); } } } elseif ($action == 'delete' && $id != 0) { /* * @TODO later */ } }
$fpm_enableslowlog = isset($_POST['phpfpm_enable_slowlog']) ? (int) $_POST['phpfpm_enable_slowlog'] : 0; $fpm_reqtermtimeout = validate($_POST['phpfpm_reqtermtimeout'], 'phpfpm_reqtermtimeout', '/^([0-9]+)(|s|m|h|d)$/'); $fpm_reqslowtimeout = validate($_POST['phpfpm_reqslowtimeout'], 'phpfpm_reqslowtimeout', '/^([0-9]+)(|s|m|h|d)$/'); // disable fcgid stuff $binary = '/usr/bin/php-cgi'; $file_extensions = 'php'; $mod_fcgid_starter = 0; $mod_fcgid_maxrequests = 0; $mod_fcgid_umask = "022"; } if (strlen($description) == 0 || strlen($description) > 50) { standard_error('descriptioninvalid'); } $upd_stmt = Database::prepare("\n\t\t\t\t\tUPDATE `" . TABLE_PANEL_PHPCONFIGS . "` SET\n\t\t\t\t\t\t`description` = :desc,\n\t\t\t\t\t\t`binary` = :binary,\n\t\t\t\t\t\t`file_extensions` = :fext,\n\t\t\t\t\t\t`mod_fcgid_starter` = :starter,\n\t\t\t\t\t\t`mod_fcgid_maxrequests` = :mreq,\n\t\t\t\t\t\t`mod_fcgid_umask` = :umask,\n\t\t\t\t\t\t`fpm_slowlog` = :fpmslow,\n\t\t\t\t\t\t`fpm_reqterm` = :fpmreqterm,\n\t\t\t\t\t\t`fpm_reqslow` = :fpmreqslow,\n\t\t\t\t\t\t`phpsettings` = :phpsettings\n\t\t\t\t\tWHERE `id` = :id"); $upd_data = array('desc' => $description, 'binary' => $binary, 'fext' => $file_extensions, 'starter' => $mod_fcgid_starter, 'mreq' => $mod_fcgid_maxrequests, 'umask' => $mod_fcgid_umask, 'fpmslow' => $fpm_enableslowlog, 'fpmreqterm' => $fpm_reqtermtimeout, 'fpmreqslow' => $fpm_reqslowtimeout, 'phpsettings' => $phpsettings, 'id' => $id); Database::pexecute($upd_stmt, $upd_data); inserttask('1'); $log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting with description '" . $description . "' has been changed by '" . $userinfo['loginname'] . "'"); redirectTo($filename, array('page' => $page, 's' => $s)); } else { $phpconfig_edit_data = (include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php'); $phpconfig_edit_form = htmlform::genHTMLForm($phpconfig_edit_data); $title = $phpconfig_edit_data['phpconfig_edit']['title']; $image = $phpconfig_edit_data['phpconfig_edit']['image']; eval("echo \"" . getTemplate("phpconfig/overview_edit") . "\";"); } } else { standard_error('nopermissionsorinvalidid'); } } }
$category = validate($_POST['category'], 'category'); $order = validate($_POST['logicalorder'], 'logicalorder'); if ($order < 1 || $order >= 1000) { $order = 1; } if ($category == '') { standard_error(array('stringisempty', 'mycategory')); } else { ticket::editCategory($db, $category, $id, $order); $log->logAction(ADM_ACTION, LOG_INFO, "edited ticket-category '" . $category . "'"); redirectTo($filename, array('page' => $page, 's' => $s)); } } else { $row = $db->query_first('SELECT * FROM `' . TABLE_PANEL_TICKET_CATS . '` WHERE `id` = "' . (int) $id . '"'); $category_edit_data = (include_once dirname(__FILE__) . '/lib/formfields/admin/tickets/formfield.category_edit.php'); $category_edit_form = htmlform::genHTMLForm($category_edit_data); $title = $category_edit_data['category_edit']['title']; $image = $category_edit_data['category_edit']['image']; eval("echo \"" . getTemplate("tickets/tickets_editcategory") . "\";"); } } elseif ($action == 'deletecategory' && $id != 0) { if (isset($_POST['send']) && $_POST['send'] == 'send') { if (ticket::deleteCategory($db, $id) == false) { standard_error('categoryhastickets'); } $log->logAction(ADM_ACTION, LOG_INFO, "deleted ticket-category #" . $id); redirectTo($filename, array('page' => $page, 's' => $s)); } else { $name = ticket::getCategoryName($db, $id); ask_yesno('ticket_reallydeletecat', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $name); }
$by = $lng['ticket']['staff']; } else { $by = $lng['ticket']['customer']; } $subject = $subticket->Get('subject'); $message = $subticket->Get('message'); eval("\$ticket_replies.=\"" . getTemplate("tickets/tickets_tickets_list") . "\";"); } $priorities = makeoption($lng['ticket']['high'], '1', $mainticket->Get('priority'), true, true); $priorities .= makeoption($lng['ticket']['normal'], '2', $mainticket->Get('priority'), true, true); $priorities .= makeoption($lng['ticket']['low'], '3', $mainticket->Get('priority'), true, true); $subject = $mainticket->Get('subject'); $ticket_replies_count = $db->num_rows($andere) + 1; // don't forget the main-ticket! $ticket_reply_data = (include_once dirname(__FILE__) . '/lib/formfields/customer/tickets/formfield.ticket_reply.php'); $ticket_reply_form = htmlform::genHTMLForm($ticket_reply_data); $title = $ticket_reply_data['ticket_reply']['title']; $image = $ticket_reply_data['ticket_reply']['image']; eval("echo \"" . getTemplate("tickets/tickets_reply") . "\";"); } } elseif ($action == 'close' && $id != 0) { if (isset($_POST['send']) && $_POST['send'] == 'send') { $now = time(); $mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int) $id); $mainticket->Set('lastchange', $now, true, true); $mainticket->Set('lastreplier', '0', true, true); $mainticket->Set('status', '3', true, true); $mainticket->Update(); $log->logAction(USR_ACTION, LOG_NOTICE, "closed support-ticket '" . $mainticket->Get('subject') . "'"); redirectTo($filename, array('page' => $page, 's' => $s)); } else {
} if (strlen(trim($docroot)) > 0) { $docroot = makeCorrectDir($docroot); } else { $docroot = ''; } if ($result['ip'] != $ip && $result['ip'] == Settings::Get('system.ipaddress') && $result_sameipotherport['id'] == '') { standard_error('cantchangesystemip'); } elseif ($result_checkfordouble['id'] != '' && $result_checkfordouble['id'] != $id) { standard_error('myipnotdouble'); } else { $upd_stmt = Database::prepare("\n\t\t\t\t\t\tUPDATE `" . TABLE_PANEL_IPSANDPORTS . "`\n\t\t\t\t\t\tSET\n\t\t\t\t\t\t\t`ip` = :ip, `port` = :port, `listen_statement` = :ls,\n\t\t\t\t\t\t\t`namevirtualhost_statement` = :nvhs, `vhostcontainer` = :vhc,\n\t\t\t\t\t\t\t`vhostcontainer_servername_statement` = :vhcss,\n\t\t\t\t\t\t\t`specialsettings` = :ss, `ssl` = :ssl,\n\t\t\t\t\t\t\t`ssl_cert_file` = :ssl_cert, `ssl_key_file` = :ssl_key,\n\t\t\t\t\t\t\t`ssl_ca_file` = :ssl_ca, `ssl_cert_chainfile` = :ssl_chain,\n\t\t\t\t\t\t\t`default_vhostconf_domain` = :dvhd, `docroot` = :docroot\n\t\t\t\t\t\tWHERE `id` = :id;\n\t\t\t\t\t"); $upd_data = array('ip' => $ip, 'port' => $port, 'ls' => $listen_statement, 'nvhs' => $namevirtualhost_statement, 'vhc' => $vhostcontainer, 'vhcss' => $vhostcontainer_servername_statement, 'ss' => $specialsettings, 'ssl' => $ssl, 'ssl_cert' => $ssl_cert_file, 'ssl_key' => $ssl_key_file, 'ssl_ca' => $ssl_ca_file, 'ssl_chain' => $ssl_cert_chainfile, 'dvhd' => $default_vhostconf_domain, 'docroot' => $docroot, 'id' => $id); Database::pexecute($upd_stmt, $upd_data); $log->logAction(ADM_ACTION, LOG_WARNING, "changed IP/port from '" . $result['ip'] . ":" . $result['port'] . "' to '" . $ip . ":" . $port . "'"); inserttask('1'); // Using nameserver, insert a task which rebuilds the server config inserttask('4'); redirectTo($filename, array('page' => $page, 's' => $s)); } } else { $result = htmlentities_array($result); $ipsandports_edit_data = (include_once dirname(__FILE__) . '/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php'); $ipsandports_edit_form = htmlform::genHTMLForm($ipsandports_edit_data); $title = $ipsandports_edit_data['ipsandports_edit']['title']; $image = $ipsandports_edit_data['ipsandports_edit']['image']; eval("echo \"" . getTemplate("ipsandports/ipsandports_edit") . "\";"); } } } }
} elseif ($destination == $result['email']) { standard_error('destinationalreadyexistasmail', $destination); } elseif (in_array($destination, $result['destination_array'])) { standard_error('destinationalreadyexist', $destination); } else { $result['destination'] .= ' ' . $destination; $db->query("UPDATE `" . TABLE_MAIL_VIRTUAL . "` SET `destination` = '" . $db->escape(makeCorrectDestination($result['destination'])) . "' WHERE `customerid`='" . (int) $userinfo['customerid'] . "' AND `id`='" . (int) $id . "'"); $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `email_forwarders_used` = `email_forwarders_used` + 1 WHERE `customerid`='" . (int) $userinfo['customerid'] . "'"); $log->logAction(USR_ACTION, LOG_NOTICE, "added email forwarder for '" . $result['email_full'] . "'"); redirectTo($filename, array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s)); } } else { $result['email_full'] = $idna_convert->decode($result['email_full']); $result = htmlentities_array($result); $forwarder_add_data = (include_once dirname(__FILE__) . '/lib/formfields/customer/email/formfield.emails_addforwarder.php'); $forwarder_add_form = htmlform::genHTMLForm($forwarder_add_data); $title = $forwarder_add_data['emails_addforwarder']['title']; $image = $forwarder_add_data['emails_addforwarder']['image']; eval("echo \"" . getTemplate("email/forwarder_add") . "\";"); } } } else { standard_error('allresourcesused'); } } elseif ($action == 'delete' && $id != 0) { $result = $db->query_first("SELECT `id`, `email`, `email_full`, `iscatchall`, `destination`, `customerid`, `popaccountid` FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE `customerid`='" . (int) $userinfo['customerid'] . "' AND `id`='" . (int) $id . "'"); if (isset($result['destination']) && $result['destination'] != '') { if (isset($_POST['forwarderid'])) { $forwarderid = intval($_POST['forwarderid']); } elseif (isset($_GET['forwarderid'])) { $forwarderid = intval($_GET['forwarderid']);
$params = array("customerid" => $userinfo['customerid'], "options_indexes" => $_POST['options_indexes'] == '1' ? '1' : '0', "error403path" => $error403path, "error404path" => $error404path, "error500path" => $error500path, "options_cgi" => $options_cgi, "id" => $id); Database::pexecute($stmt, $params); $log->logAction(USR_ACTION, LOG_INFO, "edited htaccess for '" . str_replace($userinfo['documentroot'], '', $result['path']) . "'"); } redirectTo($filename, array('page' => $page, 's' => $s)); } else { if (strpos($result['path'], $userinfo['documentroot']) === 0) { $result['path'] = substr($result['path'], strlen($userinfo['documentroot'])); // don't show nothing when it's the docroot, show slash if ($result['path'] == '') { $result['path'] = '/'; } } $result['error404path'] = $result['error404path']; $result['error403path'] = $result['error403path']; $result['error500path'] = $result['error500path']; $cperlenabled = customerHasPerlEnabled($userinfo['customerid']); /* $options_indexes = makeyesno('options_indexes', '1', '0', $result['options_indexes']); $options_cgi = makeyesno('options_cgi', '1', '0', $result['options_cgi']); */ $result = htmlentities_array($result); $htaccess_edit_data = (include_once dirname(__FILE__) . '/lib/formfields/customer/extras/formfield.htaccess_edit.php'); $htaccess_edit_form = htmlform::genHTMLForm($htaccess_edit_data); $title = $htaccess_edit_data['htaccess_edit']['title']; $image = $htaccess_edit_data['htaccess_edit']['image']; eval("echo \"" . getTemplate("extras/htaccess_edit") . "\";"); } } } }
$title = $template_edit_data['template_edit']['title']; $image = $template_edit_data['template_edit']['image']; eval("echo \"" . getTemplate("templates/templates_edit") . "\";"); } } } elseif ($action == 'editf' && $id != 0) { //file templates $result_stmt = Database::prepare("\n\t\tSELECT * FROM `" . TABLE_PANEL_TEMPLATES . "`\n\t\tWHERE `adminid` = :adminid AND `id` = :id"); Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'id' => $id)); if (Database::num_rows() > 0) { $row = $result_stmt->fetch(PDO::FETCH_ASSOC); //filetemplates if (isset($_POST['filesend']) && $_POST['filesend'] == 'filesend') { $filecontent = validate($_POST['filecontent'], 'filecontent', '/^[^\\0]+$/', 'filecontentnotset'); $upd_stmt = Database::prepare("\n\t\t\t\tUPDATE `" . TABLE_PANEL_TEMPLATES . "` SET\n\t\t\t\t\t`value` = :value\n\t\t\t\tWHERE `adminid` = :adminid AND `id` = :id"); Database::pexecute($upd_stmt, array('value' => $filecontent, 'adminid' => $userinfo['adminid'], 'id' => $id)); $log->logAction(ADM_ACTION, LOG_INFO, "edited template '" . $row['varname'] . "'"); redirectTo($filename, array('page' => $page, 's' => $s)); } else { $row = htmlentities_array($row); $filetemplate_edit_data = (include_once dirname(__FILE__) . '/lib/formfields/admin/templates/formfield.filetemplate_edit.php'); $filetemplate_edit_form = htmlform::genHTMLForm($filetemplate_edit_data); $title = $filetemplate_edit_data['filetemplate_edit']['title']; $image = $filetemplate_edit_data['filetemplate_edit']['image']; eval("echo \"" . getTemplate("templates/filetemplates_edit") . "\";"); } } else { standard_error('templatenotfound'); exit; } }
$ftps_ul = makecheckbox('ftps_ul', $lng['customer']['unlimited'], '-1', false, $result['ftps'], true, true); if ($result['ftps'] == '-1') { $result['ftps'] = ''; } $tickets_ul = makecheckbox('tickets_ul', $lng['customer']['unlimited'], '-1', false, $result['tickets'], true, true); if ($result['tickets'] == '-1') { $result['tickets'] = ''; } $mysqls_ul = makecheckbox('mysqls_ul', $lng['customer']['unlimited'], '-1', false, $result['mysqls'], true, true); if ($result['mysqls'] == '-1') { $result['mysqls'] = ''; } $language_options = ''; while (list($language_file, $language_name) = each($languages)) { $language_options .= makeoption($language_name, $language_file, $result['def_language'], true); } $ipaddress = makeoption($lng['admin']['allips'], "-1", $result['ip']); $ipsandports_stmt = Database::query("\n\t\t\t\t\tSELECT `id`, `ip` FROM `" . TABLE_PANEL_IPSANDPORTS . "` GROUP BY `ip` ORDER BY `ip`, `port` ASC\n\t\t\t\t"); while ($row = $ipsandports_stmt->fetch(PDO::FETCH_ASSOC)) { $ipaddress .= makeoption($row['ip'], $row['id'], $result['ip']); } $result = htmlentities_array($result); $admin_edit_data = (include_once dirname(__FILE__) . '/lib/formfields/admin/admin/formfield.admin_edit.php'); $admin_edit_form = htmlform::genHTMLForm($admin_edit_data); $title = $admin_edit_data['admin_edit']['title']; $image = $admin_edit_data['admin_edit']['image']; eval("echo \"" . getTemplate("admins/admins_edit") . "\";"); } } } }
$result['email_forwarders'] = ''; } $email_quota_ul = makecheckbox('email_quota_ul', $lng['customer']['unlimited'], '-1', false, $result['email_quota'], true, true); if ($result['email_quota'] == '-1') { $result['email_quota'] = ''; } $ftps_ul = makecheckbox('ftps_ul', $lng['customer']['unlimited'], '-1', false, $result['ftps'], true, true); if ($result['ftps'] == '-1') { $result['ftps'] = ''; } $tickets_ul = makecheckbox('tickets_ul', $lng['customer']['unlimited'], '-1', false, $result['tickets'], true, true); if ($result['tickets'] == '-1') { $result['tickets'] = ''; } $mysqls_ul = makecheckbox('mysqls_ul', $lng['customer']['unlimited'], '-1', false, $result['mysqls'], true, true); if ($result['mysqls'] == '-1') { $result['mysqls'] = ''; } $result = htmlentities_array($result); $gender_options = makeoption($lng['gender']['undef'], 0, $result['gender'] == '0' ? true : false, true, true); $gender_options .= makeoption($lng['gender']['male'], 1, $result['gender'] == '1' ? true : false, true, true); $gender_options .= makeoption($lng['gender']['female'], 2, $result['gender'] == '2' ? true : false, true, true); $customer_edit_data = (include_once dirname(__FILE__) . '/lib/formfields/admin/customer/formfield.customer_edit.php'); $customer_edit_form = htmlform::genHTMLForm($customer_edit_data); $title = $customer_edit_data['customer_edit']['title']; $image = $customer_edit_data['customer_edit']['image']; eval("echo \"" . getTemplate("customers/customers_edit") . "\";"); } } } }
$stmt = Database::prepare("DELETE FROM " . TABLE_NODETODOMAIN . " WHERE `id_node` = :id_node AND `id_domain` = :del_id"); foreach (array_diff($useddomains, $selecteddomains) as $del_id) { Database::pexecute($stmt, array('id_node' => $id, 'del_id' => $del_id)); } // add every IPPORT in $selectedips which is not in $usedips $stmt = Database::prepare("INSERT INTO " . TABLE_NODETODOMAIN . " SET `id_node`= :id_node, `id_domain`= :id_domain"); foreach (array_diff($selecteddomains, $useddomains) as $id_domain) { Database::pexecute($stmt, array('id_node' => $id, 'id_domain' => $id_domain)); } $result_checkfordouble_stmt = Database::prepare("\n\t\t\t\t\tSELECT `id` FROM `" . TABLE_NODES . "`\n\t\t\t\t\tWHERE `name` = :name AND `id` != :id"); $result_checkfordouble = Database::pexecute_first($result_checkfordouble_stmt, array('id' => $id, 'name' => $name)); if ($result_checkfordouble['id'] != '') { standard_error('nodeexists'); } else { $upd_stmt = Database::prepare("\n\t\t\t\t\tUPDATE `" . TABLE_NODES . "`\n\t\t\t\t\tSET\n\t\t\t\t\t\t`name` = :name, `image_name` = :image, `image_tag` = :tag, `is_default` = :default\n\t\t\t\t\tWHERE `id` = :id;\n\t\t\t\t"); $upd_data = array('name' => $name, 'image' => $image, 'tag' => $tag, 'default' => $is_default, 'id' => $id); Database::pexecute($upd_stmt, $upd_data); $log->logAction(ADM_ACTION, LOG_WARNING, "changed Node '" . $result['name'] . ":" . $result['image_name'] . "' to '" . $name . ":" . $image . "'"); inserttask('1'); redirectTo($filename, array('page' => $page, 's' => $s)); } } else { $result = htmlentities_array($result); $node_edit_data = (include_once dirname(__FILE__) . '/lib/formfields/admin/nodes/formfield.node_edit.php'); $node_edit_form = htmlform::genHTMLForm($node_edit_data); $title = $node_edit_data['node_edit']['title']; $image = $node_edit_data['node_edit']['image']; eval("echo \"" . getTemplate("nodes/node_edit") . "\";"); } } }
} else { $deactivated = '0'; $date_from = date('d-m-Y', $date_from); } $date_from_off = makecheckbox('date_from_off', $lng['panel']['not_activated'], '-1', false, $deactivated, true, true); if ($date_until == -1) { $deactivated = '-1'; $date_until = ''; } else { $deactivated = '0'; $date_until = date('d-m-Y', $date_until); } $date_until_off = makecheckbox('date_until_off', $lng['panel']['not_activated'], '-1', false, $deactivated, true, true); #$isactive = makeyesno('active', '1', '0', $row['enabled']); $autoresponder_edit_data = (include_once dirname(__FILE__) . '/lib/formfields/customer/autoresponder/formfield.autoresponder_edit.php'); $autoresponder_edit_form = htmlform::genHTMLForm($autoresponder_edit_data); $title = $autoresponder_edit_data['autoresponder_edit']['title']; $image = $autoresponder_edit_data['autoresponder_edit']['image']; eval("echo \"" . getTemplate("autoresponder/autoresponder_edit") . "\";"); } else { if ($action == "delete") { if (isset($_POST['send']) && $_POST['send'] == 'send') { $account = trim($_POST['account']); // Does autoresponder exist? $result = $db->query("SELECT `email` FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid` = '" . (int) $userinfo['customerid'] . "' AND `email` = '" . $db->escape($account) . "' LIMIT 0,1"); if ($db->num_rows($result) == 0) { standard_error('invalidautoresponder'); } $db->query("DELETE FROM `" . TABLE_MAIL_AUTORESPONDER . "`\n\t\t\tWHERE `email` = '" . $db->escape($account) . "'\n\t\t\tAND `customerid` = '" . $db->escape((int) $userinfo['customerid']) . "'\n\t\t\t"); $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `email_autoresponder_used` = `email_autoresponder_used` - 1 WHERE `customerid` = '" . $db->escape((int) $userinfo['customerid']) . "'"); redirectTo($filename, array('s' => $s));
$db_root = new db($sql_root[$result['dbserver']]['host'], $sql_root[$result['dbserver']]['user'], $sql_root[$result['dbserver']]['password'], ''); foreach (array_map('trim', explode(',', $settings['system']['mysql_access_host'])) as $mysql_access_host) { $db_root->query('SET PASSWORD FOR `' . $db_root->escape($result['databasename']) . '`@`' . $db_root->escape($mysql_access_host) . '` = PASSWORD(\'' . $db_root->escape($password) . '\')'); } //if ($access_result['allow_external_access'] == '1' && $_POST['mysql_allow_external_access'] == '1') { if ($external_access_val == '1') { $db_root->query('SET PASSWORD FOR `' . $db_root->escape($result['databasename']) . '`@`%` = PASSWORD(\'' . $db_root->escape($password) . '\')'); } $db_root->query('FLUSH PRIVILEGES'); $db_root->close(); // End root-session } // Update the Database description -- PH 2004-11-29 $log->logAction(USR_ACTION, LOG_INFO, "edited database '" . $result['databasename'] . "'"); $databasedescription = validate($_POST['description'], 'description'); $db->query('UPDATE `' . TABLE_PANEL_DATABASES . '` SET `description`="' . $db->escape($databasedescription) . '", `allow_external_access`="' . $external_access_val . '" WHERE `customerid`="' . (int) $userinfo['customerid'] . '" AND `id`="' . (int) $id . '"'); redirectTo($filename, array('page' => $page, 's' => $s)); } else { $access_result = $db->query_first('SELECT `allow_external_access` FROM `' . TABLE_PANEL_DATABASES . '` WHERE `customerid`="' . (int) $userinfo['customerid'] . '" AND `id`="' . (int) $id . '"'); $mysql_edit_data = (include_once dirname(__FILE__) . '/lib/formfields/customer/mysql/formfield.mysql_edit.php'); if (!checkNitradoServiceLimit((int) $userinfo['customerid'], 'mysql', 'allow_external_access', '1')) { unset($mysql_edit_data['mysql_edit']['sections']['section_a']['fields']['mysql_allow_external_access']); } $mysql_edit_form = htmlform::genHTMLForm($mysql_edit_data); $title = $mysql_edit_data['mysql_edit']['title']; $image = $mysql_edit_data['mysql_edit']['image']; eval("echo \"" . getTemplate("mysql/mysqls_edit") . "\";"); } } } }
} $log->logAction(USR_ACTION, LOG_INFO, "edited ftp-account '" . $result['username'] . "'"); $description = validate($_POST['ftp_description'], 'description'); $stmt = Database::prepare("UPDATE `" . TABLE_FTP_USERS . "`\n\t\t\t\t\tSET `description` = :desc\n\t\t\t\t\tWHERE `customerid` = :customerid\n\t\t\t\t\tAND `id` = :id"); Database::pexecute($stmt, array("desc" => $description, "customerid" => $userinfo['customerid'], "id" => $id)); redirectTo($filename, array('page' => $page, 's' => $s)); } else { if (strpos($result['homedir'], $userinfo['documentroot']) === 0) { $homedir = str_replace($userinfo['documentroot'], "/", $result['homedir']); } else { $homedir = $result['homedir']; } $homedir = makeCorrectDir($homedir); $pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $homedir); if (Settings::Get('customer.ftpatdomain') == '1') { $domains = ''; $result_domains_stmt = Database::prepare("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "`\n\t\t\t\t\t\tWHERE `customerid` = :customerid"); Database::pexecute($result_domains_stmt, array("customerid" => $userinfo['customerid'])); while ($row_domain = $result_domains_stmt->fetch(PDO::FETCH_ASSOC)) { $domains .= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['domain']); } } $ftp_edit_data = (include_once dirname(__FILE__) . '/lib/formfields/customer/ftp/formfield.ftp_edit.php'); $ftp_edit_form = htmlform::genHTMLForm($ftp_edit_data); $title = $ftp_edit_data['ftp_edit']['title']; $image = $ftp_edit_data['ftp_edit']['image']; eval("echo \"" . getTemplate('ftp/accounts_edit') . "\";"); } } } }
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit'], $result['documentroot']); } $redirectcode = ''; if ($settings['customredirect']['enabled'] == '1') { $def_code = getDomainRedirectId($id); $codes = getRedirectCodesArray(); foreach ($codes as $rc) { $redirectcode .= makeoption($rc['code'] . ' (' . $lng['redirect_desc'][$rc['desc']] . ')', $rc['id'], $def_code); } } #$ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']); #$iswildcarddomain = makeyesno('iswildcarddomain', '1', '0', $result['iswildcarddomain']); #$isemaildomain = makeyesno('isemaildomain', '1', '0', $result['isemaildomain']); $openbasedir = makeoption($lng['domain']['docroot'], 0, $result['openbasedir_path'], true) . makeoption($lng['domain']['homedir'], 1, $result['openbasedir_path'], true); $result_ipandport = $db->query_first("SELECT `ip` FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `id`='" . (int) $result['ipandport'] . "'"); if (filter_var($result_ipandport['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { $result_ipandport['ip'] = '[' . $result_ipandport['ip'] . ']'; } $domainip = $result_ipandport['ip']; $result = htmlentities_array($result); $subdomain_edit_data = (include_once dirname(__FILE__) . '/lib/formfields/customer/domains/formfield.domains_edit.php'); $subdomain_edit_form = htmlform::genHTMLForm($subdomain_edit_data); $title = $subdomain_edit_data['domain_edit']['title']; $image = $subdomain_edit_data['domain_edit']['image']; eval("echo \"" . getTemplate("domains/domains_edit") . "\";"); } } else { standard_error('domains_canteditdomain'); } } }
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']; eval("echo \"" . getTemplate("domains/domains_import") . "\";"); } } }
$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)) { // overwrite backup_form after we took everything from it we needed eval("\$backup_form = \"" . getTemplate("extras/backup_listexisting") . "\";"); } eval("echo \"" . getTemplate("extras/backup") . "\";"); } } } else { standard_error('backupfunctionnotenabled'); } }