Skip to content

Commit

Permalink
Merge pull request #127 from mprins/FS#2463
Browse files Browse the repository at this point in the history
update the url to the latest one used in the manager (FS#2463)
  • Loading branch information
HakanS committed Sep 8, 2012
2 parents 10295f7 + e10c99f commit ab2768f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/plugins/plugin/classes/ap_manage.class.php
Expand Up @@ -141,9 +141,18 @@ function plugin_writelog($target, $cmd, $data) {
break;

case 'update' :
$url = $data[0];
$date = date('r');
if (!$fp = @fopen($file, 'a')) return;
fwrite($fp, "updated=$date\n");
if (!$fp = @fopen($file, 'r+')) return;
$buffer = "";
while (($line = fgets($fp)) !== false) {
$urlFound = strpos($line,"url");
if($urlFound !== false) $line="url=$url\n";
$buffer .= $line;
}
$buffer .= "updated=$date\n";
fseek($fp, 0);
fwrite($fp, $buffer);
fclose($fp);
break;
}
Expand Down

0 comments on commit ab2768f

Please sign in to comment.