diff --git a/checkin_notes b/checkin_notes
index 18d66fc93c..7c42ed057e 100644
--- a/checkin_notes
+++ b/checkin_notes
@@ -10741,3 +10741,14 @@ David 24 Dec 2009
rr_sim.cpp
sched/
handle_request.cpp
+
+David 24 Dec 2009
+ - web: if someone edits their profile, remove it from the cache
+ so that they and others will see the new version.
+
+ html/
+ inc/
+ cache.inc
+ user/
+ view_profile.php
+ create_profile.php
diff --git a/html/inc/cache.inc b/html/inc/cache.inc
index 98ddc91980..f861c23013 100644
--- a/html/inc/cache.inc
+++ b/html/inc/cache.inc
@@ -41,10 +41,14 @@ function make_cache_dirs() {
}
}
-function get_path($params) {
+function get_path($params, $phpfile=null) {
if (!@filemtime("../cache/00")) make_cache_dirs();
- $y = pathinfo($_SERVER["PHP_SELF"]);
- $z = $y["basename"];
+ if ($phpfile) {
+ $z = $phpfile;
+ } else {
+ $y = pathinfo($_SERVER["PHP_SELF"]);
+ $z = $y["basename"];
+ }
// add a layer of subdirectories for reducing file lookup time
$sz = substr(md5($z."_".urlencode($params)),1,2);
@@ -241,7 +245,20 @@ function set_cache_data($data,$params=""){
}
$path = get_path($params);
//echo $path;
- $fhandle=fopen($path, "w");
+ $fhandle = fopen($path, "w");
fwrite($fhandle, $data);
fclose($fhandle);
-}?>
+}
+
+function clear_cache_entry($phpfile, $params) {
+ if (strstr($phpfile, "..")) {
+ return;
+ }
+ if (strstr($params, "..")) {
+ return;
+ }
+ $path = get_path($params, $phpfile);
+ unlink($path);
+}
+
+?>
diff --git a/html/user/create_profile.php b/html/user/create_profile.php
index df5985dab1..0b78cc855c 100644
--- a/html/user/create_profile.php
+++ b/html/user/create_profile.php
@@ -339,6 +339,7 @@ if ($min_credit && $user->expavg_credit < $min_credit) {
if (post_str("submit", true)) {
process_create_profile($user, $profile);
+ clear_cache_entry("view_profile.php", "userid=$user->id");
exit;
}
diff --git a/html/user/view_profile.php b/html/user/view_profile.php
index 34af59ce3f..e507537f21 100644
--- a/html/user/view_profile.php
+++ b/html/user/view_profile.php
@@ -15,7 +15,7 @@
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see