<?php //cid.php v5.0.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 'lib5.php'; $tpl =& initFastTemplate(); $tpl->define(array('pc_table' => 'body.pc.table_head.tpl')); $ses = new Session(TRUE); $tpl->assign('MESSAGE', $ses->msg()); if (isset($_GET['sort'])) { $sort = $_GET['sort']; } else { $sort = 'cn'; } $tpl->parse('TABLE_TEXT', 'pc_table'); $users = new Request5(); $users->findBy(); $users->findBy('pid = 0'); $users->range(mktime(0, 0, 0, 2, 1, 2014), 86400 * 31); //$users->findBy('saprname="Korzhov_OV"'); $users->_execute(); echo $users->count; $tpl->parse('BODY', 'table'); $tpl->parse('PAGE', 'page'); $tpl->FastPrint();
// Process save/aprove from URL and POST if (isset($_GET['action'])) { if ($_GET['action'] == 'save') { if (isset($_POST['editID']) && isset($_POST['editText']) && strlen($_POST['editText']) > 0) { $obj = new WPLeave2013($_POST['editID']); $obj->retrive(); $curUser = new User5($ses->login()); if ($obj->count = 1) { $person = new WpPerson(); $person->where('note6="' . $obj->tabel[0] . '"'); $person->retrive(); if ($curUser->employeeid == $obj->tabel[0] || canApprove($person->note1[0], $ses->login())) { $obj->txtotpusk[0] = $_POST['editText']; $obj->updateText(); } else { $ses->msg('В доступе отказано'); } } else { $ses->msg('Ошибка базы данных'); } } else { $ses->msg('Ошибка сервера'); } } elseif ($_GET['action'] == 'approve') { if (isset($_GET['id']) && isset($_GET['approve'])) { $obj = new WPLeave2013($_GET['id']); $obj->retrive(); $curUser = new User5($ses->login()); if ($obj->count = 1) { $person = new WpPerson(); $person->where('note6="' . $obj->tabel[0] . '"');
$this->user_is_logged_in = false; } } public function logout() { unset($_SESSION['user_id']); } public function msg($type = '', $msg = '') { if (!empty($msg)) { if (strlen(trim($type)) == 1) { $type = str_replace(array('d', 'i', 'w', 's'), array('danger', 'info', 'warning', 'success'), $type); } $_SESSION['msg'][$type] = $msg; } else { return $this->msg; } } private function flash_msg() { if (isset($_SESSION['msg'])) { $this->msg = $_SESSION['msg']; unset($_SESSION['msg']); } else { $this->msg; } } } $session = new Session(); $msg = $session->msg();
<?php //login.php v5.0.5 setlocale(LC_ALL, 'ru_RU'); require_once 'config.php'; require_once 'lib5.php'; require_once OLIB_PATH . '/class.session.php'; require_once OLIB_PATH . '/class.cache.php'; define('USER_NAME', 'REMOTE_USER'); $tpl =& initFastTemplate(); $cache = new Cache(); $ses = new Session(true); $tpl->assign('MESSAGE', $ses->msg()); if ($ses->url()) { $target_url = $ses->url(); } else { $target_url = '/'; } if (isset($_POST['USERNAME']) || isset($_SERVER[USER_NAME])) { $ses->dispose('uid'); $usr = new User5(isset($_POST['USERNAME']) ? $_POST['USERNAME'] : $_SERVER[USER_NAME]); if ($usr->count > 0) { if (isset($_SERVER[USER_NAME]) || $_POST['PASS'] && strlen($_POST['PASS']) > 0 && $usr->checkPass($_POST['PASS'])) { $ses->uid($usr->samaccountname); $ses->login($usr->samaccountname); $ses->valueOf('cn', $usr->cn); $tar = array(); if ($usr->directreports) { $tar = $usr->fullName2account($usr->directreports); } else { $tar[] = $usr->samaccountname;