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

Email all site maintainers #2505

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 6 additions & 17 deletions app/Http/Controllers/ManageProjectRolesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,25 +402,14 @@ public function viewPage(): View|RedirectResponse
*/
private static function find_site_maintainers(int $projectid): array
{
$db = Database::getInstance();

// Get the registered user first
$site2user = $db->executePrepared('
SELECT site2user.userid
FROM site2user, user2project
WHERE
site2user.userid=user2project.userid
AND user2project.projectid=?
', [$projectid]);

$userids = [];
foreach ($site2user as $site2user_array) {
$userids[] = intval($site2user_array['userid']);
}
// Get all the users with the 'Site maintainer' role for this project.
$project = \App\Models\Project::findOrFail($projectid);
$userids = $project->siteMaintainers()->pluck('userid')->toArray();

// Then we list all the users that have been submitting in the past 48 hours
// Next, get the users maintaining specific sites that have received
// submissions in the past 48 hours.
$db = Database::getInstance();
$submittime_UTCDate = gmdate(FMT_DATETIME, time() - 3600 * 48);

$site2project = $db->executePrepared('
SELECT DISTINCT userid
FROM site2user
Expand Down
9 changes: 7 additions & 2 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,7 @@ parameters:

-
message: "#^Argument of an invalid type array\\|false supplied for foreach, only iterables are supported\\.$#"
count: 6
count: 5
path: app/Http/Controllers/ManageProjectRolesController.php

-
Expand Down Expand Up @@ -1407,7 +1407,12 @@ parameters:
#^Call to deprecated method executePrepared\\(\\) of class CDash\\\\Database\\:
04/22/2023 Use Laravel query builder or Eloquent instead$#
"""
count: 6
count: 5
path: app/Http/Controllers/ManageProjectRolesController.php

-
message: "#^Dynamic call to static method Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\BelongsToMany\\<App\\\\Models\\\\User\\>\\:\\:pluck\\(\\)\\.$#"
count: 1
path: app/Http/Controllers/ManageProjectRolesController.php

-
Expand Down