本文整理汇总了PHP中ConfigHelper::checkValue方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfigHelper::checkValue方法的具体用法?PHP ConfigHelper::checkValue怎么用?PHP ConfigHelper::checkValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigHelper
的用法示例。
在下文中一共展示了ConfigHelper::checkValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: note_recipient
public function note_recipient()
{
$oldy = $this->backend->GetY();
$recipient = '<b>' . trans('Note recipient:') . '</b><br>';
$recipient .= $this->data['name'] . '<br>';
$recipient .= $this->data['address'] . '<br>';
$recipient .= $this->data['zip'] . ' ' . $this->data['city'] . '<br>';
if ($this->data['ten']) {
$recipient .= trans('TEN') . ': ' . $this->data['ten'] . '<br>';
} elseif ($this->data['ssn']) {
$recipient .= trans('SSN') . ': ' . $this->data['ssn'] . '<br>';
}
$this->backend->SetFont('arial', '', 10);
$this->backend->writeHTMLCell(80, '', 125, 50, $recipient, 0, 1, 0, true, 'L');
$y = $this->backend->GetY();
if (ConfigHelper::checkValue(ConfigHelper::getConfig('invoices.customer_bankaccount', true))) {
$bankaccount = trans('Bank account:') . ' <b>' . format_bankaccount(bankaccount($this->data['customerid'], $this->data['account'])) . '</b>';
$this->backend->SetFont('arial', 'B', 8);
$this->backend->writeHTMLCell('', '', 125, $oldy + round(($y - $oldy - 8) / 2), $bankaccount, 0, 1, 0, true, 'L');
}
if (ConfigHelper::checkValue(ConfigHelper::getConfig('invoices.customer_credentials', true))) {
$pin = '<b>' . trans('Customer ID: $a', sprintf('%04d', $this->data['customerid'])) . '</b><br>';
$pin .= '<b>PIN: ' . sprintf('%04d', $this->data['customerpin']) . '</b><br>';
$this->backend->SetFont('arial', 'B', 8);
$this->backend->writeHTMLCell('', '', 125, $oldy + round(($y - $oldy) / 2), $pin, 0, 1, 0, true, 'L');
}
$this->backend->SetY($y);
}
示例2: getInstance
/**
* Returns singleton database handler.
*
* @return \LMSDBInterface
*/
public static function getInstance()
{
if (self::$db === null) {
$_DBTYPE = LMSConfig::getIniConfig()->getSection('database')->getVariable('type')->getValue();
$_DBHOST = LMSConfig::getIniConfig()->getSection('database')->getVariable('host')->getValue();
$_DBUSER = LMSConfig::getIniConfig()->getSection('database')->getVariable('user')->getValue();
$_DBPASS = LMSConfig::getIniConfig()->getSection('database')->getVariable('password')->getValue();
$_DBNAME = LMSConfig::getIniConfig()->getSection('database')->getVariable('database')->getValue();
$_DBDEBUG = false;
if (LMSConfig::getIniConfig()->getSection('database')->hasVariable('debug')) {
$_DBDEBUG = ConfigHelper::checkValue(LMSConfig::getIniConfig()->getSection('database')->getVariable('debug')->getValue());
}
self::$db = self::getDB($_DBTYPE, $_DBHOST, $_DBUSER, $_DBPASS, $_DBNAME, $_DBDEBUG);
}
return self::$db;
}
示例3: sprintf
}
$mailfrom = $user['email'] ? $user['email'] : $queue['email'];
$headers['From'] = $mailfname.' <'.$mailfrom.'>';
$headers['Subject'] = sprintf("[RT#%06d] %s", $note['ticketid'], $DB->GetOne('SELECT subject FROM rttickets WHERE id = ?', array($note['ticketid'])));
$headers['Reply-To'] = $headers['From'];
$sms_body = $headers['Subject']."\n".$note['body'];
$body = $note['body']."\n\nhttp"
.(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '').'://'
.$_SERVER['HTTP_HOST']
.substr($_SERVER['REQUEST_URI'], 0, strrpos($_SERVER['REQUEST_URI'], '/') + 1)
.'?m=rtticketview&id='.$note['ticketid'];
if (ConfigHelper::checkValue(ConfigHelper::getConfig('phpui.helpdesk_customerinfo', false))
&& ($cid = $DB->GetOne('SELECT customerid FROM rttickets WHERE id = ?', array($note['ticketid']))))
{
$info = $DB->GetRow('SELECT id, '.$DB->Concat('UPPER(lastname)',"' '",'name').' AS customername,
email, address, zip, city, (SELECT phone FROM customercontacts
WHERE customerid = customers.id ORDER BY id LIMIT 1) AS phone
FROM customers WHERE id = ?', array($cid));
$body .= "\n\n-- \n";
$body .= trans('Customer:').' '.$info['customername']."\n";
$body .= trans('Address:').' '.$info['address'].', '.$info['zip'].' '.$info['city']."\n";
$body .= trans('Phone:').' '.$info['phone']."\n";
$body .= trans('E-mail:').' '.$info['email'];
$sms_body .= "\n";
$sms_body .= trans('Customer:').' '.$info['customername'];
示例4: list
$a['at'] = $d . '/' . $m;
} else {
list($d, $m) = explode('/', $a['at']);
}
if (!$error) {
if ($d > 30 || $d < 1 || $d > 28 && $m == 2) {
$error['at'] = trans('This month doesn\'t contain specified number of days');
}
if ($m > 6 || $m < 1) {
$error['at'] = trans('Incorrect month number (max.6)!');
}
$at = ($m - 1) * 100 + $d;
}
break;
case YEARLY:
if (ConfigHelper::checkValue(ConfigHelper::getConfig('phpui.use_current_payday', false)) && !$a['at']) {
$d = date('j', time());
$m = date('n', time());
$a['at'] = $d . '/' . $m;
} elseif (!preg_match('/^[0-9]{2}\\/[0-9]{2}$/', $a['at'])) {
$error['at'] = trans('Incorrect date format! Enter date in DD/MM format!');
} else {
list($d, $m) = explode('/', $a['at']);
}
if (!$error) {
if ($d > 30 || $d < 1 || $d > 28 && $m == 2) {
$error['at'] = trans('This month doesn\'t contain specified number of days');
}
if ($m > 12 || $m < 1) {
$error['at'] = trans('Incorrect month number');
}
示例5: trans
$customeradd['zip'] = $default_zip;
}
if (!isset($customeradd['city']) && $default_city) {
$customeradd['city'] = $default_city;
}
if (!isset($customeradd['address']) && $default_address) {
$customeradd['address'] = $default_address;
}
if (!isset($customeradd['default_stateid']) && $default_stateid) {
$customeradd['stateid'] = $default_stateid;
}
if (!isset($customeradd['default_countryid']) && $default_countryid) {
$customeradd['countryid'] = $default_countryid;
}
if (!isset($customeradd['default_status']) && $default_status) {
$customeradd['status'] = $default_status;
}
$layout['pagetitle'] = trans('New Customer');
$LMS->InitXajax();
$hook_data = $LMS->executeHook('customeradd_before_display', array('customeradd' => $customeradd, 'smarty' => $SMARTY));
$customeradd = $hook_data['customeradd'];
$SMARTY->assign('xajax', $LMS->RunXajax());
$SMARTY->assign('cstateslist', $LMS->GetCountryStates());
$SMARTY->assign('countrieslist', $LMS->GetCountries());
$SMARTY->assign('divisions', $DB->GetAll('SELECT id, shortname, status FROM divisions ORDER BY shortname'));
$SMARTY->assign('customeradd', $customeradd);
if (ConfigHelper::checkValue(ConfigHelper::getConfig('phpui.add_customer_group_required', false))) {
$SMARTY->assign('groups', $DB->GetAll('SELECT id,name FROM customergroups ORDER BY id'));
}
$SMARTY->assign('error', $error);
$SMARTY->display('customer/customeradd.html');
示例6: foreach
if (sizeof($_POST['marks'])) {
foreach ($_POST['marks'] as $id => $mark) {
$ilm[$id] = $mark;
}
}
if (sizeof($ilm)) {
foreach ($ilm as $mark) {
$ids[] = $mark;
}
}
if (sizeof($ids)) {
foreach ($ids as $invoiceid) {
list($cid, $closed) = array_values($DB->GetRow('SELECT customerid, closed FROM documents
WHERE id = ?', array($invoiceid)));
// add payment
if (ConfigHelper::checkValue(ConfigHelper::getConfig('phpui.invoice_check_payment', false)) && $cid && !$closed) {
$value = $DB->GetOne('SELECT CASE reference WHEN 0 THEN SUM(a.value*a.count)
ELSE SUM((a.value+b.value)*(a.count+b.count)) - SUM(b.value*b.count) END
FROM documents d
JOIN invoicecontents a ON (a.docid = d.id)
LEFT JOIN invoicecontents b ON (d.reference = b.docid AND a.itemid = b.itemid)
WHERE d.id = ? GROUP BY d.reference', array($invoiceid));
if ($value != 0) {
$LMS->AddBalance(array('type' => 1, 'time' => time(), 'value' => $value, 'customerid' => $cid, 'comment' => trans('Accounted')));
}
}
if ($SYSLOG) {
$args = array($SYSLOG_RESOURCE_KEYS[SYSLOG_RES_DOC] => $invoiceid, $SYSLOG_RESOURCE_KEYS[SYSLOG_RES_CUST] => $cid, 'closed' => intval(!$closed));
$SYSLOG->AddMessage(SYSLOG_RES_DOC, SYSLOG_OPER_UPDATE, $args, array($SYSLOG_RESOURCE_KEYS[SYSLOG_RES_DOC], $SYSLOG_RESOURCE_KEYS[SYSLOG_RES_CUST]));
}
$DB->Execute('UPDATE documents SET closed =
示例7: preg_replace
$reply = $LMS->GetMessage($_GET['id']);
if ($reply['replyto']) {
$message['destination'] = preg_replace('/^.* <(.+@.+)>/', '\\1', $reply['replyto']);
} else {
$message['destination'] = preg_replace('/^.* <(.+@.+)>/', '\\1', $reply['mailfrom']);
}
if (!$message['destination'] && !$reply['userid']) {
$message['destination'] = $LMS->GetCustomerEmail($message['customerid']);
if (!empty($message['destination'])) {
$message['destination'] = implode(',', $message['destination']);
}
}
$message['subject'] = 'Re: ' . $reply['subject'];
$message['inreplyto'] = $reply['id'];
$message['references'] = $reply['messageid'];
if (ConfigHelper::checkValue(ConfigHelper::getConfig('phpui.helpdesk_reply_body', false))) {
$body = explode("\n", textwrap(strip_tags($reply['body']), 74));
foreach ($body as $line) {
$message['body'] .= '> ' . $line . "\n";
}
}
if (!preg_match('/\\[RT#[0-9]{6}\\]/i', $message['subject'])) {
$message['subject'] .= sprintf(' [RT#%06d]', $message['ticketid']);
}
}
}
$layout['pagetitle'] = trans('New Message');
$SESSION->save('backto', $_SERVER['QUERY_STRING']);
$SMARTY->assign('message', $message);
$SMARTY->assign('error', $error);
$SMARTY->display('rt/rtmessageadd.html');
示例8: getCustomerNodes
/**
* Returns customer nodes
*
* @param int $id Customer id
* @param int $count Limit
* @return array Nodes
*/
public function getCustomerNodes($id, $count = null)
{
if ($result = $this->db->GetAll('SELECT n.id, n.name, mac, ipaddr,
inet_ntoa(ipaddr) AS ip, ipaddr_pub,
inet_ntoa(ipaddr_pub) AS ip_pub, passwd, access,
warning, info, ownerid, lastonline, location,
(SELECT COUNT(*) FROM nodegroupassignments
WHERE nodeid = n.id) AS gcount,
n.netid, net.name AS netname
FROM vnodes n
JOIN networks net ON net.id = n.netid
WHERE ownerid = ?
ORDER BY n.name ASC ' . ($count ? 'LIMIT ' . $count : ''), array($id))) {
// assign network(s) to node record
$network_manager = new LMSNetworkManager($this->db, $this->auth, $this->cache);
$networks = (array) $network_manager->GetNetworks();
foreach ($result as $idx => $node) {
$ids[$node['id']] = $idx;
$result[$idx]['lastonlinedate'] = lastonline_date($node['lastonline']);
//foreach ($networks as $net)
// if (isipin($node['ip'], $net['address'], $net['mask'])) {
// $result[$idx]['network'] = $net;
// break;
// }
if ($node['ipaddr_pub']) {
foreach ($networks as $net) {
if (isipin($node['ip_pub'], $net['address'], $net['mask'])) {
$result[$idx]['network_pub'] = $net;
break;
}
}
}
}
// get EtherWerX channels
if (ConfigHelper::checkValue(ConfigHelper::getConfig('phpui.ewx_support', false))) {
$channels = $this->db->GetAllByKey('SELECT nodeid, channelid, c.name, c.id, cid,
nc.upceil, nc.downceil
FROM ewx_stm_nodes
JOIN ewx_stm_channels nc ON (channelid = nc.id)
LEFT JOIN ewx_channels c ON (c.id = nc.cid)
WHERE nodeid IN (' . implode(',', array_keys($ids)) . ')', 'nodeid');
if ($channels) {
foreach ($channels as $channel) {
$idx = $ids[$channel['nodeid']];
$result[$idx]['channelid'] = $channel['id'] ? $channel['id'] : $channel['channelid'];
$result[$idx]['channelname'] = $channel['name'];
$result[$idx]['cid'] = $channel['cid'];
$result[$idx]['downceil'] = $channel['downceil'];
$result[$idx]['upceil'] = $channel['upceil'];
}
}
}
}
return $result;
}
示例9: foreach
$ilm[$id] = $mark;
}
}
if (sizeof($ilm)) {
foreach ($ilm as $mark) {
$ids[] = intval($mark);
}
}
if (sizeof($ids)) {
foreach ($ids as $noteid) {
list($cid, $value, $closed) = array_values($DB->GetRow('SELECT customerid,
(SELECT SUM(value) FROM debitnotecontents
WHERE docid = d.id) AS value, closed
FROM documents
WHERE id = ?', array($noteid)));
// add payment
if (ConfigHelper::checkValue(ConfigHelper::getConfig('phpui.note_check_payment', false)) && !$closed) {
if ($value != 0) {
$LMS->AddBalance(array('type' => 1, 'time' => time(), 'value' => $value, 'customerid' => $cid, 'comment' => trans('Accounted')));
}
}
if ($SYSLOG) {
$args = array($SYSLOG_RESOURCE_KEYS[SYSLOG_RES_DOC] => $noteid, $SYSLOG_RESOURCE_KEYS[SYSLOG_RES_CUST] => $cid, 'closed' => intval(!$closed));
$SYSLOG->AddMessage(SYSLOG_RES_DOC, SYSLOG_OPER_UPDATE, $args, array($SYSLOG_RESOURCE_KEYS[SYSLOG_RES_DOC], $SYSLOG_RESOURCE_KEYS[SYSLOG_RES_CUST]));
}
$DB->Execute('UPDATE documents SET closed =
(CASE closed WHEN 0 THEN 1 ELSE 0 END)
WHERE id = ?', array($noteid));
}
}
$SESSION->redirect('?' . $SESSION->get('backto'));
示例10: GetNoteContent
public function GetNoteContent($id)
{
if ($result = $this->db->GetRow('SELECT d.id, d.number, d.name, d.customerid,
d.userid, d.address, d.zip, d.city, d.countryid, cn.name AS country,
d.ten, d.ssn, d.cdate, d.numberplanid, d.closed, d.divisionid, d.paytime,
(SELECT name FROM users WHERE id = d.userid) AS user, n.template,
d.div_name AS division_name, d.div_shortname AS division_shortname,
d.div_address AS division_address, d.div_zip AS division_zip,
d.div_city AS division_city, d.div_countryid AS division_countryid,
d.div_ten AS division_ten, d.div_regon AS division_regon, d.div_account AS account,
d.div_inv_header AS division_header, d.div_inv_footer AS division_footer,
d.div_inv_author AS division_author, d.div_inv_cplace AS division_cplace,
c.pin AS customerpin, c.divisionid AS current_divisionid,
c.street, c.building, c.apartment,
c.post_street, c.post_building, c.post_apartment,
c.post_name, c.post_address, c.post_zip, c.post_city, c.post_countryid
FROM documents d
JOIN customeraddressview c ON (c.id = d.customerid)
LEFT JOIN countries cn ON (cn.id = d.countryid)
LEFT JOIN numberplans n ON (d.numberplanid = n.id)
WHERE d.id = ? AND d.type = ?', array($id, DOC_DNOTE))) {
$result['bankaccounts'] = $this->db->GetCol('SELECT contact FROM customercontacts
WHERE customerid = ? AND (type & ?) = ?', array($result['customerid'], CONTACT_BANKACCOUNT | CONTACT_INVOICES | CONTACT_DISABLED, CONTACT_BANKACCOUNT | CONTACT_INVOICES));
if (empty($result['bankaccounts'])) {
$result['bankaccounts'] = array();
}
$result['value'] = 0;
if (!$result['division_header']) {
$location_manager = new LMSLocationManager($this->db, $this->auth, $this->cache, $this->syslog);
$result['division_header'] = $result['division_name'] . "\n" . $result['division_address'] . "\n" . $result['division_zip'] . ' ' . $result['division_city'] . ($result['division_countryid'] && $result['countryid'] && $result['division_countryid'] != $result['countryid'] ? "\n" . trans($location_manager->GetCountryName($result['division_countryid'])) : '') . ($result['division_ten'] != '' ? "\n" . trans('TEN') . ' ' . $result['division_ten'] : '');
}
if ($result['content'] = $this->db->GetAll('SELECT
value, itemid, description
FROM debitnotecontents
WHERE docid=?
ORDER BY itemid', array($id))) {
foreach ($result['content'] as $idx => $row) {
$result['content'][$idx]['value'] = $row['value'];
$result['value'] += $row['value'];
}
}
$result['valuep'] = round(($result['value'] - floor($result['value'])) * 100);
$result['pdate'] = $result['cdate'] + $result['paytime'] * 86400;
// NOTE: don't waste CPU/mem when printing history is not set:
if (ConfigHelper::checkValue(ConfigHelper::getConfig('notes.print_balance', false))) {
if (ConfigHelper::checkValue(ConfigHelper::getConfig('notes.print_balance_history', false))) {
$result['customerbalancelist'] = $LMS->GetCustomerBalanceList($result['customerid'], $result['cdate']);
} else {
$result['customerbalancelist'] = $LMS->GetCustomerBalanceList($result['customerid']);
}
$result['customerbalancelistlimit'] = ConfigHelper::getConfig('notes.print_balance_history_limit');
}
// for backward compatibility
if ($result['post_name'] || $result['post_address']) {
$result['serviceaddr'] = $result['post_name'];
if ($result['post_address']) {
$result['serviceaddr'] .= "\n" . $result['post_address'];
}
if ($result['post_zip'] && $result['post_city']) {
$result['serviceaddr'] .= "\n" . $result['post_zip'] . ' ' . $result['post_city'];
}
}
return $result;
} else {
return FALSE;
}
}
示例11: VerifyUser
public function VerifyUser()
{
$this->islogged = false;
if ($user = $this->DB->GetRow('SELECT id, name, passwd, hosts, lastlogindate, lastloginip,
passwdexpiration, passwdlastchange, access, accessfrom, accessto, swekey_id
FROM users WHERE login=? AND deleted=0', array($this->login))) {
$this->logname = $user['name'];
$this->id = $user['id'];
$this->last = $user['lastlogindate'];
$this->lastip = $user['lastloginip'];
$this->passwdexpiration = $user['passwdexpiration'];
$this->passwdlastchange = $user['passwdlastchange'];
$this->swekeyid = $user['swekey_id'];
$this->passverified = $this->VerifyPassword($user['passwd']);
$this->hostverified = $this->VerifyHost($user['hosts']);
$this->access = $this->VerifyAccess($user['access']);
$this->accessfrom = $this->VerifyAccessFrom($user['accessfrom']);
$this->accessto = $this->VerifyAccessTo($user['accessto']);
$this->islogged = $this->passverified && $this->hostverified && $this->access && $this->accessfrom && $this->accessto;
if (ConfigHelper::checkValue(ConfigHelper::getConfig('phpui.use_swekey', false))) {
require_once LIB_DIR . DIRECTORY_SEPARATOR . 'swekey' . DIRECTORY_SEPARATOR . 'swekey_integration.php';
$SWEKEY = new SwekeyIntegration();
$this->swekeyauthenticated = $SWEKEY->IsSwekeyAuthenticated($this->swekeyid);
if (!$this->swekeyauthenticated && $this->swekeyid) {
$this->error = trans('You must login with your Swekey');
$this->islogged = false;
$SWEKEY->DestroySession();
}
}
if ($this->islogged && $this->passwdexpiration && (time() - $this->passwdlastchange) / 86400 >= $user['passwdexpiration']) {
$this->SESSION->save('session_passwdrequiredchange', TRUE);
}
} else {
$this->error = trans('Wrong password or login.');
}
return $this->islogged;
}
示例12: preg_split
// Call any of upgrade process before anything else
require_once LIB_DIR . '/upgradedb.php';
// test for proper version of Smarty
if (defined('Smarty::SMARTY_VERSION')) {
$ver_chunks = preg_split('/[- ]/', Smarty::SMARTY_VERSION);
} else {
$ver_chunks = NULL;
}
if (count($ver_chunks) != 2 || version_compare('3.0', $ver_chunks[1]) > 0) {
die('<B>Wrong version of Smarty engine! We support only Smarty-3.x greater than 3.0.</B>');
}
define('SMARTY_VERSION', $ver_chunks[1]);
// system localization
require_once LIB_DIR . '/language.php';
// Redirect to SSL
$_FORCE_SSL = ConfigHelper::checkValue(ConfigHelper::getConfig('phpui.force_ssl', false));
if ($_FORCE_SSL && $_SERVER['HTTPS'] != 'on') {
header('Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
exit(0);
}
// EXPERIMENTAL CODE! USE WITH CAUTION ;-)
$_LMSDIR = dirname(__FILE__);
$ExecStack = new ExecStack($_LMSDIR . '/modules/', isset($_GET['m']) ? $_GET['m'] : NULL, isset($_GET['a']) ? $_GET['a'] : NULL);
// don't use foreach() below, because privileges checking action
// will probably need to remove some actions from stack
// Note: that action should be executed first
while (list(, $execute) = each($ExecStack->_EXECSTACK['actions'])) {
// do include once, because testing that language for executed module has been already loaded
// will take some time, so let's PHP decide if we already loaded it or what...
@(include_once $_LMSDIR . '/modules/' . $execute['module'] . '/lang/' . $_language . '.php');
@(include_once $_LMSDIR . '/modules/' . $execute['module'] . '/modinit.php');
示例13: invoice_body_ft0100
function invoice_body_ft0100()
{
global $pdf, $invoice;
$page = $pdf->ezStartPageNumbers($pdf->ez['pageWidth'] / 2 + 10, $pdf->ez['pageHeight'] - 30, 8, '', trans('Page $a of $b', '{PAGENUM}', '{TOTALPAGENUM}'), 1);
$top = $pdf->ez['pageHeight'] - 50;
invoice_dates(500, $top);
invoice_address_box(400, 700);
$top = invoice_title(30, $top);
$top = $top - 10;
$top = invoice_seller(30, $top);
$top = $top - 10;
$top = invoice_buyer(30, $top);
$top = $top - 10;
invoice_footnote(470, $top, 90, 8);
$return = new_invoice_data(30, $top, 430, 6, 1);
$top = $return[2] - 10;
$return[1] += 5;
invoice_expositor(30, $return[1]);
invoice_to_pay(30, $top);
check_page_length($top, 200);
if ($invoice['customerbalance'] < 0 || ConfigHelper::checkValue(ConfigHelper::getConfig('invoices.always_show_form', true))) {
invoice_main_form_fill(187, 3, 0.4);
invoice_simple_form_fill(14, 3, 0.4);
}
$page = $pdf->ezStopPageNumbers(1, 1, $page);
}
示例14: array
if ($invoice_filetype != 'pdf' || $dnote_filetype != 'pdf') {
// Set some template and layout variables
$SMARTY->setTemplateDir(null);
$custom_templates_dir = ConfigHelper::getConfig('phpui.custom_templates_dir');
if (!empty($custom_templates_dir) && file_exists(SMARTY_TEMPLATES_DIR . DIRECTORY_SEPARATOR . $custom_templates_dir) && !is_file(SMARTY_TEMPLATES_DIR . DIRECTORY_SEPARATOR . $custom_templates_dir)) {
$SMARTY->AddTemplateDir(SMARTY_TEMPLATES_DIR . DIRECTORY_SEPARATOR . $custom_templates_dir);
}
$SMARTY->AddTemplateDir(array(SMARTY_TEMPLATES_DIR . DIRECTORY_SEPARATOR . 'default', SMARTY_TEMPLATES_DIR));
$SMARTY->setCompileDir(SMARTY_COMPILE_DIR);
$SMARTY->assignByRef('layout', $layout);
$SMARTY->assignByRef('LANGDEFS', $LANGDEFS);
$SMARTY->assignByRef('_ui_language', $LMS->ui_lang);
$SMARTY->assignByRef('_language', $LMS->lang);
}
// now it's time for script settings
$smtp_options = array('host' => ConfigHelper::getConfig('sendinvoices.smtp_host'), 'port' => ConfigHelper::getConfig('sendinvoices.smtp_port'), 'user' => ConfigHelper::getConfig('sendinvoices.smtp_user'), 'pass' => ConfigHelper::getConfig('sendinvoices.smtp_pass'), 'auth' => ConfigHelper::getConfig('sendinvoices.smtp_auth'), 'ssl_verify_peer' => ConfigHelper::checkValue(ConfigHelper::getConfig('sendinvoices.smtp_ssl_verify_peer', true)), 'ssl_verify_peer_name' => ConfigHelper::checkValue(ConfigHelper::getConfig('sendinvoices.smtp_ssl_verify_peer_name', true)), 'ssl_allow_self_signed' => ConfigHelper::checkConfig('sendinvoices.smtp_ssl_allow_self_signed'));
$debug_email = ConfigHelper::getConfig('sendinvoices.debug_email', '', true);
$sender_name = ConfigHelper::getConfig('sendinvoices.sender_name', '', true);
$sender_email = ConfigHelper::getConfig('sendinvoices.sender_email', '', true);
$mail_subject = ConfigHelper::getConfig('sendinvoices.mail_subject', 'Invoice No. %invoice');
$mail_body = ConfigHelper::getConfig('sendinvoices.mail_body', ConfigHelper::getConfig('mail.sendinvoice_mail_body'));
$invoice_filename = ConfigHelper::getConfig('sendinvoices.invoice_filename', 'invoice_%docid');
$dnote_filename = ConfigHelper::getConfig('sendinvoices.debitnote_filename', 'dnote_%docid');
$notify_email = ConfigHelper::getConfig('sendinvoices.notify_email', '', true);
$reply_email = ConfigHelper::getConfig('sendinvoices.reply_email', '', true);
$add_message = ConfigHelper::checkConfig('sendinvoices.add_message');
$dsn_email = ConfigHelper::getConfig('sendinvoices.dsn_email', '', true);
$mdn_email = ConfigHelper::getConfig('sendinvoices.mdn_email', '', true);
$count_limit = intval(ConfigHelper::getConfig('sendinvoices.limit', '0'));
if (empty($sender_email)) {
die("Fatal error: sender_email unset! Can't continue, exiting." . PHP_EOL);
示例15: customerNodesProvider
protected function customerNodesProvider($customer_id, $type = '', $count = null)
{
$type = strtolower($type);
switch ($type) {
case 'netdev':
$type = 'nd.ownerid = ?';
break;
default:
$type = 'n.ownerid = ?';
}
$result = $this->db->GetAll("SELECT\n n.id, n.name, mac, ipaddr, inet_ntoa(ipaddr) AS ip, nd.name as netdev_name,\n ipaddr_pub, n.authtype, inet_ntoa(ipaddr_pub) AS ip_pub,\n passwd, access, warning, info, n.ownerid, lastonline, n.location,\n (SELECT COUNT(*)\n FROM nodegroupassignments\n WHERE nodeid = n.id) AS gcount,\n n.netid, net.name AS netname\n FROM\n vnodes n\n JOIN networks net ON net.id = n.netid\n LEFT JOIN netdevices nd ON n.netdev = nd.id\n WHERE\n " . $type . "\n ORDER BY\n n.name ASC " . ($count ? 'LIMIT ' . $count : ''), array($customer_id));
if ($result) {
// assign network(s) to node record
$network_manager = new LMSNetworkManager($this->db, $this->auth, $this->cache);
$networks = (array) $network_manager->GetNetworks();
foreach ($result as $idx => $node) {
$ids[$node['id']] = $idx;
$result[$idx]['lastonlinedate'] = lastonline_date($node['lastonline']);
if ($node['ipaddr_pub']) {
foreach ($networks as $net) {
if (isipin($node['ip_pub'], $net['address'], $net['mask'])) {
$result[$idx]['network_pub'] = $net;
break;
}
}
}
}
// get EtherWerX channels
if (ConfigHelper::checkValue(ConfigHelper::getConfig('phpui.ewx_support', false))) {
$channels = $this->db->GetAllByKey('SELECT nodeid, channelid, c.name, c.id, cid,
nc.upceil, nc.downceil
FROM ewx_stm_nodes
JOIN ewx_stm_channels nc ON (channelid = nc.id)
LEFT JOIN ewx_channels c ON (c.id = nc.cid)
WHERE nodeid IN (' . implode(',', array_keys($ids)) . ')', 'nodeid');
if ($channels) {
foreach ($channels as $channel) {
$idx = $ids[$channel['nodeid']];
$result[$idx]['channelid'] = $channel['id'] ? $channel['id'] : $channel['channelid'];
$result[$idx]['channelname'] = $channel['name'];
$result[$idx]['cid'] = $channel['cid'];
$result[$idx]['downceil'] = $channel['downceil'];
$result[$idx]['upceil'] = $channel['upceil'];
}
}
}
}
return $result;
}