Changeset:
19a717b0d6d5
https://sourceforge.net/p/mrbs/hg-code/ci/19a717b0d6d517c09a3f785fa3a7dbe38a06c674
Author:
Campbell Morrison <[email protected]>
Date:
Fri Oct 28 10:41:30 2016 +0100
Log message:
Simplified code
diffstat:
web/auth/auth_wordpress.inc | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diffs (20 lines):
diff -r c9602d3ac43b -r 19a717b0d6d5 web/auth/auth_wordpress.inc
--- a/web/auth/auth_wordpress.inc Thu Oct 27 21:15:14 2016 +0100
+++ b/web/auth/auth_wordpress.inc Fri Oct 28 10:41:30 2016 +0100
@@ -66,13 +66,10 @@
$admin_roles = array_map(__NAMESPACE__ . "\\standardise_role_name",
$admin_roles);
// Check to see if one of the user's roles is an admin role
- foreach($wp_user->roles as $user_role)
+ if (count(array_intersect($wp_user->roles, $admin_roles)) > 0)
{
- if (in_array($user_role, $admin_roles))
- {
- $user_levels[$user] = 2;
- return $user_levels[$user];
- }
+ $user_levels[$user] = 2;
+ return $user_levels[$user];
}
}
------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive.
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits