]> git.mxchange.org Git - friendica.git/commitdiff
missing salmon key? report it.
authorFriendika <info@friendika.com>
Thu, 25 Aug 2011 03:40:08 +0000 (20:40 -0700)
committerFriendika <info@friendika.com>
Thu, 25 Aug 2011 03:40:08 +0000 (20:40 -0700)
include/auth.php
include/queue.php
include/salmon.php
mod/openid.php

index 768af626fb5863a697e358cda29a793d82cf76e1..b7b96bdc0bb7f3f047c2ede73dd29a8eeb3a075e 100644 (file)
@@ -48,7 +48,8 @@ if((isset($_SESSION)) && (x($_SESSION,'authenticated')) && ((! (x($_POST,'auth-p
                        goaway(z_root());
                }
 
-               $r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
+               $r = q("SELECT `user`.*, `user`.`pubkey` as `upubkey`, `user`.`prvkey` as `uprvkey` 
+               FROM `user` WHERE `uid` = %d LIMIT 1",
                        intval($_SESSION['uid'])
                );
 
@@ -183,7 +184,8 @@ else {
 
                        // process normal login request
 
-                       $r = q("SELECT * FROM `user` WHERE ( `email` = '%s' OR `nickname` = '%s' ) 
+                       $r = q("SELECT `user`.*, `user`.`pubkey` as `upubkey`, `user`.`prvkey` as `uprvkey`  
+                               FROM `user` WHERE ( `email` = '%s' OR `nickname` = '%s' ) 
                                AND `password` = '%s' AND `blocked` = 0 AND `verified` = 1 LIMIT 1",
                                dbesc(trim($_POST['openid_url'])),
                                dbesc(trim($_POST['openid_url'])),
index da5028aee5e59697ce4c43092257e3ed2c81d44e..fe96a75ce51604c43ecd42d32d8cb0683012bb20 100644 (file)
@@ -83,7 +83,8 @@ function queue_run($argv, $argc){
                                continue;
                }
 
-               $u = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
+               $u = q("SELECT `user`.*, `user`.`pubkey` AS `upubkey`, `user`.`prvkey` AS `uprvkey` 
+                       FROM `user` WHERE `uid` = %d LIMIT 1",
                        intval($c[0]['uid'])
                );
                if(! count($u)) {
@@ -124,7 +125,7 @@ function queue_run($argv, $argc){
                        case NETWORK_DIASPORA:
                                if($contact['notify']) {
                                        logger('queue: diaspora_delivery: item ' . $q_item['id'] . ' for ' . $contact['name']);
-                                       $deliver_status = diaspora_transmit($owner,$contact['notify'],$data);
+                                       $deliver_status = diaspora_transmit($owner,$contact,$data);
 
                                        if($deliver_status == (-1))
                                                update_queue_time($q_item['id']);
index 4043b4f1d93f0c1f243b564e86b9cc1f0453c5c8..ba61fffccaaa3f372abeb4b1a69864dd1f980bd2 100644 (file)
@@ -73,6 +73,13 @@ function slapper($owner,$url,$slap) {
        if(! strlen($url))
                return;
 
+
+       if(! $owner['sprvkey']) {
+               logger(sprintf("slapper: user '%s' (%d) does not have a salmon private key. Send failed.",
+               $owner['username'],$owner['uid']));
+               return;
+       }
+
        // add all namespaces to item
 
 $namespaces = <<< EOT
index 6fbd013b8d8756d27091a9f26bd5c450d1c2c154..3c32931471025ee3ca2ecf4d257151ffcdebbdde 100644 (file)
@@ -55,7 +55,8 @@ function openid_content(&$a) {
                        } 
 
 
-                       $r = q("SELECT * FROM `user` WHERE `openid` = '%s' AND `blocked` = 0 AND `verified` = 1 LIMIT 1",
+                       $r = q("SELECT `user`.*, `user`.`pubkey` as `upubkey`, `user`.`prvkey` as `uprvkey` 
+                               FROM `user` WHERE `openid` = '%s' AND `blocked` = 0 AND `verified` = 1 LIMIT 1",
                                dbesc($_SESSION['openid'])
                        );
                        if(! count($r)) {