示例#1
0
文件: index.php 项目: itav/lms
$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 {
    $nodeid = $LMS->GetNodeIDByIP(str_replace('::ffff:', '', $_SERVER['REMOTE_ADDR']));
}
$customerid = $LMS->GetNodeOwner($nodeid);
$nodeinfo = $LMS->GetNode($nodeid);
if (isset($_GET['readed'])) {
    $DB->Execute('UPDATE nodes SET warning = 0 WHERE id = ?', array($nodeid));
    header('Location: ' . $_GET['oldurl']);
} else {
    $customerinfo = $LMS->GetCustomer($customerid);
    $layout['oldurl'] = $_GET['oldurl'];
    $SMARTY->assign('customerinfo', $customerinfo);
    $SMARTY->assign('nodeinfo', $nodeinfo);
    $SMARTY->assign('layout', $layout);
    $SMARTY->display('message.html');
}