<?php //pc.php v5.2.0 setlocale(LC_ALL, 'ru_RU'); require_once 'config.php'; require_once OLIB_PATH . '/class.ad.php'; require_once OLIB_PATH . '/class.session.php'; require_once OLIB_PATH . '/class.process.php'; $tpl =& initFastTemplate(); $tpl->define(array('pc_table' => 'body.pc.table_head.tpl', 'pc' => 'body.pc.tpl', 'process' => 'body.pc.process.tpl')); $ses = new Session(true); $tpl->assign('MESSAGE', $ses->msg()); $users = new Computer('TONIPI-*'); $users->tplLink('TABLE_TEXT', 'Export hosts file', 'hostsexport.php'); $tpl->parse('TABLE_TEXT', '.pc_table'); $users->fieldUpper('cn'); $users->sortBy($sort); $users->tplTableInner('TABLE_TEXT', array('cn', 'description', 'location'), array(FALSE, FALSE, FALSE), array(FALSE, FALSE, FALSE)); $tpl->parse('BODY', 'table'); $tpl->parse('PAGE', 'page'); $tpl->FastPrint();
<?php //hostsexport.php v5.0.0 setlocale(LC_ALL, 'ru_RU'); header('Content-type: text/plain; charset=windows-1251'); require_once 'config.php'; require_once OLIB_PATH . '/class.ad.php'; require_once OLIB_PATH . '/class.session.php'; $tpl =& initFastTemplate(); $tpl->define(array('host' => '../templ.export/host.tpl')); $ses = new Session(TRUE); $tpl->assign('MESSAGE', $ses->msg()); $objs = new Computer('TONIPI-*'); $objs->fieldUpper('cn'); $objs->sortBy('cn'); for ($i = 0; $i < $objs->count; $i++) { if (isset($objs->location[$i]) && strlen($objs->location[$i]) > 0) { $tpl->assign(array('HOST_IP' => $objs->location[$i], 'HOST_NAME' => $objs->cn[$i], 'HOST_FULLNAME' => $objs->cn[$i] . '.oao.sng', 'HOST_USERNAME' => $objs->description[$i])); $tpl->parse(BODY, '.host'); } } //$tpl->parse('BODY', 'empty'); $tpl->FastPrint();