本文整理汇总了PHP中CSession::isAuth方法的典型用法代码示例。如果您正苦于以下问题:PHP CSession::isAuth方法的具体用法?PHP CSession::isAuth怎么用?PHP CSession::isAuth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSession
的用法示例。
在下文中一共展示了CSession::isAuth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionSave
public function actionSave()
{
$quest = new CQuestion();
$quest->setAttributes(CRequest::getArray($quest::getClassName()));
if ($quest->validate()) {
if (!CSession::isAuth()) {
$user = "";
} else {
$user = CStaffManager::getUser(CSession::getCurrentUser()->getId())->getName();
}
$quest->contact_info .= " " . $user . '; ip ' . $_SERVER["REMOTE_ADDR"];
if ($quest->answer_text != '') {
$quest->datetime_answ = date("Y-d-m H:i:s", time());
}
$quest->save();
if ($this->continueEdit()) {
$this->redirect("?action=edit&id=" . $quest->getId());
} else {
$this->redirect(WEB_ROOT);
}
return true;
}
$this->setData("quest", $quest);
$this->renderView("__public/_question_add/edit.tpl");
}
示例2: __construct
public function __construct()
{
if (!CSession::isAuth()) {
//$this->redirectNoAccess();
}
$this->_smartyEnabled = true;
$this->setPageTitle("Справочник видов работ");
parent::__construct();
}
示例3: __construct
public function __construct()
{
if (!CSession::isAuth()) {
$this->redirectNoAccess();
}
$this->_smartyEnabled = true;
$this->setPageTitle("Справочная система Портала");
parent::__construct();
}
示例4: __construct
public function __construct()
{
if (!CSession::isAuth()) {
if (!in_array(CRequest::getString("action"), $this->allowedAnonymous)) {
$this->redirectNoAccess();
}
}
$this->_smartyEnabled = true;
$this->setPageTitle("Управление таблицами доступа");
parent::__construct();
}
示例5: __construct
public function __construct()
{
if (!CSession::isAuth()) {
if (!in_array(CRequest::getString("action"), $this->allowedAnonymous)) {
$this->redirectNoAccess();
}
}
$this->_smartyEnabled = true;
$this->setPageTitle("Учебные группы студентов");
$this->_useDojo = true;
parent::__construct();
}
示例6: __construct
public function __construct()
{
if (!CSession::isAuth()) {
$this->redirectNoAccess();
}
if (CSession::getCurrentUser()->getLevelForCurrentTask() == ACCESS_LEVEL_NO_ACCESS) {
$this->redirectNoAccess();
}
$this->_smartyEnabled = true;
$this->setPageTitle("Учебная нагрузка");
parent::__construct();
}
示例7: actionIndex
public function actionIndex()
{
$parent = 0;
$title = "Нормативные документы";
if (CRequest::getInt("parent")) {
$parent = CRequest::getInt("parent");
$parentFolder = CDocumentsManager::getFolder($parent);
if (!is_null($parentFolder)) {
$title = $parentFolder->title;
}
}
// извлекаем все папки с учетом иерархии
$query = new CQuery();
$query->select("f.*")->from(TABLE_DOCUMENT_FOLDERS . " as f")->condition("f.parent_id = " . $parent)->order("f.title asc");
$objects = new CArrayList();
foreach ($query->execute()->getItems() as $ar) {
$folder = new CDocumentFolder(new CActiveRecord($ar));
$objects->add($objects->getCount(), $folder);
}
// теперь извлекаем все файлы
$query = new CQuery();
$query->select("f.*")->from(TABLE_DOCUMENTS . " as f")->condition("f.folder_id = " . $parent . " and f.nameFolder like 'gost%'")->order("f.browserFile asc");
foreach ($query->execute()->getItems() as $ar) {
$file = new CDocumentFile(new CDocumentActiveRecord($ar));
$objects->add($objects->getCount(), $file);
}
$this->setData("title", $title);
$this->setData("objects", $objects);
/**
* Генерация меню
*/
// если есть родительская папка, то переходим в нее
if ($parent != 0) {
$parentFolder = CDocumentsManager::getFolder($parent);
if (!is_null($parentFolder)) {
$this->addActionsMenuItem(array("title" => "Назад", "link" => "index.php?action=index&parent=" . $parentFolder->parent_id, "icon" => "actions/edit-undo.png"));
}
}
// если пользователь может чего-нибудь добавлять, то пусть добавит
$this->setData("canEdit", false);
if (CSession::isAuth()) {
if (CSession::getCurrentUser()->getLevelForCurrentTask() == ACCESS_LEVEL_WRITE_ALL || CSession::getCurrentUser()->getLevelForCurrentTask() == ACCESS_LEVEL_WRITE_OWN_ONLY) {
$this->addActionsMenuItem(array("title" => "Создать папку", "link" => "index.php?action=add&parent=" . $parent, "icon" => "actions/folder-new.png"));
$this->addActionsMenuItem(array("title" => "Загрузить файл", "link" => "files.php?action=add&parent=" . $parent, "icon" => "actions/bookmark-new.png"));
$this->setData("canEdit", true);
}
}
/**
* Отображение представления
*/
$this->addCSSInclude("_modules/_documents/style.css");
$this->renderView("_documents/_folder/index.tpl");
}
示例8: __construct
public function __construct()
{
if (!CSession::isAuth()) {
$action = CRequest::getString("action");
if ($action == "") {
$action = "index";
}
if (!in_array($action, $this->allowedAnonymous)) {
$this->redirectNoAccess();
}
}
$this->_smartyEnabled = true;
$this->setPageTitle("Редактирование страниц портала");
parent::__construct();
}
示例9: __construct
public function __construct()
{
if (!CSession::isAuth()) {
$action = CRequest::getString("action");
if ($action == "") {
$action = "index";
}
if (!in_array(CRequest::getString("action"), $this->allowedAnonymous)) {
$this->redirectNoAccess();
}
}
$this->_smartyEnabled = true;
$this->setPageTitle("Предзащита ВКР - студенты");
parent::__construct();
}
示例10: __construct
public function __construct()
{
if (!CSession::isAuth()) {
$action = CRequest::getString("action");
if ($action == "") {
$action = "index";
}
if (!in_array($action, $this->allowedAnonymous)) {
$this->redirectNoAccess();
}
}
$this->_useDojo = true;
$this->_smartyEnabled = true;
$this->setPageTitle("Комиссии ГАК");
parent::__construct();
}
示例11: __construct
public function __construct()
{
if (!CSession::isAuth()) {
$action = CRequest::getString("action");
if ($action == "") {
$action = "index";
}
if (!in_array($action, $this->allowedAnonymous)) {
$this->redirectNoAccess();
}
} else {
if (CSession::getCurrentUser()->getLevelForCurrentTask() == ACCESS_LEVEL_NO_ACCESS) {
$this->redirectNoAccess();
}
}
$this->_smartyEnabled = true;
$this->setPageTitle("Новости портала кафедры АСУ");
parent::__construct();
}
示例12: getAuthorName
public function getAuthorName()
{
$result = "";
/**
* Если включена защита персональных данных и
* пользователь не авторизован, то не показываем ссылку
*/
if (CSettingsManager::getSettingValue("hide_personal_data")) {
if (!CSession::isAuth()) {
return $result;
}
}
if (!is_null($this->document)) {
if (!is_null($this->document->person)) {
$result = $this->document->person->getName();
}
}
return $result;
}
示例13: actionViewFiles
public function actionViewFiles()
{
$files = CLibraryManager::getFilesByFolder(CRequest::getInt("id"));
if (!is_null(CRequest::getFilter("author"))) {
$author = CRequest::getFilter("author");
} else {
$author = CSession::getCurrentUser()->getId();
}
$this->addActionsMenuItem(array(array("title" => "Назад", "link" => WEB_ROOT . "_modules/_library/index.php?action=view&filter=author:" . CRequest::getFilter("author"), "icon" => "actions/edit-undo.png")));
if (CSession::isAuth() and (CSession::getCurrentUser()->getLevelForCurrentTask() == ACCESS_LEVEL_WRITE_OWN_ONLY or CSession::getCurrentUser()->getLevelForCurrentTask() == ACCESS_LEVEL_WRITE_ALL)) {
$this->addActionsMenuItem(array(array("title" => "Добавить файл", "link" => WEB_ROOT . "_modules/_library/index.php?action=addFile&id=" . CRequest::getInt("id") . "&filter=author:" . CRequest::getFilter("author"), "icon" => "actions/list-add.png")));
}
$this->setData("files", $files);
$this->renderView("_library/viewFiles.tpl");
}
示例14: actionSaveCalendar
public function actionSaveCalendar()
{
if (!CSession::isAuth()) {
$this->redirectNoAccess();
}
$cal = CFactory::createCalendar();
$cal->setName(CRequest::getString("name"));
$cal->setDescription(CRequest::getString("description"));
$cal->setDefault(false);
$cal->setResource(CSession::getCurrentPerson()->getResource());
$cal->save();
$this->redirect(WEB_ROOT . "_modules/_calendar/");
}
示例15: getAuthorName
/**
* ФИО автора
*
* @return string
*/
public function getAuthorName()
{
/**
* Если включена защита персональных данных, то не показываем
* ФИО. Также не показываем ее если пользователь не авторизован
*/
if (CSettingsManager::getSettingValue("hide_personal_data")) {
if (CSession::isAuth()) {
if (is_null($this->author)) {
return "";
} else {
if (is_null($this->author->getPerson())) {
return "";
} else {
return $this->author->getPerson()->getName();
}
}
}
} else {
if (is_null($this->author)) {
return "";
} else {
if (is_null($this->author->getPerson())) {
return "";
} else {
return $this->author->getPerson()->getName();
}
}
}
}