Exemplo n.º 1
0
function check_conf($name)
{
    global $CONFIG;
    list($section, $name) = explode('.', $name, 2);
    if (empty($name)) {
        return false;
    }
    if ($section == 'privileges' && !empty($CONFIG['privileges']['superuser'])) {
        return preg_match('/^hide/', $name) ? false : true;
    }
    if (!array_key_exists($section, $CONFIG)) {
        return false;
    }
    if (!array_key_exists($name, $CONFIG[$section])) {
        return false;
    }
    return chkconfig($CONFIG[$section][$name]);
}
Exemplo n.º 2
0
if (isset($_GET['o'])) {
    $o = $_GET['o'];
} else {
    $SESSION->restore('dnlo', $o);
}
$SESSION->save('dnlo', $o);
if (isset($_POST['cat'])) {
    $c = $_POST['cat'];
} else {
    $SESSION->restore('dnlc', $c);
}
$SESSION->save('dnlc', $c);
if (isset($_POST['search'])) {
    $h = isset($_POST['hideclosed']) ? true : false;
} elseif (($h = $SESSION->get('dnlh')) === NULL) {
    $h = isset($CONFIG['notes']['hide_closed']) ? chkconfig($CONFIG['notes']['hide_closed']) : false;
}
$SESSION->save('dnlh', $h);
if (isset($_POST['group'])) {
    $g = $_POST['group'];
    $ge = isset($_POST['groupexclude']) ? $_POST['groupexclude'] : NULL;
} else {
    $SESSION->restore('dnlg', $g);
    $SESSION->restore('dnlge', $ge);
}
$SESSION->save('dnlg', $g);
$SESSION->save('dnlge', $ge);
if ($c == 'cdate' && $s && preg_match('/^[0-9]{4}\\/[0-9]{2}\\/[0-9]{2}$/', $s)) {
    list($year, $month, $day) = explode('/', $s);
    $s = mktime(0, 0, 0, $month, $day, $year);
} elseif ($c == 'month' && $s && preg_match('/^[0-9]{4}\\/[0-9]{2}$/', $s)) {
Exemplo n.º 3
0
Arquivo: menu.php Projeto: pcela/lms
 */
$menu = array('admin' => array('name' => trans('Administration'), 'img' => 'users.gif', 'link' => '?m=welcome', 'tip' => trans('System information and management'), 'accesskey' => 'i', 'prio' => 10, 'index' => MODULES_ADMIN, 'submenu' => array(array('name' => trans('Info'), 'link' => '?m=' . $CONFIG['phpui']['default_module'], 'tip' => trans('Basic system information'), 'prio' => 10), array('name' => trans('Users'), 'link' => '?m=userlist', 'tip' => trans('User list'), 'prio' => 20), array('name' => trans('New User'), 'link' => '?m=useradd', 'tip' => trans('New User'), 'prio' => 30), array('name' => trans('Backups'), 'link' => '?m=dblist', 'tip' => trans('Allows you to manage database backups'), 'prio' => 40), array('name' => trans('Syslog'), 'link' => '?m=syslog&sl_df=' . date('Y/m/d', strtotime("-2 week", time())), 'prio' => 50), array('name' => 'Changelog', 'link' => '?m=changelog', 'tip' => '', 'prio' => 60), array('name' => 'Sponsorzy', 'link' => '?m=sponsorzy', 'tip' => 'Lista firm które przyczyniły się do rozwoju iNET LMS', 'prio' => 70), array('name' => trans('Copyrights'), 'link' => '?m=copyrights', 'tip' => trans('Copyrights, authors, etc.'), 'prio' => 200), array('name' => 'Rejestracja', 'link' => '?m=register', 'tip' => 'Informacje o rejestracji instalacji iNET LMS', 'prio' => 201))), 'customers' => array('name' => trans('Customers'), 'img' => 'customer.gif', 'link' => '?m=customerlist', 'tip' => trans('Customers Management'), 'accesskey' => 'u', 'prio' => 20, 'index' => MODULES_CUSTOMERS, 'submenu' => array(array('name' => trans('List'), 'link' => '?m=customerlist', 'tip' => trans('List of Customers'), 'prio' => 10), array('name' => trans('New Customer'), 'link' => '?m=customeradd', 'tip' => trans('Allows you to add new customer'), 'prio' => 20), array('name' => trans('Search'), 'link' => '?m=customersearch', 'tip' => trans('Allows you to find customer'), 'prio' => 30), array('name' => 'Call Center', 'link' => '?m=infocenterlist&cid=', 'tip' => '', 'prio' => 52), array('name' => trans('Notices'), 'link' => '?m=customerwarn', 'tip' => trans('Allows you to send notices to customers'), 'prio' => 60), array('name' => trans('Reports'), 'link' => '?m=customerprint', 'tip' => trans('Lists and reports printing'), 'prio' => 70))), 'nodes' => array('name' => trans('Nodes'), 'img' => 'node.gif', 'link' => '?m=nodelist', 'tip' => trans('Nodes Management'), 'accesskey' => 'k', 'prio' => 30, 'index' => MODULES_NODES, 'submenu' => array(array('name' => trans('List'), 'link' => '?m=nodelist', 'tip' => trans('List of nodes'), 'prio' => 10), array('name' => trans('New Node'), 'link' => '?m=nodeadd', 'tip' => trans('Allows you to add new node'), 'prio' => 20), array('name' => trans('Search'), 'link' => '?m=nodesearch', 'tip' => trans('Allows you to search node'), 'prio' => 30), array('name' => trans('Notices'), 'link' => '?m=nodewarn', 'tip' => trans('Allows you to send notices to customers'), 'prio' => 60), array('name' => 'Historia zmian IP', 'link' => '?m=iphistory', 'tip' => '', 'prio' => 65), array('name' => trans('Reports'), 'link' => '?m=nodeprint', 'tip' => trans('Lists and reports printing'), 'prio' => 70))), 'VoIP' => array('name' => trans('VoIP'), 'img' => 'voip.gif', 'tip' => trans('VoIP Management'), 'accesskey' => 'v', 'prio' => 40, 'index' => MODULES_VOIP, 'submenu' => array(array('name' => trans('List'), 'link' => '?m=voipaccountlist', 'tip' => trans('List of Accounts'), 'prio' => 10), array('name' => trans('New Account'), 'link' => '?m=voipaccountadd', 'tip' => trans('Allows you to add the new VoIP account'), 'prio' => 20), array('name' => trans('Search'), 'link' => '?m=voipaccountsearch', 'tip' => trans('Allows you to search VoIP account'), 'prio' => 30))), 'VoIPC5' => array('name' => 'VoIP Hiperus C5', 'img' => 'voip.gif', 'link' => '', 'tip' => 'Telefonia Internetowa Hiperus', 'accesskey' => '', 'prio' => 50, 'index' => MODULES_VOIPC5, 'submenu' => array(array('name' => 'Lista kont', 'link' => '?m=hv_accountlist', 'tip' => 'Lista Klientów', 'prio' => 10), array('name' => 'Nowe konto', 'link' => '?m=hv_accountadd', 'tip' => 'Tworzenie nowego konta VoIP w  Hiperus C5', 'prio' => 30), array('name' => 'Numery PSTN', 'link' => '?m=hv_pstnrangelist', 'tip' => 'Lista pul numerów PSTN', 'prio' => 50), array('name' => 'Lista Terminali', 'link' => '?m=hv_terminallist', 'tip' => 'Lista Terminali', 'prio' => 60), array('name' => 'Konfiguracja', 'link' => '?m=configlist&page=1&s=hiperus_c5&n=', 'tip' => '', 'prio' => 70))), 'netdevices' => array('name' => 'Osprzęt sieciowy', 'img' => 'netdev.gif', 'link' => '?m=netdevlist', 'tip' => trans('Network Devices Management'), 'accesskey' => 'o', 'prio' => 80, 'index' => MODULES_NETDEVICES, 'submenu' => array(array('name' => 'Interfejsy sieciowe', 'link' => '?m=netdevlist', 'tip' => trans('Network devices list'), 'prio' => 10), array('name' => 'Nowy interfejs', 'link' => '?m=netdevadd', 'tip' => trans('Add new device'), 'prio' => 20), array('name' => 'Węzły', 'link' => '?m=networknodelist', 'tip' => 'Węzły sieciowe', 'prio' => 30), array('name' => 'Nowy Węzeł', 'link' => '?m=networknodeadd', 'tip' => 'Dodaj nowy węzeł sieciowy', 'prio' => 40), array('name' => 'NAS', 'link' => '?m=naslist', 'tip' => 'Lista urządzeń NAS', 'prio' => 45), array('name' => trans('Hosts'), 'link' => '?m=hostlist', 'tip' => trans('List of Hosts'), 'prio' => 50), array('name' => 'Linie telekomunikacyjne', 'link' => '?m=teleline', 'tip' => 'Lista linii telekomunikacyjnych', 'prio' => 60), array('name' => trans('Map'), 'link' => '?m=netdevmap', 'tip' => trans('Network map display'), 'prio' => 80), array('name' => trans('Search'), 'link' => '?m=netdevsearch', 'tip' => trans('Allows you to search device'), 'prio' => 90))), 'monitoring' => array('name' => 'Monitoring', 'img' => 'Radar.icon.gif', 'link' => '', 'tip' => '', 'accesskey' => '', 'prio' => 100, 'index' => MODULES_MONITORING, 'submenu' => array(array('name' => 'Urządzenia sieciowe', 'link' => '?m=monitnodelist&td=netdev', 'tip' => 'Lista monitorowanych urządzeń sieciowych', 'prio' => '10'), array('name' => 'Urządzenia klientów', 'link' => '?m=monitnodelist&td=nodes', 'tip' => 'Lista monitorowanych komputerów klientów', 'prio' => '20'), array('name' => 'Urządzenia własne', 'link' => '?m=monitownlist', 'tip' => 'Lista monitorowanych własnych urządzeń', 'prio' => '30'), array('name' => 'Konfiguracja', 'link' => '?m=configlist&page=1&s=monit&n=', 'tip' => 'Podstawowa konfiguracja monitoringu', 'prio' => '50'))), 'networks' => array('name' => trans('IP Networks'), 'img' => 'network.gif', 'link' => '?m=netlist', 'tip' => trans('IP Address Pools Management'), 'accesskey' => 't', 'prio' => 110, 'index' => MODULES_NETWORKS, 'submenu' => array(array('name' => trans('List'), 'link' => '?m=netlist', 'tip' => trans('List of IP pools'), 'prio' => 10), array('name' => trans('New Network'), 'link' => '?m=netadd', 'tip' => trans('Add new address pool'), 'prio' => 20))), 'contractors' => array('name' => trans('Contractors'), 'img' => 'customer.gif', 'link' => '?m=customerlist', 'tip' => trans('Contractors Management'), 'accesskey' => 'u', 'prio' => 120, 'index' => MODULES_CONTRACTORS, 'submenu' => array(array('name' => trans('List'), 'link' => '?m=contractorlist', 'tip' => trans('List of Contractors'), 'prio' => 10), array('name' => trans('New Contractor'), 'link' => '?m=contractoradd', 'tip' => trans('Allows you to add new contractor'), 'prio' => 20))), 'tariffs' => array('name' => 'Taryfy', 'img' => 'tariffs.png', 'link' => '?m=tarifflist', 'tip' => 'Zarządzanie taryfami', 'accesskey' => 'f', 'prio' => 130, 'index' => MODULES_TARIFFS, 'submenu' => array(array('name' => trans('Subscriptions List'), 'link' => '?m=tarifflist', 'tip' => trans('List of subscription fees'), 'prio' => 10), array('name' => trans('New Subscription'), 'link' => '?m=tariffadd', 'tip' => trans('Add new subscription fee'), 'prio' => 20), array('name' => trans('Promotions'), 'link' => '?m=promotionlist', 'tip' => trans('List of promotions'), 'prio' => 90))), 'finances' => array('name' => trans('Finances'), 'img' => 'money.gif', 'link' => '?m=tarifflist', 'tip' => 'Zarządzanie finansami sieci', 'accesskey' => 'f', 'prio' => 140, 'index' => MODULES_FINANCES, 'submenu' => array(array('name' => trans('Payments List'), 'link' => '?m=paymentlist', 'tip' => trans('List of standing payments'), 'prio' => 30), array('name' => trans('New Payment'), 'link' => '?m=paymentadd', 'tip' => trans('Add new standing payment'), 'prio' => 40), array('name' => trans('Balance Sheet'), 'link' => '?m=balancelist', 'tip' => trans('Table of financial operations'), 'prio' => 50), array('name' => 'Historia importów', 'link' => '?m=cashimportlist', 'tip' => 'Hisoria zaimportowanych płatności', 'prio' => 55), array('name' => trans('New Balance'), 'link' => '?m=balancenew', 'tip' => trans('Add new financial operation'), 'prio' => 60), array('name' => trans('Invoices List'), 'link' => '?m=invoicelist', 'tip' => trans('List of invoices'), 'prio' => 70), array('name' => trans('New Invoice'), 'link' => '?m=invoicenew&action=init', 'tip' => trans('Generate invoice'), 'prio' => 75), array('name' => trans('New Pro Forma Invoice'), 'link' => '?m=invoicenew&action=init&proforma', 'tip' => trans('Generate invoice'), 'prio' => 76), array('name' => trans('Debit Notes List'), 'link' => '?m=notelist', 'tip' => trans('List of debit notes'), 'prio' => 80), array('name' => trans('New Debit Note'), 'link' => '?m=noteadd&action=init', 'tip' => trans('Generate debit note'), 'prio' => 85), array('name' => trans('Cash Registry'), 'link' => '?m=cashreglist', 'tip' => trans('List of cash registries'), 'prio' => 90), array('name' => trans('New Cash Receipt'), 'link' => '?m=receiptadd&action=init', 'tip' => trans('Generate cash receipt'), 'prio' => 100), array('name' => trans('Import'), 'link' => '?m=cashimport', 'tip' => trans('Import cash operations'), 'prio' => 110), array('name' => trans('Export'), 'link' => '?m=export', 'tip' => trans('Financial data export to external systems'), 'prio' => 120), array('name' => trans('Reports'), 'link' => '?m=print', 'tip' => trans('Lists and reports printing'), 'prio' => 130))), 'documents' => array('name' => trans('Documents'), 'img' => 'docum.gif', 'link' => '?m=documentlist', 'tip' => trans('Documents Management'), 'accesskey' => '', 'prio' => 150, 'index' => MODULES_DOCUMENTS, 'submenu' => array(array('name' => trans('List'), 'link' => '?m=documentlist&init=1', 'tip' => trans('List of documents'), 'prio' => 10), array('name' => trans('New Document'), 'link' => '?m=documentadd', 'tip' => trans('Allows you to add new document'), 'prio' => 20), array('name' => trans('Generator'), 'link' => '?m=documentgen', 'tip' => trans('Documents mass creation'), 'prio' => 40), array('name' => trans('Access rights'), 'link' => '?m=documenttypes', 'tip' => trans('Users access rights to documents by type'), 'prio' => 50))), 'hosting' => array('name' => trans('Hosting'), 'img' => 'account.gif', 'link' => '?m=accountlist', 'tip' => trans('Hosting Services Management'), 'accesskey' => 'a', 'prio' => 160, 'index' => MODULES_HOSTING, 'submenu' => array(array('name' => trans('Accounts'), 'link' => '?m=accountlist', 'tip' => trans('List of accounts'), 'prio' => 10), array('name' => trans('New Account'), 'link' => '?m=accountadd', 'tip' => trans('Add new account'), 'prio' => 20), array('name' => trans('Aliases'), 'link' => '?m=aliaslist', 'tip' => trans('List of aliases'), 'prio' => 30), array('name' => trans('New Alias'), 'link' => '?m=aliasadd', 'tip' => trans('Add new alias'), 'prio' => 40), array('name' => trans('Domains'), 'link' => '?m=domainlist', 'tip' => trans('List of domains'), 'prio' => 50), array('name' => trans('New Domain'), 'link' => '?m=domainadd', 'tip' => trans('Add new domain'), 'prio' => 60), array('name' => trans('Search'), 'link' => '?m=accountsearch', 'tip' => trans('Allows you to search for account, alias, domain'), 'prio' => 70))), 'messages' => array('name' => trans('Messages'), 'img' => 'mailsms.gif', 'link' => '?m=messageadd', 'tip' => trans('Customers Messaging'), 'accesskey' => 'm', 'prio' => 180, 'index' => MODULES_MESSAGES, 'submenu' => array(array('name' => trans('List'), 'link' => '?m=messagelist', 'tip' => trans('List of sent messages'), 'prio' => 10), array('name' => trans('New Message'), 'link' => '?m=messageadd', 'tip' => trans('Allows you to send messages to customers'), 'prio' => 20), array('name' => trans('Templates'), 'link' => '?m=messagetemplate', 'tip' => trans('Messages managing templates'), 'prio' => 21))), 'reload' => array('name' => trans('Reload'), 'img' => 'reload.gif', 'link' => '?m=reload', 'tip' => trans(''), 'accesskey' => 'r', 'prio' => 190, 'index' => MODULES_RELOAD), 'stats' => array('name' => trans('Stats'), 'img' => 'traffic.gif', 'link' => '?m=traffic', 'tip' => trans('Statistics of Internet Link Usage'), 'accesskey' => 'x', 'prio' => 200, 'index' => MODULES_STATS, 'submenu' => array(array('name' => trans('Filter'), 'link' => '?m=traffic', 'tip' => trans('User-defined stats'), 'prio' => 10), array('name' => trans('Last Hour'), 'link' => '?m=traffic&bar=hour', 'tip' => trans('Last hour stats for all networks'), 'prio' => 20), array('name' => trans('Last Day'), 'link' => '?m=traffic&bar=day', 'tip' => trans('Last day stats for all networks'), 'prio' => 30), array('name' => trans('Last 30 Days'), 'link' => '?m=traffic&bar=month', 'tip' => trans('Last month stats for all networks'), 'prio' => 40), array('name' => trans('Last Year'), 'link' => '?m=traffic&bar=year', 'tip' => trans('Last year stats for all networks'), 'prio' => 50), array('name' => trans('Compacting'), 'link' => '?m=trafficdbcompact', 'tip' => trans('Compacting Database'), 'prio' => 60), array('name' => trans('Reports'), 'link' => '?m=trafficprint', 'tip' => trans('Lists and reports printing'), 'prio' => 70))), 'helpdesk' => array('name' => trans('Helpdesk'), 'img' => 'ticket.gif', 'link' => '?m=rtqueuelist', 'tip' => trans('Requests Tracking'), 'accesskey' => 'h', 'prio' => 210, 'index' => MODULES_HELPDESK, 'submenu' => array(array('name' => trans('Queues List'), 'link' => '?m=rtqueuelist', 'tip' => trans('List of queues'), 'prio' => 10), array('name' => trans('New Queue'), 'link' => '?m=rtqueueadd', 'tip' => trans('Add new queue'), 'prio' => 20), array('name' => trans('Categories List'), 'link' => '?m=rtcategorylist', 'tip' => trans('List of categories'), 'prio' => 30), array('name' => trans('New Category'), 'link' => '?m=rtcategoryadd', 'tip' => trans('Add new category'), 'prio' => 40), array('name' => trans('Search'), 'link' => '?m=rtsearch', 'tip' => trans('Tickets searching'), 'prio' => 50), array('name' => trans('New Ticket'), 'link' => '?m=rtticketadd', 'tip' => trans('Add new ticket'), 'prio' => 60), array('name' => trans('Reports'), 'link' => '?m=rtprint', 'tip' => trans('Lists and reports printing'), 'prio' => 70))), 'timetable' => array('name' => trans('Timetable'), 'img' => 'calendar.gif', 'link' => '?m=eventlist', 'tip' => trans('Events Tracking'), 'accesskey' => 'v', 'prio' => 220, 'index' => MODULES_TIMETABLE, 'submenu' => array(array('name' => trans('Timetable'), 'link' => '?m=eventlist', 'tip' => trans('Timetable'), 'prio' => 10), array('name' => trans('New Event'), 'link' => '?m=eventadd', 'tip' => trans('New Event Addition'), 'prio' => 20), array('name' => trans('Search'), 'link' => '?m=eventsearch', 'tip' => trans('Searching of Events in Timetable'), 'prio' => 30))), 'raporty' => array('name' => 'Raporty', 'img' => 'reports.png', 'link' => '', 'tip' => '', 'prio' => 230, 'index' => MODULES_RAPORTY, 'submenu' => array(array('name' => 'Raporty SIIS', 'link' => '?m=uke_siis', 'tip' => '', 'prio' => 10), array('name' => 'Nowy raport SIIS', 'link' => '?m=uke_siis_add', 'tip' => 'Utwórz nowy raport SIIS', 'prio' => 20))), 'slownik' => array('name' => 'Słowniki', 'img' => 'dictionary.png', 'link' => '', 'prio' => 240, 'index' => MODULES_SLOWNIK, 'submenu' => array(array('name' => 'Grupy klientów', 'link' => '?m=customergrouplist', 'tip' => trans('List of Customers Groups'), 'prio' => 10), array('name' => 'Grupy kontrahentów', 'link' => '?m=contractorgrouplist', 'tip' => trans('List of Contractors Groups'), 'prio' => 15), array('name' => 'Grupy komputerów', 'link' => '?m=nodegrouplist', 'tip' => trans('List of Nodes Groups'), 'prio' => 20), array('name' => 'Grupy interfejsów', 'link' => '?m=netdevgrouplist', 'tip' => 'Lista grup interfejsów sieciowych', 'prio' => 21), array('name' => 'Grupy węzłów', 'link' => '?m=networknodegrouplist', 'tip' => 'Lista grup węzłów', 'prio' => 22), array('name' => 'Pochodzenie klientów', 'link' => '?m=customeroriginlist', 'tip' => 'Źródła pochodzenia klientów', 'prio' => 30), array('name' => 'Rodzaje urządzeń', 'link' => '?m=dictionarydevices', 'tip' => 'Rodzaje urządzeń sieciowych oraz instalowanych u klienta', 'prio' => 40), array('name' => 'Producenci, modele', 'link' => '?m=netdevicemodels', 'tip' => 'Producenci i modele urządzeń sieciowych', 'prio' => 50), array('name' => 'Powody korekt faktur', 'link' => '?m=dictionarycnote', 'tip' => 'Rodzaje powodów dla których jest dokonan korekta faktury', 'prio' => 60), array('name' => trans('Projekty'), 'link' => '?m=projectlist', 'tip' => trans('Lista projektów inwestycyjnych'), 'prio' => 70))), 'config' => array('name' => trans('Configuration'), 'img' => 'settings.gif', 'link' => '?m=configlist', 'tip' => trans('System Configuration'), 'accesskey' => 'o', 'prio' => 250, 'index' => MODULES_CONFIG, 'submenu' => array(array('name' => trans('User Interface'), 'link' => '?m=configlist', 'tip' => trans('Allows you to configure UI'), 'prio' => 10), array('name' => 'Formularze', 'link' => '?m=configform', 'tip' => 'Konfigurowanie wyświetlanych i wymaganych pól w formularzach', 'prio' => 15), array('name' => trans('Tax Rates'), 'link' => '?m=taxratelist', 'tip' => trans('Tax Rates Definitions'), 'prio' => 20), array('name' => trans('Numbering Plans'), 'link' => '?m=numberplanlist', 'tip' => trans('Numbering Plans Definitions'), 'prio' => 30), array('name' => trans('States'), 'link' => '?m=statelist', 'tip' => trans('Country States Definitions'), 'prio' => 40), array('name' => trans('Divisions'), 'link' => '?m=divisionlist', 'tip' => trans('Company Divisions Definitions'), 'prio' => 50), array('name' => trans('Daemon'), 'link' => '?m=daemoninstancelist', 'tip' => trans('Daemon(s) Configuration'), 'prio' => 70), array('name' => trans('Import Sources'), 'link' => '?m=cashsourcelist', 'tip' => trans('List of Cash Import Sources'), 'prio' => 80), array('name' => 'Wtyczki', 'link' => '?m=plugin', 'tip' => 'Konfiguracja wtyczek', 'prio' => 90))), 'password' => array('name' => trans('Password'), 'img' => 'pass.gif', 'link' => '?m=chpasswd', 'tip' => trans('Allows you to change your password'), 'accesskey' => 'p', 'prio' => 260, 'index' => MODULES_PASSWORD));
if (get_conf('phpui.radius')) {
    $menu['radius'] = array('name' => 'Radius', 'img' => 'radius.gif', 'link' => '', 'tip' => '', 'accesskey' => '', 'prio' => 90, 'index' => MODULES_RADIUS, 'submenu' => array(array('name' => 'sesje otwarte', 'link' => '?m=rad_radacct&status=open&page=1', 'tip' => '', 'prio' => 10), array('name' => 'sesje zakończone', 'link' => '?m=rad_radacct&status=completed&page=1&startdatefrom=' . date('Y/m/d', strtotime("-3 day", time())), 'tip' => '', 'prio' => 10), array('name' => 'konfiguracja', 'link' => '?m=configlist&page=1&s=radius&n=', 'tip' => '', 'prio' => 100)));
}
if (get_conf('voip.enabled', '0')) {
    $menu['telefonia'] = array('name' => 'VoIP Nettelekom', 'img' => 'voip.gif', 'link' => '?m=configlist', 'tip' => 'Telefonia internetowa', 'accesskey' => 'v', 'prio' => 60, 'index' => MODULES_VOIPNT, 'submenu' => array(array('name' => 'Lista abonamentów', 'link' => '?m=v_tarifflist', 'prio' => '10'), array('name' => 'Nowy abonament', 'link' => '?m=v_tariffadd', 'tip' => 'Nowy abonament', 'prio' => '20'), array('name' => 'Lista cenników minut', 'link' => '?m=v_cennlist', 'prio' => '30'), array('name' => 'Nowy cennik minut', 'link' => '?m=v_cennadd', 'tip' => 'Nowy cennik minut', 'prio' => '40'), array('name' => 'Lista grup cennikowych', 'link' => '?m=v_trunkgrplist', 'prio' => '50'), array('name' => 'Nowa grupa cennikowa', 'link' => '?m=v_trunkgrpadd', 'tip' => 'Nowa grupa cennikowa', 'prio' => '60'), array('name' => 'Stan centrali', 'link' => '?m=v_state', 'tip' => 'Stan centrali', 'prio' => '110'), array('name' => 'CDR', 'link' => '?m=v_cdr', 'tip' => 'Lista połączeń wychodzących', 'prio' => '120'), array('name' => 'Lista stref numeracyjnych', 'link' => '?m=v_netlist', 'tip' => 'Numery', 'prio' => '140'), array('name' => 'Nowa strefa numeracyjna', 'link' => '?m=v_netadd', 'tip' => 'Numery', 'prio' => '150'), array('name' => 'Wzorce numerów', 'link' => '?m=v_numbers', 'tip' => 'Numery', 'prio' => '160'), array('name' => 'Przelicz salda klientów', 'link' => '?m=v_checkbalance', 'tip' => 'Salda', 'prio' => '190'), array('name' => 'Użycie dysku', 'link' => '?m=v_diskusage', 'tip' => '', 'prio' => '200'), array('name' => 'Sprawozdanie UKE', 'link' => '?m=v_uke', 'tip' => '', 'prio' => '210')));
}
if (get_conf('registryequipment.enabled')) {
    $menu['registryequipment'] = array('name' => 'Ew. Pojazdów', 'img' => 'car.png', 'link' => '', 'tip' => '', 'prio' => 170, 'index' => MODULES_REGISTRYEQUIPMENT, 'submenu' => array(array('name' => 'Lista pojazdów', 'link' => '?m=re_carlist', 'prio' => 1), array('name' => 'Nowy pojazd', 'link' => '?m=re_caradd', 'prio' => 2), array('name' => 'Rodzaje pojazdów', 'link' => '?m=re_dictionarycartype', 'prio' => 50), array('name' => 'Rodzaje zdarzeń', 'link' => '?m=re_dictionaryevent', 'prio' => 60)));
}
if (get_conf('jambox.enabled', 0)) {
    $menu['TV'] = array('name' => 'TV Jambox', 'img' => 'tv_icon.png', 'tip' => 'TV Management', 'accesskey' => 't', 'prio' => 70, 'index' => MODULES_JAMBOX, 'submenu' => array(array('name' => trans('Lista klientów'), 'link' => '?m=tvcustomers', 'tip' => trans('Lista klientów'), 'prio' => 10), array('name' => trans('Lista pakietów'), 'link' => '?m=tvpackageslist', 'tip' => trans('Lista dostępnych pakietów'), 'prio' => 20), array('name' => trans('Lista STB'), 'link' => '?m=tvstblist', 'tip' => trans('Lista STB'), 'prio' => 30), array('name' => trans('Podziel podsieć'), 'link' => '?m=tvsubnetlist', 'tip' => trans('Podziel podsieć'), 'prio' => 40), array('name' => trans('Lista wiadomości'), 'link' => '?m=tvmessages', 'tip' => trans('Lista wiadomości'), 'prio' => 60), array('name' => trans('Nowa wiadomość'), 'link' => '?m=tvmessagessend', 'tip' => trans('Nowa wiadomość'), 'prio' => 61), array('name' => trans('Odśwież dane'), 'link' => '?m=tvcleancache', 'tip' => trans('Odśwież dane'), 'prio' => 71)));
}
// menu item for EtherWerX STM channels management
if (chkconfig($CONFIG['phpui']['ewx_support'])) {
    $menu['netdevices']['submenu'][] = array('name' => trans('Channels List'), 'link' => '?m=ewxchlist', 'tip' => trans('List of STM channels'), 'prio' => 50);
    $menu['netdevices']['submenu'][] = array('name' => trans('New Channel'), 'link' => '?m=ewxchadd', 'tip' => trans('Add new STM channel'), 'prio' => 51);
}
// Adding Userpanel menu items
if (!empty($CONFIG['directories']['userpanel_dir'])) {
    // be sure that Userpanel exists
    if (file_exists($CONFIG['directories']['userpanel_dir'] . '/lib/LMS.menu.php')) {
        require_once $CONFIG['directories']['userpanel_dir'] . '/lib/LMS.menu.php';
    }
}
// Adding user-defined menu items
if (!empty($CONFIG['phpui']['custom_menu'])) {
    // be sure that file exists
    if (file_exists($CONFIG['phpui']['custom_menu'])) {
        require_once $CONFIG['phpui']['custom_menu'];
Exemplo n.º 4
0
define('UPLOADFILES_DIR', $CONFIG['directories']['uploadfiles_dir']);
define('MODULES_DIR', $CONFIG['directories']['modules_dir']);
define('SMARTY_COMPILE_DIR', $CONFIG['directories']['smarty_compile_dir']);
define('SMARTY_TEMPLATES_DIR', $CONFIG['directories']['smarty_templates_dir']);
define('PLUG_DIR', $CONFIG['directories']['plug_dir']);
define('INVOICE_DIR', $CONFIG['directories']['invoice_dir']);
// Do some checks and load config defaults
//require_once(LIB_DIR.'/checkdirs.php');
require_once LIB_DIR . '/config.php';
// Init database
$_DBTYPE = $CONFIG['database']['type'];
$_DBHOST = $CONFIG['database']['host'];
$_DBUSER = $CONFIG['database']['user'];
$_DBPASS = $CONFIG['database']['password'];
$_DBNAME = $CONFIG['database']['database'];
$_DBDEBUG = isset($CONFIG['database']['debug']) ? chkconfig($CONFIG['database']['debug']) : FALSE;
require LIB_DIR . '/LMSDB.php';
$DB = DBInit($_DBTYPE, $_DBHOST, $_DBUSER, $_DBPASS, $_DBNAME, $_DBDEBUG);
if (!$DB) {
    // can't working without database
    die;
}
// Call any of upgrade process before anything else
require_once LIB_DIR . '/upgradedb.php';
// Initialize templates engine (must be before locale settings)
require_once LIB_DIR . '/Smarty/Smarty.class.php';
$SMARTY = new Smarty();
// test for proper version of Smarty
if (defined('Smarty::SMARTY_VERSION')) {
    $ver_chunks = preg_split('/[- ]/', Smarty::SMARTY_VERSION);
} else {
Exemplo n.º 5
0
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 *  USA.
 *
 *  $Id$
 */
if (!$LMS->TicketExists($_GET['id'])) {
    $SESSION->redirect('?m=rtqueuelist');
}
if (!$LMS->GetUserRightsRT($AUTH->id, 0, $_GET['id'])) {
    $SMARTY->display('noaccess.html');
    $SESSION->close();
    die;
}
$ticket = $LMS->GetTicketContents($_GET['id']);
if ($ticket['customerid'] && isset($CONFIG['phpui']['helpdesk_stats']) && chkconfig($CONFIG['phpui']['helpdesk_stats'])) {
    $yearago = mktime(0, 0, 0, date('n'), date('j'), date('Y') - 1);
    $stats = $DB->GetAllByKey('SELECT COUNT(*) AS num, cause FROM rttickets
	            	    WHERE customerid = ? AND createtime >= ?
			    GROUP BY cause', 'cause', array($ticket['customerid'], $yearago));
    $SMARTY->assign('stats', $stats);
}
if ($ticket['customerid']) {
    $SMARTY->assign('customerinfo', $LMS->GetCustomer($ticket['customerid']));
    $SMARTY->assign('customernodes', $LMS->GetCustomerNodes($ticket['customerid']));
}
$layout['pagetitle'] = trans('Ticket No. $a', sprintf("%06d", $ticket['ticketid']));
$SESSION->save('backto', $_SERVER['QUERY_STRING']);
$SMARTY->assign('ticket', $ticket);
$SMARTY->display($CONFIG['phpui']['ticket_template_file']);
Exemplo n.º 6
0
    function NetDevAdd($data)
    {
        $data = $this->exechook('lms_netdev_add_before', $data);
        if ($this->DB->Execute('INSERT INTO netdevices (name, location,
				location_city, location_street, location_house, location_flat,
				description, producer, model, serialnumber,
				ports, purchasetime, guaranteeperiod, shortname,
				nastype, clients, secret, community, channelid,
				longitude, latitude, monit_nastype, monit_login, monit_passwd,  monit_port, networknodeid, server, coaport,
				devtype, managed, sharing, modular, backbone_layer, distribution_layer, access_layer, typeofdevice, netdevicemodelid,
				invprojectid, status, login, passwd, ebgp, ibgp)
				VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?)', array($data['name'], $data['location'] ? $data['location'] : '', $data['location_city'] ? $data['location_city'] : null, $data['location_street'] ? $data['location_street'] : null, $data['location_house'] ? $data['location_house'] : null, $data['location_flat'] ? $data['location_flat'] : null, $data['description'] ? $data['description'] : '', $data['producer'] ? $data['producer'] : '', $data['model'] ? $data['model'] : '', $data['serialnumber'] ? $data['serialnumber'] : '', $data['ports'] ? $data['ports'] : 0, $data['purchasetime'] ? $data['purchasetime'] : 0, $data['guaranteeperiod'] ? $data['guaranteeperiod'] : 0, $data['shortname'] ? $data['shortname'] : '', $data['nastype'] ? $data['nastype'] : 0, $data['clients'] ? $data['clients'] : 0, $data['secret'] ? $data['secret'] : '', $data['community'] ? $data['community'] : '', !empty($data['channelid']) ? $data['channelid'] : NULL, !empty($data['longitude']) ? str_replace(',', '.', $data['longitude']) : NULL, !empty($data['latitude']) ? str_replace(',', '.', $data['latitude']) : NULL, $data['monit_nastype'] ? $data['monit_nastype'] : 0, $data['monit_login'] ? $data['monit_login'] : '', $data['monit_passwd'] ? $data['monit_passwd'] : '', $data['monit_port'] ? $data['monit_port'] : NULL, $data['networknode'] ? $data['networknode'] : 0, $data['server'] ? $data['server'] : '', $data['coaport'] ? $data['coaport'] : NULL, $data['devtype'] ? 1 : 0, $data['managed'] ? 1 : 0, $data['sharing'] ? 1 : 0, $data['modular'] ? 1 : 0, $data['backbone_layer'] ? 1 : 0, $data['distribution_layer'] ? 1 : 0, $data['access_layer'] ? 1 : 0, $data['typeofdevice'] ? $data['typeofdevice'] : 0, $data['netdevicemodelid'] ? $data['netdevicemodelid'] : NULL, $data['invprojectid'] ? $data['invprojectid'] : NULL, $data['status'] ? $data['status'] : 0, $data['login'] ? $data['login'] : NULL, $data['passwd'] ? $data['passwd'] : NULL, $data['ebgp'] ? $data['ebgp'] : 0, $data['ibgp'] ? $data['ibgp'] : 0))) {
            $id = $this->DB->GetLastInsertID('netdevices');
            // EtherWerX support (devices have some limits)
            // We must to replace big ID with smaller (first free)
            if ($id > 99999 && chkconfig($this->CONFIG['phpui']['ewx_support'])) {
                $this->DB->BeginTrans();
                $this->DB->LockTables('ewx_channels');
                if ($newid = $this->DB->GetOne('SELECT n.id + 1 FROM ewx_channels n 
						LEFT OUTER JOIN ewx_channels n2 ON n.id + 1 = n2.id
						WHERE n2.id IS NULL AND n.id <= 99999
						ORDER BY n.id ASC LIMIT 1')) {
                    $this->DB->Execute('UPDATE ewx_channels SET id = ? WHERE id = ?', array($newid, $id));
                    $id = $newid;
                }
                $this->DB->UnLockTables();
                $this->DB->CommitTrans();
            }
            $data['id'] = $id;
            $this->exechook('lms_netdev_add_after', $data);
            return $id;
        } else {
            return FALSE;
        }
    }
Exemplo n.º 7
0
function commit_cashimport()
{
    global $DB, $LMS, $CONFIG;
    $imports = $DB->GetAll('SELECT i.*, f.idate
		FROM cashimport i
		LEFT JOIN sourcefiles f ON (f.id = i.sourcefileid)
		WHERE i.closed = 0 AND i.customerid <> 0');
    if (!empty($imports)) {
        $idate = isset($CONFIG['finances']['cashimport_use_idate']) && chkconfig($CONFIG['finances']['cashimport_use_idate']);
        $icheck = isset($CONFIG['finances']['cashimport_checkinvoices']) && chkconfig($CONFIG['finances']['cashimport_checkinvoices']);
        foreach ($imports as $import) {
            $DB->BeginTrans();
            $balance['time'] = $idate ? $import['idate'] : $import['date'];
            $balance['type'] = 1;
            $balance['value'] = $import['value'];
            $balance['customerid'] = $import['customerid'];
            $balance['comment'] = $import['description'];
            $balance['importid'] = $import['id'];
            $balance['sourceid'] = $import['sourceid'];
            $balance['userid'] = 0;
            if ($import['value'] > 0 && $icheck) {
                if ($invoices = $DB->GetAll('SELECT d.id,
						(SELECT SUM(value*count) FROM invoicecontents WHERE docid = d.id) +
						COALESCE((SELECT SUM((a.value+b.value)*(a.count+b.count)) - SUM(b.value*b.count)
							FROM documents dd
							JOIN invoicecontents a ON (a.docid = dd.id)
							JOIN invoicecontents b ON (dd.reference = b.docid AND a.itemid = b.itemid)
							WHERE dd.reference = d.id
							GROUP BY dd.reference), 0) AS value
					FROM documents d
					WHERE d.customerid = ? AND d.type = ? AND d.closed = 0
					GROUP BY d.id, d.cdate ORDER BY d.cdate', array($balance['customerid'], DOC_INVOICE))) {
                    foreach ($invoices as $inv) {
                        $sum += $inv['value'];
                    }
                    $bval = $LMS->GetCustomerBalance($balance['customerid']);
                    $value = f_round($bval + $import['value'] + $sum);
                    foreach ($invoices as $inv) {
                        $inv['value'] = f_round($inv['value']);
                        if ($inv['value'] > $value) {
                            break;
                        } else {
                            // close invoice and assigned credit notes
                            $DB->Execute('UPDATE documents SET closed = 1
								WHERE id = ? OR reference = ?', array($inv['id'], $inv['id']));
                            $value -= $inv['value'];
                        }
                    }
                }
            }
            $DB->Execute('UPDATE cashimport SET closed = 1 WHERE id = ?', array($import['id']));
            $LMS->AddBalance($balance);
            $DB->CommitTrans();
        }
    }
}
Exemplo n.º 8
0
				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(chkconfig($CONFIG['phpui']['use_current_payday']) && !$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)
Exemplo n.º 9
0
    }
} else {
    $voip = NULL;
}
if (get_conf('sms.service') == 'serwersms') {
    require_once LIB_DIR . '/SerwerSMS_api.php';
}
if (get_conf('jambox.enabled', 0)) {
    require_once LIB_DIR . '/LMS.tv.class.php';
    $LMSTV = new LMSTV($DB, $AUTH, $CONFIG);
}
// Set some template and layout variables
$SMARTY->setTemplateDir(NULL);
$SMARTY->addTemplateDir(array(SMARTY_TEMPLATES_DIR . '/custom', SMARTY_TEMPLATES_DIR));
$SMARTY->compile_dir = SMARTY_COMPILE_DIR;
$SMARTY->debugging = isset($CONFIG['phpui']['smarty_debug']) ? chkconfig($CONFIG['phpui']['smarty_debug']) : FALSE;
$SMARTY->use_sub_dirs = TRUE;
//$SMARTY->error_reporting = false;
$SMARTY->error_unassigned = false;
$my_security_policy = new Smarty_Security($SMARTY);
$my_security_policy->allow_php_tag = true;
$my_security_policy->php_functions = array();
$my_security_policy->php_handling = Smarty::PHP_PASSTHRU;
$my_security_policy->php_modifier = array();
$my_security_policy->modifiers = array();
$SMARTY->assignByRef('layout', $layout);
$SMARTY->assignByRef('LANGDEFS', $LANGDEFS);
$SMARTY->assignByRef('_ui_language', $LMS->ui_lang);
$SMARTY->assignByRef('_language', $LMS->lang);
$SMARTY->assignByRef('global_warning', $SESSION->global_warning);
$error = NULL;
Exemplo n.º 10
0
 */
$SESSION->restore('ilm', $ilm);
$SESSION->remove('ilm');
if (sizeof($_POST['marks'])) {
    foreach ($_POST['marks'] as $id => $mark) {
        $ilm[$id] = $mark;
    }
}
if (sizeof($ilm)) {
    foreach ($ilm as $mark) {
        $ids[] = intval($mark);
    }
}
if (sizeof($ids)) {
    foreach ($ids as $noteid) {
        // add payment
        if (chkconfig($CONFIG['phpui']['note_check_payment']) && ($row = $DB->GetRow('SELECT customerid,
				(SELECT SUM(value) FROM debitnotecontents
					WHERE docid = d.id) AS value
				FROM documents d
				WHERE d.id = ? AND d.closed = 0', array($noteid)))) {
            if ($row['value'] != 0) {
                $LMS->AddBalance(array('type' => 1, 'time' => time(), 'value' => $row['value'], 'customerid' => $row['customerid'], 'comment' => trans('Accounted')));
            }
        }
        $DB->Execute('UPDATE documents SET closed = 
			(CASE closed WHEN 0 THEN 1 ELSE 0 END)
			WHERE id = ?', array($noteid));
    }
}
$SESSION->redirect('?' . $SESSION->get('backto'));
Exemplo n.º 11
0
    $message['ticketid'] = $_GET['ticketid'];
    $message['customerid'] = $DB->GetOne('SELECT customerid FROM rttickets WHERE id = ?', array($message['ticketid']));
    if (isset($_GET['id'])) {
        $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']);
        }
        $message['subject'] = 'Re: ' . $reply['subject'];
        $message['inreplyto'] = $reply['id'];
        $message['references'] = $reply['messageid'];
        if (isset($CONFIG['phpui']['helpdesk_reply_body']) && chkconfig($CONFIG['phpui']['helpdesk_reply_body'])) {
            $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('rtmessageadd.html');
Exemplo n.º 12
0
    function NetDevAdd($data)
    {
        if ($this->DB->Execute('INSERT INTO netdevices (name, location,
				location_city, location_street, location_house, location_flat,
				description, producer, model, serialnumber,
				ports, purchasetime, guaranteeperiod, shortname,
				nastype, clients, secret, community, channelid,
				longitude, latitude)
				VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', array($data['name'], $data['location'], $data['location_city'] ? $data['location_city'] : null, $data['location_street'] ? $data['location_street'] : null, $data['location_house'] ? $data['location_house'] : null, $data['location_flat'] ? $data['location_flat'] : null, $data['description'], $data['producer'], $data['model'], $data['serialnumber'], $data['ports'], $data['purchasetime'], $data['guaranteeperiod'], $data['shortname'], $data['nastype'], $data['clients'], $data['secret'], $data['community'], !empty($data['channelid']) ? $data['channelid'] : NULL, !empty($data['longitude']) ? str_replace(',', '.', $data['longitude']) : NULL, !empty($data['latitude']) ? str_replace(',', '.', $data['latitude']) : NULL))) {
            $id = $this->DB->GetLastInsertID('netdevices');
            // EtherWerX support (devices have some limits)
            // We must to replace big ID with smaller (first free)
            if ($id > 99999 && chkconfig($this->CONFIG['phpui']['ewx_support'])) {
                $this->DB->BeginTrans();
                $this->DB->LockTables('ewx_channels');
                if ($newid = $this->DB->GetOne('SELECT n.id + 1 FROM ewx_channels n 
						LEFT OUTER JOIN ewx_channels n2 ON n.id + 1 = n2.id
						WHERE n2.id IS NULL AND n.id <= 99999
						ORDER BY n.id ASC LIMIT 1')) {
                    $this->DB->Execute('UPDATE ewx_channels SET id = ? WHERE id = ?', array($newid, $id));
                    $id = $newid;
                }
                $this->DB->UnLockTables();
                $this->DB->CommitTrans();
            }
            return $id;
        } else {
            return FALSE;
        }
    }
Exemplo n.º 13
0
                        if ($part->type == 3 && strpos($part->dparameters[0]->value, '.7z')) {
                            $attachments[$partid][filename] = $part->dparameters[0]->value;
                            $attachments[$partid][bytes] = $part->bytes;
                            $attachments[$partid][pos] = $partid + 1;
                            $attachments[$partid][id] = $postid;
                        }
                    }
                }
            }
            if ($attachments) {
                foreach ($attachments as $attachment) {
                    $filename = '/tmp/' . $attachment[filename];
                    $filelist[] = str_replace('7z', 'xml', $filename);
                    $file = fopen($filename, 'w');
                    stream_filter_append($file, 'convert.base64-decode', STREAM_FILTER_WRITE);
                    if (chkconfig($cashimport['use_seen_flag'])) {
                        imap_savebody($ih, $file, $attachment[id], $attachment[pos]);
                    } else {
                        imap_savebody($ih, $file, $attachment[id], $attachment[pos], FT_PEEK);
                    }
                    exec('7za e ' . $filename . ' -p' . $cashimport['7zpasswd'] . ' -o/tmp -y', $debug);
                    fclose($file);
                }
            }
        }
    }
    imap_close($ih);
}
if (!empty($filelist)) {
    $count = sizeof($filelist);
    $cash = array();
Exemplo n.º 14
0
            if (!empty($CONFIG['phpui']['helpdesk_sender_name'])) {
                $mailfname = $CONFIG['phpui']['helpdesk_sender_name'];
                if ($mailfname == 'queue') {
                    $mailfname = $queue['name'];
                } elseif ($mailfname == 'user') {
                    $mailfname = $user['name'];
                }
                $mailfname = '"' . $mailfname . '"';
            }
            $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 (chkconfig($CONFIG['phpui']['helpdesk_customerinfo']) && ($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'];
                $sms_body .= ' ' . sprintf('(%04d)', $ticket['customerid']) . '. ';
                $sms_body .= $info['address'] . ', ' . $info['zip'] . ' ' . $info['city'];
                if ($info['phone']) {
                    $sms_body .= '. ' . trans('Phone:') . ' ' . $info['phone'];
Exemplo n.º 15
0
    $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';
// Read configuration of LMS-UI 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'];
    }
}
// Redirect to SSL
$_FORCE_SSL = isset($CONFIG['phpui']['force_ssl']) ? chkconfig($CONFIG['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__);
require_once LIB_DIR . '/ExecStack.class.php';
$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');
Exemplo n.º 16
0
$catrights = $LMS->GetUserRightsToCategory($AUTH->id, 0, $_GET['id']);
if (!$rights || !$catrights) {
    $SMARTY->display('noaccess.html');
    $SESSION->close();
    die;
}
$ticket = $LMS->GetTicketContents($_GET['id']);
$categories = $LMS->GetCategoryListByUser($AUTH->id);
if ($ticket['customerid'] && isset($CONFIG['phpui']['helpdesk_stats']) && chkconfig($CONFIG['phpui']['helpdesk_stats'])) {
    $yearago = mktime(0, 0, 0, date('n'), date('j'), date('Y') - 1);
    $stats = $DB->GetAllByKey('SELECT COUNT(*) AS num, cause FROM rttickets 
			    WHERE customerid = ? AND createtime >= ? 
			    GROUP BY cause', 'cause', array($ticket['customerid'], $yearago));
    $SMARTY->assign('stats', $stats);
}
if ($ticket['customerid'] && chkconfig($CONFIG['phpui']['helpdesk_customerinfo'])) {
    $customer = $LMS->GetCustomer($ticket['customerid'], true);
    $customer['groups'] = $LMS->CustomergroupGetForCustomer($ticket['customerid']);
    if (!empty($customer['contacts'])) {
        $customer['phone'] = $customer['contacts'][0]['phone'];
    }
    $customernodes = $LMS->GetCustomerNodes($ticket['customerid']);
    $allnodegroups = $LMS->GetNodeGroupNames();
    $SMARTY->assign('customerinfo', $customer);
    $SMARTY->assign('customernodes', $customernodes);
    $SMARTY->assign('allnodegroups', $allnodegroups);
}
foreach ($categories as $category) {
    $catids[] = $category['id'];
}
$iteration = $LMS->GetQueueContents($ticket['queueid'], $order = 'createtime,desc', $state = -1, 0, $catids);
Exemplo n.º 17
0
            $marks[$idx] = intval($id);
        }
    }

    if (!empty($marks)) {
        $imports = $DB->GetAll('SELECT i.*, f.idate
            FROM cashimport i
            LEFT JOIN sourcefiles f ON (f.id = i.sourcefileid)
            WHERE i.id IN ('.implode(',', $marks).')');
    }

    if (!empty($imports)) {
        $idate  = isset($CONFIG['finances']['cashimport_use_idate'])
	    	&& chkconfig($CONFIG['finances']['cashimport_use_idate']);
        $icheck = isset($CONFIG['finances']['cashimport_checkinvoices'])
	    	&& chkconfig($CONFIG['finances']['cashimport_checkinvoices']);

        foreach ($imports as $import) {

			$DB->BeginTrans();

			$balance['time'] = $idate ? $import['idate'] : $import['date'];
			$balance['type'] = 1;
			$balance['value'] = $import['value'];
			$balance['customerid'] = $customers[$import['id']];
			$balance['comment'] = $import['description'];
			$balance['importid'] = $import['id'];
			$balance['sourceid'] = $import['sourceid'];

			if ($import['value'] > 0 && $icheck)
			{
Exemplo n.º 18
0
            $SESSION->remove('notenewerror');
            if (isset($_GET['print'])) {
                $SESSION->save('noteprint', $nid);
            }
            $SESSION->redirect('?m=noteadd&action=init');
        }
        break;
}
$SESSION->save('note', $note);
$SESSION->save('notecontents', isset($contents) ? $contents : NULL);
$SESSION->save('notecustomer', isset($customer) ? $customer : NULL);
$SESSION->save('notenewerror', isset($error) ? $error : NULL);
if ($action) {
    // redirect needed because we don't want to destroy contents of note in order of page refresh
    $SESSION->redirect('?m=noteadd');
}
if (!isset($CONFIG['phpui']['big_networks']) || !chkconfig($CONFIG['phpui']['big_networks'])) {
    $SMARTY->assign('customers', $LMS->GetCustomerNames());
}
if ($newnote = $SESSION->get('noteprint')) {
    $SMARTY->assign('newnoteid', $newnote);
    $SESSION->remove('noteprint');
}
$layout['pagetitle'] = trans('New Debit Note<!long>');
$SMARTY->assign('error', $error);
$SMARTY->assign('contents', $contents);
$SMARTY->assign('customer', $customer);
$SMARTY->assign('note', $note);
$SMARTY->assign('numberplanlist', $LMS->GetNumberPlans(DOC_DNOTE, date('Y/m', $note['cdate'])));
//$SMARTY->assign('taxeslist', $taxeslist);
$SMARTY->display('noteadd.html');
Exemplo n.º 19
0
$SESSION->restore('ilm', $ilm);
$SESSION->remove('ilm');
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) {
        // add payment
        if (chkconfig($CONFIG['phpui']['invoice_check_payment']) && ($cid = $DB->GetOne('SELECT customerid FROM documents
				WHERE id = ? AND closed = 0', array($invoiceid)))) {
            $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')));
            }
        }
        $DB->Execute('UPDATE documents SET closed = 
			(CASE closed WHEN 0 THEN 1 ELSE 0 END)
			WHERE id = ?', array($invoiceid));
    }