]> git.mxchange.org Git - friendica.git/commitdiff
a few more fsw tweaks
authorMike Macgirvin <mike@macgirvin.com>
Wed, 27 Oct 2010 02:01:16 +0000 (19:01 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Wed, 27 Oct 2010 02:01:16 +0000 (19:01 -0700)
include/items.php
include/notifier.php
include/poller.php
include/salmon.php
mod/contacts.php
mod/salmon.php
view/acl_selectors.php
view/contact_edit.tpl
view/contact_selectors.php
view/magicsig.tpl
view/theme/default/style.css

index 6cdf5f0f5b6170d57b5174445464d2c4a2352204..fa07727de1850d100a21787e72f5ceb6b11c0b81 100644 (file)
@@ -935,8 +935,12 @@ function consume_feed($xml,$importer,$contact, &$hub) {
                                if(! is_array($contact))
                                        return;
 
-                               if($contact['network'] === 'stat' && strlen($datarray['title']))
-                                       unset($datarray['title']);
+                               if($contact['network'] === 'stat') {
+                                       if(strlen($datarray['title']))
+                                               unset($datarray['title']);
+                                       if(($contact['rel'] == REL_VIP) || ($contact['rel'] == REL_BUD))
+                                               $datarray['last-child'] = 1;
+                               }
                                $datarray['parent-uri'] = $item_id;
                                $datarray['uid'] = $importer['uid'];
                                $datarray['contact-id'] = $contact['id'];
@@ -960,7 +964,7 @@ function new_follower($importer,$contact,$datarray,$item) {
 
        if(is_array($contact)) {
                if($contact['network'] == 'stat' && $contact['rel'] == REL_FAN) {
-                       $q("UPDATE `contact` SET `rel` = %d WHERE `id` = %d AND `uid` = %d LIMIT 1",
+                       $r = q("UPDATE `contact` SET `rel` = %d WHERE `id` = %d AND `uid` = %d LIMIT 1",
                                intval(REL_BUD),
                                intval($contact['id']),
                                intval($importer['uid'])
@@ -1010,7 +1014,7 @@ function new_follower($importer,$contact,$datarray,$item) {
 
 function lose_follower($importer,$contact,$datarray,$item) {
 
-       if($contact['rel'] == REL_BUD) {
+       if(($contact['rel'] == REL_BUD) || ($contact['rel'] == REL_FAN)) {
                q("UPDATE `contact` SET `rel` = %d WHERE `id` = %d LIMIT 1",
                        intval(REL_FAN),
                        intval($contact['id'])
index 9e4a7102e8f02b31a44cf0fb19bf56fa3de22709..069f3bdf2e37abb655237ac8edbb6692d442b375 100644 (file)
@@ -72,7 +72,7 @@
                        killme();
        }
 
-       $r = q("SELECT `contact`.*, `user`.`nickname`, `user`.`page-flags` 
+       $r = q("SELECT `contact`.*, `user`.`nickname`, `user`.`sprvkey`, `user`.`spubkey`, `user`.`page-flags` 
                FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid` 
                WHERE `contact`.`uid` = %d AND `contact`.`self` = 1 LIMIT 1",
                intval($uid)
index e8bdc94a30df62a0cd0786d64de275fff0f2e784..e08d76508bf1cb79881e91f20eff397d5e5e050e 100644 (file)
@@ -14,7 +14,6 @@
        require_once('datetime.php');
        require_once('simplepie/simplepie.inc');
        require_once('include/items.php');
-
        require_once('include/Contact.php');
 
        $debugging = get_config('system','debugging');
index de0ea3802dcabfe8b15835fdf2e27df72ddc2db8..e93ec23d766e9274c4c20af760fa7be8841a4581 100644 (file)
@@ -136,7 +136,7 @@ EOT;
 
        $signature  = base64url_encode($rsa->sign($data . $precomputed));
 
-       $signature2 = base64url_encode($rsa->sign($data));
+       $signature2  = base64url_encode($rsa->sign($data));
 
        $salmon_tpl = load_view_file('view/magicsig.tpl');
        $salmon = replace_macros($salmon_tpl,array(
@@ -154,7 +154,7 @@ EOT;
        ));
 
        $a = get_app();
-       $return_code = trim($a->get_curl_code);
+       $return_code = trim($a->get_curl_code());
 
        // check for success, e.g. 2xx
 
@@ -177,7 +177,8 @@ EOT;
                        'Content-type: application/magic-envelope+xml',
                        'Content-length: ' . strlen($salmon)
                ));
-               $return_code = trim($a->get_curl_code);
+               $return_code = trim($a->get_curl_code());
+
        }
  
        return;
index 9360637150cc305e6a2eaa5d73ad4e6e071b02a1..beb1f1ecb82c29f46a7045263e1e264bf1f759af 100644 (file)
@@ -196,10 +196,11 @@ function contacts_content(&$a) {
                        '$last_update' => (($r[0]['last-update'] == '0000-00-00 00:00:00') 
                                ? t('Never') 
                                : datetime_convert('UTC',date_default_timezone_get(),$r[0]['last-update'],'D, j M Y, g:i A')),
-                       '$profile_select' => contact_profile_assign($r[0]['profile-id']),
+                       '$profile_select' => contact_profile_assign($r[0]['profile-id'],(($r[0]['network'] !== 'dfrn') ? true : false)),
                        '$contact_id' => $r[0]['id'],
                        '$block_text' => (($r[0]['blocked']) ? t('Unblock this contact') : t('Block this contact') ),
                        '$ignore_text' => (($r[0]['readonly']) ? t('Unignore this contact') : t('Ignore this contact') ),
+                       '$insecure' => (($r[0]['network'] === 'dfrn') ? '' : load_view_file('view/insecure_net.tpl')),
                        '$blocked' => (($r[0]['blocked']) ? '<div id="block-message">' . t('Currently blocked') . '</div>' : ''),
                        '$ignored' => (($r[0]['readonly']) ? '<div id="ignore-message">' . t('Currently ignored') . '</div>' : ''),
                        '$rating' => contact_reputation($r[0]['rating']),
index 74377f9e941a70ba8afbda205b3089732955727a..54353132ad3f692415180e8f2dd0182b4401033f 100644 (file)
@@ -195,8 +195,8 @@ function salmon_post(&$a) {
        *
        */
 
-       $r = q("SELECT * FROM `contact` WHERE `network` = 'stat' AND ( `url` = '%s' OR `lrdd` = '%s') AND `uid` = %d 
-               AND `readonly` = 0 LIMIT 1",
+       $r = q("SELECT * FROM `contact` WHERE `network` = 'stat' AND ( `url` = '%s' OR `lrdd` = '%s') 
+               AND `uid` = %d LIMIT 1",
                dbesc($author_link),
                dbesc($author_link),
                intval($importer['uid'])
@@ -206,6 +206,13 @@ function salmon_post(&$a) {
                        file_put_contents('salmon.out',"\n" . 'Author unknown to us.' . "\n", FILE_APPEND);
 
        }       
+       if((count($r)) && ($r[0]['readonly'])) {
+               if($debugging)
+                       file_put_contents('salmon.out',"\n" . 'Ignoring this author.' . "\n", FILE_APPEND);
+               salmon_return(200);
+               // NOTREACHED
+       }
+
 
        require_once('include/items.php');
 
index b5f2dcfea00769b513c89d312f16139fb1d5ad2d..32a3fff22ea736f1fab3b3830504625ec347e181 100644 (file)
@@ -49,11 +49,11 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
                $o .= "<select name=\"{$selname}[]\" id=\"$selclass\" class=\"$selclass\" multiple=\"multiple\" size=\"$size\" >\r\n";
 
 
-       $r = q("SELECT `id`, `name`, `url` FROM `contact` 
-               WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `network` = 'dfrn' 
+       $r = q("SELECT `id`, `name`, `url`, `network` FROM `contact` 
+               WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 
                $sql_extra
                ORDER BY `name` ASC ",
-               $_SESSION['uid']
+               intval(local_user())
        );
 
        if(count($r)) {
@@ -62,7 +62,11 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
                                $selected = " selected=\"selected\" ";
                        else
                                $selected = '';
-                       $o .= "<option value=\"{$rr['id']}\" $selected  title=\"{$rr['url']}\" >{$rr['name']}</option>\r\n";
+                       if($rr['network'] === 'stat')
+                               $disabled = ' disabled="true" ' ;
+                       else
+                               $disabled = '';
+                       $o .= "<option value=\"{$rr['id']}\" $selected  $disabled title=\"{$rr['url']}\" >{$rr['name']}</option>\r\n";
                }
        
        }
index acea1da4e93d4e361fa4f20e54248dfed5907578..96abf0028164c682ef0787c19c787b2d3b155311 100644 (file)
@@ -31,6 +31,7 @@
        </div>
        <div id="contact-edit-end" ></div>
 
+$insecure
 $blocked
 $ignored
 
index 7c7abfc7c89dde5cbabb8542c309fafd33648937..ac1e38e4fe2666cb600d79ffa8f8ffce7925433a 100644 (file)
@@ -1,10 +1,13 @@
 <?php
 
 
-function contact_profile_assign($current) {
+function contact_profile_assign($current,$foreign_net) {
 
        $o = '';
-       $o .= "<select id=\"contact-profile-selector\" name=\"profile-assign\" />\r\n";
+
+       $disabled = (($foreign_net) ? ' disabled="true" ' : '');
+
+       $o .= "<select id=\"contact-profile-selector\" $disabled name=\"profile-assign\" />\r\n";
 
        $r = q("SELECT `id`, `profile-name` FROM `profile` WHERE `uid` = %d",
                         intval($_SESSION['uid']));
index 6707493ca7ebc8b3af7f7830bad465ee01d288b5..622e7c5a27a32cad6ea5376df161d30e4a58de30 100644 (file)
@@ -5,5 +5,5 @@ $data
 </me:data>
 <me:encoding>$encoding</me:encoding>
 <me:alg>$algorithm</me:alg>
-<me:sig keyash="$keyhash">$signature</me:sig>
+<me:sig keyhash="$keyhash">$signature</me:sig>
 </me:env>
index 191f2d50f6a50001d5ead7ed0904a14214e81ad2..17e619dea2b259a487ea224ba1f0c0420ba9f7f0 100644 (file)
@@ -1288,9 +1288,8 @@ input#dfrn-url {
        margin-left: 50px;
 }
 
-#block-message, #ignore-message {
+#block-message, #ignore-message, #profile-edit-insecure {
        margin-top: 20px;
-       width: 180px;
        color: #FF0000;
        font-size: 1.1em;
        border: 1px solid #FF8888;
@@ -1298,6 +1297,14 @@ input#dfrn-url {
        padding: 10px;
 }
 
+#block-message, #ignore-message {
+       width: 180px;
+}
+
+#profile-edit-insecure {
+       width: 600px;
+}
+
 .profile-tabs {
        float: left;
        padding: 4px;