2
// This file is part of BOINC.
3
// http://boinc.berkeley.edu
4
// Copyright (C) 2008 University of California
6
// BOINC is free software; you can redistribute it and/or modify it
7
// under the terms of the GNU Lesser General Public License
8
// as published by the Free Software Foundation,
9
// either version 3 of the License, or (at your option) any later version.
11
// BOINC is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
// See the GNU Lesser General Public License for more details.
16
// You should have received a copy of the GNU Lesser General Public License
17
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
19
// script to repair the "has_picture" field of profiles
21
ini_set("memory_limit", "1023M");
24
require_once("../inc/util_ops.inc");
28
$profiles = BoincProfile::enum("");
30
foreach ($profiles as $p) {
32
$path = "../user_profile/images/$id.jpg";
33
$smpath = "../user_profile/images/".$id."_sm.jpg";
34
$has_pic = file_exists($path);
35
$has_pic_sm = file_exists($smpath);
36
if ($p->has_picture) {
37
if (!$has_pic || !$has_pic_sm) {
38
echo "$id $p->has_picture $has_pic $has_pic_sm\n";
39
BoincProfile::update_aux("has_picture=0 where userid=$id");
42
if ($has_pic && $has_pic_sm) {
43
echo "$id $p->has_picture $has_pic $has_pic_sm\n";
44
BoincProfile::update_aux("has_picture=1 where userid=$id");