= 3) ? '' : '/') . $achar . 'zid=' . urlencode($myaddr); else $zurl = $s; // put fragment at the end if($fragment) $zurl .= '#' . $fragment; $arr = array('url' => $s, 'zid' => urlencode($myaddr), 'result' => $zurl); call_hooks('zid', $arr); return $arr['result']; } function strip_query_param($s,$param) { return preg_replace('/[\?&]' . $param . '=(.*?)(&|$)/ism','$2',$s); } function strip_zids($s) { return preg_replace('/[\?&]zid=(.*?)(&|$)/ism','$2',$s); } function strip_zats($s) { return preg_replace('/[\?&]zat=(.*?)(&|$)/ism','$2',$s); } /** * zidify_callback() and zidify_links() work together to turn any HTML a tags with class="zrl" into zid links * These will typically be generated by a bbcode '[zrl]' tag. This is done inside prepare_text() rather than bbcode() * because the latter is used for general purpose conversions and the former is used only when preparing text for * immediate display. * * Issues: Currently the order of HTML parameters in the text is somewhat rigid and inflexible. * We assume it looks like \ and will not work if zrl and href appear in a different order. * * @param array $match * @return string */ function zidify_callback($match) { $is_zid = ((feature_enabled(local_channel(),'sendzid')) || (strpos($match[1],'zrl')) ? true : false); $replace = ' $hubloc, 'url' => \App::$query_string, 'session' => $_SESSION); call_hooks('magic_auth_success',$arr); \App::set_observer($hubloc); require_once('include/security.php'); \App::set_groups(init_groups_visitor($_SESSION['visitor_id'])); if(! get_config('system','hide_owa_greeting')) info(sprintf( t('OpenWebAuth: %1$s welcomes %2$s'),\App::get_hostname(), $hubloc['xchan_name'])); logger('OpenWebAuth: auth success from ' . $hubloc['xchan_addr']); }