function __construct() { $this->mysql = MSQL::Instance(); $this->m_users = M_Users::Instance(); $this->form_art = array(); parent::__construct(); }
protected function OnInput() { $mUsers = M_Users::Instance(); parent::onInput(); $this->mysql->Connect('localhost', 'root', '', 'liveblog'); $mUsers->ClearSessions(); $this->title = $this->title . ' :: Редактор статей'; if ($this->IsPost()) { if ($mUsers->Login($_POST['login'], $_POST['password'])) { header('Location: index.php?c=editor'); die; } $this->login = $_POST['login']; } if (empty($_GET['id'])) { $this->articles = $this->mysql->Select('SELECT * FROM articles'); $this->articles = $this->m_articles->cut_contents($this->articles); $this->back = 0; } else { $this->articles = $this->m_articles->show_one_article($_GET['id']); $this->back = '1'; } // $vars = array('title' => $this->title, 'content' => $this->content); // $page = $this->Template('views/v_main.php', $vars); // echo $page; }
protected function OnInput() { $mUsers = M_Users::Instance(); parent::onInput(); $this->mysql->Connect('localhost', 'root', '', 'liveblog'); $this->title = $this->title . ' :: Чтение'; if ($this->IsPost()) { if ($mUsers->Login($_POST['login'], $_POST['password'])) { header('Location: index.php?c=index'); die; } } if (empty($_GET['id'])) { $this->articles = $this->mysql->Select('SELECT * FROM articles ORDER BY add_time DESC'); $this->articles = $this->m_articles->cut_contents($this->articles); $this->back = 0; } else { if ($_GET['id'] === 'logout') { $mUsers->Logout(); header('Location: index.php'); exit; } $this->articles = $this->m_articles->show_one_article_index($_GET['id']); $this->back = '1'; $this->last_edit = '1'; } // $vars = array('title' => $this->title, 'content' => $this->content); // $page = $this->Template('views/v_main.php', $vars); // echo $page; }
protected function OnOutput() { $mUsers = M_Users::Instance(); $mDocument = M_Document::Instance(); $tpl = 'tpl_listuser.php'; $userall = $mUsers->Alluser(); //все пользователи вообще $vars = array('canUseSecretFunctions' => $mUsers->Can('USE_SECRET_FUNCTIONS'), 'userall' => $userall, 'result' => $this->id); // Менеджеры. // Генерация содержимого страницы Welcome. $this->content = $this->View($tpl, $vars); //собираем и выводим данные для левой колонки if ($sid = $mUsers->GetSid()) { $listdoc = $mUsers->Get_idoc_user($sid); //запрашиваем последние выбранные документы для SID $sidresult = true; } $vars2 = array('var' => $listdoc, 'sidresult' => $sidresult); //тестовая строка);а); $this->leftcontent = $this->View('tpl_leftlistdoc.php', $vars2); //собираем и выводим данные для правого меню $vars2 = array('var' => array('Редактировать Теги' => 'index.php?c=editteg', 'Редактировать Типы загружаемых файлов' => 'index.php?c=edittype')); $this->rightmenu = $this->View('tpl_rightmenu.php', $vars2); // C_Base. parent::OnOutput(); }
function __construct() { parent::__construct(); $this->needLogin = true; $this->mRasp = M_Rasp::Instance(); $this->mUsers = M_Users::Instance(); $this->mComm = M_Comment::Instance(); }
protected function OnOutput() { $mUsers = M_Users::Instance(); $mSv = M_Sv::Instance(); $name = $mSv->alltextteg($this->teg, 20); //часто употребляемые описания для данного тега print json_encode($name); }
function __construct() { $this->needLogin = false; $this->user = M_Users::Instance()->Get(); $this->keywords = ""; $this->description = ""; $this->styles = array('bootstrap', 'lightbox', 'video-js.min', 'plugin_diafilm', 'main'); $this->scripts = array('jquery-1.11.2.min', 'bootstrap.min', 'lightbox-2.6.min', 'video.min', 'custom/plugin_diafilm', 'custom/main_script'); }
function __construct() { $this->needLogin = false; $this->user = null; $this->mUsers = M_Users::Instance(); $this->mVK = M_VK::Instance(); $this->mUsers = M_Users::Instance(); $this->mSmsRasp = M_SmsRasp::Instance(); }
protected function OnOutput() { $mUsers = M_Users::Instance(); $mSv = M_Sv::Instance(); $teg = $mSv->getteg($this->docid); //все теги документе касающиеся документа print json_encode($teg); //отправляем назад }
protected function OnOutput() { $mUsers = M_Users::Instance(); $mSv = M_Sv::Instance(); $name = $mSv->autocomplete($this->text, $this->teg, LIMIT_AUTOCOMPLETE); //часто употребляемые описания для данного тега //$name[]='yy12';$name[]="$this->text"; print json_encode($name); }
protected function OnInput() { parent::OnInput(); // Подключаем необходимые классы. $mUsers = M_Users::Instance(); // Текущий пользователь. $this->user = $mUsers->Get(); $this->title = 'Главная - Электронная библиотека'; }
function __construct() { parent::__construct(); // Подключаем менеджер работы с расписанием. $this->mRasp = M_Rasp::Instance(); $this->mUsers = M_Users::Instance(); //Получаем текущую неделю $this->now_week = $this->mRasp->get_num_edu_week(date("d-m-Y")); }
public function action_admin() { $this->title .= ':: Страница администратора'; $mUsers = M_Users::Instance(); $this->msql = M_MSQL::Instance(); //$mUsers->Logout(); if (!$mUsers->Can('EDIT_USERS')) { $this->redirect('/'); } $User = $mUsers->Get(); // Обработка POST - запроса //var_dump ($_POST); if (isset($_POST)) { $p2r = array(); $table = 'privs2roles'; //$result = $this -> msql -> clean ($table); $object = array(); // Изменение ролей пользователей foreach ($_POST as $key => $value) { if ($value != 'on') { $object[id_role] = $value; $where = "id_user = {$key}"; $result = $this->msql->update('users', $object, $where); } // Изменение привелегий if ($value == 'on') { $arr = str_split($key); $role = $arr[1]; $priv = $arr[3]; $table = 'privs2roles'; // if (!($mUsers -> entry_exist ($role, $priv))) // { // $object1 = array ('id_role' => $role, 'id_priv' => $priv); // $result = $this -> msql -> insert($table, $object1); // } $p2r[] = $role; $p2r[] = $priv; } } if ($p2r) { $x = $mUsers->replace_privs2roles($p2r); } } // Получение сводной таблицы пользователей $userdata = $mUsers->AdminUsersRoles(); $privcolumns = $this->msql->rows_count('privs'); $number_roles = $this->msql->rows_count('roles'); // Получение сводной таблицы привелегий $privsdata = $mUsers->AdminPrivsRoles(); $privs = $mUsers->get_Privs(); //Вывод $layout = 'admin'; $vars = array('layout' => $layout, 'username' => $User["name"]); $this->menu = $this->Template('./v/elements/menu.php', $vars); $vars = array('userdata' => $userdata, 'privsdata' => $privsdata, 'number_roles' => $number_roles, 'privs' => $privs, 'privcolumns' => $privcolumns, 'menu' => $this->menu); $this->content = $this->Template('./v/v_admin.php', $vars); }
protected function OnOutput() { $mUsers = M_Users::Instance(); $mTeg = M_Teg::Instance(); $tpl = '__tpl_editteg.php'; $vars = array('canUseSecretFunctions' => $mUsers->Can('USE_SECRET_FUNCTIONS'), 'result' => $this->result, 'del' => $this->del, 'doc' => $this->doc, 'teg' => $this->tegname); $this->content = $this->View($tpl, $vars); // C_Base. parent::OnReturn(); }
function __construct() { $this->needLogin = true; $this->styles = array('bootstrap', 'dashboard', 'video-js.min'); $this->scripts = array('jquery-1.11.2.min', 'bootstrap.min', 'custom/main_script', 'video.min'); $this->user = M_Users::Instance()->Get(); $this->template_name = M_Templates::Instance()->getCurrentTemplate(); $this->templateDir = BASE_URL . TEMPLATE_DIR . $this->template_name; $this->template = $this->getTemplate('v_admin.php'); $this->getMediaTemplate(substr($this->templateDir, iconv_strlen(BASE_URL)) . '/media_admin.info'); }
function __construct() { parent::__construct(); $this->needLogin = true; // раскомментируйте, чтобы закрыть неавторизованный доступ к странице // Менеджеры. $this->mUsers = M_Users::Instance(); $this->mSms = M_Sms::Instance(); $this->mRasp = M_Rasp::Instance(); $this->mSet = M_Setting::Instance(); }
protected function OnOutput() { $mUsers = M_Users::Instance(); $this->loginon = $mUsers->Get(); if (!$this->loginon) { $this->form = $this->Template('views/v_main_a_form.php'); } $vars = array('title' => $this->title, 'content' => $this->content, 'styles' => $this->styles, 'form' => $this->form, 'user' => $this->loginon['login']); $page = $this->Template('views/v_main.php', $vars); echo $page; }
private function configuration() { Assets::$test = TRUE; // Delete in real $this->fc = FrontController::getInstance(); $this->controller = strtolower(str_replace('Controller', '', $this->fc->getController())); $this->action = strtolower(str_replace('Action', '', $this->fc->getAction())); $this->view = new View(); $this->params = $this->fc->getParams(); if ($this->controller == 'error') { return; } // Users and Access $this->mu = M_Users::Instance(); $this->user = $this->mu->GetUser(); $accessByIp = IpAccess::isAccess($_SERVER['REMOTE_ADDR']); if ((!$accessByIp || $this->user->locked) && $this->controller != 'authorization') { $expire = time() + 3600 * 24 * 100; setcookie('rUrl', $_SERVER['REQUEST_URI'], $expire, "/"); $this->redirect(array('authorization', 'login')); exit; } $access = new Access(); $access->fillFromUser($this->user); $access->setAccessParams($this->controller, $this->action); $sectionAccess = $access->sectionAccess(); $actionAccess = $access->actionAccess(); if (!$sectionAccess || !$actionAccess) { if ($this->user->isGuest) { $expire = time() + 3600 * 24 * 100; setcookie('rUrl', $_SERVER['REQUEST_URI'], $expire, "/"); $this->redirect(array('authorization', 'login')); } $pageArr = $access->UserAccessPage; $redirectArray = $pageArr ? $pageArr : array('error', ''); $this->redirect($redirectArray); } $this->access = $access; $sInfo = $access->actionAccess(array('service', 'info')) ? true : false; $this->fc->setSInfo($sInfo); unset($access); $this->pageTitle = __('pageTitle'); $array = array('access' => $this->access, 'controller' => $this->controller, 'action' => $this->action, 'user' => $this->user); $this->setMainVars($array); if (!empty($_POST)) { $_POST = AF::clearDataArray($_POST); } // Set user AF::setUser($this->user); AF::setUserAccess($this->access); //$sectionID = ( isset($this->params['id']) && is_numeric($this->params['id']) ) ? $this->params['id'] : ''; //Log::createLog($this->user->user_id, $this->action."Action", $this->controller, $sectionID); }
protected function OnInput() { parent::OnInput(); // Подключаем необходимые классы. $mUsers = M_Users::Instance(); $mLibrary = M_Library::Instance(); // Текущий пользователь. $this->user = $mUsers->Get(); $this->title = 'Поиск по сайту - Электронная библиотека'; if (!empty($_POST)) { $this->result = $mLibrary->Search($_POST['search']); } }
protected function OnOutput() { $mUsers = M_Users::Instance(); // Основной шаблон всех страниц. $vars = array('content' => $this->content, 'user' => $this->user, 'administration' => $mUsers->Can('administration'), 'leftcontent' => $this->leftcontent, 'rightmenu' => $this->rightmenu); $page = $this->View('tpl_main.php', $vars); // Время обработки запроса. $time = microtime(true) - $this->start_time; $page .= "<!-- Время генерации страницы: {$time} сек.-->"; //$page = "Время генерации страницы: $time сек"; // Вывод HTML. echo $page; }
protected function OnInput() { $this->title = 'Название страницы'; $this->content = ''; $this->user = null; // Если для просмотра страницы сайта нужна авторизация if ($this->needLogin) { $mUsers = M_Users::Instance(); if ($mUsers->Get() == null) { header("Location: index.php?act=login"); die; } } }
protected function OnInput() { parent::OnInput(); // Подключаем необходимые классы. $mUsers = M_Users::Instance(); // Текущий пользователь. $this->user = $mUsers->Get(); // Может ли пользователь просматривать данную страницу if (!$mUsers->Can('Editor_library')) { header("Location: index.php"); die('Отказано в доступе'); } $this->title = 'Панель управления - Электронная библиотека'; }
public function action_registration() { $this->title .= ':: Регистрация'; $mUsers = M_Users::Instance(); $this->remember_ = false; if ($this->isPost()) { $message = $mUsers->Registration($_POST['login'], $_POST['password'], isset($_POST['nick'])); if ($message == "registred") { $this->redirect('/'); } } $vars = array('remember_' => $this->remember_, 'message' => $message); $this->content = $this->Template('v/v_login.php', $vars); }
protected function OnOutput() { $mUsers = M_Users::Instance(); $mTeg = M_Teg::Instance(); $mSv = M_Sv::Instance(); $mDocument = M_Document::Instance(); $mType = M_Type::Instance(); if ($this->resultget != null) { $id = $this->docid; $doc = $mDocument->getdocument($id); //полная информация о документе $docpart = $mType->getpart($doc[0]['type']); $doctypename = $mType->getname($doc[0]['type']); $typeall = $mType->Alltype(); //все типы вообще $tegdoc = $mSv->getteg($id); //все теги касающиеся документа $tegall = $mTeg->allteg(); //все теги вообще $error = $mDocument->geterror(); //$tegid=$teg[0]['id']; //передаем информацию на страницу $docdate = $doc[0]['date']; $tpl = 'tpl_editdoc.php'; $vars = array('doc' => $doc[0], 'docpart' => $docpart, 'doctypename' => $doctypename, 'docdate' => $docdate, 'tegdoc' => $tegdoc, 'tegall' => $tegall, 'textteg' => $this->textteg, 'error' => $error, 'alltype' => $typeall, 'canUseSecretFunctions' => $mUsers->Can('USE_SECRET_FUNCTIONS')); } else { $tpl = 'tpl_welcome.php'; $vars = array('canUseSecretFunctions' => $mUsers->Can('USE_SECRET_FUNCTIONS'), 'result' => 'ничего'); } // Менеджеры. // Генерация содержимого страницы Welcome. $this->content = $this->View($tpl, $vars); //собираем и выводим данные для левой колонки if ($sid = $mUsers->GetSid()) { $listdoc = $mUsers->Get_idoc_user($sid); //запрашиваем последние выбранные документы для SID $sidresult = true; } $vars2 = array('var' => $listdoc, 'sidresult' => $sidresult); //тестовая строка); $this->leftcontent = $this->View('tpl_leftlistdoc.php', $vars2); //собираем и выводим данные для правого меню $vars2 = array('var' => array('список всех документов' => 'index.php?c=listdoc', 'Загрузка новых документов' => 'index.php?c=newdoc', 'вернутся к просмотру' => "index.php?c=viewdoc&id={$id}", 'редактировать типы загружаемых файлов' => 'index.php?c=edittype', 'Дубликат' => "index.php?c=newdoc&idcopy={$id}")); $this->rightmenu = $this->View('tpl_rightmenu.php', $vars2); // C_Base. parent::OnOutput(); // echo $this->content; }
protected function OnInput() { // Выход из системы пользователя. $mUsers = M_Users::Instance(); $mUsers->Logout(); // C_Base. parent::OnInput(); // Обработка отправки формы. if ($this->IsPost()) { if ($mUsers->Login($_POST['login'], $_POST['password'], isset($_POST['remember']))) { header('Location: index.php'); die; } $this->login = $_POST['login']; } }
protected function OnInput() { parent::OnInput(); // Подключаем необходимый класс. $mUsers = M_Users::Instance(); $this->title = 'Авторизация - Электронная библиотека'; // Очистка старых сессий. $mUsers->ClearSessions(); // Выход. $mUsers->Logout(); // Обработка отправки формы. if (!empty($_POST)) { if ($mUsers->Login($_POST['login'], $_POST['password'])) { header('Location: index.php?act=editor_library'); die; } } }
protected function OnOutput() { $mUsers = M_Users::Instance(); $mType = M_Type::Instance(); $mDocument = M_Document::Instance(); //$this->result; $alltype = $mType->alltype(); $tpl = '__tpl_newtype.php'; $vars = array('canUseSecretFunctions' => $mUsers->Can('USE_SECRET_FUNCTIONS'), 'result' => $this->result, 'alltype' => $alltype); $this->content = $this->View($tpl, $vars); //собираем и выводим данные для левой колонки if ($sid = $mUsers->GetSid()) { $listdoc = $mUsers->Get_idoc_user($sid); //запрашиваем последние выбранные документы для SID $sidresult = true; } $vars2 = array('var' => $listdoc, 'sidresult' => $sidresult); //тестовая строка); $this->leftcontent = $this->View('tpl_leftlistdoc.php', $vars2); // C_Base. parent::OnReturn(); }
protected function OnInput() { parent::OnInput(); // Подключаем необходимые классы. $mUsers = M_Users::Instance(); $mLibrary = M_Library::Instance(); // Текущий пользователь. $this->user = $mUsers->Get(); // Может ли пользователь просматривать данную страницу if (!$mUsers->Can('Editor_library')) { header("Location: index.php"); die('Отказано в доступе'); } if (isset($_GET['id_author_del'])) { if ($mLibrary->DeleteAuthor($_GET['id_author_del'])) { header('Location: index.php?act=section_authors'); die; } } $this->title = 'ПУ Раздел авторов - Электронная библиотека'; $this->authors = $mLibrary->AllAuthors(); }
protected function OnInput() { $mUsers = M_Users::Instance(); parent::onInput(); $this->mysql->Connect('localhost', 'root', '', 'liveblog'); $result = $this->m_users->Get(); $mUsers->ClearSessions(); $this->title = $this->title . ' :: Добавить статью'; if ($this->isPost()) { $now = date('Y-m-d H:i:s'); $result = $this->m_articles->New_article($_POST['title'], $_POST['content'], $result['login'], $now); if ($result) { header('Location: index.php?c=editor'); } else { $this->articles['title'] = $_POST['title']; $this->articles['content'] = $_POST['content']; } } else { $this->articles['title'] = ''; $this->articles['content'] = ''; } }
protected function OnInput() { parent::OnInput(); // Подключаем необходимый класс. $mUsers = M_Users::Instance(); $mLibrary = M_Library::Instance(); // Текущий пользователь. $this->user = $mUsers->Get(); // Может ли пользователь просматривать данную страницу if (!$mUsers->Can('Add_book')) { header("Location: index.php"); die('Отказано в доступе'); } $this->title = 'ПУ Добавить книгу - Электронная библиотека'; // Обработка отправки формы. if (!empty($_POST)) { if ($mLibrary->AddBook($_POST['title_book'])) { header('Location: index.php?act=section_books'); die; } } }