示例#1
0
/**
 * Include our init.php, which manages Sessions, Language etc.
 */
require "./lib/init.php";
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'admins' && $userinfo['change_serversettings'] == '1') {
    if ($action == '') {
        $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_admins");
        $fields = array('loginname' => $lng['login']['username'], 'name' => $lng['customer']['name'], 'diskspace' => $lng['customer']['diskspace'], 'diskspace_used' => $lng['customer']['diskspace'] . ' (' . $lng['panel']['used'] . ')', 'traffic' => $lng['customer']['traffic'], 'traffic_used' => $lng['customer']['traffic'] . ' (' . $lng['panel']['used'] . ')', 'deactivated' => $lng['admin']['deactivated']);
        $paging = new paging($userinfo, $db, TABLE_PANEL_ADMINS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $admins = '';
        $result = $db->query("SELECT * FROM `" . TABLE_PANEL_ADMINS . "` " . $paging->getSqlWhere(false) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng, true);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $i = 0;
        $count = 0;
        while ($row = $db->fetch_array($result)) {
            if ($paging->checkDisplay($i)) {
                $row['traffic_used'] = round($row['traffic_used'] / (1024 * 1024), $settings['panel']['decimal_places']);
                $row['traffic'] = round($row['traffic'] / (1024 * 1024), $settings['panel']['decimal_places']);
                $row['diskspace_used'] = round($row['diskspace_used'] / 1024, $settings['panel']['decimal_places']);
                $row['diskspace'] = round($row['diskspace'] / 1024, $settings['panel']['decimal_places']);
                /**
                 * percent-values for progressbar
示例#2
0
 */
require "./lib/init.php";
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'overview') {
    $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_email");
    eval("echo \"" . getTemplate("email/email") . "\";");
} elseif ($page == 'emails') {
    if ($action == '') {
        $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_email::emails");
        $fields = array('d.domain' => $lng['domains']['domainname'], 'm.email_full' => $lng['emails']['emailaddress'], 'm.destination' => $lng['emails']['forwarders']);
        $paging = new paging($userinfo, $db, TABLE_MAIL_VIRTUAL, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $result = $db->query('SELECT `m`.`id`, `m`.`domainid`, `m`.`email`, `m`.`email_full`, `m`.`iscatchall`, `u`.`quota`, `m`.`destination`, `m`.`popaccountid`, `d`.`domain` FROM `' . TABLE_MAIL_VIRTUAL . '` `m` LEFT JOIN `' . TABLE_PANEL_DOMAINS . '` `d` ON (`m`.`domainid` = `d`.`id`) LEFT JOIN `' . TABLE_MAIL_USERS . '` `u` ON (`m`.`popaccountid` = `u`.`id`) WHERE `m`.`customerid`="' . $db->escape($userinfo['customerid']) . '" ' . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $emails = array();
        while ($row = $db->fetch_array($result)) {
            if (!isset($emails[$row['domain']]) || !is_array($emails[$row['domain']])) {
                $emails[$row['domain']] = array();
            }
            $emails[$row['domain']][$row['email_full']] = $row;
        }
        if ($paging->sortfield == 'd.domain' && $paging->sortorder == 'desc') {
            krsort($emails);
        } else {
示例#3
0
 */
require './lib/init.php';
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'overview') {
    $log->logAction(USR_ACTION, LOG_NOTICE, 'viewed customer_ftp');
    eval('echo "' . getTemplate('ftp/ftp') . '";');
} elseif ($page == 'accounts') {
    if ($action == '') {
        $log->logAction(USR_ACTION, LOG_NOTICE, 'viewed customer_ftp::accounts');
        $fields = array('username' => $lng['login']['username'], 'homedir' => $lng['panel']['path']);
        $paging = new paging($userinfo, $db, TABLE_FTP_USERS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $result = $db->query('SELECT `id`, `username`, `homedir` FROM `' . TABLE_FTP_USERS . "` WHERE `customerid`='" . $userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . ' ' . $paging->getSqlOrderBy() . ' ' . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $i = 0;
        $count = 0;
        $accounts = '';
        while ($row = $db->fetch_array($result)) {
            if ($paging->checkDisplay($i)) {
                if (strpos($row['homedir'], $userinfo['documentroot']) === 0) {
                    $row['documentroot'] = substr($row['homedir'], strlen($userinfo['documentroot']));
                } else {
                    $row['documentroot'] = $row['homedir'];
                }
示例#4
0
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($userinfo['customers_see_all'] == '1') {
    $taxclasses = array();
    $taxclasses_option = '';
    $taxclasses_result = $db->query('SELECT `classid`, `classname` FROM `' . TABLE_BILLING_TAXCLASSES . '` ');
    while ($taxclasses_row = $db->fetch_array($taxclasses_result)) {
        $taxclasses[$taxclasses_row['classid']] = $taxclasses_row['classname'];
        $taxclasses_option .= makeoption($taxclasses_row['classname'], $taxclasses_row['classid']);
    }
    if ($action == '') {
        $fields = array('c.classname' => $lng['billing']['taxclass'], 'r.taxrate' => $lng['billing']['taxrate'], 'r.valid_from' => $lng['service']['valid_from']);
        $paging = new paging($userinfo, $db, TABLE_BILLING_TAXRATES, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $customers = '';
        $result = $db->query('SELECT `r`.*, `c`.*  ' . 'FROM `' . TABLE_BILLING_TAXRATES . '` `r` LEFT JOIN `' . TABLE_BILLING_TAXCLASSES . '` `c` ON( `r`.`taxclass` = `c`.`classid` ) ' . $paging->getSqlWhere() . ' ' . $paging->getSqlOrderBy() . ' ' . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?s=' . $s);
        $i = 0;
        $taxrates = '';
        while ($row = $db->fetch_array($result)) {
            if ($paging->checkDisplay($i)) {
                $row['taxrate_percent'] = $row['taxrate'] * 100;
                $row = htmlentities_array($row);
                eval('$taxrates.="' . getTemplate('billing/taxrates_row') . '";');
            }
            ++$i;
        }
示例#5
0
require "./lib/init.php";
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'overview') {
    $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_mysql");
    $lng['mysql']['description'] = str_replace('<SQL_HOST>', $sql['host'], $lng['mysql']['description']);
    eval("echo \"" . getTemplate("mysql/mysql") . "\";");
} elseif ($page == 'mysqls') {
    if ($action == '') {
        $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_mysql::mysqls");
        $fields = array('databasename' => $lng['mysql']['databasename'], 'description' => $lng['mysql']['databasedescription']);
        $paging = new paging($userinfo, $db, TABLE_PANEL_DATABASES, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $result = $db->query("SELECT * FROM `" . TABLE_PANEL_DATABASES . "` WHERE `customerid`='" . (int) $userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $i = 0;
        $count = 0;
        $mysqls = '';
        // Begin root-session
        $db_root = new db($sql_root[0]['host'], $sql_root[0]['user'], $sql_root[0]['password'], '');
        while ($row = $db->fetch_array($result)) {
            if ($paging->checkDisplay($i)) {
                $row = htmlentities_array($row);
                $mbdata = $db_root->query_first("SELECT SUM( data_length + index_length) / 1024 / 1024 'MB' FROM information_schema.TABLES WHERE table_schema = '" . $db_root->escape($row['databasename']) . "' GROUP BY table_schema ;");
                $row['size'] = number_format($mbdata['MB'], 3, '.', '');
示例#6
0
 */
require "./lib/init.php";
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'overview') {
    $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_ftp");
    eval("echo \"" . getTemplate("ftp/ftp") . "\";");
} elseif ($page == 'accounts') {
    if ($action == '') {
        $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_ftp::accounts");
        $fields = array('username' => $lng['login']['username'], 'homedir' => $lng['panel']['path']);
        $paging = new paging($userinfo, $db, TABLE_FTP_USERS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $result = $db->query("SELECT `id`, `username`, `homedir` FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . $userinfo['customerid'] . "'  AND `username` NOT LIKE '%_backup'" . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $i = 0;
        $count = 0;
        $accounts = '';
        while ($row = $db->fetch_array($result)) {
            if ($paging->checkDisplay($i)) {
                if (strpos($row['homedir'], $userinfo['documentroot']) === 0) {
                    $row['documentroot'] = substr($row['homedir'], strlen($userinfo['documentroot']));
                } else {
                    $row['documentroot'] = $row['homedir'];
                }
示例#7
0
 *
 * @copyright  (c) the authors
 * @author     Florian Lippert <*****@*****.**> (2003-2009)
 * @author     Froxlor team <*****@*****.**> (2010-)
 * @license    GPLv2 http://files.froxlor.org/misc/COPYING.txt
 * @package    Panel
 *
 */
define('AREA', 'admin');
require './lib/init.php';
if ($page == 'log' && $userinfo['change_serversettings'] == '1') {
    if ($action == '') {
        $fields = array('date' => $lng['logger']['date'], 'type' => $lng['logger']['type'], 'user' => $lng['logger']['user'], 'text' => $lng['logger']['action']);
        $paging = new paging($userinfo, TABLE_PANEL_LOG, $fields, null, null, 0, 'desc');
        $result_stmt = Database::query('
			SELECT * FROM `' . TABLE_PANEL_LOG . '` ' . $paging->getSqlWhere(false) . ' ' . $paging->getSqlOrderBy() . ' ' . $paging->getSqlLimit());
        $logs_count = Database::num_rows();
        $paging->setEntries($logs_count);
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $clog = array();
        while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
            if (!isset($clog[$row['action']]) || !is_array($clog[$row['action']])) {
                $clog[$row['action']] = array();
            }
            $clog[$row['action']][$row['logid']] = $row;
        }
        if ($paging->sortfield == 'date' && $paging->sortorder == 'desc') {
            krsort($clog);
示例#8
0
 $priority[2] = isset($_POST['priority3']) ? $_POST['priority3'] : '';
 $fromdate = validate($_POST['fromdate'], 'fromdate');
 $todate = validate($_POST['todate'], 'todate');
 $message = validate($_POST['message'], 'message');
 $customer = validate($_POST['customer'], 'customer');
 $cat_stmt = Database::query('SELECT COUNT(`id`) as `ccount` FROM `' . TABLE_PANEL_TICKET_CATS . '`');
 $cat = $cat_stmt->fetch(PDO::FETCH_ASSOC);
 for ($x = 0; $x < $cat['ccount']; $x++) {
     $categories[$x] = isset($_POST['category' . $x]) ? $_POST['category' . $x] : '';
 }
 $archive_search = ticket::getArchiveSearchStatement($subject, $priority, $fromdate, $todate, $message, $customer, $userinfo['adminid'], $categories);
 $query = $archive_search[0];
 $archive_params = $archive_search[1];
 $fields = array('lastchange' => $lng['ticket']['lastchange'], 'subject' => $lng['ticket']['subject'], 'lastreplier' => $lng['ticket']['lastreplier']);
 $paging = new paging($userinfo, TABLE_PANEL_TICKETS, $fields);
 $result_stmt = Database::prepare($query . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
 Database::pexecute($result_stmt, $archive_params);
 $sortcode = $paging->getHtmlSortCode($lng);
 $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
 $searchcode = $paging->getHtmlSearchCode($lng);
 $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
 $ctickets = array();
 while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
     if (!isset($ctickets[$row['customerid']]) || !is_array($ctickets[$row['customerid']])) {
         $ctickets[$row['customerid']] = array();
     }
     $ctickets[$row['customerid']][$row['id']] = $row;
 }
 if ($paging->sortfield == 'customerid' && $paging->sortorder == 'desc') {
     krsort($ctickets);
 } else {
示例#9
0
 *
 */
define('AREA', 'admin');
require './lib/init.php';
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'admins' && $userinfo['change_serversettings'] == '1') {
    if ($action == '') {
        $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_admins");
        $fields = array('loginname' => $lng['login']['username'], 'name' => $lng['customer']['name'], 'diskspace' => $lng['customer']['diskspace'], 'diskspace_used' => $lng['customer']['diskspace'] . ' (' . $lng['panel']['used'] . ')', 'traffic' => $lng['customer']['traffic'], 'traffic_used' => $lng['customer']['traffic'] . ' (' . $lng['panel']['used'] . ')', 'deactivated' => $lng['admin']['deactivated']);
        $paging = new paging($userinfo, TABLE_PANEL_ADMINS, $fields);
        $admins = '';
        $result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_ADMINS . "` " . $paging->getSqlWhere(false) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        $numrows_admins = Database::num_rows();
        $paging->setEntries($numrows_admins);
        $sortcode = $paging->getHtmlSortCode($lng, true);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $i = 0;
        $count = 0;
        $dec_places = Settings::Get('panel.decimal_places');
        while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
            if ($paging->checkDisplay($i)) {
                $row['traffic_used'] = round($row['traffic_used'] / (1024 * 1024), $dec_places);
                $row['traffic'] = round($row['traffic'] / (1024 * 1024), $dec_places);
                $row['diskspace_used'] = round($row['diskspace_used'] / 1024, $dec_places);
                $row['diskspace'] = round($row['diskspace'] / 1024, $dec_places);
示例#10
0
 while ($customers_row = $db->fetch_array($customers_result)) {
     $customers[$customers_row['customerid']] = $customers_row['loginname'] . ' (' . $customers_row['name'] . ', ' . $customers_row['firstname'] . ')';
     $customers_option .= makeoption($customers_row['loginname'] . ' (' . $customers_row['name'] . ', ' . $customers_row['firstname'] . ')', $customers_row['customerid']);
 }
 $taxclasses = array('0' => $lng['panel']['default']);
 $taxclasses_option = makeoption($lng['panel']['default'], 0, 0, true);
 $taxclasses_result = $db->query('SELECT `classid`, `classname` FROM `' . TABLE_BILLING_TAXCLASSES . '` ');
 while ($taxclasses_row = $db->fetch_array($taxclasses_result)) {
     $taxclasses[$taxclasses_row['classid']] = $taxclasses_row['classname'];
     $taxclasses_option .= makeoption($taxclasses_row['classname'], $taxclasses_row['classid']);
 }
 if ($action == '') {
     $fields = array('c.loginname' => $lng['login']['username'], 'c.name' => $lng['customer']['name'], 'c.firstname' => $lng['customer']['firstname'], 'c.company' => $lng['customer']['company'], 'o.caption_setup' => $lng['billing']['caption_setup'], 'o.caption_interval' => $lng['billing']['caption_interval'], 'o.quantity' => $lng['service']['quantity'], 'o.interval_fee' => $lng['service']['interval_fee'], 'o.interval_length' => $lng['service']['interval_length'], 'o.setup_fee' => $lng['service']['setup_fee'], 'o.service_active' => $lng['service']['active'], 'o.servicestart_date' => $lng['service']['start_date'], 'o.lastinvoiced_date' => $lng['service']['lastinvoiced_date']);
     $paging = new paging($userinfo, $db, TABLE_BILLING_SERVICE_OTHER, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
     $customers = '';
     $result = $db->query("SELECT `o`.*, `c`.`loginname`, `c`.`name`, `c`.`firstname`, `c`.`company` " . "FROM `" . TABLE_BILLING_SERVICE_OTHER . "` `o` LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` ON( `o`.`customerid` = `c`.`customerid` ) " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
     $paging->setEntries($db->num_rows($result));
     $sortcode = $paging->getHtmlSortCode($lng, true);
     $arrowcode = $paging->getHtmlArrowCode($filename . '?s=' . $s);
     $searchcode = $paging->getHtmlSearchCode($lng);
     $pagingcode = $paging->getHtmlPagingCode($filename . '?s=' . $s);
     $i = 0;
     $otherservices = '';
     while ($row = $db->fetch_array($result)) {
         if ($paging->checkDisplay($i)) {
             $enable_billing_data_edit = $row['servicestart_date'] == '0000-00-00' || $row['interval_payment'] == CONST_BILLING_INTERVALPAYMENT_PREPAID && calculateDayDifference(time(), $row['lastinvoiced_date']) >= 0;
             $row = htmlentities_array($row);
             eval("\$otherservices.=\"" . getTemplate("billing/other_row") . "\";");
         }
         $i++;
     }
示例#11
0
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($userinfo['customers_see_all'] == '1') {
    if (isset($_GET['mode']) && intval($_GET['mode']) === 1) {
        $mode = 1;
    } elseif (isset($_POST['mode']) && intval($_POST['mode']) === 1) {
        $mode = 1;
    } else {
        $mode = 0;
    }
    if ($action == '') {
        $fields = array('i.invoice_number' => $lng['billing']['number'], 'i.invoice_date' => $lng['billing']['invoice_date'], 'i.state' => $lng['invoice']['state'], 'i.state_change' => $lng['invoice']['state_change'], 'i.total_fee' => $lng['invoice']['total_fee'], 'i.total_fee_taxed' => $lng['invoice']['total_fee_taxed'], 'c.loginname' => $lng['login']['username'], 'c.name' => $lng['customer']['name'], 'c.firstname' => $lng['customer']['firstname'], 'c.company' => $lng['customer']['company']);
        $paging = new paging($userinfo, $db, TABLE_BILLING_INVOICES, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $customers = '';
        $result = $db->query("SELECT `i`.*, `c`.* " . "FROM `" . getModeDetails($mode, 'TABLE_BILLING_INVOICES', 'table') . "` `i` LEFT JOIN `" . getModeDetails($mode, 'TABLE_PANEL_USERS', 'table') . "` `c` USING (`" . getModeDetails($mode, 'TABLE_PANEL_USERS', 'key') . "`) " . $paging->getSqlWhere() . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng, true);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?mode=' . $mode . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?mode=' . $mode . '&s=' . $s);
        $i = 0;
        $count = 0;
        while ($row = $db->fetch_array($result)) {
            if ($paging->checkDisplay($i)) {
                $row['invoice_date'] = makeNicePresentableDate($row['invoice_date'], $lng['panel']['dateformat_function']);
                $row['state_change'] = date($lng['panel']['dateformat_function'], $row['state_change']);
                $row = htmlentities_array($row);
                eval("\$customers.=\"" . getTemplate("billing/invoices_row") . "\";");
                $count++;
            }
示例#12
0
     $taxclasses_option = makeoption($lng['panel']['default'], 0, 0, true);
     $taxclasses_result = $db->query('SELECT `classid`, `classname` FROM `' . TABLE_BILLING_TAXCLASSES . '` ');
     while ($taxclasses_row = $db->fetch_array($taxclasses_result)) {
         $taxclasses[$taxclasses_row['classid']] = $taxclasses_row['classname'];
         $taxclasses_option .= makeoption($taxclasses_row['classname'], $taxclasses_row['classid']);
     }
 }
 // Let's see how many customers we have
 $countcustomers = $db->query_first("SELECT COUNT(`customerid`) as `countcustomers` FROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = '" . (int) $userinfo['adminid'] . "' ") . "");
 $countcustomers = (int) $countcustomers['countcustomers'];
 if ($action == '') {
     $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_domains");
     $fields = array('d.domain' => $lng['domains']['domainname'], 'ip.ip' => $lng['admin']['ipsandports']['ip'], 'ip.port' => $lng['admin']['ipsandports']['port'], 'c.name' => $lng['customer']['name'], 'c.firstname' => $lng['customer']['firstname'], 'c.company' => $lng['customer']['company'], 'c.loginname' => $lng['login']['username'], 'd.aliasdomain' => $lng['domains']['aliasdomain']);
     $paging = new paging($userinfo, $db, TABLE_PANEL_DOMAINS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
     $domains = '';
     $result = $db->query("SELECT `d`.*, `c`.`loginname`, `c`.`name`, `c`.`firstname`, `c`.`company`, `c`.`standardsubdomain`, `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain`, `ip`.`id` AS `ipid`, `ip`.`ip`, `ip`.`port` " . "FROM `" . TABLE_PANEL_DOMAINS . "` `d` " . "LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`) " . "LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `ad` ON `d`.`aliasdomain`=`ad`.`id` " . "LEFT JOIN `" . TABLE_PANEL_IPSANDPORTS . "` `ip` ON (`d`.`ipandport` = `ip`.`id`) " . "WHERE `d`.`parentdomainid`='0' " . ($userinfo['customers_see_all'] ? '' : " AND `d`.`adminid` = '" . (int) $userinfo['adminid'] . "' ") . " " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
     $paging->setEntries($db->num_rows($result));
     $sortcode = $paging->getHtmlSortCode($lng);
     $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
     $searchcode = $paging->getHtmlSearchCode($lng);
     $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
     $domain_array = array();
     while ($row = $db->fetch_array($result)) {
         $row['domain'] = $idna_convert->decode($row['domain']);
         $row['aliasdomain'] = $idna_convert->decode($row['aliasdomain']);
         if (filter_var($row['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
             $row['ipandport'] = '[' . $row['ip'] . ']:' . $row['port'];
         } else {
             $row['ipandport'] = $row['ip'] . ':' . $row['port'];
         }
         if (!isset($domain_array[$row['domain']])) {
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($userinfo['customers_see_all'] == '1') {
    $taxclasses = array();
    $taxclasses_option = '';
    $taxclasses_result = $db->query('SELECT `classid`, `classname` FROM `' . TABLE_BILLING_TAXCLASSES . '` ');
    while ($taxclasses_row = $db->fetch_array($taxclasses_result)) {
        $taxclasses[$taxclasses_row['classid']] = $taxclasses_row['classname'];
        $taxclasses_option .= makeoption($taxclasses_row['classname'], $taxclasses_row['classid']);
    }
    if ($action == '') {
        $fields = array('tld' => $lng['domains']['topleveldomain'], 'valid_from' => $lng['service']['valid_from'], 'valid_to' => $lng['service']['valid_to'], 'interval_fee' => $lng['service']['interval_fee'], 'interval_length' => $lng['service']['interval_length'], 'setup_fee' => $lng['service']['setup_fee']);
        $paging = new paging($userinfo, $db, TABLE_BILLING_SERVICE_DOMAINS_TEMPLATES, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $customers = '';
        $result = $db->query("SELECT *  " . "FROM `" . TABLE_BILLING_SERVICE_DOMAINS_TEMPLATES . "` " . $paging->getSqlWhere() . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?s=' . $s);
        $i = 0;
        $domainstemplates = '';
        while ($row = $db->fetch_array($result)) {
            if ($paging->checkDisplay($i)) {
                $row = htmlentities_array($row);
                eval("\$domainstemplates.=\"" . getTemplate("billing/domains_templates_row") . "\";");
            }
            $i++;
        }
        eval("echo \"" . getTemplate("billing/domains_templates") . "\";");
示例#14
0
 *
 * @copyright  (c) the authors
 * @author     Florian Lippert <*****@*****.**> (2003-2009)
 * @author     Froxlor team <*****@*****.**> (2010-)
 * @license    GPLv2 http://files.froxlor.org/misc/COPYING.txt
 * @package    Panel
 *
 */
define('AREA', 'customer');
require './lib/init.php';
if ($page == 'log') {
    if ($action == '') {
        $fields = array('date' => $lng['logger']['date'], 'type' => $lng['logger']['type'], 'user' => $lng['logger']['user'], 'text' => $lng['logger']['action']);
        $paging = new paging($userinfo, TABLE_PANEL_LOG, $fields, null, null, 0, 'desc');
        $result_stmt = Database::prepare('
			SELECT * FROM `' . TABLE_PANEL_LOG . '` WHERE `user` = :loginname ' . $paging->getSqlWhere(true) . ' ' . $paging->getSqlOrderBy() . ' ' . $paging->getSqlLimit());
        Database::pexecute($result_stmt, array("loginname" => $userinfo['loginname']));
        $logs_count = Database::num_rows();
        $paging->setEntries($logs_count);
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $clog = array();
        while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
            if (!isset($clog[$row['action']]) || !is_array($clog[$row['action']])) {
                $clog[$row['action']] = array();
            }
            $clog[$row['action']][$row['logid']] = $row;
        }
        if ($paging->sortfield == 'date' && $paging->sortorder == 'desc') {
示例#15
0
        standard_error(array('ticketnotaccessible'));
    }
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'overview') {
    $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_tickets");
    eval("echo \"" . getTemplate("tickets/ticket") . "\";");
} elseif ($page == 'tickets') {
    if ($action == '') {
        $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_tickets::tickets");
        $fields = array('status' => $lng['ticket']['status'], 'priority' => $lng['ticket']['priority'], 'lastchange' => $lng['ticket']['lastchange'], 'ticket_answers' => $lng['ticket']['ticket_answers'], 'subject' => $lng['ticket']['subject'], 'lastreplier' => $lng['ticket']['lastreplier']);
        $paging = new paging($userinfo, $db, TABLE_PANEL_TICKETS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $paging->sortfield = 'lastchange';
        $paging->sortorder = 'desc';
        $result = $db->query('SELECT `main`.`id`, (SELECT COUNT(`sub`.`id`) FROM `' . TABLE_PANEL_TICKETS . '` `sub` WHERE `sub`.`answerto` = `main`.`id`) as `ticket_answers`, `main`.`lastchange`, `main`.`subject`, `main`.`status`, `main`.`lastreplier`, `main`.`priority` FROM `' . TABLE_PANEL_TICKETS . '` as `main` WHERE `main`.`answerto` = "0" AND `archived` = "0" AND `customerid`="' . (int) $userinfo['customerid'] . '" ' . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $i = 0;
        $count = 0;
        $tickets = '';
        $tickets_count = 0;
        while ($row = $db->fetch_array($result)) {
            if ($paging->checkDisplay($i)) {
                $tickets_count++;
                $row = htmlentities_array($row);
                $row['lastchange'] = date("d.m.y H:i", $row['lastchange']);
                if ($row['status'] >= 0 && $row['status'] <= 2) {
示例#16
0
/**
 * Include our init.php, which manages Sessions, Language etc.
 */
require "./lib/init.php";
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'ipsandports' || $page == 'overview') {
    if ($action == '') {
        $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_ipsandports");
        $fields = array('ip' => $lng['admin']['ipsandports']['ip'], 'port' => $lng['admin']['ipsandports']['port']);
        $paging = new paging($userinfo, $db, TABLE_PANEL_IPSANDPORTS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $ipsandports = '';
        $result = $db->query("SELECT `id`, `ip`, `port`, `listen_statement`, `namevirtualhost_statement`, `vhostcontainer`, `vhostcontainer_servername_statement`, `specialsettings`, `ssl` FROM `" . TABLE_PANEL_IPSANDPORTS . "` " . $paging->getSqlWhere(false) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $i = 0;
        $count = 0;
        while ($row = $db->fetch_array($result)) {
            if ($paging->checkDisplay($i)) {
                $row = htmlentities_array($row);
                if (filter_var($row['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
                    $row['ip'] = '[' . $row['ip'] . ']';
                }
                eval("\$ipsandports.=\"" . getTemplate("ipsandports/ipsandports_ipandport") . "\";");
                $count++;
示例#17
0
 $subject = validate($_POST['subject'], 'subject');
 $priority[0] = isset($_POST['priority1']) ? $_POST['priority1'] : '';
 $priority[1] = isset($_POST['priority2']) ? $_POST['priority2'] : '';
 $priority[2] = isset($_POST['priority3']) ? $_POST['priority3'] : '';
 $fromdate = validate($_POST['fromdate'], 'fromdate');
 $todate = validate($_POST['todate'], 'todate');
 $message = validate($_POST['message'], 'message');
 $customer = validate($_POST['customer'], 'customer');
 $cat = $db->query_first('SELECT COUNT(`id`) as `ccount` FROM `' . TABLE_PANEL_TICKET_CATS . '`');
 for ($x = 0; $x < $cat['ccount']; $x++) {
     $categories[$x] = isset($_POST['category' . $x]) ? $_POST['category' . $x] : '';
 }
 $query = ticket::getArchiveSearchStatement($db, $subject, $priority, $fromdate, $todate, $message, $customer, $userinfo['adminid'], $categories);
 $fields = array('lastchange' => $lng['ticket']['lastchange'], 'ticket_answers' => $lng['ticket']['ticket_answers'], 'subject' => $lng['ticket']['subject'], 'lastreplier' => $lng['ticket']['lastreplier'], 'priority' => $lng['ticket']['priority']);
 $paging = new paging($userinfo, $db, TABLE_PANEL_TICKETS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
 $result = $db->query($query . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
 $sortcode = $paging->getHtmlSortCode($lng);
 $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
 $searchcode = $paging->getHtmlSearchCode($lng);
 $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
 $ctickets = array();
 while ($row = $db->fetch_array($result)) {
     if (!isset($ctickets[$row['customerid']]) || !is_array($ctickets[$row['customerid']])) {
         $ctickets[$row['customerid']] = array();
     }
     $ctickets[$row['customerid']][$row['id']] = $row;
 }
 if ($paging->sortfield == 'customerid' && $paging->sortorder == 'desc') {
     krsort($ctickets);
 } else {
     ksort($ctickets);
示例#18
0
                }
                $result = htmlentities_array($result);
                $htpasswd_edit_data = (include_once dirname(__FILE__) . '/lib/formfields/customer/extras/formfield.htpasswd_edit.php');
                $htpasswd_edit_form = htmlform::genHTMLForm($htpasswd_edit_data);
                $title = $htpasswd_edit_data['htpasswd_edit']['title'];
                $image = $htpasswd_edit_data['htpasswd_edit']['image'];
                eval("echo \"" . getTemplate("extras/htpasswds_edit") . "\";");
            }
        }
    }
} elseif ($page == 'htaccess') {
    if ($action == '') {
        $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_extras::htaccess");
        $fields = array('path' => $lng['panel']['path'], 'options_indexes' => $lng['extras']['view_directory'], 'error404path' => $lng['extras']['error404path'], 'error403path' => $lng['extras']['error403path'], 'error500path' => $lng['extras']['error500path'], 'options_cgi' => $lng['extras']['execute_perl']);
        $paging = new paging($userinfo, TABLE_PANEL_HTACCESS, $fields);
        $result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_HTACCESS . "`\n\t\t\tWHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        Database::pexecute($result_stmt, array("customerid" => $userinfo['customerid']));
        $paging->setEntries(Database::num_rows());
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $i = 0;
        $count = 0;
        $htaccess = '';
        $cperlenabled = customerHasPerlEnabled($userinfo['customerid']);
        while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
            if ($paging->checkDisplay($i)) {
                if (strpos($row['path'], $userinfo['documentroot']) === 0) {
                    $row['path'] = substr($row['path'], strlen($userinfo['documentroot']));
                    // don't show nothing when it's the docroot, show slash
示例#19
0
define('AREA', 'admin');
require './lib/init.php';
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'customers' && $userinfo['customers'] != '0') {
    if ($action == '') {
        // clear request data
        unset($_SESSION['requestData']);
        $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_customers");
        $fields = array('c.loginname' => $lng['login']['username'], 'a.loginname' => $lng['admin']['admin'], 'c.name' => $lng['customer']['name'], 'c.email' => $lng['customer']['email'], 'c.firstname' => $lng['customer']['firstname'], 'c.company' => $lng['customer']['company'], 'c.diskspace' => $lng['customer']['diskspace'], 'c.diskspace_used' => $lng['customer']['diskspace'] . ' (' . $lng['panel']['used'] . ')', 'c.traffic' => $lng['customer']['traffic'], 'c.traffic_used' => $lng['customer']['traffic'] . ' (' . $lng['panel']['used'] . ')');
        $paging = new paging($userinfo, TABLE_PANEL_CUSTOMERS, $fields);
        $customers = '';
        $result_stmt = Database::prepare("\n\t\t\tSELECT `c`.*, `a`.`loginname` AS `adminname`\n\t\t\tFROM `" . TABLE_PANEL_CUSTOMERS . "` `c`, `" . TABLE_PANEL_ADMINS . "` `a`\n\t\t\tWHERE " . ($userinfo['customers_see_all'] ? '' : " `c`.`adminid` = :adminid AND ") . "\n\t\t\t`c`.`adminid` = `a`.`adminid` " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid']));
        $num_rows = Database::num_rows();
        $paging->setEntries($num_rows);
        $sortcode = $paging->getHtmlSortCode($lng, true);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $i = 0;
        $count = 0;
        while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
            if ($paging->checkDisplay($i)) {
                $domains_stmt = Database::prepare("\n\t\t\t\t\tSELECT COUNT(`id`) AS `domains`\n\t\t\t\t\tFROM `" . TABLE_PANEL_DOMAINS . "`\n\t\t\t\t\tWHERE `customerid` = :cid\n\t\t\t\t\tAND `parentdomainid` = '0'\n\t\t\t\t\tAND `id`<> :stdd");
                Database::pexecute($domains_stmt, array('cid' => $row['customerid'], 'stdd' => $row['standardsubdomain']));
                $domains = $domains_stmt->fetch(PDO::FETCH_ASSOC);
                $row['domains'] = intval($domains['domains']);
示例#20
0
                }
            } else {
                if (strpos($result['path'], $userinfo['documentroot']) === 0) {
                    $result['path'] = substr($result['path'], strlen($userinfo['documentroot']));
                }
                $result = htmlentities_array($result);
                eval("echo \"" . getTemplate("extras/htpasswds_edit") . "\";");
            }
        }
    }
} elseif ($page == 'htaccess') {
    if ($action == '') {
        $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_extras::htaccess");
        $fields = array('path' => $lng['panel']['path'], 'options_indexes' => $lng['extras']['view_directory'], 'error404path' => $lng['extras']['error404path'], 'error403path' => $lng['extras']['error403path'], 'error500path' => $lng['extras']['error500path']);
        $paging = new paging($userinfo, $db, TABLE_PANEL_HTACCESS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $result = $db->query("SELECT `id`, `path`, `options_indexes`, `error404path`, `error403path`, `error500path` FROM `" . TABLE_PANEL_HTACCESS . "` WHERE `customerid`='" . (int) $userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $i = 0;
        $count = 0;
        $htaccess = '';
        while ($row = $db->fetch_array($result)) {
            if ($paging->checkDisplay($i)) {
                if (strpos($row['path'], $userinfo['documentroot']) === 0) {
                    $row['path'] = substr($row['path'], strlen($userinfo['documentroot']));
                }
                $row['options_indexes'] = str_replace('1', $lng['panel']['yes'], $row['options_indexes']);
                $row['options_indexes'] = str_replace('0', $lng['panel']['no'], $row['options_indexes']);
示例#21
0
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'overview') {
    $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_email");
    eval("echo \"" . getTemplate("email/email") . "\";");
} elseif ($page == 'emails') {
    if ($action == '') {
        $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_email::emails");
        $fields = array('d.domain' => $lng['domains']['domainname'], 'm.email_full' => $lng['emails']['emailaddress'], 'm.destination' => $lng['emails']['forwarders']);
        $paging = new paging($userinfo, TABLE_MAIL_VIRTUAL, $fields);
        $result_stmt = Database::prepare('SELECT `m`.`id`, `m`.`domainid`, `m`.`email`, `m`.`email_full`, `m`.`iscatchall`, `u`.`quota`, `m`.`destination`, `m`.`popaccountid`, `d`.`domain`, `u`.`mboxsize` FROM `' . TABLE_MAIL_VIRTUAL . '` `m`
			LEFT JOIN `' . TABLE_PANEL_DOMAINS . '` `d` ON (`m`.`domainid` = `d`.`id`)
			LEFT JOIN `' . TABLE_MAIL_USERS . '` `u` ON (`m`.`popaccountid` = `u`.`id`)
			WHERE `m`.`customerid`= :customerid ' . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        Database::pexecute($result_stmt, array("customerid" => $userinfo['customerid']));
        $emailscount = Database::num_rows();
        $paging->setEntries($emailscount);
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $emails = array();
        while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
            if (!isset($emails[$row['domain']]) || !is_array($emails[$row['domain']])) {
                $emails[$row['domain']] = array();
            }
            $emails[$row['domain']][$row['email_full']] = $row;
        }
        if ($paging->sortfield == 'd.domain' && $paging->sortorder == 'desc') {
示例#22
0
// select all my (accessable) certificates
$certs_stmt_query = "SELECT s.*, d.domain, d.letsencrypt, c.customerid, c.loginname\n\tFROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` s\n\tLEFT JOIN `" . TABLE_PANEL_DOMAINS . "` d ON `d`.`id` = `s`.`domainid`\n\tLEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` c ON `c`.`customerid` = `d`.`customerid`\n\tWHERE ";
$qry_params = array();
if (AREA == 'admin' && $userinfo['customers_see_all'] == '0') {
    // admin with only customer-specific permissions
    $certs_stmt_query .= "d.adminid = :adminid ";
    $qry_params['adminid'] = $userinfo['adminid'];
} elseif (AREA == 'customer') {
    // customer-area
    $certs_stmt_query .= "d.customerid = :cid ";
    $qry_params['cid'] = $userinfo['customerid'];
} else {
    $certs_stmt_query .= "1 ";
}
// sorting by domain-name
$certs_stmt_query .= $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit();
$certs_stmt = Database::prepare($certs_stmt_query);
Database::pexecute($certs_stmt, $qry_params);
$all_certs = $certs_stmt->fetchAll(PDO::FETCH_ASSOC);
$certificates = "";
if (count($all_certs) == 0) {
    $message = $lng['domains']['no_ssl_certificates'];
    $sortcode = "";
    $arrowcode = array('d.domain' => '');
    $searchcode = "";
    $pagingcode = "";
    eval("\$certificates.=\"" . getTemplate("ssl_certificates/certs_error", true) . "\";");
} else {
    $paging->setEntries(count($all_certs));
    $sortcode = $paging->getHtmlSortCode($lng);
    $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
示例#23
0
    redirectTo('customer_index.php');
}
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'overview') {
    $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_domains");
    eval("echo \"" . getTemplate("domains/domains") . "\";");
} elseif ($page == 'domains') {
    if ($action == '') {
        $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_domains::domains");
        $fields = array('d.domain' => $lng['domains']['domainname']);
        $paging = new paging($userinfo, TABLE_PANEL_DOMAINS, $fields);
        $domains_stmt = Database::prepare("SELECT `d`.`id`, `d`.`customerid`, `d`.`domain`, `d`.`documentroot`, `d`.`isbinddomain`, `d`.`isemaildomain`, `d`.`caneditdomain`, `d`.`iswildcarddomain`, `d`.`parentdomainid`, `d`.`letsencrypt`, `d`.`termination_date`, `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain`, `da`.`id` AS `domainaliasid`, `da`.`domain` AS `domainalias` FROM `" . TABLE_PANEL_DOMAINS . "` `d`\n\t\t\tLEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `ad` ON `d`.`aliasdomain`=`ad`.`id`\n\t\t\tLEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `da` ON `da`.`aliasdomain`=`d`.`id`\n\t\t\tWHERE `d`.`customerid`= :customerid\n\t\t\tAND `d`.`email_only`='0'\n\t\t\tAND `d`.`id` <> :standardsubdomain " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        Database::pexecute($domains_stmt, array("customerid" => $userinfo['customerid'], "standardsubdomain" => $userinfo['standardsubdomain']));
        $paging->setEntries(Database::num_rows());
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $domains = '';
        $parentdomains_count = 0;
        $domains_count = 0;
        $domain_array = array();
        while ($row = $domains_stmt->fetch(PDO::FETCH_ASSOC)) {
            $row['domain'] = $idna_convert->decode($row['domain']);
            $row['aliasdomain'] = $idna_convert->decode($row['aliasdomain']);
            $row['domainalias'] = $idna_convert->decode($row['domainalias']);
            if ($row['parentdomainid'] == '0' && $row['caneditdomain'] == '1') {
示例#24
0
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($userinfo['customers_see_all'] == '1') {
    if (isset($_GET['mode']) && intval($_GET['mode']) === 1) {
        $mode = 1;
    } elseif (isset($_POST['mode']) && intval($_POST['mode']) === 1) {
        $mode = 1;
    } else {
        $mode = 0;
    }
    if ($action == '') {
        $fields = array('i.invoice_number' => $lng['billing']['number'], 'i.invoice_date' => $lng['billing']['invoice_date'], 'i.state' => $lng['invoice']['state'], 'i.state_change' => $lng['invoice']['state_change'], 'i.total_fee' => $lng['invoice']['total_fee'], 'i.total_fee_taxed' => $lng['invoice']['total_fee_taxed'], 'c.loginname' => $lng['login']['username'], 'c.name' => $lng['customer']['name'], 'c.firstname' => $lng['customer']['firstname'], 'c.company' => $lng['customer']['company']);
        $paging = new paging($userinfo, $db, TABLE_BILLING_INVOICES, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $customers = '';
        $result = $db->query('SELECT `i`.*, `c`.* ' . 'FROM `' . getModeDetails($mode, 'TABLE_BILLING_INVOICES', 'table') . '` `i` LEFT JOIN `' . getModeDetails($mode, 'TABLE_PANEL_USERS', 'table') . '` `c` USING (`' . getModeDetails($mode, 'TABLE_PANEL_USERS', 'key') . '`) ' . $paging->getSqlWhere() . ' ' . $paging->getSqlOrderBy() . ' ' . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng, true);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?mode=' . $mode . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?mode=' . $mode . '&s=' . $s);
        $i = 0;
        $count = 0;
        while ($row = $db->fetch_array($result)) {
            if ($paging->checkDisplay($i)) {
                $row['invoice_date'] = makeNicePresentableDate($row['invoice_date'], $lng['panel']['dateformat_function']);
                $row['state_change'] = date($lng['panel']['dateformat_function'], $row['state_change']);
                $row = htmlentities_array($row);
                eval('$customers.="' . getTemplate('billing/invoices_row') . '";');
                ++$count;
            }
示例#25
0
require './lib/init.php';
$id = 0;
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'overview') {
    $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_ftp");
    eval("echo \"" . getTemplate('ftp/ftp') . "\";");
} elseif ($page == 'accounts') {
    if ($action == '') {
        $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_ftp::accounts");
        $fields = array('username' => $lng['login']['username'], 'homedir' => $lng['panel']['path'], 'description' => $lng['panel']['ftpdesc']);
        $paging = new paging($userinfo, TABLE_FTP_USERS, $fields);
        $result_stmt = Database::prepare("SELECT `id`, `username`, `description`, `homedir` FROM `" . TABLE_FTP_USERS . "`\n\t\t\tWHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        Database::pexecute($result_stmt, array("customerid" => $userinfo['customerid']));
        $ftps_count = Database::num_rows();
        $paging->setEntries($ftps_count);
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $i = 0;
        $count = 0;
        $accounts = '';
        while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
            if ($paging->checkDisplay($i)) {
                if (strpos($row['homedir'], $userinfo['documentroot']) === 0) {
                    $row['documentroot'] = str_replace($userinfo['documentroot'], "/", $row['homedir']);
                } else {
示例#26
0
 */
require "./lib/init.php";
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'overview') {
    $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_domains");
    eval("echo \"" . getTemplate("domains/domains") . "\";");
} elseif ($page == 'domains') {
    if ($action == '') {
        $log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_domains::domains");
        $fields = array('d.domain' => $lng['domains']['domainname'], 'd.documentroot' => $lng['panel']['path'], 'd.aliasdomain' => $lng['domains']['aliasdomain']);
        $paging = new paging($userinfo, $db, TABLE_PANEL_DOMAINS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $result = $db->query("SELECT `d`.`id`, `d`.`customerid`, `d`.`domain`, `d`.`documentroot`, `d`.`isemaildomain`, `d`.`caneditdomain`, `d`.`iswildcarddomain`, `d`.`parentdomainid`, `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain`, `da`.`id` AS `domainaliasid`, `da`.`domain` AS `domainalias` FROM `" . TABLE_PANEL_DOMAINS . "` `d` LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `ad` ON `d`.`aliasdomain`=`ad`.`id` LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `da` ON `da`.`aliasdomain`=`d`.`id` WHERE `d`.`customerid`='" . (int) $userinfo['customerid'] . "' AND `d`.`email_only`='0' AND `d`.`id` <> " . (int) $userinfo['standardsubdomain'] . " " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $domains = '';
        $parentdomains_count = 0;
        $domains_count = 0;
        $domain_array = array();
        while ($row = $db->fetch_array($result)) {
            $row['domain'] = $idna_convert->decode($row['domain']);
            $row['aliasdomain'] = $idna_convert->decode($row['aliasdomain']);
            $row['domainalias'] = $idna_convert->decode($row['domainalias']);
            if ($row['parentdomainid'] == '0' && $row['caneditdomain'] == '1') {
                $parentdomains_count++;
示例#27
0
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($userinfo['customers_see_all'] == '1') {
    $taxclasses = array();
    $taxclasses_option = '';
    $taxclasses_result = $db->query('SELECT `classid`, `classname` FROM `' . TABLE_BILLING_TAXCLASSES . '` ');
    while ($taxclasses_row = $db->fetch_array($taxclasses_result)) {
        $taxclasses[$taxclasses_row['classid']] = $taxclasses_row['classname'];
        $taxclasses_option .= makeoption($taxclasses_row['classname'], $taxclasses_row['classid']);
    }
    if ($action == '') {
        $fields = array('tld' => $lng['domains']['topleveldomain'], 'valid_from' => $lng['service']['valid_from'], 'valid_to' => $lng['service']['valid_to'], 'interval_fee' => $lng['service']['interval_fee'], 'interval_length' => $lng['service']['interval_length'], 'setup_fee' => $lng['service']['setup_fee']);
        $paging = new paging($userinfo, $db, TABLE_BILLING_SERVICE_DOMAINS_TEMPLATES, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
        $customers = '';
        $result = $db->query('SELECT *  ' . 'FROM `' . TABLE_BILLING_SERVICE_DOMAINS_TEMPLATES . '` ' . $paging->getSqlWhere() . ' ' . $paging->getSqlOrderBy() . ' ' . $paging->getSqlLimit());
        $paging->setEntries($db->num_rows($result));
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?s=' . $s);
        $i = 0;
        $domainstemplates = '';
        while ($row = $db->fetch_array($result)) {
            if ($paging->checkDisplay($i)) {
                $row = htmlentities_array($row);
                eval('$domainstemplates.="' . getTemplate('billing/domains_templates_row') . '";');
            }
            ++$i;
        }
        eval('echo "' . getTemplate('billing/domains_templates') . '";');
示例#28
0
 *
 */
define('AREA', 'admin');
require './lib/init.php';
if (isset($_POST['id'])) {
    $id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
    $id = intval($_GET['id']);
}
if ($page == 'ipsandports' || $page == 'overview') {
    if ($action == '') {
        $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_ipsandports");
        $fields = array('ip' => $lng['admin']['ipsandports']['ip'], 'port' => $lng['admin']['ipsandports']['port']);
        $paging = new paging($userinfo, TABLE_PANEL_IPSANDPORTS, $fields);
        $ipsandports = '';
        $result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_IPSANDPORTS . "` " . $paging->getSqlWhere(false) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        Database::pexecute($result_stmt);
        $paging->setEntries(Database::num_rows());
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $i = 0;
        $count = 0;
        while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
            if ($paging->checkDisplay($i)) {
                $row = htmlentities_array($row);
                if (filter_var($row['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
                    $row['ip'] = '[' . $row['ip'] . ']';
                }
                eval("\$ipsandports.=\"" . getTemplate("ipsandports/ipsandports_ipandport") . "\";");
示例#29
0
}
if ($page == 'domains' || $page == 'overview') {
    // Let's see how many customers we have
    $stmt = Database::prepare("\n\t\tSELECT COUNT(`customerid`) as `countcustomers` FROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = :adminid"));
    $params = array();
    if ($userinfo['customers_see_all'] == '0') {
        $params['adminid'] = $userinfo['adminid'];
    }
    $countcustomers = Database::pexecute_first($stmt, $params);
    $countcustomers = (int) $countcustomers['countcustomers'];
    if ($action == '') {
        $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_domains");
        $fields = array('d.domain' => $lng['domains']['domainname'], 'c.name' => $lng['customer']['name'], 'c.firstname' => $lng['customer']['firstname'], 'c.company' => $lng['customer']['company'], 'c.loginname' => $lng['login']['username'], 'd.aliasdomain' => $lng['domains']['aliasdomain']);
        $paging = new paging($userinfo, TABLE_PANEL_DOMAINS, $fields);
        $domains = '';
        $result_stmt = Database::prepare("\n\t\t\tSELECT `d`.*, `c`.`loginname`, `c`.`name`, `c`.`firstname`, `c`.`company`, `c`.`standardsubdomain`, `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain`\n\t\t\tFROM `" . TABLE_PANEL_DOMAINS . "` `d`\n\t\t\tLEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`)\n\t\t\tLEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `ad` ON `d`.`aliasdomain`=`ad`.`id`\n\t\t\tWHERE `d`.`parentdomainid`='0' " . ($userinfo['customers_see_all'] ? '' : " AND `d`.`adminid` = :adminid ") . " " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
        $params = array();
        if ($userinfo['customers_see_all'] == '0') {
            $params['adminid'] = $userinfo['adminid'];
        }
        Database::pexecute($result_stmt, $params);
        $numrows_domains = Database::num_rows();
        $paging->setEntries($numrows_domains);
        $sortcode = $paging->getHtmlSortCode($lng);
        $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
        $searchcode = $paging->getHtmlSearchCode($lng);
        $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
        $domain_array = array();
        while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
            $row['domain'] = $idna_convert->decode($row['domain']);
            $row['aliasdomain'] = $idna_convert->decode($row['aliasdomain']);
示例#30
0
     $service_categories_option = '';
     $service_categories_result = $db->query('SELECT `id`, `category_name`, `category_caption` FROM `' . TABLE_BILLING_SERVICE_CATEGORIES_ADMINS . '` WHERE `category_mode` = \'1\' ORDER BY `category_order` ASC ');
     while ($service_categories_row = $db->fetch_array($service_categories_result)) {
         if (isset($lng['billing']['categories'][$service_categories_row['category_caption']]) && $lng['billing']['categories'][$service_categories_row['category_caption']] != '') {
             $service_categories_row['category_caption'] = $lng['billing']['categories'][$service_categories_row['category_caption']];
         }
         $service_categories[$service_categories_row['id']] = $service_categories_row['category_caption'];
         $service_categories_option .= makeoption($service_categories_row['category_caption'], $service_categories_row['id']);
     }
 }
 if ($action == '') {
     $log->logAction(ADM_ACTION, LOG_NOTICE, 'viewed admin_admins');
     $fields = array('loginname' => $lng['login']['username'], 'name' => $lng['customer']['name'], 'diskspace' => $lng['customer']['diskspace'], 'diskspace_used' => $lng['customer']['diskspace'] . ' (' . $lng['panel']['used'] . ')', 'traffic' => $lng['customer']['traffic'], 'traffic_used' => $lng['customer']['traffic'] . ' (' . $lng['panel']['used'] . ')', 'mysqls' => $lng['customer']['mysqls'], 'mysqls_used' => $lng['customer']['mysqls'] . ' (' . $lng['panel']['used'] . ')', 'ftps' => $lng['customer']['ftps'], 'ftps_used' => $lng['customer']['ftps'] . ' (' . $lng['panel']['used'] . ')', 'tickets' => $lng['customer']['tickets'], 'tickets_used' => $lng['customer']['tickets'] . ' (' . $lng['panel']['used'] . ')', 'subdomains' => $lng['customer']['subdomains'], 'subdomains_used' => $lng['customer']['subdomains'] . ' (' . $lng['panel']['used'] . ')', 'emails' => $lng['customer']['emails'], 'emails_used' => $lng['customer']['emails'] . ' (' . $lng['panel']['used'] . ')', 'email_accounts' => $lng['customer']['accounts'], 'email_accounts_used' => $lng['customer']['accounts'] . ' (' . $lng['panel']['used'] . ')', 'email_forwarders' => $lng['customer']['forwarders'], 'email_forwarders_used' => $lng['customer']['forwarders'] . ' (' . $lng['panel']['used'] . ')', 'email_quota' => $lng['customer']['email_quota'], 'email_quota_used' => $lng['customer']['email_quota'] . ' (' . $lng['panel']['used'] . ')', 'deactivated' => $lng['admin']['deactivated']);
     $paging = new paging($userinfo, $db, TABLE_PANEL_ADMINS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
     $admins = '';
     $result = $db->query('SELECT * FROM `' . TABLE_PANEL_ADMINS . '` ' . $paging->getSqlWhere(false) . ' ' . $paging->getSqlOrderBy() . ' ' . $paging->getSqlLimit());
     $paging->setEntries($db->num_rows($result));
     $sortcode = $paging->getHtmlSortCode($lng, true);
     $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
     $searchcode = $paging->getHtmlSearchCode($lng);
     $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
     $i = 0;
     $count = 0;
     while ($row = $db->fetch_array($result)) {
         if ($paging->checkDisplay($i)) {
             $highlight_row = $row['service_active'] != '1' && $settings['billing']['activate_billing'] == '1' && $settings['billing']['highlight_inactive'] == '1';
             $row['traffic_used'] = round($row['traffic_used'] / (1024 * 1024), $settings['panel']['decimal_places']);
             $row['traffic'] = round($row['traffic'] / (1024 * 1024), $settings['panel']['decimal_places']);
             $row['diskspace_used'] = round($row['diskspace_used'] / 1024, $settings['panel']['decimal_places']);
             $row['diskspace'] = round($row['diskspace'] / 1024, $settings['panel']['decimal_places']);
             $row = str_replace_array('-1', 'UL', $row, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains tickets');