diff options
author | Friendika <info@friendika.com> | 2011-08-07 16:15:54 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-08-07 16:15:54 -0700 |
commit | 48ffa880f099b19052f18e399bf6af50780a24b0 (patch) | |
tree | 48f5e9b52b425af937b5ae2511aaaf6968e0b666 /mod | |
parent | aa3a14ec36db5f9df9d0ec27c607a994451fc845 (diff) | |
download | volse-hubzilla-48ffa880f099b19052f18e399bf6af50780a24b0.tar.gz volse-hubzilla-48ffa880f099b19052f18e399bf6af50780a24b0.tar.bz2 volse-hubzilla-48ffa880f099b19052f18e399bf6af50780a24b0.zip |
cleanup
Diffstat (limited to 'mod')
-rw-r--r-- | mod/contacts.php | 14 | ||||
-rw-r--r-- | mod/dfrn_confirm.php | 20 | ||||
-rw-r--r-- | mod/dfrn_request.php | 4 | ||||
-rw-r--r-- | mod/follow.php | 6 | ||||
-rw-r--r-- | mod/pubsub.php | 4 | ||||
-rw-r--r-- | mod/receive.php | 2 | ||||
-rw-r--r-- | mod/salmon.php | 11 |
7 files changed, 34 insertions, 27 deletions
diff --git a/mod/contacts.php b/mod/contacts.php index 4f5a49acd..f64709ab6 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -249,16 +249,16 @@ function contacts_content(&$a) { $tpl = get_markup_template("contact_edit.tpl"); switch($r[0]['rel']) { - case REL_BUD: + case CONTACT_IS_FRIEND: $dir_icon = 'images/lrarrow.gif'; $alt_text = t('Mutual Friendship'); break; - case REL_VIP; + case CONTACT_IS_FOLLOWER; $dir_icon = 'images/larrow.gif'; $alt_text = t('is a fan of yours'); break; - case REL_FAN; + case CONTACT_IS_SHARING; $dir_icon = 'images/rarrow.gif'; $alt_text = t('you are a fan of'); break; @@ -368,7 +368,7 @@ function contacts_content(&$a) { $search = dbesc($search.'*'); $sql_extra .= ((strlen($search)) ? " AND MATCH `name` AGAINST ('$search' IN BOOLEAN MODE) " : ""); - $sql_extra2 = ((($sort_type > 0) && ($sort_type <= REL_BUD)) ? sprintf(" AND `rel` = %d ",intval($sort_type)) : ''); + $sql_extra2 = ((($sort_type > 0) && ($sort_type <= CONTACT_IS_FRIEND)) ? sprintf(" AND `rel` = %d ",intval($sort_type)) : ''); $r = q("SELECT COUNT(*) AS `total` FROM `contact` @@ -392,15 +392,15 @@ function contacts_content(&$a) { continue; switch($rr['rel']) { - case REL_BUD: + case CONTACT_IS_FRIEND: $dir_icon = 'images/lrarrow.gif'; $alt_text = t('Mutual Friendship'); break; - case REL_VIP; + case CONTACT_IS_FOLLOWER; $dir_icon = 'images/larrow.gif'; $alt_text = t('is a fan of yours'); break; - case REL_FAN; + case CONTACT_IS_SHARING; $dir_icon = 'images/rarrow.gif'; $alt_text = t('you are a fan of'); break; diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 91333284b..869bde3bf 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -306,11 +306,11 @@ function dfrn_confirm_post(&$a,$handsfree = null) { if($network === 'dfrn') { - $new_relation = REL_VIP; - if(($relation == REL_FAN) || ($duplex)) - $new_relation = REL_BUD; + $new_relation = CONTACT_IS_FOLLOWER; + if(($relation == CONTACT_IS_SHARING) || ($duplex)) + $new_relation = CONTACT_IS_FRIEND; - if(($relation == REL_FAN) && ($duplex)) + if(($relation == CONTACT_IS_SHARING) && ($duplex)) $duplex = 0; $r = q("UPDATE `contact` SET `photo` = '%s', @@ -401,7 +401,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { $r = q("SELECT `hide-friends` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1", intval($uid) ); - if((count($r)) && ($r[0]['hide-friends'] == 0) && (is_array($contact)) && isset($new_relation) && ($new_relation == REL_BUD)) { + if((count($r)) && ($r[0]['hide-friends'] == 0) && (is_array($contact)) && isset($new_relation) && ($new_relation == CONTACT_IS_FRIEND)) { require_once('include/items.php'); @@ -592,11 +592,11 @@ function dfrn_confirm_post(&$a,$handsfree = null) { logger('dfrn_confirm: request - photos imported'); - $new_relation = REL_FAN; - if(($relation == REL_VIP) || ($duplex)) - $new_relation = REL_BUD; + $new_relation = CONTACT_IS_SHARING; + if(($relation == CONTACT_IS_FOLLOWER) || ($duplex)) + $new_relation = CONTACT_IS_FRIEND; - if(($relation == REL_VIP) && ($duplex)) + if(($relation == CONTACT_IS_FOLLOWER) && ($duplex)) $duplex = 0; $r = q("UPDATE `contact` SET @@ -639,7 +639,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { if((count($r)) && ($r[0]['notify-flags'] & NOTIFY_CONFIRM)) { push_lang($r[0]['language']); - $tpl = (($new_relation == REL_BUD) + $tpl = (($new_relation == CONTACT_IS_FRIEND) ? get_intltext_template('friend_complete_eml.tpl') : get_intltext_template('intro_complete_eml.tpl')); diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php index 6b9558b86..79070604b 100644 --- a/mod/dfrn_request.php +++ b/mod/dfrn_request.php @@ -309,7 +309,7 @@ function dfrn_request_post(&$a) { notice( t('You have already introduced yourself here.') . EOL ); return; } - elseif($ret[0]['rel'] == REL_BUD) { + elseif($ret[0]['rel'] == CONTACT_IS_FRIEND) { notice( sprintf( t('Apparently you are already friends with %s.'), $a->profile['name']) . EOL); return; } @@ -445,7 +445,7 @@ function dfrn_request_post(&$a) { * * OStatus network * Check contact existence - * Try and scrape together enough information to create a contact record, with us as REL_VIP + * Try and scrape together enough information to create a contact record, with us as CONTACT_IS_FOLLOWER * Substitute our user's feed URL into $url template * Send the subscriber home to subscribe * diff --git a/mod/follow.php b/mod/follow.php index 830399ff5..925572640 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -82,9 +82,9 @@ function follow_post(&$a) { if(count($r)) { // update contact - if($r[0]['rel'] == REL_VIP) { + if($r[0]['rel'] == CONTACT_IS_FOLLOWER) { q("UPDATE `contact` SET `rel` = %d , `readonly` = 0 WHERE `id` = %d AND `uid` = %d LIMIT 1", - intval(REL_BUD), + intval(CONTACT_IS_FRIEND), intval($r[0]['id']), intval(local_user()) ); @@ -106,7 +106,7 @@ function follow_post(&$a) { dbesc($ret['nick']), dbesc($ret['photo']), dbesc($ret['network']), - intval(($ret['network'] === NETWORK_MAIL) ? REL_BUD : REL_FAN), + intval(($ret['network'] === NETWORK_MAIL) ? CONTACT_IS_FRIEND : CONTACT_IS_SHARING), intval($ret['priority']), intval($writeable) ); diff --git a/mod/pubsub.php b/mod/pubsub.php index edb0a7fe1..d6e3d378f 100644 --- a/mod/pubsub.php +++ b/mod/pubsub.php @@ -111,8 +111,8 @@ function pubsub_post(&$a) { AND ( `rel` = %d OR `rel` = %d ) AND `blocked` = 0 AND `readonly` = 0 LIMIT 1", intval($contact_id), intval($importer['uid']), - intval(REL_FAN), - intval(REL_BUD) + intval(CONTACT_IS_SHARING), + intval(CONTACT_IS_FRIEND) ); if(! count($r)) { diff --git a/mod/receive.php b/mod/receive.php index f5a2eb7b6..e9af087de 100644 --- a/mod/receive.php +++ b/mod/receive.php @@ -238,7 +238,7 @@ function receive_post(&$a) { // is this a follower? Or have we ignored the person? // If so we can not accept this post. - if((count($r)) && (($r[0]['readonly']) || ($r[0]['rel'] == REL_VIP) || ($r[0]['blocked']))) { + if((count($r)) && (($r[0]['readonly']) || ($r[0]['rel'] == CONTACT_IS_FOLLOWER) || ($r[0]['blocked']))) { logger('mod-diaspora: Ignoring this author.'); receive_return(202); // NOTREACHED diff --git a/mod/salmon.php b/mod/salmon.php index 300ad8746..514653be3 100644 --- a/mod/salmon.php +++ b/mod/salmon.php @@ -134,7 +134,14 @@ function salmon_post(&$a) { // Setup RSA stuff to verify the signature - set_include_path(get_include_path() . PATH_SEPARATOR . 'library/phpsec'); + require_once('library/phpsec/Crypt/RSA.php'); + + $rsa = new CRYPT_RSA(); + $rsa->signatureMode = CRYPT_RSA_SIGNATURE_PKCS1; + $rsa->setHash('sha256'); + $rsa->loadKey($prvkey); + + $sig = $rsa->sign($data); require_once('library/phpsec/Crypt/RSA.php'); @@ -194,7 +201,7 @@ function salmon_post(&$a) { // is this a follower? Or have we ignored the person? // If so we can not accept this post. - if((count($r)) && (($r[0]['readonly']) || ($r[0]['rel'] == REL_VIP) || ($r[0]['blocked']))) { + if((count($r)) && (($r[0]['readonly']) || ($r[0]['rel'] == CONTACT_IS_FOLLOWER) || ($r[0]['blocked']))) { logger('mod-salmon: Ignoring this author.'); salmon_return(202); // NOTREACHED |