Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#644 Registration link is still showing up when registration is disabled #645

Open
wants to merge 23 commits into
base: 1.8
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f72accd
Fix tag cloud plugin on PHP 5.2
svivian Jan 30, 2018
958b40d
Fix upgrade query with Wordpress integration
svivian Jan 30, 2018
5520ae8
Fix qa_db_list_tables (external users)
svivian Jan 30, 2018
176f605
1.8.0
svivian Jan 30, 2018
1a34ee2
Update cached tag count when deleting posts
pupi1985 Feb 7, 2018
4ae9c8f
Move the cache calculation away from the basic search plugin
pupi1985 Feb 7, 2018
d4b7409
Fix some scenarios where ^userpoints records are not present and gene…
pupi1985 Feb 10, 2018
96dd714
Merge pull request #605 from pupi1985/patch-102
svivian Mar 1, 2018
0bd2a82
Update hidden HTML to avoid its detection as malware
pupi1985 Feb 12, 2018
6965766
Merge pull request #607 from pupi1985/patch-103
svivian Mar 3, 2018
33bd9dc
Merge pull request #602 from pupi1985/patch-101
svivian Mar 3, 2018
a1da514
Update branches
svivian Mar 4, 2018
fdd38b2
Fix missing email confirmation link in user account
svivian Mar 5, 2018
a0a0d32
Reinstate PHPMailerAutoload
svivian Mar 5, 2018
c2da004
Prevent browser content encoding error in PHP 5.3
svivian Mar 6, 2018
6890815
Fix another PHP 7.2 count warning
pupi1985 Apr 9, 2018
7cca35e
Merge pull request #631 from pupi1985/patch-107
svivian Apr 14, 2018
dfa3df7
#642 fix php 7.2 warning on main page
hendrikiseke1979 May 30, 2018
20ea1c3
#644 Registration link is still showing up when registration is disabled
hendrikiseke1979 May 30, 2018
e62b463
Merge branch 'bugfix' into 1.8
May 30, 2018
fc9ebb3
tabs to spaces
hendrikiseke1979 May 30, 2018
3efb665
Merge remote-tracking branch 'origin/1.8' into 1.8
hendrikiseke1979 May 30, 2018
8df1c87
tabs to spaces
hendrikiseke1979 May 30, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix some scenarios where ^userpoints records are not present and gene…
…rate issues
pupi1985 committed Feb 10, 2018
commit d4b74099eeb7421a0c6ef58f3d941944e8c8287d
11 changes: 11 additions & 0 deletions qa-include/app/users.php
Original file line number Diff line number Diff line change
@@ -456,6 +456,17 @@ function qa_get_logged_in_user_cache()
require_once QA_INCLUDE_DIR . 'db/selects.php';
$qa_cached_logged_in_user = qa_db_get_pending_result('loggedinuser', qa_db_user_account_selectspec($userid, true));

// If the site is configured to share the ^users table then there might not be a record in the
// ^userpoints table so this creates it
if ($qa_cached_logged_in_user['points'] === null) {
require_once QA_INCLUDE_DIR . 'db/points.php';
require_once QA_INCLUDE_DIR . 'db/users.php';

qa_db_points_update_ifuser($userid, null);
qa_db_uapprovecount_update();
$qa_cached_logged_in_user = qa_db_single_select(qa_db_user_account_selectspec($userid, true));
}

if (!isset($qa_cached_logged_in_user)) {
// the user can no longer be found (should only apply to deleted users)
qa_clear_session_user();
10 changes: 9 additions & 1 deletion qa-include/db/selects.php
Original file line number Diff line number Diff line change
@@ -1523,9 +1523,17 @@ function qa_db_top_users_selectspec($start, $count = null)
);
}

// If the site is configured to share the ^users table then there might not be a record in the ^userpoints table
if (defined('QA_MYSQL_USERS_PREFIX')) {
$basePoints = (int)qa_opt('points_base');
$source = '^users JOIN (SELECT ^users.userid, COALESCE(points,' . $basePoints . ') AS points FROM ^users LEFT JOIN ^userpoints ON ^users.userid=^userpoints.userid ORDER BY points DESC LIMIT #,#) y ON ^users.userid=y.userid';
} else {
$source = '^users JOIN (SELECT userid FROM ^userpoints ORDER BY points DESC LIMIT #,#) y ON ^users.userid=y.userid JOIN ^userpoints ON ^users.userid=^userpoints.userid';;
}

return array(
'columns' => array('^users.userid', 'handle', 'points', 'flags', '^users.email', 'avatarblobid' => 'BINARY avatarblobid', 'avatarwidth', 'avatarheight'),
'source' => '^users JOIN (SELECT userid FROM ^userpoints ORDER BY points DESC LIMIT #,#) y ON ^users.userid=y.userid JOIN ^userpoints ON ^users.userid=^userpoints.userid',
'source' => $source,
'arguments' => array($start, $count),
'arraykey' => 'userid',
'sortdesc' => 'points',