本文整理汇总了PHP中cmsUser::sessionDel方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsUser::sessionDel方法的具体用法?PHP cmsUser::sessionDel怎么用?PHP cmsUser::sessionDel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cmsUser
的用法示例。
在下文中一共展示了cmsUser::sessionDel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: applet_users
//.........这里部分代码省略.........
cpToolMenu($toolmenu);
if ($do == 'edit') {
if (cmsCore::inRequest('multiple')){
if (cmsCore::inRequest('item')){
$_SESSION['editlist'] = cmsCore::request('item', 'array_int', array());
} else {
cmsCore::addSessionMessage($_LANG['AD_NO_SELECT_OBJECTS'], 'error');
cmsCore::redirectBack();
}
}
$ostatok = '';
if (isset($_SESSION['editlist'])) {
$item_id = array_shift($_SESSION['editlist']);
if (count($_SESSION['editlist']) == 0) {
unset($_SESSION['editlist']);
} else {
$ostatok = '('. $_LANG['AD_NEXT_IN'] . count($_SESSION['editlist']) .')';
}
} else {
$item_id = cmsCore::request('id', 'int', 0);
}
$mod = cmsCore::c('db')->get_fields('cms_users', "id = '". $item_id ."'", '*');
if (!$mod) { cmsCore::error404(); }
echo '<h3>'. $_LANG['AD_USER_EDIT'] .' '. $ostatok .'</h3>';
cpAddPathway($mod['nickname']);
} else {
$mod = cmsUser::sessionGet('items');
if ($mod) { cmsUser::sessionDel('items'); }
cpAddPathway($_LANG['AD_USER_ADD']);
}
cmsCore::c('page')->addHeadJS('components/registration/js/check.js');
?>
<form action="index.php?view=users" method="post" enctype="multipart/form-data" name="addform" id="addform">
<input type="hidden" name="csrf_token" value="<?php echo cmsUser::getCsrfToken(); ?>" />
<div style="width:500px;">
<div class="form-group">
<label><?php echo $_LANG['LOGIN']; ?>:</label>
<input type="text" id="logininput" class="form-control" name="login" value="<?php echo cmsCore::getArrVal($mod, 'login', ''); ?>" onchange="checkLogin()" />
<?php if ($do == 'edit') { echo '<div class="help-block" style="text-align:right;"><a target="_blank" href="/users/'. $mod['login'] .'" title="'. $_LANG['AD_USER_PROFILE'] .'">'. $_LANG['AD_USER_PROFILE'] .'</a></div>'; } ?>
</div>
<div class="form-group">
<label><?php echo $_LANG['NICKNAME']; ?>:</label>
<input type="text" id="login" class="form-control" name="nickname" value="<?php echo htmlspecialchars(cmsCore::getArrVal($mod, 'nickname', '')); ?>" />
</div>
<div class="form-group">
<label><?php echo $_LANG['EMAIL']; ?>:</label>
<input type="text" id="nickname" class="form-control" name="email" value="<?php echo cmsCore::getArrVal($mod, 'email', ''); ?>" />
</div>
<div class="form-group">
<label><?php if ($do == 'edit') { echo $_LANG['AD_NEW_PASS']; } else { echo $_LANG['PASS']; } ?></label>
<input type="password" id="pass" class="form-control" name="pass" />
</div>
<div class="form-group">
<label><?php echo $_LANG['REPEAT_PASS']; ?>:</label>
示例2: content
//.........这里部分代码省略.........
cmsPage::initTemplate('components', $article['tpl'])->assign('article', $article)->assign('cfg', $model->config)->assign('page', $page)->assign('is_pages', !empty($GLOBALS['pt']))->assign('pt_pages', $pt_pages)->assign('is_admin', $is_admin)->assign('is_editor', $is_editor)->assign('is_author', $is_author)->assign('is_author_del', $is_author_del)->assign('tagbar', cmsTagBar('content', $article['id']))->assign('karma_points', @$karma_points)->assign('karma_votes', @$karma['votes'])->assign('karma_buttons', @$btns)->display($article['tpl']);
// Комментарии статьи
if ($article['published'] && $article['comments'] && $inCore->isComponentInstalled('comments')) {
cmsCore::includeComments();
comments('article', $article['id'], array(), $is_author);
}
}
///////////////////////////////////// ADD ARTICLE //////////////////////////////////////////////////////////////////////////////////
if ($do == 'addarticle' || $do == 'editarticle') {
$is_add = cmsUser::isUserCan('content/add');
// может добавлять статьи
$is_auto_add = cmsUser::isUserCan('content/autoadd');
// добавлять статьи без модерации
if (!$is_add && !$is_auto_add) {
cmsCore::error404();
}
// Для редактирования получаем статью и проверяем доступ
if ($do == 'editarticle') {
// Получаем статью
$item = $model->getArticle($id);
if (!$item) {
cmsCore::error404();
}
$pubcats = array();
// доступ к редактированию админам, авторам и редакторам
if (!$inUser->is_admin && $item['user_id'] != $inUser->id && !($item['modgrp_id'] == $inUser->group_id && cmsUser::isUserCan('content/autoadd'))) {
cmsCore::error404();
}
}
// Для добавления проверяем не вводили ли мы данные ранее
if ($do == 'addarticle') {
$item = cmsUser::sessionGet('article');
if ($item) {
cmsUser::sessionDel('article');
}
// Категории, в которые разрешено публиковать
$pubcats = $model->getPublicCats();
if (!$pubcats) {
cmsCore::addSessionMessage($_LANG['ADD_ARTICLE_ERR_CAT'], 'error');
cmsCore::redirectBack();
}
}
// не было запроса на сохранение, показываем форму
if (!cmsCore::inRequest('add_mod')) {
$dynamic_cost = false;
// Если добавляем статью
if ($do == 'addarticle') {
$pagetitle = $_LANG['ADD_ARTICLE'];
$inPage->setTitle($pagetitle);
$inPage->addPathway($_LANG['USERS'], '/' . str_replace('/', '', cmsUser::PROFILE_LINK_PREFIX));
$inPage->addPathway($inUser->nickname, cmsUser::getProfileURL($inUser->login));
$inPage->addPathway($_LANG['MY_ARTICLES'], '/content/my.html');
$inPage->addPathway($pagetitle);
// поддержка биллинга
if (IS_BILLING) {
$action = cmsBilling::getAction('content', 'add_content');
foreach ($pubcats as $p => $pubcat) {
if ($pubcat['cost']) {
$dynamic_cost = true;
} else {
$pubcats[$p]['cost'] = $action['point_cost'][$inUser->group_id];
}
}
cmsBilling::checkBalance('content', 'add_content', $dynamic_cost);
}
}
示例3: end
if (!$photos) {
cmsCore::error404();
}
cmsCore::loadLanguage('components/photos');
if (!cmsCore::inRequest('submit')) {
$p = end($photos);
$album_id = $p['album_id'];
$albums = $model->getPhotoAlbums($usr['id'], true, true);
$inPage->setTitle($_LANG['PHOTOS_CONFIG']);
$inPage->addPathway($usr['nickname'], cmsUser::getProfileURL($usr['login']));
$inPage->addPathway($_LANG['PHOTOALBUMS'], '/users/' . $usr['id'] . '/photoalbum.html');
$inPage->addPathway($_LANG['PHOTOS_CONFIG']);
cmsPage::initTemplate('components', 'com_users_photo_submit')->assign('user_id', $usr['id'])->assign('albums', $albums)->assign('photos', $photos)->assign('album_id', $album_id)->assign('is_edit', cmsCore::request('is_edit', 'int', 0))->display('com_users_photo_submit.tpl');
}
if (cmsCore::inRequest('submit')) {
cmsUser::sessionDel('photos_list');
$new_album = cmsCore::request('new_album', 'int', 0);
$delete = cmsCore::request('delete', 'array_int');
$titles = cmsCore::request('title', 'array_str');
$allow = cmsCore::request('allow', 'array_str');
$desc = cmsCore::request('desc', 'array_str');
$is_edit = cmsCore::request('is_edit', 'int', 0);
foreach ($delete as $photo_id) {
$model->deletePhoto($photo_id);
}
if ($new_album) {
$album['user_id'] = $usr['id'];
$album['title'] = cmsCore::request('album_title', 'str', $_LANG['PHOTOALBUM'] . ' ' . date('d.m.Y'));
$album['allow_who'] = cmsCore::request('album_allow_who', 'str', 'all');
$album['description'] = cmsCore::request('description', 'str', '');
$album_id = $model->addPhotoAlbum($album);
示例4: applet_userbanlist
//.........这里部分代码省略.........
if (!$items['ip']) {
$error = true;
cmsCore::addSessionMessage($_LANG['AD_NEED_IP'], 'error');
}
if ($items['ip'] == $_SERVER['REMOTE_ADDR'] ||
$items['user_id'] == cmsCore::c('user')->id) {
$error = true;
cmsCore::addSessionMessage($_LANG['AD_ITS_YOUR_IP'], 'error');
}
if (cmsUser::userIsAdmin($items['user_id'])) {
$error = true;
cmsCore::addSessionMessage($_LANG['AD_ITS_ADMIN'], 'error');
}
if ($error) {
cmsCore::redirectBack();
}
if ($do == 'update') {
cmsCore::c('db')->update('cms_banlist', $items, $id);
if (empty($_SESSION['editlist'])) {
cmsCore::redirect('?view=userbanlist');
} else {
cmsCore::redirect('?view=userbanlist&do=edit');
}
}
cmsCore::c('db')->insert('cms_banlist', $items);
$back_url = cmsUser::sessionGet('back_url');
cmsUser::sessionDel('back_url');
cmsCore::redirect($back_url ? $back_url : '?view=userbanlist');
}
if ($do == 'add' || $do == 'edit') {
cmsCore::c('page')->addHeadJS('admin/js/banlist.js');
$toolmenu = array(
array( 'icon' => 'save.gif', 'title' => $_LANG['SAVE'], 'link' => 'javascript:document.addform.submit();' ),
array( 'icon' => 'cancel.gif', 'title' => $_LANG['CANCEL'], 'link' => 'javascript:history.go(-1);' )
);
cpToolMenu($toolmenu);
if ($do == 'add') {
echo '<h3>'. $_LANG['AD_TO_BANLIST_ADD'] .'</h3>';
cpAddPathway($_LANG['AD_TO_BANLIST_ADD']);
} else {
if (cmsCore::inRequest('multiple')) {
if (cmsCore::inRequest('item')) {
$_SESSION['editlist'] = cmsCore::request('item', 'array_int', array());
} else {
cmsCore::addSessionMessage($_LANG['AD_NO_SELECT_OBJECTS'], 'error');
cmsCore::redirectBack();
}
}
$ostatok = '';
if (isset($_SESSION['editlist'])) {
$item_id = array_shift($_SESSION['editlist']);
if (count($_SESSION['editlist']) == 0) {
unset($_SESSION['editlist']);
示例5: applet_tickets
function applet_tickets()
{
global $adminAccess;
if (!cmsUser::isAdminCan('admin/tickets', $adminAccess)) {
cpAccessDenied();
}
global $_LANG;
cmsUser::sessionDel('ticket_cat');
$do = cmsCore::request('do', 'str', 'list');
$super_user = cmsCore::c('user')->id == 1;
$toolmenu = array(array('icon' => 'new.gif', 'title' => $_LANG['AD_TICKET_CREATE'], 'link' => '?view=tickets&do=add'), array('icon' => 'liststuff.gif', 'title' => $_LANG['AD_TICKET_LIST'], 'link' => '?view=tickets&do=list'));
cpToolMenu($toolmenu, 'list', 'do');
cmsCore::c('page')->setTitle($_LANG['AD_TICKETS']);
cpAddPathway($_LANG['AD_TICKETS'], 'index.php?view=tickets');
if ($do == 'list') {
$fields = array(array('title' => 'id', 'field' => 'id', 'width' => '40'), array('title' => $_LANG['AD_TICKET_STATUS'], 'field' => 'status', 'width' => '100', 'filter' => 1, 'prc' => 'cpTicketStatus', 'filterlist' => cpGetTicketStatusList()), array('title' => $_LANG['AD_TICKET_DATE'], 'field' => 'pubdate', 'width' => '80'), array('title' => $_LANG['AD_TICKET_TITLE'], 'field' => 'title', 'width' => '', 'filter' => 32, 'link' => 'index.php?view=tickets&do=view&id=%id%'), array('title' => $_LANG['AD_TICKET_LAST_MSG_DATE'], 'field' => 'last_msg_date', 'width' => '80'), array('title' => $_LANG['AD_TICKET_CAT'], 'field' => 'cat_id', 'width' => '150', 'filter' => 1, 'prc' => 'cpTicketCategory', 'filter' => 1, 'filterlist' => cpGetTicketCats()), array('title' => $_LANG['AD_TICKET_PRIORITY'], 'field' => 'priority', 'width' => '100', 'filter' => 1, 'prc' => 'cpTicketPriority', 'filterlist' => cpGetTicketPriorityList()));
if ($super_user) {
$fields[] = array('title' => $_LANG['AD_TICKET_USER'], 'field' => 'user_id', 'width' => '110', 'prc' => 'cpTicketAuthor');
}
$actions = array(array('title' => $_LANG['AD_TICKET_CLOSE'], 'icon' => 'off.gif', 'link' => '?view=tickets&do=close_ticket&id=%id%', 'condition' => 'cpCheckTicketClose'), array('title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'link' => '?view=tickets&do=delete&id=%id%', 'confirm' => $_LANG['AD_TICKET_DELETE']));
cpListTable('cms_ticket', $fields, $actions, $super_user ? '' : 'user_id=' . cmsCore::c('user')->id, 'last_msg_date DESC', 30);
}
if ($do == 'delete') {
$id = cmsCore::request('id', 'int', 0);
$item = cmsCore::c('db')->get_fields('cms_ticket', 'id=' . $id, '*');
if (!empty($item)) {
$server = cmsCore::c('db')->get_field('cms_ticket_cat', 'id=' . $item['cat_id'], 'server');
if (empty($server)) {
$server = 'http://ds-soft.ru/tickets.api.php';
}
//Удаляем сам тиккет
cmsCore::c('db')->delete('cms_ticket', 'id=' . $item['id']);
//Удаляем все сообщения тиккета
cmsCore::c('db')->delete('cms_ticket_msg', 'ticket_id=' . $item['id']);
//Удаляем все прикрепленные изображения тиккета
cmsCore::deleteUploadImages($item['id'], 'ticket');
if ($item['status'] != '3') {
//Отправляем сообщение на сервер техподдержки что тикет удален
cmsCore::c('curl')->ajax()->request('post', $server . '?do=ticket_deleted', array('ticket_id' => $item['id'], 'ticket_secret_key' => $item['secret_key'], 'host' => cmsCore::c('config')->host));
}
cmsCore::addSessionMessage($_LANG['AD_TICKET_DELETE_SUCCESS'], 'success');
} else {
cmsCore::addSessionMessage($_LANG['AD_TICKET_ERROR'], 'error');
}
cmsCore::redirect('index.php?view=tickets');
}
if ($do == 'close_ticket') {
$id = cmsCore::request('id', 'int', 0);
$item = cmsCore::c('db')->get_fields('cms_ticket', 'id=' . $id, '*');
if (!empty($item)) {
cmsCore::c('db')->setFlag('cms_ticket', $item['id'], 'status', '3');
$server = cmsCore::c('db')->get_field('cms_ticket_cat', 'id=' . $item['cat_id'], 'server');
if (empty($server)) {
$server = 'http://ds-soft.ru/tickets.api.php';
}
//Отправляем сообщение на сервер техподдержки что тикет закрыт
cmsCore::c('curl')->ajax()->request('post', $server . '?do=ticket_closed', array('ticket_id' => $item['id'], 'ticket_secret_key' => $item['secret_key'], 'host' => cmsCore::c('config')->host));
cmsCore::addSessionMessage($_LANG['AD_TICKET_CLOSE_SUCCESS'], 'success');
} else {
cmsCore::addSessionMessage($_LANG['AD_TICKET_ERROR'], 'error');
}
cmsCore::redirect('index.php?view=tickets');
}
if ($do == 'add') {
cpAddPathway($_LANG['AD_TICKET_CREATE'], 'index.php?view=tickets&do=add');
cmsCore::c('page')->initTemplate('applets', 'tickets_add')->assign('cats', cpGetTicketCats())->display();
}
if ($do == 'submit') {
$cats = cpGetTicketCats();
$item = array('cat_id' => cmsCore::request('cat_id', 'int', 0), 'priority' => cmsCore::request('priority', array(0, 1, 2, 3), 0), 'title' => cmsCore::request('title', 'str', ''), 'msg' => cmsCore::request('msg', 'str', ''));
if (!isset($cats[$item['cat_id']])) {
$item['cat_id'] = 0;
}
if (!empty($item['title']) && !empty($item['msg'])) {
$item['msg'] = cmsCore::c('db')->escape_string($item['msg']);
$item['msg_count'] = 1;
$item['pubdate'] = date('Y-m-d H:i:s');
$item['last_msg_date'] = $item['pubdate'];
$item['user_id'] = cmsCore::c('user')->id;
$item['id'] = cmsCore::c('db')->insert('cms_ticket', $item);
cmsCore::addSessionMessage($_LANG['AD_TICKET_CREATED'], 'success');
$do = 'send';
} else {
cmsCore::addSessionMessage($_LANG['AD_TICKET_ERROR_2'], 'error');
cmsCore::redirect('index.php?view=tickets&do=add');
}
}
if ($do == 'send') {
if (empty($item)) {
$id = cmsCore::request('id', 'int', 0);
$item = cmsCore::c('db')->get_fields('cms_ticket', 'id=' . $id, '*');
}
if (!empty($item)) {
$cat = cmsCore::c('db')->get_fields('cms_ticket_cat', 'id=' . $item['cat_id'], '*');
$server = !empty($cat['server']) ? $cat['server'] : 'http://ds-soft.ru/tickets.api.php';
$ticket = array('ticket_id' => $item['id'], 'cat_id' => $item['cat_id'], 'priority' => $item['priority'], 'title' => $item['title'], 'msg' => $item['msg'], 'host' => cmsCore::c('config')->host, 'module' => $cat['module']);
if ($ticket['cat_id'] > 0 && !empty($cat['module'])) {
$ticket['module'] = $cat['module'];
}
//Отправляем тикет на сервер техподдержки
//.........这里部分代码省略.........
示例6: applet_userbanlist
function applet_userbanlist()
{
$inCore = cmsCore::getInstance();
$inDB = cmsDatabase::getInstance();
$inUser = cmsUser::getInstance();
global $_LANG;
global $adminAccess;
if (!cmsUser::isAdminCan('admin/users', $adminAccess)) {
cpAccessDenied();
}
$GLOBALS['cp_page_title'] = $_LANG['AD_BANLIST'];
cpAddPathway($_LANG['AD_USERS'], 'index.php?view=users');
cpAddPathway($_LANG['AD_BANLIST'], 'index.php?view=userbanlist');
$do = cmsCore::request('do', 'str', 'list');
$id = cmsCore::request('id', 'int', -1);
$to = cmsCore::request('to', 'int', 0);
// для редиректа обратно в профиль на сайт
if ($to) {
cmsUser::sessionPut('back_url', cmsCore::getBackURL());
}
if ($do == 'list') {
$toolmenu[] = array('icon' => 'useradd.gif', 'title' => $_LANG['AD_TO_BANLIST_ADD'], 'link' => '?view=userbanlist&do=add');
$toolmenu[] = array('icon' => 'edit.gif', 'title' => $_LANG['AD_EDIT_SELECTED'], 'link' => "javascript:checkSel('?view=userbanlist&do=edit&multiple=1');");
$toolmenu[] = array('icon' => 'delete.gif', 'title' => $_LANG['AD_DELETE_SELECTED'], 'link' => "javascript:checkSel('?view=userbanlist&do=delete&multiple=1');");
cpToolMenu($toolmenu);
$fields[] = array('title' => 'id', 'field' => 'id', 'width' => '30');
$fields[] = array('title' => $_LANG['AD_IS_ACTIVE'], 'field' => 'status', 'width' => '55', 'prc' => 'cpYesNo');
$fields[] = array('title' => $_LANG['AD_BANLIST_USER'], 'field' => 'user_id', 'width' => '120', 'filter' => '12', 'prc' => 'cpUserNick');
$fields[] = array('title' => $_LANG['AD_BANLIST_IP'], 'field' => 'ip', 'width' => '100', 'link' => '?view=userbanlist&do=edit&id=%id%', 'filter' => '12');
$fields[] = array('title' => $_LANG['DATE'], 'field' => 'bandate', 'width' => '', 'fdate' => '%d/%m/%Y %H:%i:%s', 'filter' => '12');
$fields[] = array('title' => $_LANG['AD_BANLIST_TIME'], 'field' => 'int_num', 'width' => '55');
$fields[] = array('title' => '', 'field' => 'int_period', 'width' => '70');
$fields[] = array('title' => $_LANG['AD_AUTOREMOVE'], 'field' => 'autodelete', 'width' => '90', 'prc' => 'cpYesNo');
$actions[] = array('title' => $_LANG['EDIT'], 'icon' => 'edit.gif', 'link' => '?view=userbanlist&do=edit&id=%id%');
$actions[] = array('title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'confirm' => $_LANG['AD_REMOVE_RULE'], 'link' => '?view=userbanlist&do=delete&id=%id%');
cpListTable('cms_banlist', $fields, $actions, '1=1', 'ip DESC');
}
if ($do == 'delete') {
if (!isset($_REQUEST['item'])) {
if ($id >= 0) {
dbDelete('cms_banlist', $id);
}
} else {
dbDeleteList('cms_banlist', cmsCore::request('item', 'array_int', array()));
}
cmsCore::redirect('?view=userbanlist');
}
if ($do == 'submit' || $do == 'update') {
if (!cmsUser::checkCsrfToken()) {
cmsCore::error404();
}
$types = array('user_id' => array('user_id', 'int', 0), 'ip' => array('ip', 'str', ''), 'cause' => array('cause', 'str', ''), 'autodelete' => array('autodelete', 'int', 0), 'int_num' => array('int_num', 'int', 0), 'int_period' => array('int_period', 'str', '', create_function('$p', 'if(!in_array($p, array("MONTH","DAY","HOUR","MINUTE"))){ $p = "MINUTE"; } return $p;')));
$items = cmsCore::getArrayFromRequest($types);
$error = false;
if (!$items['ip']) {
$error = true;
cmsCore::addSessionMessage($_LANG['AD_NEED_IP'], 'error');
}
if ($items['ip'] == $_SERVER['REMOTE_ADDR'] || $items['user_id'] == $inUser->id) {
$error = true;
cmsCore::addSessionMessage($_LANG['AD_ITS_YOUR_IP'], 'error');
}
if (cmsUser::userIsAdmin($items['user_id'])) {
$error = true;
cmsCore::addSessionMessage($_LANG['AD_ITS_ADMIN'], 'error');
}
if ($error) {
cmsCore::redirectBack();
}
if ($do == 'update') {
$inDB->update('cms_banlist', $items, $id);
if (empty($_SESSION['editlist'])) {
cmsCore::redirect('?view=userbanlist');
} else {
cmsCore::redirect('?view=userbanlist&do=edit');
}
}
$inDB->insert('cms_banlist', $items);
$back_url = cmsUser::sessionGet('back_url');
cmsUser::sessionDel('back_url');
cmsCore::redirect($back_url ? $back_url : '?view=userbanlist');
}
if ($do == 'add' || $do == 'edit') {
$GLOBALS['cp_page_head'][] = '<script language="JavaScript" type="text/javascript" src="/admin/js/banlist.js"></script>';
$toolmenu[] = array('icon' => 'save.gif', 'title' => $_LANG['SAVE'], 'link' => 'javascript:document.addform.submit();');
$toolmenu[] = array('icon' => 'cancel.gif', 'title' => $_LANG['CANCEL'], 'link' => 'javascript:history.go(-1);');
cpToolMenu($toolmenu);
if ($do == 'add') {
echo '<h3>' . $_LANG['AD_TO_BANLIST_ADD'] . '</h3>';
cpAddPathway($_LANG['AD_TO_BANLIST_ADD']);
} else {
if (isset($_REQUEST['multiple'])) {
if (isset($_REQUEST['item'])) {
$_SESSION['editlist'] = cmsCore::request('item', 'array_int', array());
} else {
cmsCore::addSessionMessage($_LANG['AD_NO_SELECT_OBJECTS'], 'error');
cmsCore::redirectBack();
}
}
$ostatok = '';
//.........这里部分代码省略.........
示例7: printBody
/**
* Выводит тело страницы (результат работы компонента)
*/
public function printBody()
{
if (cmsConfig::getConfig('slight')) {
$searchquery = cmsUser::sessionGet('searchquery');
if ($searchquery && cmsCore::getInstance()->component != 'search') {
$this->page_body = preg_replace('/(' . preg_quote($searchquery) . ')/iu', '<strong class="search_match">$1</strong>', $this->page_body);
cmsUser::sessionDel('searchquery');
}
}
$this->page_body = cmsCore::callEvent('PRINT_PAGE_BODY', $this->page_body);
echo $this->page_body;
}
示例8: applet_tickets
function applet_tickets() {
global $adminAccess;
if (!cmsUser::isAdminCan('admin/tickets', $adminAccess)) { cpAccessDenied(); }
global $_LANG;
cmsUser::sessionDel('ticket_cat');
$do = cmsCore::request('do', 'str', 'list');
$super_user = cmsCore::c('user')->id == 1;
$toolmenu = array(
array( 'icon' => 'new.gif', 'title' => $_LANG['AD_TICKET_CREATE'], 'link' => '?view=tickets&do=add' ),
array( 'icon' => 'liststuff.gif', 'title' => $_LANG['AD_TICKET_LIST'], 'link' => '?view=tickets&do=list' )
);
cpToolMenu($toolmenu, 'list', 'do');
cmsCore::c('page')->setTitle($_LANG['AD_TICKETS']);
cpAddPathway($_LANG['AD_TICKETS'], 'index.php?view=tickets');
if ($do == 'list') {
$fields = array(
array( 'title' => 'id', 'field' => 'id', 'width' => '40' ),
array( 'title' => $_LANG['AD_TICKET_STATUS'], 'field' => 'status', 'width' => '100', 'filter' => 1, 'prc' => 'cpTicketStatus', 'filterlist' => cpGetTicketStatusList() ),
array( 'title' => $_LANG['AD_TICKET_DATE'], 'field' => 'pubdate', 'width' => '80' ),
array( 'title' => $_LANG['AD_TICKET_TITLE'], 'field' => 'title', 'width' => '', 'filter' => 32, 'link' => 'index.php?view=tickets&do=view&id=%id%' ),
array( 'title' => $_LANG['AD_TICKET_LAST_MSG_DATE'], 'field' => 'last_msg_date', 'width' => '80' ),
array( 'title' => $_LANG['AD_TICKET_CAT'], 'field' => 'cat_id', 'width' => '150', 'filter' => 1, 'prc' => 'cpTicketCategory', 'filter' => 1, 'filterlist' => cpGetTicketCats() ),
array( 'title' => $_LANG['AD_TICKET_PRIORITY'], 'field' => 'priority', 'width' => '100', 'filter' => 1, 'prc' => 'cpTicketPriority', 'filterlist' => cpGetTicketPriorityList() )
);
if ($super_user) {
$fields[] = array( 'title' => $_LANG['AD_TICKET_USER'], 'field' => 'user_id', 'width' => '110', 'prc' => 'cpTicketAuthor' );
}
$actions = array(
array( 'title' => $_LANG['AD_TICKET_CLOSE'], 'icon' => 'off.gif', 'link' => '?view=tickets&do=close_ticket&id=%id%', 'condition' => 'cpCheckTicketClose' ),
array( 'title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'link' => '?view=tickets&do=delete&id=%id%', 'confirm' => $_LANG['AD_TICKET_DELETE'] )
);
cpListTable('cms_ticket', $fields, $actions, $super_user ? '' : 'user_id='. cmsCore::c('user')->id, 'last_msg_date DESC', 30);
}
if ($do == 'delete') {
$id = cmsCore::request('id', 'int', 0);
$item = cmsCore::c('db')->get_fields('cms_ticket', 'id='. $id, '*');
if (!empty($item)) {
$server = cmsCore::c('db')->get_field('cms_ticket_cat', 'id='. $item['cat_id'], 'server');
if (empty($server)) { $server = 'http://ds-soft.ru/tickets.api.php'; }
//Удаляем сам тиккет
cmsCore::c('db')->delete('cms_ticket', 'id='. $item['id']);
//Удаляем все сообщения тиккета
cmsCore::c('db')->delete('cms_ticket_msg', 'ticket_id='. $item['id']);
//Удаляем все прикрепленные изображения тиккета
cmsCore::deleteUploadImages($item['id'], 'ticket');
if ($item['status'] != '3') {
//Отправляем сообщение на сервер техподдержки что тикет удален
cmsCore::c('curl')->ajax()->request('post', $server .'?do=ticket_deleted', array( 'ticket_id' => $item['id'], 'ticket_secret_key' => $item['secret_key'], 'host' => cmsCore::c('config')->host ));
}
cmsCore::addSessionMessage($_LANG['AD_TICKET_DELETE_SUCCESS'], 'success');
} else {
cmsCore::addSessionMessage($_LANG['AD_TICKET_ERROR'], 'error');
}
cmsCore::redirect('index.php?view=tickets');
}
if ($do == 'close_ticket') {
$id = cmsCore::request('id', 'int', 0);
$item = cmsCore::c('db')->get_fields('cms_ticket', 'id='. $id, '*');
if (!empty($item)) {
cmsCore::c('db')->setFlag('cms_ticket', $item['id'], 'status', '3');
$server = cmsCore::c('db')->get_field('cms_ticket_cat', 'id='. $item['cat_id'], 'server');
if (empty($server)) { $server = 'http://ds-soft.ru/tickets.api.php'; }
//Отправляем сообщение на сервер техподдержки что тикет закрыт
cmsCore::c('curl')->ajax()->request('post', $server .'?do=ticket_closed', array( 'ticket_id' => $item['id'], 'ticket_secret_key' => $item['secret_key'], 'host' => cmsCore::c('config')->host ));
cmsCore::addSessionMessage($_LANG['AD_TICKET_CLOSE_SUCCESS'], 'success');
} else {
cmsCore::addSessionMessage($_LANG['AD_TICKET_ERROR'], 'error');
}
cmsCore::redirect('index.php?view=tickets');
}
if ($do == 'add') {
cpAddPathway($_LANG['AD_TICKET_CREATE'], 'index.php?view=tickets&do=add');
$cats = cpGetTicketCats();
?>
//.........这里部分代码省略.........
示例9: board
//.........这里部分代码省略.........
cmsPage::initTemplate('components', 'com_board_item')->
assign('item', $item)->
assign('cfg', cmsCore::m('board')->config)->
assign('user_id', cmsCore::c('user')->id)->
assign('is_admin', cmsCore::c('user')->is_admin)->
assign('formsdata', cmsForm::getFieldsValues($item['form_id'], $item['form_array']))->
assign('is_moder', cmsCore::m('board')->is_moderator_by_group)->
display();
}
/////////////////////////////// NEW BOARD ITEM /////////////////////////////////
if ($do == 'additem') {
// Получаем категории, в которые может загружать пользователь
$catslist = cmsCore::m('board')->getPublicCats(cmsCore::m('board')->category_id);
if (!$catslist) {
cmsCore::addSessionMessage($_LANG['YOU_CANT_ADD_ADV_ANY'], 'error');
$inCore->redirect('/board');
}
$cat['is_photos'] = 1;
$formsdata = array();
if (cmsCore::m('board')->category_id && cmsCore::m('board')->category_id != cmsCore::m('board')->root_cat['id']) {
$cat = cmsCore::m('board')->getCategory(cmsCore::m('board')->category_id);
$formsdata = cmsForm::getFieldsHtml($cat['form_id']);
}
cmsCore::c('page')->addPathway($_LANG['ADD_ADV']);
if ( !cmsCore::inRequest('submit') ) {
if (IS_BILLING) { cmsBilling::checkBalance('board', 'add_item'); }
cmsCore::c('page')->setTitle($_LANG['ADD_ADV']);
$item = cmsUser::sessionGet('item');
if ($item) { cmsUser::sessionDel('item'); }
$item['city'] = !empty($item['city']) ? $item['city'] : cmsCore::c('user')->city;
cmsPage::initTemplate('components', 'com_board_edit')->
assign('action', "/board/add.html")->
assign('form_do', 'add')->
assign('cfg', cmsCore::m('board')->config)->
assign('cat', $cat)->
assign('item', $item)->
assign('pagetitle', $_LANG['ADD_ADV'])->
assign('formsdata', $formsdata)->
assign('is_admin', cmsCore::c('user')->is_admin)->
assign('is_user', cmsCore::c('user')->id)->
assign('catslist', $catslist)->
assign('is_billing', IS_BILLING)->assign('balance', cmsCore::c('user')->balance)->
display();
cmsUser::sessionClearAll();
return;
}
if ( cmsCore::inRequest('submit') ) {
// проверяем на заполненость скрытое поле
$title_fake = cmsCore::request('title_fake', 'str', '');
// если оно заполнено, считаем что это бот, 404
if ($title_fake) { cmsCore::error404(); }
$errors = false;
// проверяем наличие категории
if (!$cat['id']) {
示例10: forum
//.........这里部分代码省略.........
}
// новая тема
if ($do == 'newthread') {
// права доступа
if (!cmsUser::isUserCan('forum/add_thread') && !$inUser->is_admin) {
cmsPage::includeTemplateFile('special/accessdenied.php');
return;
}
$forum = $model->getForum($id);
if (!$forum) {
cmsCore::error404();
}
if (!cmsCore::checkContentAccess($forum['access_list'])) {
cmsPage::includeTemplateFile('special/accessdenied.php');
return;
}
$path_list = $inDB->getNsCategoryPath('cms_forums', $forum['NSLeft'], $forum['NSRight'], 'id, title, access_list, moder_list');
if ($path_list) {
foreach ($path_list as $pcat) {
if (!cmsCore::checkContentAccess($pcat['access_list'])) {
cmsPage::includeTemplateFile('special/accessdenied.php');
return;
}
$inPage->addPathway($pcat['title'], '/forum/' . $pcat['id']);
}
$is_forum_moder = $model->isForumModerator($pcat['moder_list']);
}
if (IS_BILLING && $forum['topic_cost']) {
cmsBilling::checkBalance('forum', 'add_thread', false, $forum['topic_cost']);
}
$pagetitle = $_LANG['NEW_THREAD'];
$thread = cmsUser::sessionGet('thread');
if ($thread) {
cmsUser::sessionDel('thread');
}
$last_post['content'] = cmsUser::sessionGet('post_content');
if ($last_post['content']) {
cmsUser::sessionDel('post_content');
}
}
// новый пост
if ($do == 'newpost') {
// права доступа
if (!cmsUser::isUserCan('forum/add_post') && !$inUser->is_admin) {
cmsPage::includeTemplateFile('special/accessdenied.php');
return;
}
$thread = $model->getThread($id);
if (!$thread || $thread['closed']) {
cmsCore::error404();
}
$path_list = $inDB->getNsCategoryPath('cms_forums', $thread['NSLeft'], $thread['NSRight'], 'id, title, access_list, moder_list');
if ($path_list) {
foreach ($path_list as $pcat) {
if (!cmsCore::checkContentAccess($pcat['access_list'])) {
cmsPage::includeTemplateFile('special/accessdenied.php');
return;
}
$inPage->addPathway($pcat['title'], '/forum/' . $pcat['id']);
}
$is_forum_moder = $model->isForumModerator($pcat['moder_list']);
}
$inPage->addPathway($thread['title'], '/forum/thread' . $thread['id'] . '.html');
$pagetitle = $_LANG['NEW_POST'];
$last_post = $model->getPost(cmsCore::request('replyid', 'int', 0));
if ($last_post) {
示例11: coordSend
$cfg['maps_chekin'] = $inCore->request('maps_chekin', 'int');
$cfg['maps_center'] = $inCore->request('maps_center', 'str');
$cfg['maps_traffic'] = $inCore->request('maps_traffic', 'str');
$cfg['main_zoom'] = $inCore->request('main_zoom', 'int');
$cfg['point_zoom'] = $inCore->request('point_zoom', 'int');
$cfg['maps_user_del'] = $inCore->request('maps_user_del', 'int');
$cfg['maps_chekin_del'] = $inCore->request('maps_chekin_del', 'int');
$cfg['maps_image_acces'] = $inCore->request('maps_image_acces', 'str');
$cfg['maps_image_original'] = $inCore->request('maps_image_original', 'int');
$inCore->saveComponentConfig('usermaps', $cfg);
$inCore->redirectBack();
}
$msg = cmsUser::sessionGet('usermaps_msg');
if ($msg) {
echo '<p class="success">' . $msg . '</p>';
cmsUser::sessionDel('usermaps_msg');
}
?>
<script src="http://api-maps.yandex.ru/1.1/index.xml?key=<?php
echo $cfg['yandex_key'];
?>
" type="text/javascript"></script>
<script type="text/javascript">
var map;
function coordSend(maps_center)
{
var obj=document.optform
obj.maps_center.value=maps_center
}
window.onload = function ()
示例12: getLastEnteredValue
/**
* Возвращает значение поля формы из сессии
* @param int $field_id ID поля формы
* @return string
*/
private function getLastEnteredValue($field_id)
{
$ses_value = cmsUser::sessionGet('form_last_' . $this->form_id . '_' . $field_id);
if ($ses_value) {
cmsUser::sessionDel('form_last_' . $this->form_id . '_' . $field_id);
}
return (string) $ses_value;
}
示例13:
{
$model->updateCategory($id,$name,$bg,$tx);
}
unset($bg);
unset($bg_color);
unset($tx);
unset($tx_color);
unset($name);
}
}
$inCore->saveComponentConfig('calendar', $cfg);
$inCore->redirectBack();
}
$msg = cmsUser::sessionGet('calendr_msg');
if ($msg) { echo '<p class="success">'.$msg.'</p>'; cmsUser::sessionDel('calendr_msg'); }
?>
<script type="text/javascript" src="/admin/components/calendar/colorpicker/colorpicker.js"></script>
<form action="index.php?view=components&do=config&id=<?php echo $_REQUEST['id'];?>" method="post" name="optform" target="_self" id="optform">
<div id="config_tabs" style="margin-top:12px;">
<ul id="tabs">
<li><a href="#basic"><span>Общие</span></a></li>
<li><a href="#calendar_category"><span>Категории</span></a></li>
<li><a href="#calendar_image"><span>Изображения</span></a></li>
<li><a href="#calendar_module"><span>Модуль</span></a></li>
</ul>
<div id="basic">
<table width="661" border="0" cellpadding="10" cellspacing="0" class="proptable">
<tr>
<td width="250">
示例14: blog
//.........这里部分代码省略.........
if (!$blog) {
cmsCore::error404();
}
//Если доступа нет, возвращаемся и выводим сообщение об ошибке
if (!cmsUser::checkUserContentAccess($blog['allow_who'], $blog['user_id'])) {
cmsCore::addSessionMessage($_LANG['CLOSED_BLOG'] . '<br>' . $_LANG['CLOSED_BLOG_TEXT'], 'error');
cmsCore::redirect('/blog');
}
// Права доступа
$myblog = $inUser->id && $inUser->id == $blog['user_id'];
// автор блога
$is_writer = $inBlog->isUserBlogWriter($blog, $inUser->id);
// может ли пользователь писать в блог
// если не его блог, пользователь не писатель и не админ, вне зависимости от авторства показываем 404
if (!$myblog && !$is_writer && !$inUser->is_admin) {
cmsCore::error404();
}
// проверяем является ли пользователь автором, если редактируем пост
if ($do == 'editpost' && !$inUser->is_admin && $post['user_id'] != $inUser->id) {
cmsCore::error404();
}
//Если еще не было запроса на сохранение
if (!cmsCore::inRequest('goadd')) {
$inPage->addPathway($blog['title'], $model->getBlogURL());
//для нового поста
if ($do == 'newpost') {
if (IS_BILLING) {
cmsBilling::checkBalance('blogs', 'add_post');
}
$inPage->addPathway($_LANG['NEW_POST']);
$inPage->setTitle($_LANG['NEW_POST']);
$post = cmsUser::sessionGet('mod');
if ($post) {
cmsUser::sessionDel('mod');
} else {
$post['cat_id'] = $cat_id;
$post['comments'] = 1;
}
}
//для редактирования поста
if ($do == 'editpost') {
$inPage->addPathway($post['title'], $model->getPostURL('', $post['seolink']));
$inPage->addPathway($_LANG['EDIT_POST']);
$inPage->setTitle($_LANG['EDIT_POST']);
}
$inPage->initAutocomplete();
$autocomplete_js = $inPage->getAutocompleteJS('tagsearch', 'tags');
//получаем рубрики блога
$cat_list = cmsCore::getListItems('cms_blog_cats', $post['cat_id'], 'id', 'ASC', "blog_id = '{$blog['id']}'");
//получаем код панелей bbcode и смайлов
$bb_toolbar = cmsPage::getBBCodeToolbar('message', $model->config['img_on'], 'blogs', 'post', $post_id);
$smilies = cmsPage::getSmilesPanel('message');
$inCore->initAutoGrowText('#message');
//показываем форму
$smarty = $inCore->initSmarty('components', 'com_blog_edit_post.tpl');
$smarty->assign('blog', $blog);
$smarty->assign('pagetitle', $do == 'editpost' ? $_LANG['EDIT_POST'] : $_LANG['NEW_POST']);
$smarty->assign('mod', $post);
$smarty->assign('cat_list', $cat_list);
$smarty->assign('bb_toolbar', $bb_toolbar);
$smarty->assign('smilies', $smilies);
$smarty->assign('is_admin', $inUser->is_admin);
$smarty->assign('myblog', $myblog);
$smarty->assign('user_can_iscomments', cmsUser::isUserCan('comments/iscomments'));
$smarty->assign('autocomplete_js', $autocomplete_js);
$smarty->display('com_blog_edit_post.tpl');
示例15: cms_model_users
cmsUser::sessionPut('reg_msg', 'Инвайты не выданы: нет подходящих пользователей');
}
}
}
if ($inCore->request('inv_delete', 'int', 0)) {
$inCore->loadModel('users');
$model = new cms_model_users();
$model->deleteInvites();
cmsUser::sessionPut('reg_msg', 'Неиспользованные инвайты удалены');
}
$inCore->redirectBack();
}
$msg = cmsUser::sessionGet('reg_msg');
if ($msg) {
echo '<p class="success">' . $msg . '</p>';
cmsUser::sessionDel('reg_msg');
}
?>
<form action="index.php?view=components&do=config&id=<?php
echo $_REQUEST['id'];
?>
" method="post" name="optform" target="_self" id="optform">
<div id="config_tabs" style="margin-top:12px;">
<ul id="tabs">
<li><a href="#basic"><span>Общие</span></a></li>
<li><a href="#form"><span>Форма</span></a></li>
<li><a href="#greets"><span>Приветствие</span></a></li>
</ul>