本文整理汇总了PHP中cmsUser::sessionGet方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsUser::sessionGet方法的具体用法?PHP cmsUser::sessionGet怎么用?PHP cmsUser::sessionGet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cmsUser
的用法示例。
在下文中一共展示了cmsUser::sessionGet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
if (!$this->getPackageContentsDir()) {
$this->redirectToAction('install/finish');
}
$form = $this->getForm('ftp');
$account = cmsUser::isSessionSet('ftp_account') ? cmsUser::sessionGet('ftp_account') : array();
if ($this->request->has('submit')) {
$account = array_merge($account, $form->parse($this->request, true, $account));
if ($account['save_to_session']) {
cmsUser::sessionSet('ftp_account', $account);
} else {
cmsUser::sessionSet('ftp_account', array('host' => $account['host'], 'path' => $account['path'], 'is_pasv' => $account['is_pasv']));
}
$errors = $form->validate($this, $account);
if ($errors) {
cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
}
if (!$errors) {
$account['host'] = trim(str_replace('ftp://', '', $account['host']), '/');
if ($account['path'] != '/') {
$account['path'] = '/' . trim($account['path'], '/') . '/';
}
$this->uploadPackageToFTP($account);
}
}
return $this->cms_template->render('install_ftp', array('manifest' => $this->parsePackageManifest(), 'account' => $account, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
}
示例2: getGeoByIp
public function getGeoByIp()
{
$cached_geo = cmsUser::sessionGet('geo_data');
if ($cached_geo) {
return $cached_geo;
}
$out = simplexml_load_string(file_get_contents_from_url('http://ipgeobase.ru:7020/geo?ip=' . cmsUser::getIp()));
$data = array();
if ($out && is_object($out) && !empty($out->ip[0])) {
foreach ($out->ip[0] as $key => $value) {
$data[$key] = (string) $value;
}
}
$geo = array('city' => array('id' => null, 'name' => null), 'country' => array('id' => null, 'name' => null));
if (isset($data['country'])) {
$geo['country'] = $this->model->getItemByField('geo_countries', 'alpha2', $data['country']);
}
if (isset($data['city'])) {
if (!empty($geo['country']['id'])) {
$this->model->filterEqual('country_id', $geo['country']['id']);
}
$geo['city'] = $this->model->getItemByField('geo_cities', 'name', $data['city']);
}
cmsUser::sessionSet('geo_data', $geo);
return $geo;
}
示例3: run
public function run()
{
if (!$this->getPackageContentsDir()) {
$this->redirectToAction('install/finish');
}
$form = $this->getForm('ftp');
$is_submitted = $this->request->has('submit');
$account = cmsUser::isSessionSet('ftp_account') ? cmsUser::sessionGet('ftp_account') : array();
if ($is_submitted) {
$account = array_merge($account, $form->parse($this->request, $is_submitted, $account));
cmsUser::sessionSet('ftp_account', $account);
$errors = $form->validate($this, $account);
if ($errors) {
cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
}
if (!$errors) {
$account['host'] = trim(str_replace('ftp://', '', $account['host']), '/');
if ($account['path'] != '/') {
$account['path'] = '/' . trim($account['path'], '/') . '/';
}
$this->uploadPackageToFTP($account);
}
}
return cmsTemplate::getInstance()->render('install_ftp', array('account' => $account, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
}
示例4: getAuthRedirectUrl
public function getAuthRedirectUrl($value)
{
$url = href_to_home();
$user_id = cmsUser::sessionGet('user:id');
if (!$user_id) {
return $url;
}
$back_url = $this->getBackURL();
if (strpos($back_url, href_to('auth', 'login')) !== false) {
$back_url = $url;
}
switch ($value) {
case 'none':
$url = $back_url;
break;
case 'index':
$url = href_to_home();
break;
case 'profile':
$url = href_to('users', $user_id);
break;
case 'profileedit':
$url = href_to('users', $user_id, 'edit');
break;
}
return $url;
}
示例5: run
public function run()
{
if (cmsUser::isLogged()) {
$this->redirectToHome();
}
$email = $this->request->get('login_email');
$password = $this->request->get('login_password');
$remember = (bool) $this->request->get('remember');
$back_url = $this->request->has('back') ? $this->request->get('back') : false;
$is_site_offline = !cmsConfig::get('is_site_on');
if ($this->request->has('submit')) {
$is_captcha_valid = true;
if (cmsUser::sessionGet('is_auth_captcha') && $this->options['auth_captcha']) {
$is_captcha_valid = cmsEventsManager::hook('captcha_validate', $this->request);
}
if ($is_captcha_valid) {
cmsUser::sessionUnset('is_auth_captcha');
$logged_id = cmsUser::login($email, $password, $remember);
if ($logged_id) {
if ($is_site_offline) {
$userSession = cmsUser::sessionGet('user');
if (!$userSession['is_admin']) {
cmsUser::addSessionMessage(LANG_LOGIN_ADMIN_ONLY, 'error');
cmsUser::logout();
$this->redirectBack();
}
}
cmsEventsManager::hook('auth_login', $logged_id);
$is_back = $this->request->get('is_back');
if ($is_back) {
$this->redirectBack();
}
if ($back_url) {
$this->redirect($back_url);
} else {
$this->redirectToHome();
}
}
}
if ($this->options['auth_captcha'] && !$is_site_offline) {
cmsUser::sessionSet('is_auth_captcha', true);
}
if ($is_captcha_valid) {
cmsUser::addSessionMessage(LANG_LOGIN_ERROR, 'error');
if ($is_site_offline) {
$this->redirectBack();
}
} else {
cmsUser::addSessionMessage(LANG_CAPTCHA_ERROR, 'error');
}
}
if ($back_url) {
cmsUser::addSessionMessage(LANG_LOGIN_REQUIRED, 'error');
}
if (cmsUser::sessionGet('is_auth_captcha')) {
$captcha_html = cmsEventsManager::hook('captcha_html');
}
return cmsTemplate::getInstance()->render('login', array('back_url' => $back_url, 'captcha_html' => isset($captcha_html) ? $captcha_html : false));
}
示例6: mod_user_stats
function mod_user_stats($module_id, $cfg)
{
$inDB = cmsDatabase::getInstance();
cmsCore::loadLanguage('components/users');
global $_LANG;
if (!isset($cfg['show_total'])) {
$cfg['show_total'] = 1;
}
if (!isset($cfg['show_online'])) {
$cfg['show_online'] = 1;
}
if (!isset($cfg['show_gender'])) {
$cfg['show_gender'] = 1;
}
if (!isset($cfg['show_city'])) {
$cfg['show_city'] = 1;
}
$total_usr = cmsUser::getCountAllUsers();
if ($cfg['show_gender']) {
$gender_stats = array();
//male
$gender_stats['male'] = $inDB->rows_count('cms_users u INNER JOIN cms_user_profiles p ON p.user_id = u.id', "u.is_locked = 0 AND u.is_deleted = 0 AND p.gender = 'm'");
//female
$gender_stats['female'] = $inDB->rows_count('cms_users u INNER JOIN cms_user_profiles p ON p.user_id = u.id', "u.is_locked = 0 AND u.is_deleted = 0 AND p.gender = 'f'");
//unknown
$gender_stats['unknown'] = $total_usr - $gender_stats['male'] - $gender_stats['female'];
}
if ($cfg['show_city']) {
$sql = "SELECT IF (p.city != '', p.city, '{$_LANG['NOT_DECIDE']}') city, COUNT( p.user_id ) count\n FROM cms_users u\n LEFT JOIN cms_user_profiles p ON p.user_id = u.id\n WHERE u.is_locked =0 AND u.is_deleted =0\n GROUP BY p.city";
$rs = $inDB->query($sql);
$city_stats = array();
if ($inDB->num_rows($rs)) {
while ($row = $inDB->fetch_assoc($rs)) {
if ($row['city'] != $_LANG['NOT_DECIDE']) {
$row['href'] = '/users/city/' . urlencode($row['city']);
} else {
$row['href'] = '';
}
$row['city'] = icms_ucfirst(mb_strtolower($row['city']));
$city_stats[] = $row;
}
}
}
if ($cfg['show_online']) {
$people = cmsUser::getOnlineCount();
}
if ($cfg['show_bday']) {
$bday = cmsUser::getBirthdayUsers();
}
cmsPage::initTemplate('modules', 'mod_user_stats')->assign('cfg', $cfg)->assign('total_usr', $total_usr)->assign('gender_stats', $gender_stats)->assign('city_stats', $city_stats)->assign('usr_online', cmsUser::sessionGet('usr_online'))->assign('people', $people)->assign('bday', $bday)->display('mod_user_stats.tpl');
return true;
}
示例7: cpGetTicketCats
function cpGetTicketCats()
{
$cats = cmsUser::sessionGet('ticket_cat');
if (empty($cats)) {
$result = cmsCore::c('db')->query('SELECT id,title FROM cms_ticket_cat');
$cats = array(0 => array('id' => 0, 'title' => 'CMS RuDi'));
while ($cat = cmsCore::c('db')->fetch_assoc($result)) {
$cats[$cat['id']] = array('id' => $cat['id'], 'title' => $cat['title']);
}
cmsUser::sessionPut('ticket_cat', $cats);
}
return $cats;
}
示例8: signInUser
/**
* Авторизует пользователя
* возвращает url для редиректа
* @param str $login
* @param str $passw
* @param int $remember_pass
* @return srt $back_url
*/
public function signInUser($login = '', $passw = '', $remember_pass = 1, $pass_in_md5 = 0)
{
if ($this->id) {
return cmsCore::getBackURL();
}
$default_back_url = '/auth/error.html';
if (!$login || !$passw) {
return $default_back_url;
}
$inDB = cmsDatabase::getInstance();
$inCore = cmsCore::getInstance();
// Авторизация по логину или e-mail
if (!preg_match("/^([a-z0-9\\._-]+)@([a-z0-9\\._-]+)\\.([a-z]{2,4})\$/ui", $login)) {
$where_login = "u.login = '{$login}'";
} else {
$where_login = "u.email = '{$login}'";
}
$where_pass = $pass_in_md5 ? "u.password = '{$passw}'" : "u.password = md5('{$passw}')";
// Проверяем локальную пару логин + пароль
$user = $this->loadUser(0, "{$where_login} AND {$where_pass}");
// иначе пытаемся авторизоваться через плагины
if (!$user) {
$user = cmsCore::callEvent('SIGNIN_USER', array('login' => $login, 'pass' => $passw));
}
if (!$user) {
return $default_back_url;
}
$_SESSION['user'] = $user;
cmsCore::callEvent('USER_LOGIN', $_SESSION['user']);
if ($remember_pass) {
$cookie_code = md5($user['id'] . $user['password'] . PATH);
cmsCore::setCookie('userid', $cookie_code, time() + 2592000);
}
// Флаг первой авторизации
$first_time_auth = !$user['is_logged_once'];
// обновляем дату последнего визита, ip
self::setUserLogdate($user['id']);
$inDB->query("UPDATE cms_users SET last_ip = '{$this->ip}', is_logged_once = 1 WHERE id = '{$user['id']}'");
// помечаем, что пользователь онлайн
$inDB->query("UPDATE cms_online SET user_id = '{$user['id']}' WHERE sess_id = '" . session_id() . "'");
////////////// юзер уже авторизован //////////////////////////
// Формируем url редиректа после авторизации
// Получаем настройки что делать после авторизации
$cfg = $inCore->loadComponentConfig('registration');
// Получаем URL, предыдущий перед формой логина
$auth_back_url = cmsUser::sessionGet('auth_back_url');
$auth_back_url = $auth_back_url ? $auth_back_url : cmsCore::getBackURL();
if (strpos($auth_back_url, $_SERVER['HTTP_HOST']) === false || strpos($auth_back_url, '/auth/') !== false) {
$auth_back_url = '/';
}
cmsUser::sessionDel('auth_back_url');
// Авторизация в админку
if ($_SESSION['user']['is_admin'] && cmsCore::inRequest('is_admin')) {
return '/admin/';
}
// Остальные пользователи
if ($_SESSION['user']['id']) {
if ($first_time_auth) {
$cfg['auth_redirect'] = $cfg['first_auth_redirect'];
}
switch ($cfg['auth_redirect']) {
case 'none':
$url = $auth_back_url;
break;
case 'index':
$url = '/';
break;
case 'profile':
$url = cmsUser::getProfileURL($user['login']);
break;
case 'editprofile':
$url = '/users/' . $user['id'] . '/editprofile.html';
break;
}
return $url;
}
return $default_back_url;
}
示例9: getUploadedPhotos
public function getUploadedPhotos($user_id) {
$photos = array();
if (cmsUser::sessionGet('photos_list')){
$sess_ids = 'id IN ('.rtrim(implode(',', cmsUser::sessionGet('photos_list')), ',').')';
} else {
$sess_ids = '1=0';
}
$sql = "SELECT id, user_id, album_id, title, description, allow_who, imageurl
FROM cms_user_photos
WHERE user_id='{$user_id}' AND (album_id = 0 OR ({$sess_ids}))";
$result = $this->inDB->query($sql);
if ($this->inDB->num_rows($result)) {
while($photo = $this->inDB->fetch_assoc($result)){
$photos[$photo['id']] = $photo;
}
}
$photos = cmsCore::callEvent('GET_USER_UPLOADED_PHOTOS', $photos);
return $photos ? $photos : false;
}
示例10: 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;
}
示例11: 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;
}
示例12: registration
//.........这里部分代码省略.........
}
if ($errors) {
cmsCore::redirectBack();
}
$md5_pass = md5($pass);
$inDB->query("UPDATE cms_users SET password = '{$md5_pass}', logdate = NOW() WHERE id = '{$user['id']}'");
$inDB->query("DELETE FROM cms_users_activate WHERE code = '{$usercode}'");
cmsCore::addSessionMessage($_LANG['CHANGE_PASS_COMPLETED'], 'info');
$inUser->signInUser($user['login'], $pass, true);
cmsCore::redirect(cmsUser::getProfileURL($user['login']));
}
$inPage->setTitle($_LANG['RECOVER_PASS']);
$inPage->addPathway($_LANG['RECOVER_PASS']);
cmsPage::initTemplate('components', 'com_registration_remind')->assign('cfg', $model->config)->assign('user', $user)->display('com_registration_remind.tpl');
}
//============================================================================//
if ($do == 'register') {
if (!cmsUser::checkCsrfToken()) {
cmsCore::error404();
}
if ($inUser->id && !$inUser->is_admin) {
if ($inCore->menuId() == 1) {
return;
} else {
cmsCore::error404();
}
}
// регистрация закрыта
if (!$model->config['is_on']) {
cmsCore::error404();
}
// регистрация по инвайтам
if ($model->config['reg_type'] == 'invite') {
if (!$users_model->checkInvite(cmsUser::sessionGet('invite_code'))) {
cmsCore::error404();
}
}
$errors = false;
// получаем данные
$item['login'] = cmsCore::request('login', 'str', '');
$item['email'] = cmsCore::request('email', 'email');
$item['icq'] = cmsCore::request('icq', 'str', '');
$item['city'] = cmsCore::request('city', 'str', '');
$item['nickname'] = cmsCore::request('nickname', 'str', '');
$item['realname1'] = cmsCore::request('realname1', 'str', '');
$item['realname2'] = cmsCore::request('realname2', 'str', '');
$pass = cmsCore::request('pass', 'str', '');
$pass2 = cmsCore::request('pass2', 'str', '');
// проверяем логин
if (mb_strlen($item['login']) < 2 || mb_strlen($item['login']) > 15 || is_numeric($item['login']) || !preg_match("/^([a-z0-9])+\$/ui", $item['login'])) {
cmsCore::addSessionMessage($_LANG['ERR_LOGIN'], 'error');
$errors = true;
}
// проверяем пароль
if (!$pass) {
cmsCore::addSessionMessage($_LANG['TYPE_PASS'], 'error');
$errors = true;
}
if ($pass && !$pass2) {
cmsCore::addSessionMessage($_LANG['TYPE_PASS_TWICE'], 'error');
$errors = true;
}
if ($pass && $pass2 && mb_strlen($pass) < 6) {
cmsCore::addSessionMessage($_LANG['PASS_SHORT'], 'error');
$errors = true;
}
示例13: blogs
//.........这里部分代码省略.........
$post['tags'] = cmsTagLine('blogpost', $post['id'], false);
}
// получаем блог
$blog = cmsCore::c('blog')->getBlog($id);
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('/blogs');
}
// Права доступа
$myblog = (cmsCore::c('user')->id && cmsCore::c('user')->id == $blog['user_id']); // автор блога
$is_writer = cmsCore::c('blog')->isUserBlogWriter($blog, cmsCore::c('user')->id); // может ли пользователь писать в блог
// если не его блог, пользователь не писатель и не админ, вне зависимости от авторства показываем 404
if (!$myblog && !$is_writer && !cmsCore::c('user')->is_admin ) { cmsCore::error404(); }
// проверяем является ли пользователь автором, если редактируем пост
if (($inCore->do == 'editpost') && !cmsCore::c('user')->is_admin && $post['user_id'] != cmsCore::c('user')->id) { cmsCore::error404(); }
//Если еще не было запроса на сохранение
if (!cmsCore::inRequest('goadd')){
cmsCore::c('page')->addPathway($blog['title'], cmsCore::m('blogs')->getBlogURL($blog['seolink']));
//для нового поста
if ($inCore->do == 'newpost'){
if (IS_BILLING){ cmsBilling::checkBalance('blogs', 'add_post'); }
cmsCore::c('page')->addPathway($_LANG['NEW_POST']);
cmsCore::c('page')->setTitle($_LANG['NEW_POST']);
$post = cmsUser::sessionGet('mod');
if ($post){
cmsUser::sessionDel('mod');
} else {
$post['cat_id'] = $cat_id;
$post['comments'] = 1;
}
}
//для редактирования поста
if ($inCore->do=='editpost'){
cmsCore::c('page')->addPathway($post['title'], cmsCore::m('blogs')->getPostURL($blog['seolink'], $post['seolink']));
cmsCore::c('page')->addPathway($_LANG['EDIT_POST']);
cmsCore::c('page')->setTitle($_LANG['EDIT_POST']);
}
cmsCore::c('page')->initAutocomplete();
$autocomplete_js = cmsCore::c('page')->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',cmsCore::m('blogs')->config['img_on'], 'blogs', 'blog_post', $post_id);
$smilies = cmsPage::getSmilesPanel('message');
$inCore->initAutoGrowText('#message');
//показываем форму
cmsPage::initTemplate('components', 'com_blog_edit_post')->
assign('blog', $blog)->
assign('pagetitle', ($inCore->do=='editpost' ? $_LANG['EDIT_POST'] : $_LANG['NEW_POST']))->
示例14: 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">
示例15: forum
//.........这里部分代码省略.........
cmsCore::redirectBack();
}
}
// новая тема
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'];