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
d225ef24
Commit
d225ef24
authored
7 years ago
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove approve_user_required option
parent
122bb75a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
21 deletions
+11
-21
page.php
qa-include/app/page.php
+2
-8
users-edit.php
qa-include/app/users-edit.php
+4
-3
users.php
qa-include/app/users.php
+2
-5
qa-lang-options.php
qa-include/lang/qa-lang-options.php
+1
-1
qa-lang-users.php
qa-include/lang/qa-lang-users.php
+1
-1
admin-default.php
qa-include/pages/admin/admin-default.php
+1
-3
No files found.
qa-include/app/page.php
View file @
d225ef24
...
@@ -281,15 +281,9 @@ function qa_output_content($qa_content)
...
@@ -281,15 +281,9 @@ function qa_output_content($qa_content)
'^1'
=>
'<a href="'
.
qa_path_html
(
'confirm'
)
.
'">'
,
'^1'
=>
'<a href="'
.
qa_path_html
(
'confirm'
)
.
'">'
,
'^2'
=>
'</a>'
,
'^2'
=>
'</a>'
,
));
));
}
elseif
((
$flags
&
QA_USER_FLAGS_MUST_APPROVE
)
&&
qa_get_logged_in_level
()
<
QA_USER_LEVEL_APPROVED
&&
qa_opt
(
'moderate_users'
))
{
$qa_content
=
qa_content_prepare
();
$qa_content
[
'title'
]
=
qa_lang_html
(
'users/approve_title'
);
$qa_content
[
'error'
]
=
strtr
(
qa_lang_html
(
'users/approve_required'
),
array
(
'^1'
=>
'<a href="'
.
qa_path_html
(
'account'
)
.
'">'
,
'^2'
=>
'</a>'
,
));
}
}
// we no longer block access here for unapproved users; this is handled by the Permissions settings
}
}
// Combine various Javascript elements in $qa_content into single array for theme layer
// Combine various Javascript elements in $qa_content into single array for theme layer
...
...
This diff is collapsed.
Click to expand it.
qa-include/app/users-edit.php
View file @
d225ef24
...
@@ -203,8 +203,7 @@ function qa_create_new_user($email, $password, $handle, $level = QA_USER_LEVEL_B
...
@@ -203,8 +203,7 @@ function qa_create_new_user($email, $password, $handle, $level = QA_USER_LEVEL_B
}
else
}
else
$confirm
=
''
;
$confirm
=
''
;
if
(
qa_opt
(
'moderate_users'
)
&&
qa_opt
(
'approve_user_required'
)
&&
$level
<
QA_USER_LEVEL_EXPERT
)
// we no longer use the 'approve_user_required' option to set QA_USER_FLAGS_MUST_APPROVE; this can be handled by the Permissions settings
qa_db_user_set_flag
(
$userid
,
QA_USER_FLAGS_MUST_APPROVE
,
true
);
qa_send_notification
(
$userid
,
$email
,
$handle
,
qa_lang
(
'emails/welcome_subject'
),
qa_lang
(
'emails/welcome_body'
),
array
(
qa_send_notification
(
$userid
,
$email
,
$handle
,
qa_lang
(
'emails/welcome_subject'
),
qa_lang
(
'emails/welcome_body'
),
array
(
'^password'
=>
isset
(
$password
)
?
qa_lang
(
'main/hidden'
)
:
qa_lang
(
'users/password_to_set'
),
// v 1.6.3: no longer email out passwords
'^password'
=>
isset
(
$password
)
?
qa_lang
(
'main/hidden'
)
:
qa_lang
(
'users/password_to_set'
),
// v 1.6.3: no longer email out passwords
...
@@ -344,8 +343,10 @@ function qa_set_user_level($userid, $handle, $level, $oldlevel)
...
@@ -344,8 +343,10 @@ function qa_set_user_level($userid, $handle, $level, $oldlevel)
qa_db_user_set
(
$userid
,
'level'
,
$level
);
qa_db_user_set
(
$userid
,
'level'
,
$level
);
qa_db_uapprovecount_update
();
qa_db_uapprovecount_update
();
if
(
$level
>=
QA_USER_LEVEL_APPROVED
)
if
(
$level
>=
QA_USER_LEVEL_APPROVED
)
{
// no longer necessary as QA_USER_FLAGS_MUST_APPROVE is deprecated, but kept for posterity
qa_db_user_set_flag
(
$userid
,
QA_USER_FLAGS_MUST_APPROVE
,
false
);
qa_db_user_set_flag
(
$userid
,
QA_USER_FLAGS_MUST_APPROVE
,
false
);
}
qa_report_event
(
'u_level'
,
qa_get_logged_in_userid
(),
qa_get_logged_in_handle
(),
qa_cookie_get
(),
array
(
qa_report_event
(
'u_level'
,
qa_get_logged_in_userid
(),
qa_get_logged_in_handle
(),
qa_cookie_get
(),
array
(
'userid'
=>
$userid
,
'userid'
=>
$userid
,
...
...
This diff is collapsed.
Click to expand it.
qa-include/app/users.php
View file @
d225ef24
...
@@ -41,7 +41,7 @@ define('QA_USER_FLAGS_NO_MAILINGS', 32);
...
@@ -41,7 +41,7 @@ define('QA_USER_FLAGS_NO_MAILINGS', 32);
define
(
'QA_USER_FLAGS_WELCOME_NOTICE'
,
64
);
define
(
'QA_USER_FLAGS_WELCOME_NOTICE'
,
64
);
define
(
'QA_USER_FLAGS_MUST_CONFIRM'
,
128
);
define
(
'QA_USER_FLAGS_MUST_CONFIRM'
,
128
);
define
(
'QA_USER_FLAGS_NO_WALL_POSTS'
,
256
);
define
(
'QA_USER_FLAGS_NO_WALL_POSTS'
,
256
);
define
(
'QA_USER_FLAGS_MUST_APPROVE'
,
512
);
define
(
'QA_USER_FLAGS_MUST_APPROVE'
,
512
);
// @deprecated
define
(
'QA_FIELD_FLAGS_MULTI_LINE'
,
1
);
define
(
'QA_FIELD_FLAGS_MULTI_LINE'
,
1
);
define
(
'QA_FIELD_FLAGS_LINK_URL'
,
2
);
define
(
'QA_FIELD_FLAGS_LINK_URL'
,
2
);
...
@@ -1021,7 +1021,7 @@ function qa_user_maximum_permit_error($permitoption, $limitaction = null, $check
...
@@ -1021,7 +1021,7 @@ function qa_user_maximum_permit_error($permitoption, $limitaction = null, $check
* 'userblock' => the user has been blocked
* 'userblock' => the user has been blocked
* 'ipblock' => the ip address has been blocked
* 'ipblock' => the ip address has been blocked
* 'confirm' => the user should confirm their email address
* 'confirm' => the user should confirm their email address
* 'approve' => the user needs to be approved by the site admins
* 'approve' => the user needs to be approved by the site admins
(no longer used as global permission)
* 'limit' => the user or IP address has reached a rate limit (if $limitaction specified)
* 'limit' => the user or IP address has reached a rate limit (if $limitaction specified)
* false => the operation can go ahead
* false => the operation can go ahead
*/
*/
...
@@ -1051,9 +1051,6 @@ function qa_user_permit_error($permitoption = null, $limitaction = null, $userle
...
@@ -1051,9 +1051,6 @@ function qa_user_permit_error($permitoption = null, $limitaction = null, $userle
if
(
!
$error
&&
isset
(
$userid
)
&&
(
$flags
&
QA_USER_FLAGS_MUST_CONFIRM
)
&&
qa_opt
(
'confirm_user_emails'
))
if
(
!
$error
&&
isset
(
$userid
)
&&
(
$flags
&
QA_USER_FLAGS_MUST_CONFIRM
)
&&
qa_opt
(
'confirm_user_emails'
))
$error
=
'confirm'
;
$error
=
'confirm'
;
if
(
!
$error
&&
isset
(
$userid
)
&&
(
$flags
&
QA_USER_FLAGS_MUST_APPROVE
)
&&
qa_opt
(
'moderate_users'
))
$error
=
'approve'
;
if
(
isset
(
$limitaction
)
&&
!
$error
)
{
if
(
isset
(
$limitaction
)
&&
!
$error
)
{
if
(
qa_user_limits_remaining
(
$limitaction
)
<=
0
)
if
(
qa_user_limits_remaining
(
$limitaction
)
<=
0
)
$error
=
'limit'
;
$error
=
'limit'
;
...
...
This diff is collapsed.
Click to expand it.
qa-include/lang/qa-lang-options.php
View file @
d225ef24
...
@@ -32,7 +32,7 @@ return array(
...
@@ -32,7 +32,7 @@ return array(
'allow_self_answer'
=>
'Allow users to answer their own question:'
,
'allow_self_answer'
=>
'Allow users to answer their own question:'
,
'allow_user_walls'
=>
'Enable wall posts on user profiles:'
,
'allow_user_walls'
=>
'Enable wall posts on user profiles:'
,
'allow_view_q_bots'
=>
'Allow search engines to view question pages'
,
'allow_view_q_bots'
=>
'Allow search engines to view question pages'
,
'approve_user_required'
=>
'All new users must be approved:'
,
'approve_user_required'
=>
'All new users must be approved:'
,
// @deprecated
'avatar_allow_gravatar'
=>
'Allow ^1Gravatar^2 avatars:'
,
'avatar_allow_gravatar'
=>
'Allow ^1Gravatar^2 avatars:'
,
'avatar_allow_upload'
=>
'Allow users to upload avatars:'
,
'avatar_allow_upload'
=>
'Allow users to upload avatars:'
,
'avatar_default_show'
=>
'Default avatar:'
,
'avatar_default_show'
=>
'Default avatar:'
,
...
...
This diff is collapsed.
Click to expand it.
qa-include/lang/qa-lang-users.php
View file @
d225ef24
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
return
array
(
return
array
(
'about'
=>
'About'
,
'about'
=>
'About'
,
'add_user_x_favorites'
=>
'Add user ^ to my favorites'
,
'add_user_x_favorites'
=>
'Add user ^ to my favorites'
,
'approve_required'
=>
'Please wait for your account to be approved or ^1add more information^2.'
,
'approve_required'
=>
'Please wait for your account to be approved or ^1add more information^2.'
,
// @deprecated
'approve_title'
=>
'User approval pending'
,
'approve_title'
=>
'User approval pending'
,
'approve_user_button'
=>
'Approve User'
,
'approve_user_button'
=>
'Approve User'
,
'approved_user'
=>
'Approved user'
,
'approved_user'
=>
'Approved user'
,
...
...
This diff is collapsed.
Click to expand it.
qa-include/pages/admin/admin-default.php
View file @
d225ef24
...
@@ -146,7 +146,6 @@ $optiontype = array(
...
@@ -146,7 +146,6 @@ $optiontype = array(
'allow_user_walls'
=>
'checkbox'
,
'allow_user_walls'
=>
'checkbox'
,
'allow_self_answer'
=>
'checkbox'
,
'allow_self_answer'
=>
'checkbox'
,
'allow_view_q_bots'
=>
'checkbox'
,
'allow_view_q_bots'
=>
'checkbox'
,
'approve_user_required'
=>
'checkbox'
,
'avatar_allow_gravatar'
=>
'checkbox'
,
'avatar_allow_gravatar'
=>
'checkbox'
,
'avatar_allow_upload'
=>
'checkbox'
,
'avatar_allow_upload'
=>
'checkbox'
,
'avatar_default_show'
=>
'checkbox'
,
'avatar_default_show'
=>
'checkbox'
,
...
@@ -562,7 +561,7 @@ switch ($adminsection) {
...
@@ -562,7 +561,7 @@ switch ($adminsection) {
$getoptions
=
qa_get_options
(
array
(
'feedback_enabled'
,
'permit_post_q'
,
'permit_post_a'
,
'permit_post_c'
));
$getoptions
=
qa_get_options
(
array
(
'feedback_enabled'
,
'permit_post_q'
,
'permit_post_a'
,
'permit_post_c'
));
if
(
!
QA_FINAL_EXTERNAL_USERS
)
if
(
!
QA_FINAL_EXTERNAL_USERS
)
array_push
(
$showoptions
,
'confirm_user_emails'
,
'confirm_user_required'
,
'moderate_users'
,
'
approve_user_required'
,
'
'
);
array_push
(
$showoptions
,
'confirm_user_emails'
,
'confirm_user_required'
,
'moderate_users'
,
''
);
$captchamodules
=
qa_list_modules
(
'captcha'
);
$captchamodules
=
qa_list_modules
(
'captcha'
);
...
@@ -625,7 +624,6 @@ switch ($adminsection) {
...
@@ -625,7 +624,6 @@ switch ($adminsection) {
$checkboxtodisplay
=
array
(
$checkboxtodisplay
=
array
(
'confirm_user_required'
=>
'option_confirm_user_emails'
,
'confirm_user_required'
=>
'option_confirm_user_emails'
,
'approve_user_required'
=>
'option_moderate_users'
,
'captcha_on_unapproved'
=>
'option_moderate_users'
,
'captcha_on_unapproved'
=>
'option_moderate_users'
,
'captcha_on_unconfirmed'
=>
'option_confirm_user_emails && !(option_moderate_users && option_captcha_on_unapproved)'
,
'captcha_on_unconfirmed'
=>
'option_confirm_user_emails && !(option_moderate_users && option_captcha_on_unapproved)'
,
'captcha_module'
=>
'option_captcha_on_register || option_captcha_on_anon_post || (option_confirm_user_emails && option_captcha_on_unconfirmed) || (option_moderate_users && option_captcha_on_unapproved) || option_captcha_on_reset_password || option_captcha_on_feedback'
,
'captcha_module'
=>
'option_captcha_on_register || option_captcha_on_anon_post || (option_confirm_user_emails && option_captcha_on_unconfirmed) || (option_moderate_users && option_captcha_on_unapproved) || option_captcha_on_reset_password || option_captcha_on_feedback'
,
...
...
This diff is collapsed.
Click to expand it.
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