Minor improvements (#954)

* Minor improvements

* Update admin_extensions.php

* Updated

* Update index.tpl
This commit is contained in:
Roman Kelesidis 2023-10-05 23:09:57 +07:00 committed by GitHub
commit 3a03381b8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 28 additions and 24 deletions

View file

@ -569,7 +569,7 @@ if ($e_mode == 'perm' && $group) {
$forum_p = [];
$act_id = 0;
$forum_p = auth_unpack($allowed_forums);
$sql = 'SELECT forum_id, forum_name FROM ' . BB_FORUMS . ' WHERE forum_id IN (' . implode(', ', $forum_p) . ')';
$sql = 'SELECT forum_id, forum_name, forum_parent FROM ' . BB_FORUMS . ' WHERE forum_id IN (' . implode(', ', $forum_p) . ') ORDER BY forum_order';
if (!($result = DB()->sql_query($sql))) {
bb_die('Could not get forum names');
}
@ -577,15 +577,16 @@ if ($e_mode == 'perm' && $group) {
while ($row = DB()->sql_fetchrow($result)) {
$forum_perm[$act_id]['forum_id'] = $row['forum_id'];
$forum_perm[$act_id]['forum_name'] = $row['forum_name'];
$forum_perm[$act_id]['forum_parent'] = $row['forum_parent'];
$act_id++;
}
}
for ($i = 0, $iMax = count($forum_perm); $i < $iMax; $i++) {
$template->assign_block_vars('allow_option_values', array(
'VALUE' => $forum_perm[$i]['forum_id'],
'OPTION' => htmlCHR($forum_perm[$i]['forum_name']))
);
$template->assign_block_vars('allow_option_values', [
'VALUE' => $forum_perm[$i]['forum_id'],
'OPTION' => (($forum_perm[$i]['forum_parent']) ? HTML_SF_SPACER : '') . htmlCHR($forum_perm[$i]['forum_name'])
]);
}
$template->assign_vars(array(
@ -594,24 +595,24 @@ if ($e_mode == 'perm' && $group) {
'A_PERM_ACTION' => "admin_extensions.php?mode=groups&amp;e_mode=perm&amp;e_group=$group",
));
$forum_option_values = array(0 => $lang['PERM_ALL_FORUMS']);
$forum_option_values = array(0 => array('parent' => 0, 'name' => $lang['PERM_ALL_FORUMS']));
$sql = 'SELECT forum_id, forum_name FROM ' . BB_FORUMS;
$sql = 'SELECT forum_id, forum_name, forum_parent FROM ' . BB_FORUMS . ' ORDER BY forum_order';
if (!($result = DB()->sql_query($sql))) {
bb_die('Could not get forums #1');
}
while ($row = DB()->sql_fetchrow($result)) {
$forum_option_values[(int)$row['forum_id']] = $row['forum_name'];
$forum_option_values[(int)$row['forum_id']] = array('parent' => $row['forum_parent'], 'name' => $row['forum_name']);
}
DB()->sql_freeresult($result);
foreach ($forum_option_values as $value => $option) {
$template->assign_block_vars('forum_option_values', array(
'VALUE' => $value,
'OPTION' => htmlCHR($option))
);
$template->assign_block_vars('forum_option_values', [
'VALUE' => $value,
'OPTION' => (($option['parent']) ? HTML_SF_SPACER : '') . htmlCHR($option['name'])
]);
}
$empty_perm_forums = [];

View file

@ -83,7 +83,7 @@ if ($mode != '') {
// The rank image has to be a jpg, gif or png
//
if ($rank_image != '') {
if (!preg_match('/(\.gif|\.png|\.jpg)$/is', $rank_image)) {
if (!preg_match('/(\.gif|\.png|\.jpg|\.jpeg|\.bmp|\.webp)$/is', $rank_image)) {
$rank_image = '';
}
}

View file

@ -411,16 +411,16 @@ $bb_cfg['board_email_form'] = false; // can users send email to each other via b
$bb_cfg['board_email_sig'] = ''; // this text will be attached to all emails the board sends
$bb_cfg['board_email_sitename'] = $domain_name; // sitename used in all emails header
$bb_cfg['topic_notify_enabled'] = true;
$bb_cfg['pm_notify_enabled'] = true;
$bb_cfg['group_send_email'] = true;
$bb_cfg['email_change_disabled'] = false; // TODO: disable changing email by user
$bb_cfg['topic_notify_enabled'] = true; // отправлять ли уведомление на почту, если в теме которую отслеживает пользователь есть новые ответы
$bb_cfg['pm_notify_enabled'] = true; // отправлять ли уведомление на почту, если пришло личное письмо на сайте
$bb_cfg['group_send_email'] = true; // отправлять ли уведомление на почту, если пользователя приняли в группу, пригласили в группу
$bb_cfg['email_change_disabled'] = false; // отключить возможность изменять почту самим пользователям
$bb_cfg['show_email_visibility_settings'] = true; // разрешать ли пользователям изменять свои настройки отображения почты (Скрыто или нет)
$bb_cfg['bounce_email'] = "bounce@$domain_name"; // bounce email address
$bb_cfg['tech_admin_email'] = "admin@$domain_name"; // email for sending error reports
$bb_cfg['abuse_email'] = "abuse@$domain_name";
$bb_cfg['adv_email'] = "adv@$domain_name";
$bb_cfg['abuse_email'] = "abuse@$domain_name"; // почта для жалоб (абуз, правообладатели)
$bb_cfg['adv_email'] = "adv@$domain_name"; // почта для рекламных предложений
// Bugsnag error reporting
$bb_cfg['bugsnag'] = [

View file

@ -237,6 +237,9 @@ foreach ($profile_fields as $field => $can_edit) {
$db_data['user_email'] = $email;
} elseif ($email != $pr_data['user_email']) {
// если смена мейла юзером
if ($bb_cfg['email_change_disabled'] && !$adm_edit && !IS_ADMIN) {
$errors[] = $lang['EMAIL_CHANGING_DISABLED'];
}
if (!$cur_pass_valid) {
$errors[] = $lang['CONFIRM_PASSWORD_EXPLAIN'];
}

View file

@ -2790,7 +2790,7 @@ $lang['UPLOAD_ERROR_COMMON_DISABLED'] = 'File upload disabled';
$lang['UPLOAD_ERROR_COMMON'] = 'File upload error';
$lang['UPLOAD_ERROR_SIZE'] = 'The uploaded file exceeds the maximum size of %s';
$lang['UPLOAD_ERROR_FORMAT'] = 'Invalid file type of image';
$lang['UPLOAD_ERROR_DIMENSIONS'] = 'Image dimensions exceed the maximum allowable %sx%s px';
$lang['UPLOAD_ERROR_DIMENSIONS'] = 'Image dimensions exceed the maximum allowable %sx%s pixels';
$lang['UPLOAD_ERROR_NOT_IMAGE'] = 'The uploaded file is not an image';
$lang['UPLOAD_ERROR_NOT_ALLOWED'] = 'Extension %s for downloads is not allowed';
$lang['UPLOAD_ERRORS'] = [

View file

@ -210,7 +210,7 @@ class Ajax
*/
public function check_admin_session()
{
global $user;
global $user, $lang;
if (!$user->data['session_admin']) {
if (empty($this->request['user_password'])) {
@ -221,7 +221,7 @@ class Ajax
'login_password' => $_POST['user_password'],
];
if (!$user->login($login_args, true)) {
$this->ajax_die('Wrong password');
$this->ajax_die($lang['ERROR_LOGIN']);
}
}
}

View file

@ -204,7 +204,7 @@
<!-- BEGIN reg_user_row -->
<tr class="{reg_user_row.ROW_CLASS}">
<td class="bold" nowrap="nowrap">{reg_user_row.USER}</td>
<td align="center" nowrap="nowrap">{reg_user_row.STARTED}-{reg_user_row.LASTUPDATE}</td>
<td align="center" nowrap="nowrap"><b>{L_LOGIN}:</b> {reg_user_row.STARTED} | <b>{L_LAST_UPDATED}:</b> {reg_user_row.LASTUPDATE}</td>
<td class="tCenter"><a href="{reg_user_row.U_WHOIS_IP}" class="gen" target="_blank">{reg_user_row.IP_ADDRESS}</a>
</td>
</tr>

View file

@ -83,7 +83,7 @@
</tr>
<tr>
<td class="prof-title">{L_EMAIL}: * <!-- IF EDIT_PROFILE --><!-- ELSE IF $bb_cfg['reg_email_activation'] --><br/><h6>{L_EMAIL_EXPLAIN}</h6><!-- ENDIF --></td>
<td><input id="email" onBlur="ajax.exec({ action: 'user_register', mode: 'check_email', email: $('#email').val()}); return false;" type="text" name="user_email" size="35" maxlength="40" value="{USER_EMAIL}"<!-- IF EDIT_PROFILE --><!-- IF !$bb_cfg['emailer']['enabled'] --> readonly style="color: gray;"<!-- ENDIF --><!-- ENDIF --> /><span id="check_email"></span></td>
<td><input id="email" onBlur="ajax.exec({ action: 'user_register', mode: 'check_email', email: $('#email').val()}); return false;" type="text" name="user_email" size="35" maxlength="40" value="{USER_EMAIL}"<!-- IF EDIT_PROFILE and not ADM_EDIT and not IS_ADMIN --><!-- IF $bb_cfg['emailer_disabled'] or $bb_cfg['email_change_disabled'] --> readonly style="color: gray;"<!-- ENDIF --><!-- ENDIF --> /><span id="check_email"></span></td>
</tr>
<!-- IF EDIT_PROFILE and not ADM_EDIT -->
<tr>