Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
5201ea15
Commit
5201ea15
authored
May 30, 2015
by
pupi1985
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turned REPLACE statements into INSERT..ON DUPLICATE KEY UPDATE in db/users.php
parent
6565f129
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
users.php
qa-include/db/users.php
+13
-6
No files found.
qa-include/db/users.php
View file @
5201ea15
...
...
@@ -207,8 +207,9 @@
*/
{
qa_db_query_sub
(
'REPLACE ^userprofile (title, content, userid) VALUES ($, $, $)'
,
$field
,
$value
,
$userid
'INSERT INTO ^userprofile (userid, title, content) VALUES ($, $, $) '
.
'ON DUPLICATE KEY UPDATE content = VALUES(content)'
,
$userid
,
$field
,
$value
);
}
...
...
@@ -293,11 +294,13 @@
$userid
);
foreach
(
$userlevels
as
$userlevel
)
foreach
(
$userlevels
as
$userlevel
)
{
qa_db_query_sub
(
'REPLACE ^userlevels (userid, entitytype, entityid, level) VALUES ($, $, #, #)'
,
'INSERT INTO ^userlevels (userid, entitytype, entityid, level) VALUES ($, $, #, #) '
.
'ON DUPLICATE KEY UPDATE level = VALUES(level)'
,
$userid
,
$userlevel
[
'entitytype'
],
$userlevel
[
'entityid'
],
$userlevel
[
'level'
]
);
}
}
...
...
@@ -318,11 +321,15 @@
Update the cached count of the number of users who are awaiting approval after registration
*/
{
if
(
qa_should_update_counts
()
&&
!
QA_FINAL_EXTERNAL_USERS
)
if
(
qa_should_update_counts
()
&&
!
QA_FINAL_EXTERNAL_USERS
)
{
qa_db_query_sub
(
"REPLACE ^options (title, content) SELECT 'cache_uapprovecount', COUNT(*) FROM ^users WHERE level<# AND NOT (flags&#)"
,
"INSERT INTO ^options (title, content) "
.
"SELECT 'cache_uapprovecount', COUNT(*) FROM ^users "
.
"WHERE level < # AND NOT (flags & #) "
.
"ON DUPLICATE KEY UPDATE content = VALUES(content)"
,
QA_USER_LEVEL_APPROVED
,
QA_USER_FLAGS_USER_BLOCKED
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment