diff --git a/include/auth.php b/include/auth.php index ef5c6f0b44..bbbe8eb0db 100644 --- a/include/auth.php +++ b/include/auth.php @@ -23,12 +23,20 @@ if((x($_SESSION,'authenticated')) && (! ($_POST['auth-params'] == 'login'))) { if(strlen($a->user['timezone'])) date_default_timezone_set($a->user['timezone']); + if(x($a->user,'nickname')) + $_SESSION['my_url'] = $a->get_baseurl() . '/profile/' . $r[0]['nickname']; + else + $_SESSION['my_url'] = $a->get_baseurl() . '/profile/' . $r[0]['uid']; + + + $r = q("SELECT * FROM `contact` WHERE `uid` = %s AND `self` = 1 LIMIT 1", intval($_SESSION['uid'])); if(count($r)) { $a->contact = $r[0]; $a->cid = $r[0]['id']; $_SESSION['cid'] = $a->cid; + } } } diff --git a/include/notifier.php b/include/notifier.php index 76694f4aec..b8eef3971f 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -15,8 +15,8 @@ require_once("datetime.php"); if($argc < 3) exit; - - $baseurl = $argv[1]); +dbg(3); + $baseurl = $argv[1]; $a->set_baseurl($argv[1]); $cmd = $argv[2]; @@ -224,7 +224,7 @@ if($argc < 3) $url = $rr['notify'] . '?dfrn_id=' . $rr['dfrn-id']; $xml = fetch_url($url); - +echo $xml; if(! $xml) continue; @@ -246,7 +246,7 @@ if($argc < 3) $postvars['data'] = $atom_nowrite; $xml = post_url($rr['notify'],$postvars); - +echo $xml; } killme(); diff --git a/include/poller.php b/include/poller.php index 08028cdeed..ab030a7091 100644 --- a/include/poller.php +++ b/include/poller.php @@ -118,7 +118,7 @@ echo "Length:" . strlen($xml) . "\r\n"; $datarray = get_atom_elements($item); $datarray['parent-uri'] = $parent_uri; $datarray['uid'] = $importer['uid']; - $datarray['contact-id'] = $importer['id']; + $datarray['contact-id'] = $contact['id']; $r = post_remote($a,$datarray); continue; } @@ -146,7 +146,7 @@ echo "Length:" . strlen($xml) . "\r\n"; $datarray = get_atom_elements($item); $datarray['parent-uri'] = $item_id; $datarray['uid'] = $importer['uid']; - $datarray['contact-id'] = $importer['id']; + $datarray['contact-id'] = $contact['id']; $r = post_remote($a,$datarray); continue; diff --git a/mod/contacts.php b/mod/contacts.php index 999617aa19..585ac14232 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -184,7 +184,7 @@ function contacts_content(&$a) { return $o; } - +dbg(2); if(($a->argc == 2) && ($a->argv[1] == 'all')) $sql_extra = ''; else @@ -198,21 +198,21 @@ function contacts_content(&$a) { switch($sort_type) { case DIRECTION_BOTH : - $sql_extra = " AND `dfrn-id` != '' AND `issued-id` != '' "; + $sql_extra2 = " AND `dfrn-id` != '' AND `issued-id` != '' "; break; case DIRECTION_IN : - $sql_extra = " AND `dfrn-id` = '' AND `issued-id` != '' "; + $sql_extra2 = " AND `dfrn-id` = '' AND `issued-id` != '' "; break; case DIRECTION_OUT : - $sql_extra = " AND `dfrn-id` != '' AND `issued-id` = '' "; + $sql_extra2 = " AND `dfrn-id` != '' AND `issued-id` = '' "; break; case DIRECTION_ANY : default: - $sql_extra = ''; + $sql_extra2 = ''; break; } - $r = q("SELECT * FROM `contact` WHERE `uid` = %d $sql_extra", + $r = q("SELECT * FROM `contact` WHERE `uid` = %d $sql_extra $sql_extra2 ", intval($_SESSION['uid'])); if(count($r)) { diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php index 7fb55c4bfe..b0c7b36aae 100644 --- a/mod/dfrn_request.php +++ b/mod/dfrn_request.php @@ -39,7 +39,6 @@ function dfrn_request_post(&$a) { // to confirm the request. We've done so and clicked submit, // which brings us here. - $dfrn_url = notags(trim($_POST['dfrn_url'])); $aes_allow = (((x($_POST,'aes_allow')) && ($_POST['aes_allow'] == 1)) ? 1 : 0); $confirm_key = ((x($_POST,'confirm_key')) ? $_POST['confirm_key'] : ""); @@ -48,7 +47,7 @@ function dfrn_request_post(&$a) { if(x($dfrn_url)) { - $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `dfrn-url` = '%s' LIMIT 1", + $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `url` = '%s' LIMIT 1", intval($_SESSION['uid']), dbesc($dfrn_url) ); @@ -88,7 +87,7 @@ function dfrn_request_post(&$a) { if($invalid) { notice( $invalid . ' required DFRN parameter' . (($invalid == 1) ? " was " : "s were " ) - . "not found at the given URL" . EOL ); + . "not found at the given URL" . EOL . print_r($parms,true)) ; return; } } @@ -220,7 +219,7 @@ function dfrn_request_post(&$a) { if($invalid) { notice( $invalid . ' required DFRN parameter' . (($invalid == 1) ? " was " : "s were " ) - . "not found at the given URL" . EOL) ; + . "not found at the given URL" . EOL . print_r($parms,true)) ; return; } diff --git a/mod/home.php b/mod/home.php index d796052ade..07087bb2cc 100644 --- a/mod/home.php +++ b/mod/home.php @@ -19,7 +19,7 @@ function home_content(&$a) { $a->page['footer'] .= "