diff --git a/README.md b/README.md index 2b78813c2..ecccaba3d 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ and go from there. The documentation will be translated into english in the near * Apache / nginx * MySQL / MariaDB / Percona * PHP: 5.6 / 7.0 / 7.1 -* PHP Extensions: bcmath, intl, tidy (optional) +* PHP Extensions: bcmath, intl, tidy (optional), xml ## Installation diff --git a/admin/admin_bt_tracker_cfg.php b/admin/admin_bt_tracker_cfg.php deleted file mode 100644 index a43f5e888..000000000 --- a/admin/admin_bt_tracker_cfg.php +++ /dev/null @@ -1,94 +0,0 @@ - 'Tracker is disabled', - 'browser_redirect_url' => 'http://demo.torrentpier.com/', -); - -$default_cfg_bool = array( - 'autoclean' => 1, - 'off' => 0, - 'compact_mode' => 1, - 'update_dlstat' => 1, - 'limit_active_tor' => 0, - 'limit_concurrent_ips' => 0, - 'retracker' => 1, -); - -$default_cfg_num = array( - 'numwant' => 50, - 'expire_factor' => 4, - 'limit_seed_count' => 20, - 'limit_leech_count' => 4, - 'leech_expire_factor' => 60, - 'limit_seed_ips' => 0, - 'limit_leech_ips' => 0, -); - -/** - * Set template vars - */ -set_tpl_vars($default_cfg_str, $bb_cfg['tracker']); -set_tpl_vars_lang($default_cfg_str); - -set_tpl_vars_bool($default_cfg_bool, $bb_cfg['tracker']); -set_tpl_vars_lang($default_cfg_bool); - -set_tpl_vars($default_cfg_num, $bb_cfg['tracker']); -set_tpl_vars_lang($default_cfg_num); - -$template->assign_vars(array( - 'IGNORE_REPORTED_IP' => $bb_cfg['ignore_reported_ip'], - 'ANNOUNCE_INTERVAL' => $bb_cfg['announce_interval'], - 'PASSKEY_KEY' => $bb_cfg['passkey_key'], - 'GOLD_SILVER_ENABLED' => $bb_cfg['tracker']['gold_silver_enabled'], - 'DISABLE_SUBMIT' => true, - - 'S_HIDDEN_FIELDS' => '', - 'S_CONFIG_ACTION' => 'admin_bt_tracker_cfg.php', -)); - -print_page('admin_bt_tracker_cfg.tpl', 'admin'); diff --git a/admin/admin_ug_auth.php b/admin/admin_ug_auth.php index 0e13ae4a5..eadb6ed53 100644 --- a/admin/admin_ug_auth.php +++ b/admin/admin_ug_auth.php @@ -87,37 +87,39 @@ if ($submit && $mode == 'user') { } // Make user an admin (if already user) - if ($_POST['userlevel'] === 'admin') { - if ($userdata['user_id'] == $user_id || $user_id == GUEST_UID || $user_id == BOT_UID) { - bb_die('Could not update admin status'); + if (isset($_POST['userlevel'])) { + if ($_POST['userlevel'] === 'admin') { + if ($userdata['user_id'] == $user_id || $user_id == GUEST_UID || $user_id == BOT_UID) { + bb_die('Could not update admin status'); + } + + DB()->query('UPDATE ' . BB_USERS . ' SET user_level = ' . ADMIN . " WHERE user_id = $user_id"); + + // Delete any entries in auth_access, they are not required if user is becoming an admin + delete_permissions($group_id, $user_id); + + $message = $lang['AUTH_UPDATED'] . '

'; + $message .= sprintf($lang['CLICK_RETURN_USERAUTH'], '', '') . '

'; + $message .= sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); + + bb_die($message); + } // Make admin a user (if already admin) + elseif ($_POST['userlevel'] === 'user') { + // ignore if you're trying to change yourself from an admin to user! + if ($userdata['user_id'] == $user_id) { + bb_die('Could not update admin status

Could not change yourself from an admin to user'); + } + // Update users level, reset to USER + DB()->query('UPDATE ' . BB_USERS . ' SET user_level = ' . USER . " WHERE user_id = $user_id"); + + delete_permissions($group_id, $user_id); + + $message = $lang['AUTH_UPDATED'] . '

'; + $message .= sprintf($lang['CLICK_RETURN_USERAUTH'], '', '') . '

'; + $message .= sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); + + bb_die($message); } - - DB()->query('UPDATE ' . BB_USERS . ' SET user_level = ' . ADMIN . " WHERE user_id = $user_id"); - - // Delete any entries in auth_access, they are not required if user is becoming an admin - delete_permissions($group_id, $user_id); - - $message = $lang['AUTH_UPDATED'] . '

'; - $message .= sprintf($lang['CLICK_RETURN_USERAUTH'], '', '') . '

'; - $message .= sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - - bb_die($message); - } // Make admin a user (if already admin) - elseif ($_POST['userlevel'] === 'user') { - // ignore if you're trying to change yourself from an admin to user! - if ($userdata['user_id'] == $user_id) { - bb_die('Could not update admin status

Could not change yourself from an admin to user'); - } - // Update users level, reset to USER - DB()->query('UPDATE ' . BB_USERS . ' SET user_level = ' . USER . " WHERE user_id = $user_id"); - - delete_permissions($group_id, $user_id); - - $message = $lang['AUTH_UPDATED'] . '

'; - $message .= sprintf($lang['CLICK_RETURN_USERAUTH'], '', '') . '

'; - $message .= sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '', ''); - - bb_die($message); } // diff --git a/library/ajax/mod_action.php b/library/ajax/mod_action.php index 9a073ad5f..8ef2ca6cd 100644 --- a/library/ajax/mod_action.php +++ b/library/ajax/mod_action.php @@ -98,13 +98,13 @@ switch ($mode) { $reg_ip = DB()->fetch_rowset("SELECT username, user_id, user_rank FROM " . BB_USERS . " WHERE user_reg_ip = '{$profiledata['user_reg_ip']}' - AND user_reg_ip != '' + AND user_reg_ip != 0 AND user_id != {$profiledata['user_id']} ORDER BY username ASC"); $last_ip = DB()->fetch_rowset("SELECT username, user_id, user_rank FROM " . BB_USERS . " WHERE user_last_ip = '{$profiledata['user_last_ip']}' - AND user_last_ip != '' + AND user_last_ip != 0 AND user_id != {$profiledata['user_id']}"); $link_reg_ip = $link_last_ip = ''; diff --git a/library/language/source/main.php b/library/language/source/main.php index 0a6a9e27f..06fe6d5d7 100644 --- a/library/language/source/main.php +++ b/library/language/source/main.php @@ -2014,7 +2014,6 @@ $lang['DELETE_DISALLOW_EXPLAIN'] = 'You can remove a disallowed username by sele $lang['ADD_DISALLOW'] = 'Add'; $lang['ADD_DISALLOW_TITLE'] = 'Add a disallowed username'; -$lang['ADD_DISALLOW_EXPLAIN'] = 'You can disallow a username using the wildcard character * to match any character'; $lang['NO_DISALLOWED'] = 'No Disallowed Usernames'; diff --git a/styles/templates/admin/admin_bt_tracker_cfg.tpl b/styles/templates/admin/admin_bt_tracker_cfg.tpl deleted file mode 100644 index e64cc0758..000000000 --- a/styles/templates/admin/admin_bt_tracker_cfg.tpl +++ /dev/null @@ -1,134 +0,0 @@ -

{L_TRACKER_CFG_TITLE}

- -
- - --- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{L_TRACKER_SETTINGS}
-

{L_CHANGES_DISABLED}

-

{L_OFF_TRACKER}

{L_OFF_REASON}

{L_OFF_REASON_EXPL}
 

{L_AUTOCLEAN}

Used in cron Tracker cleanup and dlstat
{L_AUTOCLEAN_EXPL}

{L_COMPACT_MODE}

{L_COMPACT_MODE_EXPL}

{L_BROWSER_REDIRECT_URL}

{L_BROWSER_REDIRECT_URL_EXPL}
   
{L_USE_AUTH_KEY_HEAD}

{L_USE_AUTH_KEY}

{L_USE_AUTH_KEY_EXPL}
  {L_YES}

{L_AUTH_KEY_NAME}

$bb_cfg['passkey_key']
{L_AUTH_KEY_NAME_EXPL}
  {PASSKEY_KEY}

{L_ALLOW_GUEST_DL}

{L_ALLOW_GUEST_DL_EXPL}
  {L_NO}{L_YES}
{L_LIMIT_ACTIVE_TOR_HEAD}

{L_NUMWANT}

{L_NUMWANT_EXPL}
 

{L_LIMIT_ACTIVE_TOR}

{L_LIMIT_SEED_COUNT}

{L_LIMIT_SEED_COUNT_EXPL}
  torrents

{L_LIMIT_LEECH_COUNT}

{L_LIMIT_LEECH_COUNT_EXPL}
  torrents

{L_LEECH_EXPIRE_FACTOR}

{L_LEECH_EXPIRE_FACTOR_EXPL}
  minutes

{L_LIMIT_CONCURRENT_IPS}

{L_LIMIT_CONCURRENT_IPS_EXPL}

{L_LIMIT_SEED_IPS}

{L_LIMIT_SEED_IPS_EXPL}
  IP's

{L_LIMIT_LEECH_IPS}

{L_LIMIT_LEECH_IPS_EXPL}
  IP's
{L_ANNOUNCE_INTERVAL_HEAD}

{L_ANNOUNCE_INTERVAL}

$bb_cfg['announce_interval']
{L_ANNOUNCE_INTERVAL_EXPL}
  {ANNOUNCE_INTERVAL} seconds

{L_EXPIRE_FACTOR}

{L_EXPIRE_FACTOR_EXPL}
 

{L_UPDATE_DLSTAT}

Used in cron Tracker cleanup and dlstat

{L_ADD_RETRACKER}

{L_GOLD} / {L_SILVER}

- - -

{L_IGNORE_GIVEN_IP}

$bb_cfg['ignore_reported_ip']
{L_IGNOR_GIVEN_IP_EXPL}
  {L_YES}{L_NO}
- - {S_HIDDEN_FIELDS} -   -   -   - - -
-
- -
diff --git a/styles/templates/admin/admin_disallow.tpl b/styles/templates/admin/admin_disallow.tpl index 1987afaa4..9a1389cad 100644 --- a/styles/templates/admin/admin_disallow.tpl +++ b/styles/templates/admin/admin_disallow.tpl @@ -12,8 +12,7 @@ {L_ADD_DISALLOW_TITLE} -

{L_USERNAME}

{L_ADD_DISALLOW_EXPLAIN}
-   +   {L_DELETE_DISALLOW_TITLE}