Skip to content

Commit 79a04dc

Browse files
authored
Merge pull request #233 from topcoder-platform/issues-226
Issues-108
2 parents 6fbf6ca + 6f10829 commit 79a04dc

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

config/vanilla/bootstrap.early.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,8 @@
5656
->column('Archived', 'tinyint(1)', '0')
5757
->set(false, false);
5858
}
59+
60+
// Delete the records with UserID=0 (Guests) from UserRole table
61+
// FIX: https://github.com/topcoder-platform/forums/issues/108
62+
Gdn::sql()->delete('UserRole',['UserID' => 0]);
5963
}

vanilla/applications/dashboard/models/class.usermodel.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2493,6 +2493,10 @@ public function saveAdminUser($formPostValues) {
24932493
* @param bool $RecordEvent
24942494
*/
24952495
public function saveRoles($UserID, $RoleIDs, $RecordEvent) {
2496+
if(!$UserID) {
2497+
throw new Exception(t('UserID is invalid.'), 400);
2498+
}
2499+
24962500
if (is_string($RoleIDs) && !is_numeric($RoleIDs)) {
24972501
// The $RoleIDs are a comma delimited list of role names.
24982502
$RoleNames = array_map('trim', explode(',', $RoleIDs));

0 commit comments

Comments
 (0)