4 use Friendica\Core\System;
6 require_once 'include/follow.php';
8 function repair_ostatus_content(App $a) {
11 notice( t('Permission denied.') . EOL);
12 goaway($_SESSION['return_url']);
16 $o = "<h2>".t("Resubscribing to OStatus contacts")."</h2>";
22 $counter = intval($_REQUEST['counter']);
24 $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE
25 `uid` = %d AND `network` = '%s' AND `rel` IN (%d, %d)",
27 dbesc(NETWORK_OSTATUS),
28 intval(CONTACT_IS_FRIEND),
29 intval(CONTACT_IS_SHARING));
32 return($o.t("Error"));
34 $total = $r[0]["total"];
36 $r = q("SELECT `url` FROM `contact` WHERE
37 `uid` = %d AND `network` = '%s' AND `rel` IN (%d, %d)
41 dbesc(NETWORK_OSTATUS),
42 intval(CONTACT_IS_FRIEND),
43 intval(CONTACT_IS_SHARING), $counter++);
50 $o .= "<p>".$counter."/".$total.": ".$r[0]["url"]."</p>";
52 $o .= "<p>".t("Keep this window open until done.")."</p>";
54 $result = new_contact($uid,$r[0]["url"],true);
56 $a->page['htmlhead'] = '<meta http-equiv="refresh" content="1; URL='.System::baseUrl().'/repair_ostatus?counter='.$counter.'">';