]> git.mxchange.org Git - friendica.git/commitdiff
bug fixes
authorMike Macgirvin <mike@macgirvin.com>
Mon, 19 Jul 2010 12:24:22 +0000 (05:24 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Mon, 19 Jul 2010 12:24:22 +0000 (05:24 -0700)
include/auth.php
include/notifier.php
include/poller.php
mod/contacts.php
mod/dfrn_request.php
mod/home.php
mod/item.php
mod/login.php
view/profile.php
view/profile_tabs.tpl

index ef5c6f0b44033f9cc26a38b2c35199ac99b19177..bbbe8eb0dbf855ff80c08de1180b33af268a4cb1 100644 (file)
@@ -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;
+
                }
        }
 }
index 76694f4aecd09710c4986ab346cf450dc0625a50..b8eef3971f44d850d625bf34d64fbca1697a732f 100644 (file)
@@ -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();
index 08028cdeed56200f6b0e3f0e0ab7ea9fe53bbcd5..ab030a7091e02a0fd188d5340a24a08d69eeabd8 100644 (file)
@@ -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;
 
index 999617aa19d155328ca638096cc51e7409fad362..585ac1423227b7d5d4878feaa6f5f1c1c73c324f 100644 (file)
@@ -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)) {
index 7fb55c4bfe13d164a6b1520f9be3c91b67c5e6c7..b0c7b36aae4052729aa2170bb7a203e599eaf55c 100644 (file)
@@ -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;
                                }
index d796052ade32ef2154d62be27f5a7e2d0c5f830e..07087bb2cca058203adc45ec3b37bdac4f4315b3 100644 (file)
@@ -19,7 +19,7 @@ function home_content(&$a) {
 
        $a->page['footer'] .= "<div class=\"powered\" >Powered by <a href=\"http://dfrn.org\" name=\"DFRN.org\" >DFRN</a></div>";
        $o .= '<h1>Welcome' . ((x($a->config,'sitename')) ? " to {$a->config['sitename']}" : "" ) . '</h1>';
-       $o .= login(($a->config['register_html'] == REGISTER_CLOSED) ? 0 : 1);
+       $o .= login(($a->config['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
        return $o;
 
        
index e0497af7a54e79e240915d6fa1365252d04e706a..4de9dc59f8e2df9b552a9309ad04c429cabd80e5 100644 (file)
@@ -5,7 +5,7 @@ function sanitise_acl(&$item) {
 }
 
 function item_post(&$a) {
-
+dbg(3);
        if((! local_user()) && (! remote_user()))
                return;
 
@@ -170,6 +170,6 @@ function item_post(&$a) {
                        array(),$foo));
 
        }
-       goaway($a->get_baseurl() . "/" . $_POST['return'] );
+//     goaway($a->get_baseurl() . "/" . $_POST['return'] );
        return; // NOTREACHED
 }
\ No newline at end of file
index ba232a9432973dd2b2a52b141cb7a068f64d2a4c..6ee625966d259fd6f4ce162e7c2062e572a0b2be 100644 (file)
@@ -1,8 +1,5 @@
 <?php
 
-
-
 function login_content(&$a) {
-//     return login($a->config['register_enabled']);
        return login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true);
 }
\ No newline at end of file
index d1e53ad56d3f5acd63a4ca13319c6fd9177e8066..d95edb952e6b7b2363e3a2efadaff366d70f5768 100644 (file)
@@ -29,7 +29,7 @@
                || (strlen($profile['region'])) \r
                || (strlen($profile['postal-code'])) \r
                || (strlen($profile['country-name']))) { ?>\r
-               <span class="location">Location:\r
+               <div class="location">Location:\r
                        <div class="adr">\r
                                <div class="street-address"><?php if(strlen($profile['address'])) echo $profile['address']; ?></div>\r
                                <span class="city-state-zip"><span class="locality"><?php echo $profile['locality']; ?></span><?php if(strlen($profile['locality'])) echo ', '; ?><span class="region"><?php echo $profile['region'] ?></span><?php if(strlen($profile['postal-code'])) { ?> <span class="postal-code"><?php echo $profile['postal-code']; ?></span><?php } ?></span>\r
index 052b2405acb00f0df235925dd5d91b0f8e6e72c0..95c0ba1d2720ce1b7635c67c5ca4ece7ab91476f 100644 (file)
@@ -1,4 +1,3 @@
-<?php
 
 <div id="profile-tabs-wrapper" >
 <div id="profile-tab-status-tab" class="profile-tabs" >
@@ -6,11 +5,11 @@
 </div>
 
 <div id="profile-tab-profile-tab" class="profile-tabs" >
-<a href="$url&tab=profile" id="profile-tab-profile-link" >Profile</a>
+<a href="$url?tab=profile" id="profile-tab-profile-link" >Profile</a>
 </div>
 
 <div id="profile-tab-photos-tab" class="profile-tabs" >
-<a href="$url&tab=photos" id="profile-tab-photos-link" >Photos</a>
+<a href="$url?tab=photos" id="profile-tab-photos-link" >Photos</a>
 </div>
 
 </div>