$customergroups = " AND EXISTS (SELECT 1 FROM customergroups g, customerassignments ca \n\tWHERE c.id = ca.customerid \n\tAND g.id = ca.customergroupid \n\tAND (%groups)) "; $groupnames = ConfigHelper::getConfig('sendinvoices.customergroups'); $groupsql = ""; $groups = preg_split("/[[:blank:]]+/", $groupnames, -1, PREG_SPLIT_NO_EMPTY); foreach ($groups as $group) { if (!empty($groupsql)) { $groupsql .= " OR "; } $groupsql .= "UPPER(g.name) = UPPER('" . $group . "')"; } if (!empty($groupsql)) { $customergroups = preg_replace("/\\%groups/", $groupsql, $customergroups); } // Initialize Session, Auth and LMS classes $AUTH = NULL; $LMS = new LMS($DB, $AUTH, $SYSLOG); $LMS->ui_lang = $_ui_language; $LMS->lang = $_language; define('USER_AGENT', "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); define('COOKIE_FILE', tempnam('/tmp', 'lms-sendinvoices-cookies-')); if (array_key_exists('test', $options)) { $test = TRUE; printf("WARNING! You are using test mode.\n"); } $ch = curl_init(); if (!$ch) { die("Fatal error: Can't init curl library!\n"); } $query = "SELECT d.id, d.number, d.cdate, c.email, d.name, d.customerid, n.template \n\t\tFROM documents d \n\t\tLEFT JOIN customers c ON c.id = d.customerid \n\t\tLEFT JOIN numberplans n ON n.id = d.numberplanid \n\t\tWHERE c.deleted = 0 AND d.type IN (1,3) AND c.email <> '' AND c.invoicenotice = 1 " . (!empty($invoiceid) ? "AND d.id = " . $invoiceid : "AND d.cdate >= {$daystart} AND d.cdate <= {$dayend}") . (!empty($groupnames) ? $customergroups : "") . " ORDER BY d.number"; $docs = $DB->GetAll($query); if (!empty($docs)) {
require_once LIB_DIR . '/common.php'; require_once LIB_DIR . '/checkip.php'; require_once LIB_DIR . '/accesstable.php'; require_once LIB_DIR . '/SYSLOG.class.php'; if (ConfigHelper::checkConfig('phpui.logging') && class_exists('SYSLOG')) { $SYSLOG = new SYSLOG($DB); } else { $SYSLOG = null; } // Initialize Session, Auth and LMS classes $SESSION = new Session($DB, ConfigHelper::getConfig('phpui.timeout')); $AUTH = new Auth($DB, $SESSION, $SYSLOG); if ($SYSLOG) { $SYSLOG->SetAuth($AUTH); } $LMS = new LMS($DB, $AUTH, $SYSLOG); $LMS->ui_lang = $_ui_language; $LMS->lang = $_language; $plugin_manager = new LMSPluginManager(); $LMS->setPluginManager($plugin_manager); // Initialize Swekey class if (ConfigHelper::checkConfig('phpui.use_swekey')) { require_once LIB_DIR . '/swekey/lms_integration.php'; $LMS_SWEKEY = new LmsSwekeyIntegration($DB, $AUTH, $LMS); $SMARTY->assign('lms_swekey', $LMS_SWEKEY->GetIntegrationScript($AUTH->id)); } // 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 . '/' . $custom_templates_dir) && !is_file(SMARTY_TEMPLATES_DIR . '/' . $custom_templates_dir)) { $SMARTY->AddTemplateDir(SMARTY_TEMPLATES_DIR . '/' . $custom_templates_dir);
$customergroups = " AND EXISTS (SELECT 1 FROM customergroups g, customerassignments ca \n\tWHERE c.id = ca.customerid \n\tAND g.id = ca.customergroupid \n\tAND (%groups)) "; $groupnames = $CONFIG['sendinvoices']['customergroups']; $groupsql = ""; $groups = preg_split("/[[:blank:]]+/", $groupnames, -1, PREG_SPLIT_NO_EMPTY); foreach ($groups as $group) { if (!empty($groupsql)) { $groupsql .= " OR "; } $groupsql .= "UPPER(g.name) = UPPER('" . $group . "')"; } if (!empty($groupsql)) { $customergroups = preg_replace("/\\%groups/", $groupsql, $customergroups); } // Initialize Session, Auth and LMS classes $AUTH = NULL; $LMS = new LMS($DB, $AUTH, $CONFIG); $LMS->ui_lang = $_ui_language; $LMS->lang = $_language; $query = "SELECT d.id, d.number, d.cdate, c.email, d.name, d.customerid, n.template \n\t\tFROM documents d \n\t\tLEFT JOIN customers c ON c.id = d.customerid \n\t\tLEFT JOIN numberplans n ON n.id = d.numberplanid \n\t\tWHERE c.deleted = 0 AND d.type = 1 AND c.email <> '' AND c.invoicenotice = 1 " . (!empty($invoiceid) ? "AND d.id = " . $invoiceid : "AND d.cdate >= {$daystart} AND d.cdate <= {$dayend}") . (!empty($groupnames) ? $customergroups : "") . " ORDER BY d.number"; $docs = $DB->GetAll($query); define('USER_AGENT', "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); define('COOKIE_FILE', tempnam('/tmp', 'lms-sendinvoices-cookies-')); $ch = curl_init(); if (!$ch) { die("Fatal error: Can't init curl library!\n"); } if (!empty($docs)) { if (array_key_exists('test', $options)) { $test = TRUE; printf("WARNING! You are using test mode.\n"); }
require_once LIB_DIR . DIRECTORY_SEPARATOR . 'definitions.php'; require_once LIB_DIR . DIRECTORY_SEPARATOR . 'checkip.php'; require_once LIB_DIR . DIRECTORY_SEPARATOR . 'accesstable.php'; require_once LIB_DIR . DIRECTORY_SEPARATOR . 'SYSLOG.class.php'; if (ConfigHelper::checkConfig('phpui.logging') && class_exists('SYSLOG')) { $SYSLOG = new SYSLOG($DB); } else { $SYSLOG = null; } // Initialize Session, Auth and LMS classes $SESSION = new Session($DB, ConfigHelper::getConfig('phpui.timeout')); $AUTH = new Auth($DB, $SESSION, $SYSLOG); if ($SYSLOG) { $SYSLOG->SetAuth($AUTH); } $LMS = new LMS($DB, $AUTH, $SYSLOG); $LMS->ui_lang = $_ui_language; $LMS->lang = $_language; $plugin_manager = new LMSPluginManager(); $LMS->setPluginManager($plugin_manager); $SMARTY->setPluginManager($plugin_manager); // Initialize Swekey class if (ConfigHelper::checkConfig('phpui.use_swekey')) { require_once LIB_DIR . DIRECTORY_SEPARATOR . 'swekey' . DIRECTORY_SEPARATOR . 'lms_integration.php'; $LMS_SWEKEY = new LmsSwekeyIntegration($DB, $AUTH, $LMS); $SMARTY->assign('lms_swekey', $LMS_SWEKEY->GetIntegrationScript($AUTH->id)); } // 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)) {
$DB = LMSDB::getInstance(); } catch (Exception $ex) { trigger_error($ex->getMessage(), E_USER_WARNING); // can't working without database die("Fatal error: cannot connect to database!" . PHP_EOL); } // Include required files (including sequence is important) require_once LIB_DIR . DIRECTORY_SEPARATOR . 'language.php'; include_once LIB_DIR . DIRECTORY_SEPARATOR . 'definitions.php'; require_once LIB_DIR . DIRECTORY_SEPARATOR . 'unstrip.php'; require_once LIB_DIR . DIRECTORY_SEPARATOR . 'common.php'; require_once LIB_DIR . DIRECTORY_SEPARATOR . 'SYSLOG.class.php'; // Initialize Session, Auth and LMS classes $AUTH = NULL; $SYSLOG = NULL; $LMS = new LMS($DB, $AUTH, $SYSLOG); $LMS->ui_lang = $_ui_language; $LMS->lang = $_language; $bgz_username = ConfigHelper::getConfig('finances.bgz_username'); $bgz_password = ConfigHelper::getConfig('finances.bgz_password'); $bgz_firm = ConfigHelper::getConfig('finances.bgz_firm'); if (empty($bgz_username) || empty($bgz_password) || empty($bgz_firm)) { die("Fatal error: BGZ credentials are not set!" . PHP_EOL); } define('USER_AGENT', "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); define('COOKIE_FILE', tempnam('/tmp', 'lms-bgz-cookies-')); function log_in_to_bgz($user, $firm, $pass) { $ch = curl_init(); if (!$ch) { return FALSE;
trigger_error($ex->getMessage(), E_USER_WARNING); // can't working without database die("Fatal error: cannot connect to database!\n"); } // Initialize templates engine $SMARTY = new Smarty(); // add LMS's custom plugins directory $SMARTY->addPluginsDir(LIB_DIR . '/SmartyPlugins'); // Include required files (including sequence is important) require_once LIB_DIR . '/unstrip.php'; require_once LIB_DIR . '/language.php'; require_once LIB_DIR . '/definitions.php'; require_once LIB_DIR . '/common.php'; // Initialize LMS class $AUTH = NULL; $LMS = new LMS($DB, $AUTH); $LMS->ui_lang = $_ui_language; $LMS->lang = $_language; // set some template and layout variables $SMARTY->assignByRef('_LANG', $_LANG); $SMARTY->assignByRef('LANGDEFS', $LANGDEFS); $SMARTY->assignByRef('_ui_language', $LMS->ui_lang); $SMARTY->assignByRef('_language', $LMS->lang); $SMARTY->template_dir = getcwd(); $SMARTY->compile_dir = SMARTY_COMPILE_DIR; @(include 'locale/' . $LMS->ui_lang . '/strings.php'); $layout['lmsv'] = '1.11-git'; $SMARTY->assignByRef('layout', $layout); header('X-Powered-By: LMS/' . $layout['lmsv']); $_SERVER['REMOTE_ADDR'] = str_replace('::ffff:', '', $_SERVER['REMOTE_ADDR']); if ($customerid = $LMS->GetNodeOwner($LMS->GetNodeIDByIP($_SERVER['REMOTE_ADDR']))) {
} // Read configuration from database if ($cfg = $DB->GetAll('SELECT section, var, value FROM uiconfig WHERE disabled=0')) { foreach ($cfg as $row) { $CONFIG[$row['section']][$row['var']] = $row['value']; } } // Include required files (including sequence is important) require_once LIB_DIR . '/language.php'; include_once LIB_DIR . '/definitions.php'; require_once LIB_DIR . '/unstrip.php'; require_once LIB_DIR . '/common.php'; require_once LIB_DIR . '/LMS.class.php'; // Initialize Session, Auth and LMS classes $AUTH = NULL; $LMS = new LMS($DB, $AUTH, $CONFIG); $LMS->ui_lang = $_ui_language; $LMS->lang = $_language; if (empty($CONFIG['finances']['bgz_username']) || empty($CONFIG['finances']['bgz_firm']) || empty($CONFIG['finances']['bgz_firm'])) { die("Fatal error: BGZ credentials are not set!\n"); } define('USER_AGENT', "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); define('COOKIE_FILE', tempnam('/tmp', 'lms-bgz-cookies-')); function log_in_to_bgz($user, $firm, $pass) { $ch = curl_init(); if (!$ch) { return FALSE; } $params = array('user' => $user, 'firm' => $firm, 'pass' => $pass); curl_setopt_array($ch, array(CURLOPT_URL => "https://www.transferbgz.pl/logon/logon.pa", CURLOPT_HTTPGET => FALSE, CURLOPT_POST => TRUE, CURLOPT_POSTFIELDS => $params, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_COOKIEJAR => COOKIE_FILE, CURLOPT_COOKIEFILE => COOKIE_FILE, CURLOPT_SSLVERSION => 3, CURLOPT_SSL_VERIFYHOST => 2, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_USERAGENT => USER_AGENT));
$customergroups = " AND EXISTS (SELECT 1 FROM customergroups g, customerassignments ca \n\tWHERE c.id = ca.customerid \n\tAND g.id = ca.customergroupid \n\tAND (%groups)) "; $groupnames = ConfigHelper::getConfig('sendinvoices.customergroups'); $groupsql = ""; $groups = preg_split("/[[:blank:]]+/", $groupnames, -1, PREG_SPLIT_NO_EMPTY); foreach ($groups as $group) { if (!empty($groupsql)) { $groupsql .= " OR "; } $groupsql .= "UPPER(g.name) = UPPER('" . $group . "')"; } if (!empty($groupsql)) { $customergroups = preg_replace("/\\%groups/", $groupsql, $customergroups); } // Initialize Session, Auth and LMS classes $AUTH = NULL; $LMS = new LMS($DB, $AUTH, $SYSLOG); $LMS->ui_lang = $_ui_language; $LMS->lang = $_language; if (array_key_exists('test', $options)) { $test = TRUE; printf("WARNING! You are using test mode." . PHP_EOL); } $query = "SELECT d.id, d.number, d.cdate, d.name, d.customerid, n.template, m.email\n\t\tFROM documents d \n\t\tLEFT JOIN customers c ON c.id = d.customerid \n\t\tJOIN (SELECT customerid, " . $DB->GroupConcat('contact') . " AS email\n\t\t\tFROM customercontacts WHERE (type & ?) = ? GROUP BY customerid) m ON m.customerid = c.id\n\t\tLEFT JOIN numberplans n ON n.id = d.numberplanid \n\t\tWHERE c.deleted = 0 AND d.type IN (?, ?) AND c.invoicenotice = 1" . (!empty($invoiceid) ? " AND d.id = " . $invoiceid : " AND d.cdate >= {$daystart} AND d.cdate <= {$dayend}") . (!empty($groupnames) ? $customergroups : "") . " ORDER BY d.number"; $docs = $DB->GetAll($query, array(CONTACT_INVOICES | CONTACT_DISABLED, CONTACT_INVOICES, DOC_INVOICE, DOC_CNOTE)); if (!empty($docs)) { if ($filetype == 'pdf') { $pdf_type = ConfigHelper::getConfig('invoices.pdf_type', 'tcpdf'); $pdf_type = ucwords($pdf_type); $classname = 'LMS' . $pdf_type . 'Invoice'; } foreach ($docs as $doc) {
exit(0); } // Include required files (including sequence is important) require_once LIB_DIR . '/language.php'; require_once LIB_DIR . '/unstrip.php'; require_once LIB_DIR . '/definitions.php'; require_once LIB_DIR . '/common.php'; require_once LIB_DIR . '/checkip.php'; require_once LIB_DIR . '/LMS.class.php'; require_once LIB_DIR . '/Auth.class.php'; require_once LIB_DIR . '/accesstable.php'; require_once LIB_DIR . '/Session.class.php'; // Initialize Session, Auth and LMS classes $SESSION = new Session($DB, $CONFIG['phpui']['timeout']); $AUTH = new Auth($DB, $SESSION); $LMS = new LMS($DB, $AUTH, $CONFIG); $LMS->ui_lang = $_ui_language; $LMS->lang = $_language; // Set some template and layout variables $SMARTY->template_dir = SMARTY_TEMPLATES_DIR; $SMARTY->compile_dir = SMARTY_COMPILE_DIR; $SMARTY->debugging = isset($CONFIG['phpui']['smarty_debug']) ? chkconfig($CONFIG['phpui']['smarty_debug']) : FALSE; $layout['logname'] = $AUTH->logname; $layout['logid'] = $AUTH->id; $layout['lmsdbv'] = $DB->_version; $layout['smarty_version'] = SMARTY_VERSION; $layout['hostname'] = hostname(); $layout['lmsv'] = '1.11-git'; //$layout['lmsvr'] = $LMS->_revision.'/'.$AUTH->_revision; $layout['lmsvr'] = ''; $layout['dberrors'] =& $DB->errors;
$daystart = intval($currtime / 86400) * 86400 - $timeoffset; $dayend = $daystart + 86399; // prepare customergroups in sql query $customergroups = " AND EXISTS (SELECT 1 FROM customergroups g, customerassignments ca \n\tWHERE c.id = ca.customerid \n\tAND g.id = ca.customergroupid \n\tAND (%groups)) "; $groupnames = ConfigHelper::getConfig('sendinvoices.customergroups'); $groupsql = ""; $groups = preg_split("/[[:blank:]]+/", $groupnames, -1, PREG_SPLIT_NO_EMPTY); foreach ($groups as $group) { if (!empty($groupsql)) { $groupsql .= " OR "; } $groupsql .= "UPPER(g.name) = UPPER('" . $group . "')"; } if (!empty($groupsql)) { $customergroups = preg_replace("/\\%groups/", $groupsql, $customergroups); } // Initialize Session, Auth and LMS classes $SYSLOG = null; $AUTH = null; $LMS = new LMS($DB, $AUTH, $SYSLOG); $LMS->ui_lang = $_ui_language; $LMS->lang = $_language; $test = array_key_exists('test', $options); if ($test) { echo "WARNING! You are using test mode." . PHP_EOL; } $query = "SELECT d.id, d.number, d.cdate, d.name, d.customerid, d.type AS doctype, n.template, m.email\n\t\tFROM documents d \n\t\tLEFT JOIN customers c ON c.id = d.customerid \n\t\tJOIN (SELECT customerid, " . $DB->GroupConcat('contact') . " AS email\n\t\t\tFROM customercontacts WHERE (type & ?) = ? GROUP BY customerid) m ON m.customerid = c.id\n\t\tLEFT JOIN numberplans n ON n.id = d.numberplanid \n\t\tWHERE c.deleted = 0 AND d.type IN (?, ?, ?) AND c.invoicenotice = 1\n\t\t\tAND d.cdate >= {$daystart} AND d.cdate <= {$dayend}" . (!empty($groupnames) ? $customergroups : "") . " ORDER BY d.number"; $docs = $DB->GetAll($query, array(CONTACT_INVOICES | CONTACT_DISABLED, CONTACT_INVOICES, DOC_INVOICE, DOC_CNOTE, DOC_DNOTE)); if (!empty($docs)) { $LMS->SendInvoices($docs, 'backend', compact('SMARTY', 'invoice_filetype', 'dnote_filetype', 'invoice_filename', 'dnote_filename', 'debug_email', 'mail_body', 'mail_subject', 'currtime', 'sender_email', 'sender_name', 'extrafile', 'dsn_email', 'reply_email', 'mdn_email', 'notify_email', 'quiet', 'test', 'add_message', 'smtp_host', 'smtp_port', 'smtp_user', 'smtp_pass', 'smtp_auth')); }
function sms_notice() { global $g5, $bo_table, $member; //if ($member['mb_id'] == "gt") return false; //if ($member['mb_id'] == "bigmsg") return false; $sms = new LMS(); $page = $_SERVER['PHP_SELF']; $wr_subject = $_POST['wr_subject']; $w = $_POST['w']; $wr_id = $_POST['wr_id']; $mb_name = $member['mb_nick'] . "({$member['mb_id']})"; $mb_name .= $member['mb_hp'] ? "\n" . $member['mb_hp'] : ""; // 게시판 글쓰기/댓글 if ($bo_table != "") { // 게시판 제목 $sql = "select * from {$g5['board_table']} where bo_table='{$bo_table}'"; $row = sql_fetch($sql); $bo_subject = $row['bo_subject']; $wr_content = cut_str($_POST['wr_content'], 20) . "\n"; // 게시판 글쓰기(수정은 알림 안함) if ($w == "" && $page == "/bbs/write_update.php") { $message = "피잡스쿨:{$bo_subject}\n"; $message .= $wr_subject . "\n\n"; $message .= $mb_name; mylog("문자전송"); $sms->tran('피잡알림', $message, ADMIN_SMS_PHONE, ADMIN_SMS_PHONE, 'gt', "gt"); //if($member['mb_id']== "super") exit(); } else { if ($w == "c" && $wr_id == "") { $message = "피잡스쿨: {$bo_subject}(댓글)"; $message .= $wr_content; $message .= $mb_name; mylog($wr_content, "msg"); $sms->tran('피잡알림', $message, ADMIN_SMS_PHONE, ADMIN_SMS_PHONE, 'gt', "gt"); } } } // 1:1 문의 mylog($page, "page"); //echo "<br>w: ".$w; if ($page == "/bbs/qawrite_update.php") { $qa_id = $_POST['qa_id']; $qa_subject = cut_str($_POST['qa_subject'], 20); /* w: '' qa_id: '' // 질문 w: 'u' qa_id: 23 // 수정 w: 'r' qa_id: 23 // 추가질문 */ // 답변등록알림(질문자에게 알림) if ($w == "a" && $qa_id > 0) { $sql = "select * from {$g5['qa_content_table']} where qa_id='{$qa_id}'"; $row = sql_fetch($sql); $qa_hp = $row["qa_hp"]; if ($qa_hp != "") { $message = "피잡스쿨: 답변알림\n"; $message .= "\\'1:1문의\\' 에 질문하신 \"{$row['qa_subject']}\" 글에 답변이 등록되었습니다.\n\n"; $message .= "답변: \\'{$qa_subject}\\'"; mylog($message, "message"); $sms->tran('피잡알림', $message, $qa_hp, ADMIN_SMS_PHONE, 'gt', "gt"); } } else { if ($w != "u") { // w = 'a'(메일 답변받기) , w = 'r'(추가질문) $message = "피잡스쿨: 1:1문의\n"; $message .= $qa_subject . "\n"; $message .= $mb_name; mylog($message, "message"); $sms->tran('피잡알림', $message, ADMIN_SMS_PHONE, ADMIN_SMS_PHONE, 'gt', "gt"); } } } // 강좌관련 $it_id = (int) $_POST['it_id']; if ($it_id > 1) { $sql = "select * from {$g5['g5_shop_item_table']} where it_id='{$it_id}'"; $row = sql_fetch($sql); $it_name = $row['it_name']; // 강좌후기 if ($page == "/shop/itemuseformupdate.php" && $w != "u") { $subject = $_POST['is_subject']; $message = "피잡스쿨: {$it_name}(후기)\n"; $message .= $subject . "\n"; $message .= $mb_name; mylog($message, "message"); $sms->tran('피잡알림', $message, ADMIN_SMS_PHONE, ADMIN_SMS_PHONE, 'gt', "gt"); } // 강좌질문 if ($page == "/shop/itemqaformupdate.php" && $w != "u") { $subject = $_POST['iq_subject']; $message = "피잡스쿨: {$it_name}(질문)\n"; $message .= $subject . "\n"; $message .= $mb_name; mylog($message, "message"); $sms->tran('피잡알림', $message, ADMIN_SMS_PHONE, ADMIN_SMS_PHONE, 'gt', "gt"); } // 강좌질문 답변 등록알림(질문한 멤버에게 답변등록알림) if ($page == "/shop/itemqansformupdate.php" && $w == "u") { $iq_id = $_POST['iq_id']; $iq_answer = cut_str(strip_tags($_POST['iq_answer']), 20); $sql = "select * from {$g5['g5_shop_item_qa_table']} where it_id='{$it_id}' and iq_id='{$iq_id}'"; $row = sql_fetch($sql); $iq_hp = $row['iq_hp']; if ($iq_hp != "") { $message = "피잡스쿨: 답변알림\n"; $message .= "\\'{$it_name}\\' 강좌에 질문하신 \"{$row['iq_subject']}\" 글에 답변이 등록되었습니다.\n\n"; $message .= "답변: \\'{$iq_answer}\\'"; mylog($message, "message"); $sms->tran('피잡알림', $message, $iq_hp, ADMIN_SMS_PHONE, 'gt', "gt"); } } // 강좌댓글 if ($page == "/shop/itemcommentupdate.php" && $w == "c") { $subject = $_POST['is_subject']; $message = "피잡스쿨: {$it_name}(댓글)\n"; $message .= $subject . "\n"; $message .= $mb_name; mylog($message, "message"); $sms->tran('피잡알림', $message, ADMIN_SMS_PHONE, ADMIN_SMS_PHONE, 'gt', "gt"); } } }
} if (!empty($CONFIG['monit']['smtp_port'])) { $CONFIG['mail']['smtp_port'] = $CONFIG['monit']['smtp_port']; } if (!empty($CONFIG['monit']['smtp_user'])) { $CONFIG['mail']['smtp_username'] = $CONFIG['monit']['smtp_user']; } if (!empty($CONFIG['monit']['smtp_pass'])) { $CONFIG['mail']['smtp_password'] = $CONFIG['monit']['smtp_pass']; } if (!empty($CONFIG['monit']['smtp_auth'])) { $CONFIG['mail']['smtp_auth_type'] = $CONFIG['monit']['smtp_auth']; } $perlscript = get_conf('monit.test_script_dir', '/usr/local/sbin/lms-monitoring.pl'); $AUTH = NULL; $LMS = new LMS($DB, $AUTH, $CONFIG); $LMS->ui_lang = $_ui_language; $LMS->lang = $_language; $GG = new rfGG(GG_VER_77); $MT = new routeros_api(); $currenttime = time(); $lasttesttime = $DB->GetOne('SELECT MAX(cdate) FROM monittime LIMIT 1;'); if ($tmp = $DB->GetCol('SELECT nodeid FROM monitwarn WHERE backtime=?', array(0))) { $noping = implode(',', $tmp); } else { $noping = NULL; } if ($tmp = $DB->GetCol('SELECT ownid FROM monitwarn WHERE backtime = ?', array(0))) { $nopingown = implode(',', $tmp); } else { $nopingown = NULL;
$DB = DBInit($_DBTYPE, $_DBHOST, $_DBUSER, $_DBPASS, $_DBNAME); if (!$DB) { die("Fatal error: cannot connect to database!\n"); } if ($cfg = $DB->GetAll('SELECT section, var, value FROM uiconfig WHERE disabled=0')) { foreach ($cfg as $row) { $CONFIG[$row['section']][$row['var']] = $row['value']; } } require_once LIB_DIR . '/language.php'; include_once LIB_DIR . '/definitions.php'; require_once LIB_DIR . '/unstrip.php'; require_once LIB_DIR . '/common.php'; require_once LIB_DIR . '/LMS.class.php'; $AUTH = NULL; $LMS = new LMS($DB, $AUTH, $CONFIG); $LMS->ui_lang = $_ui_language; $LMS->lang = $_language; if (!$quite) { echo "\n-- START --\n\n"; } $filelist = array(); if (!$notmail) { $ih = @imap_open("{" . $cashimport['server'] . "}INBOX", $cashimport['username'], $cashimport['password']); if (!$ih) { die("Cannot connect to mail server!\n"); } $posts = imap_search($ih, $cashimport['use_seen_flag'] ? 'UNSEEN' : 'ALL'); if (!empty($posts)) { foreach ($posts as $postid) { $imap_structure = imap_fetchstructure($ih, $postid);
****************************************/ // Include required files (including sequence is important) require_once LIB_DIR . '/language.php'; include_once LIB_DIR . '/definitions.php'; require_once LIB_DIR . '/unstrip.php'; require_once LIB_DIR . '/common.php'; #require_once(LIB_DIR.'/LMS.class.php'); require_once LIB_DIR . '/SYSLOG.class.php'; if (ConfigHelper::checkConfig('phpui.logging') && class_exists('SYSLOG')) { $SYSLOG = new SYSLOG($DB); } else { $SYSLOG = null; } // Initialize Session, Auth and LMS classes $AUTH = NULL; $LMS = new LMS($DB, $AUTH, $SYSLOG); $LMS->ui_lang = $_ui_language; $LMS->lang = $_language; $month = intval(strftime("%m", time())); $year = strftime("%Y", time()); $yearday = strftime("01/%m", time()); $mday = strftime("%s", mktime(0, 0, 0, $month, 1, $year)); /* ******************************************************************** We should have all hard work here which is being done by our script! ********************************************************************/ function parse_data($id, $tresc, $customer) { global $LMS, $LANGDEFS; $tresc = preg_replace("/\\%dzis/", date("d/m/Y"), $tresc); $tresc = preg_replace("/\\%balance/", sprintf("%6.2f", $customer['balance']), $tresc); $tresc = preg_replace("/\\%bankaccount/", format_bankaccount($customer['bankaccount']), $tresc);
try { $DB = LMSDB::getInstance(); } catch (Exception $ex) { trigger_error($ex->getMessage(), E_USER_WARNING); // can't work without database die("Fatal error: cannot connect to database!" . PHP_EOL); } // Include required files (including sequence is important) require_once LIB_DIR . DIRECTORY_SEPARATOR . 'common.php'; require_once LIB_DIR . DIRECTORY_SEPARATOR . 'language.php'; include_once LIB_DIR . DIRECTORY_SEPARATOR . 'definitions.php'; require_once LIB_DIR . DIRECTORY_SEPARATOR . 'unstrip.php'; $SYSLOG = SYSLOG::getInstance(); // Initialize Session, Auth and LMS classes $AUTH = NULL; $LMS = new LMS($DB, $AUTH, $SYSLOG); $LMS->ui_lang = $_ui_language; $LMS->lang = $_language; $plugin_manager = new LMSPluginManager(); $LMS->setPluginManager($plugin_manager); if (array_key_exists('import-file', $options)) { $import_file = $options['import-file']; $import_filename = basename($import_file); } else { $import_file = 'php://stdin'; $import_filename = strftime('%Y%m%d%H%M%S.csv'); } @(include ConfigHelper::getConfig('phpui.import_config', 'cashimportcfg.php')); if (!isset($patterns) || !is_array($patterns)) { die(trans("Configuration error. Patterns array not found!") . PHP_EOL); }
// 문의글 등록시 관리자에게 전송 if (($w == '' || $w == 'r') && trim($qaconfig['qa_admin_hp'])) { $sms_content = $config['cf_title'] . ' ' . $qaconfig['qa_title'] . '에 문의글이 등록되었습니다.'; $send_number = preg_replace('/[^0-9]/', '', $qaconfig['qa_send_number']); $recv_number = preg_replace('/[^0-9]/', '', $qaconfig['qa_admin_hp']); if ($recv_number) { $strDest = array(); $strDest[] = $recv_number; $strCallBack = $send_number; $strCaller = iconv_euckr(trim($config['cf_title'])); $strSubject = ''; $strURL = ''; $strData = iconv_euckr($sms_content); $strDate = ''; $nCount = count($strDest); $SMS = new LMS(); $SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $port_setting); $res = $SMS->Add($strDest, $strCallBack, $strCaller, $strSubject, $strURL, $strData, $strDate, $nCount); if ($res) { $SMS->Send(); } $SMS->Init(); // 보관하고 있던 결과값을 지웁니다. } } } } else { include_once G5_LIB_PATH . '/icode.sms.lib.php'; // 답변글은 질문 등록자에게 전송 if ($w == 'a' && $write['qa_sms_recv'] && trim($write['qa_hp'])) { $sms_content = $config['cf_title'] . ' ' . $qaconfig['qa_title'] . '에 답변이 등록되었습니다.';
require_once LIB_DIR . '/checkip.php'; require_once LIB_DIR . '/LMS.class.php'; require_once LIB_DIR . '/Auth.class.php'; require_once LIB_DIR . '/Profiles.class.php'; require_once LIB_DIR . '/accesstable.php'; require_once LIB_DIR . '/Session.class.php'; require_once LIB_DIR . '/GaduGadu.class.php'; require_once LIB_DIR . '/LMS.Hiperus.class.php'; require_once LIB_DIR . '/RADIUS.class.php'; require_once LIB_DIR . '/Routeros_api.class.php'; require_once LIB_DIR . '/LMS.PLUG.class.php'; // Initialize Session, Auth and LMS classes $SESSION = new Session($DB, $CONFIG['phpui']['timeout']); $AUTH = new Auth($DB, $SESSION); $PROFILE = new Profile($DB, $AUTH); $LMS = new LMS($DB, $AUTH, $CONFIG); $LMS->ui_lang = $_ui_language; $LMS->lang = $_language; $GG = new rfGG(GG_VER_77); $RAD = new radius($DB, $LMS); $MT = new routeros_api(); require_once LIB_DIR . '/smarty_addons.php'; $layout['plugin'] = NULL; $layout['logname'] = $AUTH->logname; $layout['logid'] = $AUTH->id; $layout['lmsdbv'] = $DB->_version; $layout['smarty_version'] = SMARTY_VERSION; $layout['hostname'] = hostname(); $layout['lmsv'] = 'iNET LMS'; $layout['lmsvr'] = $LMS->_revision . '/' . $AUTH->_revision; $layout['lmsvr'] = LMSV;
trigger_error($ex->getMessage(), E_USER_WARNING); // can't working without database die("Fatal error: cannot connect to database!" . PHP_EOL); } // Initialize templates engine $SMARTY = new Smarty(); $SMARTY->addPluginsDir(LIB_DIR . DIRECTORY_SEPARATOR . 'SmartyPlugins'); // Include required files (including sequence is important) require_once LIB_DIR . DIRECTORY_SEPARATOR . 'language.php'; require_once LIB_DIR . DIRECTORY_SEPARATOR . 'common.php'; require_once LIB_DIR . DIRECTORY_SEPARATOR . 'definitions.php'; // Initialize LMS class $SESSION = new Session($DB, ConfigHelper::getConfig('phpui.timeout')); $AUTH = new Auth($DB, $SESSION, $SYSLOG); $SYSLOG = null; $LMS = new LMS($DB, $AUTH, $SYSLOG); $LMS->ui_lang = $_ui_language; $LMS->lang = $_language; // set some template and layout variables $SMARTY->assignByRef('_LANG', $_LANG); $SMARTY->assignByRef('LANGDEFS', $LANGDEFS); $SMARTY->assignByRef('_ui_language', $LMS->ui_lang); $SMARTY->assignByRef('_language', $LMS->lang); $SMARTY->template_dir = getcwd(); $SMARTY->compile_dir = SMARTY_COMPILE_DIR; include 'lang.php'; $SMARTY->assignByRef('layout', $layout); if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $forwarded_ip = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); $nodeid = $LMS->GetNodeIDByIP($forwarded_ip['0']); } else {
$_DBUSER = $CONFIG['database']['user']; $_DBPASS = $CONFIG['database']['password']; $_DBNAME = $CONFIG['database']['database']; require LIB_DIR . '/LMSDB.php'; $DB = DBInit($_DBTYPE, $_DBHOST, $_DBUSER, $_DBPASS, $_DBNAME); if (!$DB) { die("Fatal error: cannot connect to database!\n"); } if ($cfg = $DB->GetAll('SELECT section, var, value FROM uiconfig WHERE disabled=0')) { foreach ($cfg as $row) { $CONFIG[$row['section']][$row['var']] = $row['value']; } } require LIB_DIR . '/LMS.class.php'; $AUTH = NULL; $LMS = new LMS($DB, $AUTH, $CONFIG); $LMS->ui_lang = $_ui_language; $LMS->lang = $_language; require LIB_DIR . '/LMS.Hiperus.class.php'; if (!array_key_exists('leftmonth', $options)) { $leftmonth = get_conf('hiperus_c5.leftmonth', 1); } else { $leftmonth = $options['leftmonth']; } if (empty($leftmonth)) { $leftmonth = 1; } $userlist = $DB->GetAll('SELECT hc.id AS id, hc.ext_billing_id AS id_ext, ' . $DB->Year('hc.create_date') . ' AS create_year, ' . $DB->Month('hc.create_date') . ' AS create_month, ' . $DB->Day('hc.create_date') . ' AS create_day ' . ' FROM hv_customers hc JOIN hv_assign ha ON (ha.customerid = hc.id) WHERE ha.keytype = ? AND ha.keyvalue = ? ', array('issue_invoice', '2')); $count_u = sizeof($userlist);