aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-08-24 20:40:08 -0700
committerFriendika <info@friendika.com>2011-08-24 20:40:08 -0700
commit8f6ae2b66044a36996ac92a8db1a540db9c71fe3 (patch)
tree7f09c79da7a8044eb6a242de9dd9fae7b8a647f2 /include
parent96adbb64572369ab15e2a1da5b44fc7f0dc76aa1 (diff)
downloadvolse-hubzilla-8f6ae2b66044a36996ac92a8db1a540db9c71fe3.tar.gz
volse-hubzilla-8f6ae2b66044a36996ac92a8db1a540db9c71fe3.tar.bz2
volse-hubzilla-8f6ae2b66044a36996ac92a8db1a540db9c71fe3.zip
missing salmon key? report it.
Diffstat (limited to 'include')
-rw-r--r--include/auth.php6
-rw-r--r--include/queue.php5
-rw-r--r--include/salmon.php7
3 files changed, 14 insertions, 4 deletions
diff --git a/include/auth.php b/include/auth.php
index 768af626f..b7b96bdc0 100644
--- a/include/auth.php
+++ b/include/auth.php
@@ -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'])),
diff --git a/include/queue.php b/include/queue.php
index da5028aee..fe96a75ce 100644
--- a/include/queue.php
+++ b/include/queue.php
@@ -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']);
diff --git a/include/salmon.php b/include/salmon.php
index 4043b4f1d..ba61fffcc 100644
--- a/include/salmon.php
+++ b/include/salmon.php
@@ -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