forked from openfoodfacts/openfoodfacts-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Iterate over both product collections on user delete (openfoodfa…
…cts#8476) Iterate over both product collections
- Loading branch information
1 parent
fd398bd
commit 468184e
Showing
2 changed files
with
58 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/perl -w | ||
|
||
# This file is part of Product Opener. | ||
# | ||
# Product Opener | ||
# Copyright (C) 2011-2023 Association Open Food Facts | ||
# Contact: [email protected] | ||
# Address: 21 rue des Iles, 94100 Saint-Maur des Fossés, France | ||
# | ||
# Product Opener is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
use Modern::Perl '2017'; | ||
use utf8; | ||
|
||
use CGI::Carp qw(fatalsToBrowser); | ||
|
||
use ProductOpener::Config qw/:all/; | ||
use ProductOpener::Store qw/:all/; | ||
use ProductOpener::Index qw/:all/; | ||
use ProductOpener::Display qw/:all/; | ||
use ProductOpener::Images qw/:all/; | ||
use ProductOpener::Users qw/:all/; | ||
use ProductOpener::Mail qw/:all/; | ||
use ProductOpener::Lang qw/:all/; | ||
|
||
use CGI qw/:cgi :form escapeHTML/; | ||
use URI::Escape::XS; | ||
use Encode; | ||
|
||
my $userid = $ARGV[0]; | ||
my $user_ref = retrieve("$data_root/users/$userid.sto"); | ||
$user_ref->{moderator} = 1; | ||
store("$data_root/users/$userid.sto", $user_ref); |