コード例 #1
0
 *  it under the terms of the GNU General Public License Version 2 as
 *  published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  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 (!check_conf('privileges.reports')) {
    access_denied();
}
$type = isset($_GET['type']) ? $_GET['type'] : '';
switch ($type) {
    case 'stats':
        /******************************************/
        $days = !empty($_GET['days']) ? intval($_GET['days']) : intval($_POST['days']);
        $times = !empty($_GET['times']) ? intval($_GET['times']) : intval($_POST['times']);
        $queue = !empty($_GET['queue']) ? intval($_GET['queue']) : intval($_POST['queue']);
        $categories = !empty($_GET['categories']) ? $_GET['categories'] : $_POST['categories'];
        if ($queue) {
            $where[] = 'queueid = ' . $queue;
        }
        if ($days) {
            $where[] = 'rttickets.createtime > ' . mktime(0, 0, 0, date('n'), date('j') - $days);
コード例 #2
0
ファイル: index.php プロジェクト: rzt/lms
$SMARTY->assignByRef('modules', $USERPANEL->MODULES);
$SMARTY->assignByRef('layout', $layout);

header('X-Powered-By: LMS/'.$layout['lmsv']);

if($SESSION->islogged)
{
	$module = isset($_GET['m']) ? $_GET['m'] : '';

	if (isset($USERPANEL->MODULES[$module])) $USERPANEL->MODULES[$module]['selected'] = true;

	// Userpanel rights module
	$rights = $USERPANEL->GetCustomerRights($SESSION->id);
	$SMARTY->assign('rights', $rights);

	if(check_conf('userpanel.hide_nodes_modules'))
	{
		if(!$DB->GetOne('SELECT COUNT(*) FROM nodes WHERE ownerid = ? LIMIT 1', array($SESSION->id)))
		{
			unset($USERPANEL->MODULES['messages']);
			unset($USERPANEL->MODULES['stats']);
		}
	}

	if( file_exists(USERPANEL_MODULES_DIR.$module.'/functions.php')
	    && isset($USERPANEL->MODULES[$module]) )
        {
    		include(USERPANEL_MODULES_DIR.$module.'/functions.php');

		$function = isset($_GET['f']) && $_GET['f']!='' ? $_GET['f'] : 'main';
		if (function_exists('module_'.$function)) 
コード例 #3
0
ファイル: print.php プロジェクト: rzt/lms
			$SMARTY->assign('total',$total);
			$SMARTY->assign('taxes', $taxes);
			$SMARTY->assign('taxescount', sizeof($taxes));
		}

		if (strtolower($CONFIG['phpui']['report_type']) == 'pdf') {
			$output = $SMARTY->fetch('printliabilityreport.html');
			html2pdf($output, trans('Reports'), $layout['pagetitle']);
		} else {
			$SMARTY->display('printliabilityreport.html');
		}
	break;
	
	case 'receiptlist':

		if (!check_conf('privileges.cash_operations'))
			access_denied();

		if($_POST['from'])
		{
			list($year, $month, $day) = explode('/', $_POST['from']);
			$from = mktime(0,0,0, $month, $day, $year);
		}
		else
			$from = mktime(0,0,0, date('m'), date('d'), date('Y'));
		
		if($_POST['to'])
		{
			list($year, $month, $day) = explode('/', $_POST['to']);
			$to = mktime(23,59,59, $month, $day, $year);
		}
コード例 #4
0
function module_main()
{
    global $SMARTY, $LMS, $SESSION, $CONFIG, $DB;
    $error = NULL;
    if (isset($_POST['helpdesk']) && empty($_GET['id'])) {
        $ticket = $_POST['helpdesk'];
        $ticket['queue'] = $CONFIG['userpanel']['default_queue'];
        $ticket['categories'] = $CONFIG['userpanel']['default_categories'];
        $ticket['subject'] = strip_tags($ticket['subject']);
        $ticket['body'] = strip_tags($ticket['body']);
        if (!$ticket['queue'] || !$ticket['categories']) {
            header('Location: ?m=helpdesk');
            die;
        }
        if ($ticket['subject'] == '' && $ticket['body'] == '') {
            header('Location: ?m=helpdesk');
            die;
        }
        if ($ticket['subject'] == '') {
            $error['subject'] = trans('Ticket must have its title!');
        }
        if ($ticket['body'] == '') {
            $error['body'] = trans('Ticket must have its body!');
        }
        if (!$error) {
            $ticket['email'] = $LMS->GetCustomerEmail($SESSION->id);
            $ticket['mailfrom'] = $ticket['email'] ? $ticket['email'] : '';
            $ts = time();
            $DB->Execute('INSERT INTO rttickets (queueid, customerid, subject, createtime)
				VALUES (?, ?, ?, ?)', array($ticket['queue'], $SESSION->id, $ticket['subject'], $ts));
            $id = $DB->GetLastInsertID('rttickets');
            $DB->Execute('INSERT INTO rtmessages (ticketid, customerid, createtime, subject, body, mailfrom)
		                VALUES (?, ?, ?, ?, ?, ?)', array($id, $SESSION->id, $ts, $ticket['subject'], $ticket['body'], $ticket['mailfrom']));
            foreach (explode(',', $ticket['categories']) as $catid) {
                $DB->Execute('INSERT INTO rtticketcategories (ticketid, categoryid) VALUES (?, ?)', array($id, $catid));
            }
            if (check_conf('phpui.newticket_notify')) {
                $user = $LMS->GetUserInfo($CONFIG['userpanel']['default_userid']);
                if ($mailfname = $CONFIG['phpui']['helpdesk_sender_name']) {
                    if ($mailfname == 'queue') {
                        $mailfname = $LMS->GetQueueName($ticket['queue']);
                    }
                    if ($mailfname == 'user') {
                        $mailfname = $user['name'];
                    }
                    $mailfname = '"' . $mailfname . '"';
                }
                if ($user['email']) {
                    $mailfrom = $user['email'];
                } elseif ($qemail = $LMS->GetQueueEmail($ticket['queue'])) {
                    $mailfrom = $qemail;
                } else {
                    $mailfrom = $ticket['mailfrom'];
                }
                $headers['Date'] = date('r');
                $headers['From'] = $mailfname . ' <' . $mailfrom . '>';
                $headers['Subject'] = sprintf("[RT#%06d] %s", $id, $ticket['subject']);
                $headers['Reply-To'] = $headers['From'];
                $sms_body = $headers['Subject'] . "\n" . $ticket['body'];
                $body = $ticket['body'] . "\n\n" . $CONFIG['userpanel']['lms_url'] . '/?m=rtticketview&id=' . $id;
                if (check_conf('phpui.helpdesk_customerinfo')) {
                    $info = $DB->GetRow('SELECT id AS customerid, ' . $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($SESSION->id));
                    $body .= "\n\n-- \n";
                    $body .= trans('Customer:') . ' ' . $info['customername'] . "\n";
                    $body .= trans('ID:') . ' ' . sprintf('%04d', $info['customerid']) . "\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'] . '. ';
                    $sms_body .= $info['phone'];
                }
                // send email
                if ($recipients = $DB->GetCol('SELECT DISTINCT email
			    FROM users, rtrights
			    WHERE users.id = userid AND email != \'\' AND (rtrights.rights & 8) = 8
			        AND (ntype & ?) = ? AND queueid = ?', array(MSG_MAIL, MSG_MAIL, intval($ticket['queue'])))) {
                    foreach ($recipients as $email) {
                        $headers['To'] = '<' . $email . '>';
                        $LMS->SendMail($email, $headers, $body);
                    }
                }
                // send sms
                if (!empty($CONFIG['sms']['service']) && ($recipients = $DB->GetCol('SELECT DISTINCT phone
			    FROM users, rtrights
			    WHERE users.id = userid AND phone != \'\' AND (rtrights.rights & 8) = 8
			        AND (ntype & ?) = ? AND queueid = ?', array(MSG_SMS, MSG_SMS, intval($ticket['queue']))))) {
                    foreach ($recipients as $phone) {
                        $LMS->SendSMS($phone, $sms_body);
                    }
                }
            }
            header('Location: ?m=helpdesk');
            die;
        } else {
            $SMARTY->assign('error', $error);
            $SMARTY->assign('helpdesk', $ticket);
        }
    } elseif (isset($_POST['helpdesk']) && !empty($_GET['id'])) {
        $ticket = $_POST['helpdesk'];
        $ticket['body'] = strip_tags($ticket['body']);
        $ticket['subject'] = strip_tags($ticket['subject']);
        $ticket['inreplyto'] = intval($ticket['inreplyto']);
        $ticket['id'] = intval($_GET['id']);
        if ($ticket['subject'] == '') {
            $error['subject'] = trans('Ticket must have its title!');
        }
        if ($ticket['body'] == '') {
            $error['body'] = trans('Ticket must have its body!');
        }
        if (!$DB->GetOne('SELECT 1 FROM rttickets WHERE id = ? AND customerid = ?', array($ticket['id'], $SESSION->id))) {
            $error = true;
        }
        if (!$error) {
            $ticket['customerid'] = $SESSION->id;
            // add message
            $DB->Execute('INSERT INTO rtmessages (ticketid, createtime, subject, body, customerid, inreplyto)
                        VALUES (?, ?NOW?, ?, ?, ?, ?)', array($ticket['id'], $ticket['subject'], $ticket['body'], $ticket['customerid'], $ticket['inreplyto']));
            // re-open ticket
            $DB->Execute('UPDATE rttickets SET state = CASE state
				WHEN 0 THEN 0
				WHEN 1 THEN 1
				WHEN 2 THEN 1
				WHEN 3 THEN 1 END 
			WHERE id = ?', array($ticket['id']));
            header('Location: ?m=helpdesk&op=view&id=' . $ticket['id']);
            die;
        } else {
            $SMARTY->assign('error', $error);
            $SMARTY->assign('helpdesk', $ticket);
            $_GET['op'] = 'message';
        }
    }
    if (isset($_GET['op']) && $_GET['op'] == 'view') {
        if (preg_match('/^[0-9]+$/', $_GET['id'])) {
            $ticket = $LMS->GetTicketContents($_GET['id']);
        }
        $ticket['id'] = $_GET['id'];
        $SMARTY->assign('title', trans('Request No. $a', sprintf('%06d', $ticket['ticketid'])));
        if ($ticket['customerid'] == $SESSION->id) {
            $SMARTY->assign('ticket', $ticket);
            $SMARTY->display('module:helpdeskview.html');
            die;
        }
    } elseif (isset($_GET['op']) && $_GET['op'] == 'message') {
        if (preg_match('/^[0-9]+$/', $_GET['id'])) {
            $ticket = $LMS->GetTicketContents($_GET['id']);
        }
        $ticket['id'] = $_GET['id'];
        if (isset($_GET['msgid']) && preg_match('/^[0-9]+$/', $_GET['msgid'])) {
            $helpdesk['subject'] = $DB->GetOne('SELECT subject FROM rtmessages
	                	WHERE ticketid = ? AND id = ?', array($ticket['id'], $_GET['msgid']));
            $helpdesk['subject'] = preg_replace('/^Re:\\s*/', '', $helpdesk['subject']);
            $helpdesk['subject'] = 'Re: ' . $helpdesk['subject'];
            $SMARTY->assign('helpdesk', $helpdesk);
        }
        $SMARTY->assign('title', trans('Request No. $a', sprintf('%06d', $ticket['ticketid'])));
        if ($ticket['customerid'] == $SESSION->id) {
            $SMARTY->assign('ticket', $ticket);
            $SMARTY->display('module:helpdeskreply.html');
            die;
        }
    }
    if ($helpdesklist = $LMS->GetCustomerTickets($SESSION->id)) {
        foreach ($helpdesklist as $idx => $key) {
            $helpdesklist[$idx]['lastmod'] = $LMS->DB->GetOne('SELECT MAX(createtime) FROM rtmessages WHERE ticketid = ?', array($key['id']));
        }
    }
    $SMARTY->assign('helpdesklist', $helpdesklist);
    $SMARTY->display('module:helpdesk.html');
}
コード例 #5
0
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  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$
 */
$layout['pagetitle'] = trans('Configuration Reload');
$_RELOAD_TYPE = $CONFIG['phpui']['reload_type'];
$_EXECCMD = $CONFIG['phpui']['reload_execcmd'];
$serverTime = date("r");
if (check_conf('phpui.reload_timer')) {
    $SMARTY->assign('serverTime', $serverTime);
}
switch ($_RELOAD_TYPE) {
    case 'exec':
        $hosts = $DB->GetAll('SELECT id, name, lastreload, reload, description FROM hosts ORDER BY name');
        if (isset($_GET['setreloads']) && isset($_POST['hosts'])) {
            $SMARTY->display('header.html');
            echo '<H1>' . $layout['pagetitle'] . '</H1>';
            $execlist = explode(';', $_EXECCMD);
            foreach ($hosts as $host) {
                if (in_array($host['id'], $_POST['hosts'])) {
                    echo '<H3>' . trans('Host:') . ' ' . $host['name'] . '</H3>';
                    echo '<TABLE WIDTH="100%" CLASS="superlight" CELLPADDING="5"><TR><TD CLASS="FALL">';
                    foreach ($execlist as $execcmd) {
                        $execcmd = str_replace('%host', $host['name'], $execcmd);
コード例 #6
0
ファイル: LMS.class.php プロジェクト: bochniak/lms
    function GetQueueNames()
    {
        return $this->DB->GetAll('SELECT q.id, name FROM rtqueues q' . (!check_conf('privileges.superuser') ? ' JOIN rtrights r ON r.queueid = q.id 
				WHERE r.rights <> 0 AND r.userid = ?' : '') . ' ORDER BY name', array($this->AUTH->id));
    }
コード例 #7
0
$KONTO_DO = bankaccount($customer['id'], $division['account']);
if ($division) {
    list($division['name']) = explode("\n", $division['name']);
    $ISP1_DO = $division['name'];
    $ISP2_DO = trim($division['zip'] . ' ' . $division['city'] . ' ' . $division['address']);
} else {
    if (!empty($CONFIG['finances']['line_1'])) {
        $ISP1_DO = $CONFIG['finances']['line_1'];
    }
    if (!empty($CONFIG['finances']['line_2'])) {
        $ISP2_DO = $CONFIG['finances']['line_2'];
    }
}
$USER_T1 = !isset($CONFIG['finances']['pay_title']) ? 'Abonament - ID:%CID% %LongCID%' : iconv('UTF-8', 'ISO-8859-2', $CONFIG['finances']['pay_title']);
$CURR = 'PLN';
$SHORT_TO_WORDS = check_conf('phpui.to_words_short_version');
$Before = array("%CID%", "%LongCID%");
$After = array($customer['id'], sprintf('%04d', $customer['id']));
$USER_TY = str_replace($Before, $After, $USER_T1);
$KWOTA = trim($customer['balance'] * -1);
$ISP1_DO = iconv('UTF-8', 'ISO-8859-2', $ISP1_DO);
$ISP2_DO = iconv('UTF-8', 'ISO-8859-2', $ISP2_DO);
$USER_OD = trim(iconv('UTF-8', 'ISO-8859-2', $customer['customername']));
$USER_ADDR = trim(iconv('UTF-8', 'ISO-8859-2', $customer['zip'] . ' ' . $customer['city'] . ' ' . $customer['address']));
$KWOTA_NR = str_replace(',', '.', $KWOTA);
// na wszelki wypadek
$KWOTA_GR = sprintf('%02d', round(($KWOTA_NR - floor($KWOTA_NR)) * 100));
if ($SHORT_TO_WORDS) {
    $KWOTA_ZL = to_words(floor($KWOTA_NR), 0, '', 1);
    $KWOTA_ZL = iconv('UTF-8', 'ISO-8859-2', $KWOTA_ZL);
    $KWOTA_X = $KWOTA_ZL . ' ' . $KWOTA_GR . '/100';
コード例 #8
0
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 *  USA.
 *
 *  $Id$
 */
@(include LIB_DIR . '/locale/' . $_language . '/fortunes.php');
$layout['pagetitle'] = 'LAN Management System';
$layout['dbversion'] = $DB->GetDBVersion();
$layout['dbtype'] = $CONFIG['database']['type'];
if (check_conf('privileges.superuser')) {
    $content = $LMS->CheckUpdates();
    if (isset($content['newer_version'])) {
        list($v, ) = preg_split('/\\s+/', $LMS->_version);
        if (version_compare($content['newer_version'], $v) > 0) {
            $SMARTY->assign('newer_version', $content['newer_version']);
        }
    }
    $SMARTY->assign('regdata', $LMS->GetRegisterData());
}
$SMARTY->assign('_dochref', is_dir('doc/html/' . $LMS->ui_lang) ? 'doc/html/' . $LMS->ui_lang . '/' : 'doc/html/en/');
$SMARTY->assign('rtstats', $LMS->RTStats());
if (!check_conf('privileges.hide_sysinfo')) {
    require_once LIB_DIR . '/Sysinfo.class.php';
    $SI = new Sysinfo();
    $SMARTY->assign('sysinfo', $SI->get_sysinfo());
}
if (!check_conf('privileges.hide_summaries')) {
    $SMARTY->assign('customerstats', $LMS->CustomerStats());
    $SMARTY->assign('nodestats', $LMS->NodeStats());
}
$SMARTY->display('welcome.html');
コード例 #9
0
ファイル: invoice.php プロジェクト: rzt/lms
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  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$
 */

global $LMS,$SESSION,$CONFIG,$_CONFIG,$SMARTY,$invoice, $layout, $type;

$type = check_conf('userpanel.invoice_duplicate') ? trans('DUPLICATE') : trans('ORIGINAL');

if(strtolower($CONFIG['invoices']['type']) == 'pdf')
{
    include('invoice_tcpdf.php');
    die;
}

header('Content-Type: '.$CONFIG['invoices']['content_type']);
if(isset($CONFIG['invoices']['attachment_name']) && $CONFIG['invoices']['attachment_name'] != '')
	header('Content-Disposition: attachment; filename='.$CONFIG['invoices']['attachment_name']);

$SMARTY->assign('css', file($CONFIG['directories']['sys_dir'].'/img/style_print.css')); 

// use LMS templates directory
$SMARTY->template_dir = !isset($CONFIG['directories']['smarty_templates_dir']) ? $CONFIG['directories']['sys_dir'].'/templates' : $CONFIG['directories']['smarty_templates_dir'];
コード例 #10
0
ファイル: functions.php プロジェクト: rzt/lms
function module_main()
{
    global $SMARTY,$CONFIG,$SESSION;
    $bars = 1;

    if(isset($_GET['bar']) && isset($_POST['order']))
	$SESSION->save('trafficorder', $_POST['order']);

    $bar = isset($_GET['bar']) ? $_GET['bar'] : '';
    $owner = check_conf('userpanel.owner_stats') ? $SESSION->id : NULL;

    switch($bar)
    {
	case 'hour':
		$traffic = Traffic( time()-(60*60), time(), $owner, 'download');
	break;

	case 'day':
		$traffic = Traffic( time()-(60*60*24), time(),  $owner, 'download');
	break;

	case 'year':
		$traffic = Traffic( time()-(60*60*24*365), time(), $owner, 'download');
	break;

	case 'all':
		$traffic = Traffic( 0, time(), $owner, 'download');
	break;

	case 'month':
	default:
		$traffic = Traffic( time()-(60*60*24*30), time(), $owner, 'download');
	break;
    }

    if(isset($traffic))
    {
	$SMARTY->assign('download', $traffic['download']);
	$SMARTY->assign('upload', $traffic['upload']);
    }

    $layout['pagetitle'] = trans('Network Statistics');

    $SMARTY->assign('bar', $bar ? $bar : 'month');
    $SMARTY->display('module:stats.html');
}
コード例 #11
0
ファイル: welcome.php プロジェクト: repcio/lms
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  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$
 */
@(include LIB_DIR . '/locale/' . $_language . '/fortunes.php');
$layout['pagetitle'] = 'LAN Management System';
$layout['dbversion'] = $DB->GetDBVersion();
$layout['dbtype'] = $CONFIG['database']['type'];
if (check_conf('privileges.superuser')) {
    $content = $LMS->CheckUpdates();
    if (isset($content['newer_version'])) {
        list($v, ) = preg_split('/\\s+/', $LMS->_version);
        if (version_compare($content['newer_version'], $v) > 0) {
            $SMARTY->assign('newer_version', $content['newer_version']);
        }
    }
    $SMARTY->assign('regdata', $LMS->GetRegisterData());
}
$SMARTY->assign('_dochref', is_dir('doc/html/' . $LMS->ui_lang) ? 'doc/html/' . $LMS->ui_lang . '/' : 'doc/html/en/');
$SMARTY->assign('rtstats', $LMS->RTStats());
if (!$CONFIG['phpui']['hide_sysinfo']) {
    require_once LIB_DIR . '/Sysinfo.class.php';
    $SI = new Sysinfo();
    $SMARTY->assign('sysinfo', $SI->get_sysinfo());
コード例 #12
0
function homepage_start()
{
    global $pageview, $SMARTY, $LMS, $DB, $CONFIG, $layout, $_language, $PROFILE, $AUTH, $SESSION, $voip, $registers;
    if (get_conf('homepage.box_customer') && !check_conf('privileges.hide_summaries')) {
        $pageview[] = 'box_customer';
    }
    if (get_conf('homepage.box_nodes') && !check_conf('privileges.hide_summaries')) {
        $pageview[] = 'box_nodes';
    }
    if (get_conf('homepage.box_helpdesk') && $LMS->RTStats()) {
        $pageview[] = 'box_helpdesk';
    }
    if (get_conf('homepage.box_callcenter')) {
        $pageview[] = 'box_callcenter';
    }
    if (get_conf('homepage.box_links') && !check_conf('privileges.hide_links')) {
        $pageview[] = 'box_links';
    }
    if (get_conf('homepage.box_board')) {
        $pageview[] = 'box_board';
    }
    if (get_conf('homepage.box_system') && !check_conf('privileges.hide_sysinfo')) {
        $pageview[] = 'box_system';
    }
    if (get_conf('homepage.box_lms') && !check_conf('privileges.hide_sysinfo')) {
        $pageview[] = 'box_lms';
    }
    if (get_conf('homepage.box_totd')) {
        $pageview[] = 'box_totd';
    }
    $obj = new xajaxResponse();
    if (check_conf('privileges.superuser') && !$registers) {
        $obj->assign("id_box_0a", "innerHTML", $SMARTY->fetch("welcome_box_registers.html"));
    }
    $count = sizeof($pageview);
    for ($i = 0; $i < $count; $i++) {
        if ($pageview[$i] == 'box_customer') {
            $customerstats = $LMS->CustomerStats();
            $SMARTY->assign('customerstats', $customerstats);
            $SMARTY->assign('contractending30', $LMS->getIdContractEnding('30'));
            $SMARTY->assign('contractending7', $LMS->getIdContractEnding('7'));
            $SMARTY->assign('contractnodata', $LMS->getIdContractEnding('-2'));
        } elseif ($pageview[$i] == 'box_nodes') {
            $SMARTY->assign('nodestats', $LMS->NodeStats());
        } elseif ($pageview[$i] == 'box_helpdesk') {
            $SMARTY->assign('rtstats', $LMS->RTStats());
        } elseif ($pageview[$i] == 'box_callcenter') {
            $result = $DB->GetRow('SELECT COUNT(id) AS total,
				COUNT(CASE WHEN closed = 1 THEN 1 END) AS zamkniete,
				COUNT(CASE WHEN closed = 0 THEN 1 END) AS otwarte
				FROM info_center WHERE deleted=0');
            $SMARTY->assign('callcenter_stats', $result);
        } elseif ($pageview[$i] == 'box_links') {
        } elseif ($pageview[$i] == 'box_board') {
            $userlist = $DB->GetAll('SELECT id, name FROM users WHERE deleted = ? ORDER BY name;', array(0));
            //$read = $PROFILE->get('board_status');
            if (!$SESSION->check_exists_key('board_status')) {
                $itemdata['board_status'] = 2;
                $SESSION->save('board_status', $itemdata['board_status']);
            } else {
                $itemdata['board_status'] = $SESSION->get('board_status');
            }
            if (!$SESSION->check_exists_key('board_prio')) {
                $itemdata['board_prio'] = '';
                $SESSION->save('board_prio', $itemdata['board_prio']);
            } else {
                $itemdata['board_prio'] = $SESSION->get('board_prio');
            }
            if (!$SESSION->check_exists_key('board_author')) {
                $itemdata['board_author'] = '';
                $SESSION->save('board_author', '');
            } else {
                $itemdata['board_author'] = $SESSION->get('board_author');
            }
            $SESSION->_saveSession();
            $SMARTY->assign('messlist', $messlist);
            $SMARTY->assign('itemdata', $itemdata);
            $SMARTY->assign('userlist', $userlist);
            $obj->script("xajax_board_view_list('-2','-2','-2');");
        } elseif ($pageview[$i] == 'box_lms') {
            $layout['dbversion'] = $DB->GetDBVersion();
            $layout['dbtype'] = $CONFIG['database']['type'];
        } elseif ($pageview[$i] == 'box_system') {
            require_once LIB_DIR . '/Sysinfo.class.php';
            $SI = new Sysinfo();
            $SMARTY->assign('sysinfo', $SI->get_sysinfo());
        } elseif ($pageview[$i] == 'box_totd') {
            @(include LIB_DIR . '/locale/' . $_language . '/fortunes.php');
        }
        $obj->assign("id_box_" . $i, "innerHTML", $SMARTY->fetch("welcome_" . $pageview[$i] . ".html"));
    }
    return $obj;
}
コード例 #13
0
ファイル: check_conf.php プロジェクト: 0xsKu/920-Text-Editor
<?php

$DIR = dirname(__FILE__);
$G_ERROR = 0;
$syndir = "{$DIR}/new_syntax";
if (!is_dir($syndir)) {
    exit('no syntax dir');
}
$files = scandir($syndir);
foreach ($files as $file) {
    if ($file == '.' || $file == '..') {
        continue;
    }
    check_conf($syndir . "/{$file}");
    //break one
    if ($G_ERROR == 1) {
        break;
    }
}
exit("\nok\n");
function check_conf($file)
{
    if (is_dir($file)) {
        return;
    }
    $groups = array();
    $linked_groups = array();
    $lines = file($file);
    $save = array();
    foreach ($lines as $lnum => $line) {
        $line = trim($line);