#!/usr/bin/env php . */ define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..')); $longoptions = array('dry-run'); $helptext = << $marker)); $encProfile = $oprofile->escape($profileTemplate, true); $encProfile = str_replace($marker, '%', $encProfile); $groupTemplate = common_local_url('groupbyid', array('id' => $marker)); $encGroup = $oprofile->escape($groupTemplate, true); $encGroup = str_replace($marker, '%', $encGroup); $sql = "SELECT * FROM ostatus_profile WHERE uri LIKE '%s' OR uri LIKE '%s'"; $oprofile->query(sprintf($sql, $encProfile, $encGroup)); echo "Found $oprofile->N bogus ostatus_profile entries for local users and groups:\n"; while ($oprofile->fetch()) { echo "$oprofile->uri"; if ($dry) { echo " (unchanged)\n"; } else { echo " removing bogus ostatus_profile entry..."; $evil = clone($oprofile); $evil->delete(); echo " ok\n"; } } echo "done.\n";