$conditions = array('LIMIT' => LIMIT_COMMENTS, 'ORDER' => COMMENTS_ORDER, 'SPAM' => SPAM_SURVEY_COMMENTS, 'section' => 'survey'); if (isset($_GET['action'])) { switch ($_GET['action']) { case 'viewsurvey': if (@$_SESSION['rights']['public']['survey']['com_view'] or @$_SESSION['rights']['superadmin']) { survey_view((int) $_GET['id']); $conditions['action'] = 'add'; $conditions['link'] = '?section=survey&action=viewsurvey&id=' . (int) $_GET['id']; comments_get('survey', (int) $_GET['id'], $conditions); } else { echo table(ACCESS_DENIED, NO_ACCESS_RIGHTS); } break; case 'vote': if (@$_SESSION['rights']['public']['survey']['view'] or @$_SESSION['rights']['superadmin']) { survey_vote((int) $_GET['id']); } else { echo table(ACCESS_DENIED, NO_ACCESS_RIGHTS); } break; case 'addcomment': if (@$_SESSION['rights']['public']['survey']['com_add'] or @$_SESSION['rights']['superadmin']) { $conditions['action'] = 'add'; $conditions['link'] = '?section=survey&action=viewsurvey&id=' . (int) $_GET['id']; comments_add('survey', (int) $_GET['id'], $conditions); } else { echo table(ACCESS_DENIED, NO_ACCESS_RIGHTS); } break; case 'editcomment': $conditions['action'] = 'edit';
// TODO ban if ($template_result[F_BANNED_STATUS] && !$skip_ban_check) { if (defined('IN_API')) { return; } $bantime = date(FMT_DATE_TIME, $template_result[F_BANNED_STATUS]); // TODO: Add ban reason. Add vacation time. Add message window sn_sys_logout(false, true); message("{$lang['sys_banned_msg']} {$bantime}", $lang['ban_title']); die("{$lang['sys_banned_msg']} {$bantime}"); } $template_result[F_USER_AUTHORIZED] = $sys_user_logged_in = !empty($user) && isset($user['id']) && $user['id']; // !!! Просто $allow_anonymous используется в платежных модулях !!! $allow_anonymous = $allow_anonymous || isset($sn_page_data['allow_anonymous']) && $sn_page_data['allow_anonymous']; if (!$allow_anonymous && !$sys_user_logged_in) { sn_setcookie(SN_COOKIE, '', time() - PERIOD_WEEK, SN_ROOT_RELATIVE); sys_redirect(SN_ROOT_VIRTUAL . 'login.php'); } $user_time_diff = user_time_diff_get(); //defined('SN_CLIENT_TIME_DIFF_SECONDS') or define('SN_CLIENT_TIME_DIFF_SECONDS', $user_time_diff[PLAYER_OPTION_TIME_DIFF]); //defined('SN_CLIENT_TIME_UTC_OFFSET') or define('SN_CLIENT_TIME_UTC_OFFSET', $user_time_diff[PLAYER_OPTION_TIME_DIFF_UTC_OFFSET]); //$time_diff = SN_CLIENT_TIME_DIFF_SECONDS + SN_CLIENT_TIME_UTC_OFFSET; //defined('SN_CLIENT_TIME_DIFF') or define('SN_CLIENT_TIME_DIFF', $time_diff); //defined('SN_CLIENT_TIME_LOCAL') or define('SN_CLIENT_TIME_LOCAL', SN_TIME_NOW + SN_CLIENT_TIME_DIFF); global $time_diff; define('SN_CLIENT_TIME_DIFF', $time_diff = $user_time_diff[PLAYER_OPTION_TIME_DIFF] + $user_time_diff[PLAYER_OPTION_TIME_DIFF_UTC_OFFSET]); define('SN_CLIENT_TIME_LOCAL', SN_TIME_NOW + SN_CLIENT_TIME_DIFF); !empty($user) && sys_get_param_id('only_hide_news') ? die(nws_mark_read($user)) : false; !empty($user) && sys_get_param_id('survey_vote') ? die(survey_vote($user)) : false; lng_load_i18n($sn_mvc['i18n'][$sn_page_name]); execute_hooks($sn_mvc['model'][''], $template);