mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 06:13:58 -07:00
r65
Новые запреты git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@65 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
ff3f0ee1f7
commit
d435db3e89
15 changed files with 59 additions and 88 deletions
|
@ -321,18 +321,10 @@ class ajax_common
|
|||
$this->ajax_die('invalid new_opt');
|
||||
}
|
||||
|
||||
$user_can_change = array(
|
||||
'hide_porn_forums',
|
||||
);
|
||||
|
||||
foreach ($bf['user_opt'] as $opt_name => $opt_bit)
|
||||
{
|
||||
if (isset($new_opt[$opt_name]))
|
||||
{
|
||||
if (!IS_ADMIN && !in_array($opt_name, $user_can_change))
|
||||
{
|
||||
$this->ajax_die("not admin: $opt_name");
|
||||
}
|
||||
setbit($u_data['user_opt'], $opt_bit, !empty($new_opt[$opt_name]));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ $bb_cfg['css_ver'] = 1;
|
|||
|
||||
// Increase number of revision after update
|
||||
$bb_cfg['tp_version'] = '2.0.2';
|
||||
$bb_cfg['tp_release_state'] = 'TP II r63';
|
||||
$bb_cfg['tp_release_state'] = 'TP II r65';
|
||||
$bb_cfg['tp_release_date'] = '03-07-2011';
|
||||
|
||||
$bb_cfg['board_disabled_msg'] = 'форум временно отключен'; // 'forums temporarily disabled'; // show this msg if board has been disabled via ON/OFF trigger
|
||||
|
@ -80,8 +80,6 @@ $bb_cfg['db_alias'] = array(
|
|||
// http://www.php.net/manual/en/mysql.constants.php#mysql.client-flags
|
||||
define('DBFLAGS', NULL); // Flags: MYSQL_CLIENT_COMPRESS - Compress MySQL
|
||||
define('DBMS', 'mysql');
|
||||
define('DBCOLLATION', '');
|
||||
define('PCONNECT', false);
|
||||
|
||||
// Cache
|
||||
$bb_cfg['cache']['pconnect'] = false;
|
||||
|
|
|
@ -5,16 +5,16 @@ define('BB_SCRIPT', 'gallery');
|
|||
define('BB_ROOT', './');
|
||||
require(BB_ROOT ."common.php");
|
||||
|
||||
if (!$bb_cfg['gallery_enabled'])
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['GALLERY_DISABLED']);
|
||||
}
|
||||
|
||||
// Start session management
|
||||
$user->session_start(array('req_login' => true));
|
||||
|
||||
if (!$bb_cfg['gallery_enabled']) bb_die($lang['GALLERY_DISABLED']);
|
||||
|
||||
require(LANG_DIR ."lang_gallery.php");
|
||||
|
||||
if(bf($userdata['user_opt'], 'user_opt', 'allow_gallery'))
|
||||
{
bb_die($lang['USE_GALLERY_OFF']);
}
|
||||
|
||||
$go = isset($_GET['go']) ? $_GET['go'] : '';
|
||||
$max_size = $bb_cfg['pic_max_size'];
|
||||
$dir = $bb_cfg['pic_dir'];
|
||||
|
|
|
@ -19,22 +19,7 @@ function generate_user_info(&$row, $date_format, $group_mod, &$from, &$posts, &$
|
|||
$joined = bb_date($row['user_regdate'], $date_format);
|
||||
$posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0;
|
||||
|
||||
$poster_avatar = '';
|
||||
if ( @$row['user_avatar_type'] && $row['user_id'] != ANONYMOUS && $row['user_allowavatar'] )
|
||||
{
|
||||
switch( $row['user_avatar_type'] )
|
||||
{
|
||||
case USER_AVATAR_UPLOAD:
|
||||
$poster_avatar = ( $bb_cfg['allow_avatar_upload'] ) ? '<img src="' . $bb_cfg['avatar_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" />' : '';
|
||||
break;
|
||||
case USER_AVATAR_REMOTE:
|
||||
$poster_avatar = ( $bb_cfg['allow_avatar_remote'] ) ? '<img src="' . $row['user_avatar'] . '" alt="" border="0" />' : '';
|
||||
break;
|
||||
case USER_AVATAR_GALLERY:
|
||||
$poster_avatar = ( $bb_cfg['allow_avatar_local'] ) ? '<img src="' . $bb_cfg['avatar_gallery_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" />' : '';
|
||||
break;
|
||||
}
|
||||
}
|
||||
$poster_avatar = get_avatar($row['user_avatar'], $row['user_avatar_type'], !bf($row['user_opt'], 'user_opt', 'allow_avatar'));
|
||||
|
||||
if ( bf($row['user_opt'], 'user_opt', 'viewemail') || $group_mod )
|
||||
{
|
||||
|
|
|
@ -564,17 +564,20 @@ $bf['forum_perm'] = array(
|
|||
);
|
||||
|
||||
$bf['user_opt'] = array(
|
||||
'viewemail' => 0,
|
||||
'allow_sig' => 1,
|
||||
'allowavatar' => 2,
|
||||
'allow_pm' => 3,
|
||||
'allow_viewonline' => 4,
|
||||
'notify' => 5,
|
||||
'notify_pm' => 6,
|
||||
'allow_passkey' => 7,
|
||||
'hide_porn_forums' => 8,
|
||||
'can_hide_ads' => 9,
|
||||
'hide_ads' => 10,
|
||||
'viewemail' => 0, // Показывать e-mail
|
||||
'allow_sig' => 1, // Запрет на подпись
|
||||
'allow_avatar' => 2, // Запрет на аватар
|
||||
'allow_pm' => 3, // Запрет на отправку ЛС
|
||||
'allow_viewonline' => 4, // Скрывать пребывание пользователя
|
||||
'notify' => 5, // Сообщать об ответах в отслеживаемых темах
|
||||
'notify_pm' => 6, // Сообщать о новых ЛС
|
||||
'allow_passkey' => 7, // Запрет на добавление passkey, он же запрет на скачивание торрентов
|
||||
'hide_porn_forums' => 8, // Скрывать pron форумы
|
||||
'allow_gallery' => 9, // Запрет на использование галереи
|
||||
'hide_ads' => 10, // Запрет на показ рекламы
|
||||
'allow_topic' => 11, // Запрет на создание новых тем
|
||||
'allow_post' => 12, // Запрет на отправку сообщений
|
||||
'allow_post_edit' => 13, // Запрет на редактирование сообщений
|
||||
);
|
||||
|
||||
function bit2dec ($bit_num)
|
||||
|
@ -2905,13 +2908,13 @@ function create_magnet($infohash, $auth_key, $logged_in)
|
|||
return '<a href="magnet:?xt=urn:btih:'. bin2hex($infohash) .'&tr='. urlencode($bb_cfg['bt_announce_url'] . $passkey_url) .'"><img src="images/magnet.png" width="12" height="12" border="0" /></a>';
|
||||
}
|
||||
|
||||
function get_avatar ($avatar, $type, $allowavatar = true)
|
||||
function get_avatar ($avatar, $type, $allow_avatar = true)
|
||||
{
|
||||
global $bb_cfg, $lang;
|
||||
|
||||
$user_avatar = '<img src="'. $bb_cfg['no_avatar'] .'" alt="" border="0" />';
|
||||
|
||||
if ($allowavatar)
|
||||
if ($allow_avatar)
|
||||
{
|
||||
switch($type)
|
||||
{
|
||||
|
|
|
@ -206,7 +206,7 @@ $template->assign_vars(array(
|
|||
'LOGGED_IN' => $logged_in,
|
||||
'SESSION_USER_ID' => $userdata['user_id'],
|
||||
'THIS_USERNAME' => $userdata['username'],
|
||||
'THIS_AVATAR' => get_avatar($userdata['user_avatar'], $userdata['user_avatar_type'], !bf($userdata['user_opt'], 'user_opt', 'allowavatar')),
|
||||
'THIS_AVATAR' => get_avatar($userdata['user_avatar'], $userdata['user_avatar_type'], !bf($userdata['user_opt'], 'user_opt', 'allowa_vatar')),
|
||||
'SHOW_LOGIN_LINK' => !defined('IN_LOGIN'),
|
||||
'AUTOLOGIN_DISABLED' => !$bb_cfg['allow_autologin'],
|
||||
'S_LOGIN_ACTION' => BB_ROOT ."login.php",
|
||||
|
|
|
@ -818,14 +818,6 @@ class user_common
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if user can hide ads
|
||||
*/
|
||||
function hide_ads ()
|
||||
{
|
||||
return (bf($this->opt, 'user_opt', 'can_hide_ads') && bf($this->opt, 'user_opt', 'hide_ads'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue ads
|
||||
*/
|
||||
|
@ -833,7 +825,7 @@ class user_common
|
|||
{
|
||||
global $datastore, $bb_cfg;
|
||||
|
||||
if ($bb_cfg['show_ads'] && !$this->hide_ads() && !defined('IN_ADMIN') && !defined('IN_AJAX'))
|
||||
if ($bb_cfg['show_ads'] && !bf($this->opt, 'user_opt', 'hide_ads') && !defined('IN_ADMIN') && !defined('IN_AJAX'))
|
||||
{
|
||||
$datastore->enqueue('ads');
|
||||
$this->show_ads = true;
|
||||
|
|
|
@ -132,7 +132,7 @@ switch ($mode)
|
|||
|
||||
include(INC_DIR . 'ucp/usercp_avatar.php');
|
||||
|
||||
if ( !bf($pr_data['user_opt'], 'user_opt', 'allowavatar') && ( $bb_cfg['allow_avatar_upload'] || $bb_cfg['allow_avatar_local'] || $bb_cfg['allow_avatar_remote'] ) )
|
||||
if ( !bf($pr_data['user_opt'], 'user_opt', 'allow_avatar') && ( $bb_cfg['allow_avatar_upload'] || $bb_cfg['allow_avatar_local'] || $bb_cfg['allow_avatar_remote'] ) )
|
||||
{
|
||||
$template->assign_block_vars('switch_avatar_block', array() );
|
||||
|
||||
|
@ -619,8 +619,8 @@ foreach ($profile_fields as $field => $can_edit)
|
|||
}
|
||||
$tp_data['USER_AVATAR'] = get_avatar($user_avatar, $user_avatar_type) . $hidden_vars;
}
|
||||
else
|
||||
{
$tp_data['USER_AVATAR'] = get_avatar($pr_data['user_avatar'], $pr_data['user_avatar_type'], !bf($pr_data['user_opt'], 'user_opt', 'allowavatar'));
}
|
||||
if ($submit && !bf($pr_data['user_opt'], 'user_opt', 'allowavatar'))
|
||||
{
$tp_data['USER_AVATAR'] = get_avatar($pr_data['user_avatar'], $pr_data['user_avatar_type'], !bf($pr_data['user_opt'], 'user_opt', 'allow_avatar'));
}
|
||||
if ($submit && !bf($pr_data['user_opt'], 'user_opt', 'allow_avatar'))
|
||||
{
|
||||
if ( $user_avatar != $pr_data['user_avatar'] || $user_avatar_type != $pr_data['user_avatar_type'])
|
||||
{
|
||||
|
|
|
@ -45,7 +45,7 @@ else
|
|||
{
|
||||
$percentage = 0;
|
||||
}
|
||||
$avatar_img = get_avatar($profiledata['user_avatar'], $profiledata['user_avatar_type'], !bf($profiledata['user_opt'], 'user_opt', 'allowavatar'));
|
||||
$avatar_img = get_avatar($profiledata['user_avatar'], $profiledata['user_avatar_type'], !bf($profiledata['user_opt'], 'user_opt', 'allow_avatar'));
|
||||
|
||||
if (!$ranks = $datastore->get('ranks'))
|
||||
{
|
||||
|
@ -74,7 +74,6 @@ $temp_url = append_sid("privmsg.php?mode=post&" . POST_USERS_URL . "=" . $pr
|
|||
$pm_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['SEND_PRIVATE_MESSAGE'] . '" title="' . $lang['SEND_PRIVATE_MESSAGE'] . '" border="0" /></a>';
|
||||
|
||||
$location = ($profiledata['user_from']) ? $profiledata['user_from'] : '';
|
||||
$location .= ($profiledata['user_from_flag'] && $profiledata['user_from_flag'] != 'blank.gif') ? ' '. make_user_flag($profiledata['user_from_flag']) : '';
|
||||
|
||||
$pm = '<a href="' . $temp_url . '">' . $lang['SEND_PRIVATE_MESSAGE'] . '</a>';
|
||||
|
||||
|
@ -239,10 +238,13 @@ if (IS_ADMIN)
|
|||
));
|
||||
|
||||
$ajax_user_opt = bb_json_encode(array(
|
||||
'allowavatar' => bf($profiledata['user_opt'], 'user_opt', 'allowavatar'),
|
||||
'allow_avatar' => bf($profiledata['user_opt'], 'user_opt', 'allow_avatar'),
|
||||
'allow_sig' => bf($profiledata['user_opt'], 'user_opt', 'allow_sig'),
|
||||
'allow_passkey' => bf($profiledata['user_opt'], 'user_opt', 'allow_passkey'),
|
||||
'allow_pm' => bf($profiledata['user_opt'], 'user_opt', 'allow_pm'),
|
||||
'allow_sig' => bf($profiledata['user_opt'], 'user_opt', 'allow_sig'),
|
||||
'allow_post' => bf($profiledata['user_opt'], 'user_opt', 'allow_post'),
|
||||
'allow_post_edit' => bf($profiledata['user_opt'], 'user_opt', 'allow_post_edit'),
|
||||
'allow_topic' => bf($profiledata['user_opt'], 'user_opt', 'allow_topic'),
|
||||
));
|
||||
|
||||
$template->assign_vars(array(
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
Russian language for TorrentPier SVN
|
||||
*/
|
||||
|
||||
$lang['USE_GALLERY_OFF'] = 'You can not upload images';
|
||||
$lang['GALLERY_YOUR_IMAGE'] = 'Your image';
|
||||
$lang['GALLERY_FAILURE'] = 'Failure';
|
||||
$lang['GALLERY_LINK_URL'] = 'Link to image';
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
Russian language for TorrentPier SVN
|
||||
*/
|
||||
|
||||
$lang['USE_GALLERY_OFF'] = 'Вы не можете загружать изображения';
|
||||
$lang['GALLERY_YOUR_IMAGE'] = 'Ваше изображение';
|
||||
$lang['GALLERY_FAILURE'] = 'Неудача';
|
||||
$lang['GALLERY_LINK_URL'] = 'Ссылка на изображение';
|
||||
|
|
|
@ -152,7 +152,7 @@ $template->assign_vars(array(
|
|||
));
|
||||
|
||||
// per-letter selection end
|
||||
$sql = "SELECT username, user_id, user_opt, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_avatar, user_avatar_type, user_allowavatar
|
||||
$sql = "SELECT username, user_id, user_opt, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_avatar, user_avatar_type
|
||||
FROM ". BB_USERS ."
|
||||
WHERE user_id NOT IN(". EXCLUDED_USERS_CSV .")";
|
||||
if ( $username )
|
||||
|
@ -176,23 +176,8 @@ if ( $row = DB()->sql_fetchrow($result) )
|
|||
|
||||
$joined = bb_date($row['user_regdate'], $lang['DATE_FORMAT']);
|
||||
$posts = $row['user_posts'];
|
||||
$poster_avatar = false;
|
||||
|
||||
if ($row['user_avatar_type'] && $user_id != ANONYMOUS && $row['user_allowavatar'])
|
||||
{
|
||||
switch ($row['user_avatar_type'])
|
||||
{
|
||||
case USER_AVATAR_UPLOAD:
|
||||
$poster_avatar = ($bb_cfg['allow_avatar_upload']) ? '<img src="'. $bb_cfg['avatar_path'] .'/'. $row['user_avatar'] .'" alt="" border="0" />' : false;
|
||||
break;
|
||||
case USER_AVATAR_REMOTE:
|
||||
$poster_avatar = ($bb_cfg['allow_avatar_remote']) ? '<img src="'. $row['user_avatar'] .'" alt="" border="0" />' : false;
|
||||
break;
|
||||
case USER_AVATAR_GALLERY:
|
||||
$poster_avatar = ($bb_cfg['allow_avatar_local']) ? '<img src="'. $bb_cfg['avatar_gallery_path'] .'/'. $row['user_avatar'] .'" alt="" border="0" />' : false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$poster_avatar = get_avatar($row['user_avatar'], $row['user_avatar_type'], !bf($row['user_opt'], 'user_opt', 'allow_avatar'));
|
||||
|
||||
$pm = '<a class="txtb" href="'. append_sid("privmsg.php?mode=post&". POST_USERS_URL ."=$user_id") .'">'. $lang['SEND_PM_TXTB'] .'</a>';
|
||||
$email = ($bb_cfg['board_email_form']) ? '<a class="txtb" href="'. append_sid("profile.php?mode=email&". POST_USERS_URL ."=$user_id") .'">'. $lang['SEND_EMAIL_TXTB'] .'</a>' : false;
|
||||
|
|
|
@ -64,6 +64,10 @@ $is_auth = array();
|
|||
switch ($mode)
|
||||
{
|
||||
case 'newtopic':
|
||||
if(bf($userdata['user_opt'], 'user_opt', 'allow_topic'))
|
||||
{
|
||||
bb_die($lang['RULES_POST_CANNOT']);
|
||||
}
|
||||
if ($topic_type == POST_ANNOUNCE)
|
||||
{
|
||||
$is_auth_type = 'auth_announce';
|
||||
|
@ -79,9 +83,17 @@ switch ($mode)
|
|||
break;
|
||||
case 'reply':
|
||||
case 'quote':
|
||||
if(bf($userdata['user_opt'], 'user_opt', 'allow_post'))
|
||||
{
|
||||
bb_die($lang['RULES_REPLY_CANNOT']);
|
||||
}
|
||||
$is_auth_type = 'auth_reply';
|
||||
break;
|
||||
case 'editpost':
|
||||
if(bf($userdata['user_opt'], 'user_opt', 'allow_post_edit'))
|
||||
{
|
||||
bb_die($lang['RULES_EDIT_CANNOT']);
|
||||
}
|
||||
$is_auth_type = 'auth_edit';
|
||||
break;
|
||||
case 'delete':
|
||||
|
@ -299,7 +311,8 @@ if ($submit || $refresh)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!IS_GUEST && $mode != 'newtopic' && bf($userdata['user_opt'], 'user_opt', 'notify'))
|
||||
$notify_user = bf($userdata['user_opt'], 'user_opt', 'notify');
|
||||
if (!IS_GUEST && $mode != 'newtopic' && !$notify_user)
|
||||
{
|
||||
$notify_user = (int) DB()->fetch_row("
|
||||
SELECT topic_id
|
||||
|
@ -308,10 +321,6 @@ else
|
|||
AND user_id = ". $userdata['user_id'] ."
|
||||
");
|
||||
}
|
||||
else
|
||||
{
|
||||
$notify_user = $userdata['user_notify'];
|
||||
}
|
||||
}
|
||||
|
||||
$update_post_time = !empty($_POST['update_post_time']);
|
||||
|
|
|
@ -143,10 +143,13 @@ $(document).ready(function(){
|
|||
<style type="text/css"> #user-opt label { display: block; } </style>
|
||||
<legend>Юзеру <b style="color: darkred;">ЗАПРЕЩЕНО</b></legend>
|
||||
<div class="tLeft" style="padding: 2px 6px 6px; display: block;">
|
||||
<label><input type="checkbox" name="allowavatar" />показывать аватар</label>
|
||||
<label><input type="checkbox" name="allow_passkey" />passkey</label>
|
||||
<label><input type="checkbox" name="allow_pm" />отправлять лс</label>
|
||||
<label><input type="checkbox" name="allow_avatar" />показывать аватар</label>
|
||||
<label><input type="checkbox" name="allow_sig" />показывать подпись</label>
|
||||
<label><input type="checkbox" name="allow_passkey" />скачивать торренты</label>
|
||||
<label><input type="checkbox" name="allow_pm" />отправлять лс</label>
|
||||
<label><input type="checkbox" name="allow_post" />отправлять сообщения</label>
|
||||
<label><input type="checkbox" name="allow_post_edit" />редактировать сообщения</label>
|
||||
<label><input type="checkbox" name="allow_topic" />создавать темы</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div id="user-opt-save" class="hidden">
|
||||
|
|
|
@ -805,7 +805,7 @@ for($i = 0; $i < $total_posts; $i++)
|
|||
$poster_avatar = '';
|
||||
if ( !$user->opt_js['h_av'] && $poster_id != ANONYMOUS )
|
||||
{
|
||||
$poster_avatar = get_avatar($postrow[$i]['user_avatar'], $postrow[$i]['user_avatar_type'], !bf($postrow[$i]['user_opt'], 'user_opt', 'allowavatar'));
|
||||
$poster_avatar = get_avatar($postrow[$i]['user_avatar'], $postrow[$i]['user_avatar_type'], !bf($postrow[$i]['user_opt'], 'user_opt', 'allow_avatar'));
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue