/** * @param mixed|Finger $content * @return string */ public static function squash($content) { if ($content instanceof Finger) { return self::squash($content->getPrint()); } else { if (is_array($content)) { return implode("", array_map(function ($item) { return self::squash($item); }, $content)); } else { return (string) $content; } } }
public function getKey_finger() { $sql = 'SELECT max(NO_URUT) as NO_URUT FROM kar_finger'; $cntfinger = Finger::findBySql($sql)->one(); $id_cnt_finger = $cntfinger->NO_URUT + 1; return $id_cnt_finger; }
function GetHublocs($address) { // Try and find a hubloc for the person attempting to auth. // Since we're matching by address, we have to return all entries // some of which may be from re-installed hubs; and we'll need to // try each sequentially to see if one can pass the test $x = q("select * from hubloc left join xchan on xchan_hash = hubloc_hash \n\t\t\twhere hubloc_addr = '%s' order by hubloc_id desc", dbesc($address)); if (!$x) { // finger them if they can't be found. $j = Finger::run($address, null); if ($j['success']) { import_xchan($j); $x = q("select * from hubloc left join xchan on xchan_hash = hubloc_hash \n\t\t\t\t\twhere hubloc_addr = '%s' order by hubloc_id desc", dbesc($address)); } } if (!$x) { logger('mod_zot: auth: unable to finger ' . $address); $this->Debug('no hubloc found for ' . $address . ' and probing failed.'); $this->Finalise(); } return $x; }