From 953c8ac68675d2f866489b040e2defea855f5c83 Mon Sep 17 00:00:00 2001 From: marijus Date: Mon, 18 Aug 2014 21:25:02 +0200 Subject: make lockview provide the right info --- mod/lockview.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'mod') diff --git a/mod/lockview.php b/mod/lockview.php index 8903bdec6..86d238593 100644 --- a/mod/lockview.php +++ b/mod/lockview.php @@ -26,11 +26,6 @@ function lockview_content(&$a) { $item = $r[0]; - if(array_key_exists('public_policy',$item) && $item['public_policy']) { - echo '
  • ' . translate_scope($item['public_policy']) . '
  • '; - killme(); - } - if($item['uid'] != local_user()) { echo '
  • ' . t('Remote privacy information not available.') . '
  • '; killme(); @@ -83,4 +78,8 @@ function lockview_content(&$a) { echo $o . implode($l); killme(); + if(array_key_exists('public_policy',$item) && $item['public_policy']) { + echo '
  • ' . translate_scope($item['public_policy']) . '
  • '; + killme(); + } } -- cgit v1.2.3 From a10f39b9942d6805d62351e06b0b89e5bc999bf5 Mon Sep 17 00:00:00 2001 From: marijus Date: Tue, 19 Aug 2014 22:01:33 +0200 Subject: really fix lock info --- mod/lockview.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/lockview.php b/mod/lockview.php index 86d238593..7d39f9e2f 100644 --- a/mod/lockview.php +++ b/mod/lockview.php @@ -33,7 +33,7 @@ function lockview_content(&$a) { if(($item['item_private'] == 1) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid'])) && (! strlen($item['deny_cid'])) && (! strlen($item['deny_gid']))) { - echo '
  • ' . t('Remote privacy information not available.') . '
  • '; + echo '
  • ' . translate_scope($item['public_policy']) . '
  • '; killme(); } @@ -82,4 +82,5 @@ function lockview_content(&$a) { echo '
  • ' . translate_scope($item['public_policy']) . '
  • '; killme(); } + } -- cgit v1.2.3 From 82389f8c1b9e43050589da6ea3dda8cac399db9b Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 19 Aug 2014 16:04:38 -0700 Subject: really really fix lockview (cross fingers) ;-) --- mod/lockview.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'mod') diff --git a/mod/lockview.php b/mod/lockview.php index 7d39f9e2f..6673ae709 100644 --- a/mod/lockview.php +++ b/mod/lockview.php @@ -33,7 +33,13 @@ function lockview_content(&$a) { if(($item['item_private'] == 1) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid'])) && (! strlen($item['deny_cid'])) && (! strlen($item['deny_gid']))) { - echo '
  • ' . translate_scope($item['public_policy']) . '
  • '; + + // if the post is private, but public_policy is blank ("visible to the internet"), and there aren't any + // specific recipients, we're the recipient of a post with "bcc" or targeted recipients; so we'll just show it + // as unknown specific recipients. The sender will have the visibility list and will fall through to the + // next section. + + echo '
  • ' . translate_scope((! $item['public_policy']) ? PERMS_SPECIFIC : $item['public_policy']) . '
  • '; killme(); } @@ -78,9 +84,5 @@ function lockview_content(&$a) { echo $o . implode($l); killme(); - if(array_key_exists('public_policy',$item) && $item['public_policy']) { - echo '
  • ' . translate_scope($item['public_policy']) . '
  • '; - killme(); - } } -- cgit v1.2.3 From f7895d322e30ce3d69689c1646fd0056d195e5a8 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 20 Aug 2014 16:10:57 -0700 Subject: provide admin option for allowing rss/atom feed connections. Need to do this now before the feature is complete so that public sites don't get borked. We also will need a service class for this. --- mod/admin.php | 50 +++++--------------------------------------------- 1 file changed, 5 insertions(+), 45 deletions(-) (limited to 'mod') diff --git a/mod/admin.php b/mod/admin.php index 14657bd1a..5df63636a 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -265,50 +265,10 @@ function admin_page_site_post(&$a){ $delivery_interval = ((x($_POST,'delivery_interval'))? intval(trim($_POST['delivery_interval'])) : 0); $poll_interval = ((x($_POST,'poll_interval'))? intval(trim($_POST['poll_interval'])) : 0); $maxloadavg = ((x($_POST,'maxloadavg'))? intval(trim($_POST['maxloadavg'])) : 50); -// $ssl_policy = ((x($_POST,'ssl_policy')) ? intval($_POST['ssl_policy']) : 0); -/* - if($ssl_policy != intval(get_config('system','ssl_policy'))) { - if($ssl_policy == SSL_POLICY_FULL) { - q("update `contact` set - `url` = replace(`url` , 'http:' , 'https:'), - `photo` = replace(`photo` , 'http:' , 'https:'), - `thumb` = replace(`thumb` , 'http:' , 'https:'), - `micro` = replace(`micro` , 'http:' , 'https:'), - `request` = replace(`request`, 'http:' , 'https:'), - `notify` = replace(`notify` , 'http:' , 'https:'), - `poll` = replace(`poll` , 'http:' , 'https:'), - `confirm` = replace(`confirm`, 'http:' , 'https:'), - `poco` = replace(`poco` , 'http:' , 'https:') - where `self` = 1" - ); - q("update `profile` set - `photo` = replace(`photo` , 'http:' , 'https:'), - `thumb` = replace(`thumb` , 'http:' , 'https:') - where 1 " - ); - } - elseif($ssl_policy == SSL_POLICY_SELFSIGN) { - q("update `contact` set - `url` = replace(`url` , 'https:' , 'http:'), - `photo` = replace(`photo` , 'https:' , 'http:'), - `thumb` = replace(`thumb` , 'https:' , 'http:'), - `micro` = replace(`micro` , 'https:' , 'http:'), - `request` = replace(`request`, 'https:' , 'http:'), - `notify` = replace(`notify` , 'https:' , 'http:'), - `poll` = replace(`poll` , 'https:' , 'http:'), - `confirm` = replace(`confirm`, 'https:' , 'http:'), - `poco` = replace(`poco` , 'https:' , 'http:') - where `self` = 1" - ); - q("update `profile` set - `photo` = replace(`photo` , 'https:' , 'http:'), - `thumb` = replace(`thumb` , 'https:' , 'http:') - where 1 " - ); - } - } -*/ -// set_config('system','ssl_policy',$ssl_policy); + $feed_contacts = ((x($_POST,'feed_contacts')) ? intval($_POST['feed_contacts']) : 0); + + + set_config('system','feed_contacts',$feed_contacts); set_config('system','delivery_interval',$delivery_interval); set_config('system','poll_interval',$poll_interval); set_config('system','maxloadavg',$maxloadavg); @@ -464,7 +424,7 @@ function admin_page_site(&$a) { '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile_theme'), t("Theme for mobile devices"), $theme_choices_mobile), '$theme_accessibility' => array('theme_accessibility', t("Accessibility system theme"), get_config('system','accessibility_theme'), t("Accessibility theme"), $theme_choices_accessibility), '$site_channel' => array('site_channel', t("Channel to use for this website's static pages"), get_config('system','site_channel'), t("Site Channel")), -// '$ssl_policy' => array('ssl_policy', t("SSL link policy"), (string) intval(get_config('system','ssl_policy')), t("Determines whether generated links should be forced to use SSL"), $ssl_choices), + '$feed_contacts' => array('feed_contacts', t('Allow Feeds as Connections'),get_config('system','feed_contacts'),t('(Heavy system resource usage)')), '$maximagesize' => array('maximagesize', t("Maximum image size"), intval(get_config('system','maximagesize')), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")), '$register_policy' => array('register_policy', t("Does this site allow new member registration?"), get_config('system','register_policy'), "", $register_choices), '$access_policy' => array('access_policy', t("Which best describes the types of account offered by this hub?"), get_config('system','access_policy'), "This is displayed on the public server site list.", $access_choices), -- cgit v1.2.3 From a6829f7dcb6735ee0b2f003647cc168e55002a5f Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 20 Aug 2014 17:15:13 -0700 Subject: move Friendica photo migrator to addons, bring back a few XML scraping functions that we're going to require (unfortunately) --- mod/frphotos.php | 87 -------------------------------------------------------- 1 file changed, 87 deletions(-) delete mode 100644 mod/frphotos.php (limited to 'mod') diff --git a/mod/frphotos.php b/mod/frphotos.php deleted file mode 100644 index 8d6197fa3..000000000 --- a/mod/frphotos.php +++ /dev/null @@ -1,87 +0,0 @@ -get_channel(); - - $fr_server = $_REQUEST['fr_server']; - $fr_username = $_REQUEST['fr_username']; - $fr_password = $_REQUEST['fr_password']; - - $cookies = 'store/[data]/frphoto_cookie_' . $channel['channel_address']; - - if($fr_server && $fr_username && $fr_password) { - - $ch = curl_init($fr_server . '/api/friendica/photos/list'); - - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt ($ch, CURLOPT_COOKIEFILE, $cookies); - curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookies); - curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); - curl_setopt($ch, CURLOPT_USERPWD, $fr_username . ':' . $fr_password); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); - curl_setopt($ch, CURLOPT_USERAGENT, 'RedMatrix'); - - $output = curl_exec($ch); - curl_close($ch); - - $j = json_decode($output,true); - -// echo print_r($j,true); - - $total = 0; - if(count($j)) { - foreach($j as $jj) { - - $r = q("select uid from photo where resource_id = '%s' and uid = %d limit 1", - dbesc($jj), - intval($channel['channel_id']) - ); - if($r) - continue; - - $total ++; - proc_run('php','util/frphotohelper.php',$jj, $channel['channel_address'], urlencode($fr_server)); - sleep(3); - } - } - if($total) { - set_pconfig(local_user(),'frphotos','complete','1'); - } - @unlink($cookies); - goaway(z_root() . '/photos/' . $channel['channel_address']); - } -} - - -function frphotos_content(&$a) { - - if(! local_user()) { - notice( t('Permission denied') . EOL); - return; - } - - if(intval(get_pconfig(local_user(),'frphotos','complete'))) { - info('Friendica photos have already been imported into this channel.'); - return; - } - - $o = replace_macros(get_markup_template('frphotos.tpl'),array( - '$header' => t('Friendica Photo Album Import'), - '$desc' => t('This will import all your Friendica photo albums to this Red channel.'), - '$fr_server' => array('fr_server', t('Friendica Server base URL'),'',''), - '$fr_username' => array('fr_username', t('Friendica Login Username'),'',''), - '$fr_password' => array('fr_password', t('Friendica Login Password'),'',''), - '$submit' => t('Submit'), - )); - return $o; -} -- cgit v1.2.3 From b8a5b7a610fa940297b4bd3f66c912c3f3e7e161 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 20 Aug 2014 19:36:01 -0700 Subject: restrict returned directory contents to xchans in the zot network. We could probably add other networks to this and create a distributed directory for the free web. It's highly unlikely we would do this but we *could*. --- mod/dirsearch.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/dirsearch.php b/mod/dirsearch.php index b72d303b7..96e576a19 100644 --- a/mod/dirsearch.php +++ b/mod/dirsearch.php @@ -154,7 +154,7 @@ function dirsearch_content(&$a) { else { $qlimit = " LIMIT " . intval($startrec) . " , " . intval($perpage); if($return_total) { - $r = q("SELECT COUNT(xchan_hash) AS `total` FROM xchan left join xprof on xchan_hash = xprof_hash where $logic $sql_extra and not ( xchan_flags & %d) and not ( xchan_flags & %d ) and not ( xchan_flags & %d ) $safesql ", + $r = q("SELECT COUNT(xchan_hash) AS `total` FROM xchan left join xprof on xchan_hash = xprof_hash where $logic $sql_extra and xchan_network = 'zot' and not ( xchan_flags & %d) and not ( xchan_flags & %d ) and not ( xchan_flags & %d ) $safesql ", intval(XCHAN_FLAGS_HIDDEN), intval(XCHAN_FLAGS_ORPHAN), intval(XCHAN_FLAGS_DELETED) @@ -199,7 +199,7 @@ function dirsearch_content(&$a) { json_return_and_die($spkt); } else { - $r = q("SELECT xchan.*, xprof.* from xchan left join xprof on xchan_hash = xprof_hash where ( $logic $sql_extra ) and not ( xchan_flags & %d ) and not ( xchan_flags & %d ) and not ( xchan_flags & %d ) $safesql $order $qlimit ", + $r = q("SELECT xchan.*, xprof.* from xchan left join xprof on xchan_hash = xprof_hash where ( $logic $sql_extra ) and xchan_network = 'zot' and not ( xchan_flags & %d ) and not ( xchan_flags & %d ) and not ( xchan_flags & %d ) $safesql $order $qlimit ", intval(XCHAN_FLAGS_HIDDEN), intval(XCHAN_FLAGS_ORPHAN), intval(XCHAN_FLAGS_DELETED) -- cgit v1.2.3 From b4aed1212930e40377665dc45271f2b1f428511f Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 20 Aug 2014 23:01:25 -0700 Subject: extensible profiles - add the input form elements. Still needs styling and we're not yet storing the results. And right now we're ignoring the type and only doing type=string. Oh yeah - and I split off starting the second delivery chain into its own function in tag_deliver since it was largely duplicate code. --- mod/profiles.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'mod') diff --git a/mod/profiles.php b/mod/profiles.php index b938e836b..d6df09e9a 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -568,6 +568,24 @@ function profiles_content(&$a) { '$no_selected' => (($r[0]['hide_friends'] == 0) ? " checked=\"checked\" " : "") )); + $q = q("select * from profdef where true"); + if($q) { + $extra_fields = array(); + + foreach($q as $qq) { + $mine = q("select v from profext where k = '%s' and hash = '%s' and channel_id = %d limit 1", + dbesc($qq['field_name']), + dbesc($r[0]['profile_guid']), + intval(local_user()) + ); + + if(array_key_exists($qq['field_name'],$fields)) { + $extra_fields[] = array($qq['field_name'],$qq['field_desc'],(($mine) ? $mine[0]['v'] : ''), $qq['field_help']); + } + } + } + +logger('extra_fields: ' . print_r($extra_fields,true)); $f = get_config('system','birthday_input_format'); if(! $f) @@ -674,6 +692,7 @@ function profiles_content(&$a) { '$education' => $r[0]['education'], '$contact' => $r[0]['contact'], '$channels' => $r[0]['channels'], + '$extra_fields' => $extra_fields, )); $arr = array('profile' => $r[0], 'entry' => $o); -- cgit v1.2.3 From 831714f0f0e5bd9a17c760a2476a12603be5d089 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 21 Aug 2014 16:46:24 -0700 Subject: profile edit - missing visibility and drop link on non-default profiles, re-arrange order of replacing red#matrix smilie so it works correctly, accept a post with body content of '0' which was interpreted by x() as nothing (was treated as integer). --- mod/item.php | 1 - 1 file changed, 1 deletion(-) (limited to 'mod') diff --git a/mod/item.php b/mod/item.php index 92dc3e7c6..27691eb4f 100644 --- a/mod/item.php +++ b/mod/item.php @@ -790,7 +790,6 @@ function item_post(&$a) { else $post_id = 0; - $post = item_store($datarray,$execflag); $post_id = $post['item_id']; -- cgit v1.2.3 From 921799b045c376c2ffe80a0c4fe0dc6c2c78e854 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 21 Aug 2014 17:42:19 -0700 Subject: make the old personal xrd interface (old webfinger) work again --- mod/xrd.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'mod') diff --git a/mod/xrd.php b/mod/xrd.php index 4d6a530e4..d059bec9b 100644 --- a/mod/xrd.php +++ b/mod/xrd.php @@ -22,7 +22,20 @@ function xrd_init(&$a) { if(! $r) killme(); -// $salmon_key = salmon_key($r[0]['pubkey']); + if(get_config('system','diaspora_enabled')) { + $tpl = get_markup_template('xrd_diaspora.tpl'); + $dspr = replace_macros($tpl,array( + '$baseurl' => $a->get_baseurl(), + '$dspr_guid' => $r[0]['channel_guid'], + '$dspr_key' => base64_encode(pemtorsa($r[0]['channel_pubkey'])) + )); + } + else + $dspr = ''; + + + + $salmon_key = salmon_key($r[0]['channel_pubkey']); header('Access-Control-Allow-Origin: *'); header("Content-type: text/xml"); @@ -34,15 +47,15 @@ function xrd_init(&$a) { '$nick' => $r[0]['channel_address'], '$accturi' => $uri, '$profile_url' => $a->get_baseurl() . '/channel/' . $r[0]['channel_address'], -// '$hcard_url' => $a->get_baseurl() . '/hcard/' . $r[0]['channel_address'], + '$hcard_url' => $a->get_baseurl() . '/hcard/' . $r[0]['channel_address'], '$atom' => $a->get_baseurl() . '/feed/' . $r[0]['channel_address'], '$zot_post' => $a->get_baseurl() . '/post/' . $r[0]['channel_address'], '$poco_url' => $a->get_baseurl() . '/poco/' . $r[0]['channel_address'], '$photo' => $a->get_baseurl() . '/photo/profile/l/' . $r[0]['channel_id'], -// '$dspr' => $dspr, + '$dspr' => $dspr, // '$salmon' => $a->get_baseurl() . '/salmon/' . $r[0]['channel_address'], // '$salmen' => $a->get_baseurl() . '/salmon/' . $r[0]['channel_address'] . '/mention', -// '$modexp' => 'data:application/magic-public-key,' . $salmon_key, + '$modexp' => 'data:application/magic-public-key,' . $salmon_key, // '$bigkey' => salmon_key($r[0]['pubkey']) )); -- cgit v1.2.3 From 05515e3b10d2dcc6cf306e1749c1717e96dfcff2 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 21 Aug 2014 20:42:55 -0700 Subject: D* receive endpoint is receive/users/$guid - where $guid is really the channel_guid, not the channel_hash. We'll allow this to be truncated for older D* sites or those that can't process our 64 character guids. --- mod/receive.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'mod') diff --git a/mod/receive.php b/mod/receive.php index c5a2dc4e0..4071b169b 100644 --- a/mod/receive.php +++ b/mod/receive.php @@ -4,8 +4,6 @@ * Diaspora endpoint */ - -//require_once('include/salmon.php'); require_once('include/crypto.php'); require_once('include/diaspora.php'); @@ -31,8 +29,11 @@ function receive_post(&$a) { $guid = argv(2); - $r = q("SELECT * FROM channel left join account on account_id = channel_account_id WHERE channel_guid = '%s' AND account_flags = 0 LIMIT 1", - dbesc($guid) + // Diaspora sites *may* provide a truncated guid. + + $r = q("SELECT * FROM channel left join xchan on channel_hash = xchan_hash WHERE channel_guid like '%s' AND NOT (channel_pageflags & %d ) LIMIT 1", + dbesc($guid . '%'), + intval(PAGE_REMOVED) ); if(! $r) http_status_exit(500); -- cgit v1.2.3 From 2dc705d9a04df4b5d5415a42ddd2cb86c99222e8 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 22 Aug 2014 15:51:48 -0700 Subject: issue #571 - use feed/nickname?top=1 --- mod/feed.php | 1 + 1 file changed, 1 insertion(+) (limited to 'mod') diff --git a/mod/feed.php b/mod/feed.php index 0f8296ed1..fdbe4db8c 100644 --- a/mod/feed.php +++ b/mod/feed.php @@ -11,6 +11,7 @@ function feed_init(&$a) { $params['end'] = ((x($_REQUEST,'date_end')) ? $_REQUEST['date_end'] : ''); $params['type'] = ((stristr(argv(0),'json')) ? 'json' : 'xml'); $params['pages'] = ((x($_REQUEST,'pages')) ? intval($_REQUEST['pages']) : 0); + $params['top'] = ((x($_REQUEST,'top')) ? intval($_REQUEST['top']) : 0); $channel = ''; if(argc() > 1) { -- cgit v1.2.3 From 9196c9eef091e7f4a41fbc9452521d6ca2de55a3 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 22 Aug 2014 21:37:08 -0700 Subject: We really can't do this without a hubloc. I was hoping we could, but notifier is setup to take hublocs, not xchans. --- mod/import.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/import.php b/mod/import.php index d3b237c3a..e732c3c06 100644 --- a/mod/import.php +++ b/mod/import.php @@ -179,13 +179,14 @@ function import_post(&$a) { // create new hubloc for the new channel at this site - $r = q("insert into hubloc ( hubloc_guid, hubloc_guid_sig, hubloc_hash, hubloc_addr, hubloc_flags, + $r = q("insert into hubloc ( hubloc_guid, hubloc_guid_sig, hubloc_hash, hubloc_addr, hubloc_network, hubloc_flags, hubloc_url, hubloc_url_sig, hubloc_host, hubloc_callback, hubloc_sitekey ) - values ( '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s' )", + values ( '%s', '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s' )", dbesc($channel['channel_guid']), dbesc($channel['channel_guid_sig']), dbesc($channel['channel_hash']), dbesc($channel['channel_address'] . '@' . get_app()->get_hostname()), + dbesc('zot'), intval(($seize) ? HUBLOC_FLAGS_PRIMARY : 0), dbesc(z_root()), dbesc(base64url_encode(rsa_sign(z_root(),$channel['channel_prvkey']))), -- cgit v1.2.3 From 5d2dc4e8fdb62785cf306496c7cdcefb31d4a0ed Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 23 Aug 2014 02:45:21 -0700 Subject: switch everything over to crypto_encapsulate() --- mod/item.php | 4 ++-- mod/zfinger.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'mod') diff --git a/mod/item.php b/mod/item.php index 27691eb4f..df51c8a92 100644 --- a/mod/item.php +++ b/mod/item.php @@ -768,9 +768,9 @@ function item_post(&$a) { $key = get_config('system','pubkey'); $datarray['item_flags'] = $datarray['item_flags'] | ITEM_OBSCURED; if($datarray['title']) - $datarray['title'] = json_encode(aes_encapsulate($datarray['title'],$key)); + $datarray['title'] = json_encode(crypto_encapsulate($datarray['title'],$key)); if($datarray['body']) - $datarray['body'] = json_encode(aes_encapsulate($datarray['body'],$key)); + $datarray['body'] = json_encode(crypto_encapsulate($datarray['body'],$key)); } if($orig_post) { diff --git a/mod/zfinger.php b/mod/zfinger.php index cf8a3fda1..ef55085d6 100644 --- a/mod/zfinger.php +++ b/mod/zfinger.php @@ -203,7 +203,7 @@ function zfinger_init(&$a) { $permissions['connected'] = true; } - $ret['permissions'] = (($ztarget && $zkey) ? aes_encapsulate(json_encode($permissions),$zkey) : $permissions); + $ret['permissions'] = (($ztarget && $zkey) ? crypto_encapsulate(json_encode($permissions),$zkey) : $permissions); if($permissions['view_profile']) $ret['profile'] = $profile; -- cgit v1.2.3 From 9b524c9bc4553a82b98f46e4c4804d76ee1495f2 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 23 Aug 2014 21:12:33 -0700 Subject: unobscure viewsrc items --- mod/viewsrc.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/viewsrc.php b/mod/viewsrc.php index 0f4df9b9b..ddf39535c 100644 --- a/mod/viewsrc.php +++ b/mod/viewsrc.php @@ -19,13 +19,16 @@ function viewsrc_content(&$a) { } if(local_user() && $item_id) { - $r = q("select body from item where item_restrict = 0 and uid = %d and id = %d limit 1", + $r = q("select item_flags, body from item where item_restrict = 0 and uid = %d and id = %d limit 1", intval(local_user()), intval($item_id) ); - if($r) + if($r) { + if($r[0]['item_flags'] & ITEM_OBSCURED) + $r[0]['body'] = crypto_unencapsulate(json_decode($r[0]['body'],true),get_config('system','prvkey')); $o = (($json) ? json_encode($r[0]['body']) : str_replace("\n",'
    ',$r[0]['body'])); + } } if(is_ajax()) { -- cgit v1.2.3 From bbcf0be16a2140069fe2826c57bb0c7278f7cb52 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 27 Aug 2014 18:19:56 -0700 Subject: Admin setting for Diaspora Protocol enable. We may want to have this also at a channel level since there are privacy issues and quirks and trade-offs. --- mod/admin.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mod') diff --git a/mod/admin.php b/mod/admin.php index 5df63636a..bcbb6fc26 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -266,9 +266,11 @@ function admin_page_site_post(&$a){ $poll_interval = ((x($_POST,'poll_interval'))? intval(trim($_POST['poll_interval'])) : 0); $maxloadavg = ((x($_POST,'maxloadavg'))? intval(trim($_POST['maxloadavg'])) : 50); $feed_contacts = ((x($_POST,'feed_contacts')) ? intval($_POST['feed_contacts']) : 0); + $diaspora_enable = ((x($_POST,'diaspora_enable')) ? intval($_POST['diaspora_enable']) : 0); set_config('system','feed_contacts',$feed_contacts); + set_config('system','diaspora_enable',$diaspora_enable); set_config('system','delivery_interval',$delivery_interval); set_config('system','poll_interval',$poll_interval); set_config('system','maxloadavg',$maxloadavg); @@ -424,6 +426,7 @@ function admin_page_site(&$a) { '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile_theme'), t("Theme for mobile devices"), $theme_choices_mobile), '$theme_accessibility' => array('theme_accessibility', t("Accessibility system theme"), get_config('system','accessibility_theme'), t("Accessibility theme"), $theme_choices_accessibility), '$site_channel' => array('site_channel', t("Channel to use for this website's static pages"), get_config('system','site_channel'), t("Site Channel")), + '$diaspora_enable' => array('diaspora_enable',t('Enable Diaspora Protocol'), get_config('system','diaspora_enable'), t('Communicate with Diaspora and Friendica - experimental')), '$feed_contacts' => array('feed_contacts', t('Allow Feeds as Connections'),get_config('system','feed_contacts'),t('(Heavy system resource usage)')), '$maximagesize' => array('maximagesize', t("Maximum image size"), intval(get_config('system','maximagesize')), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")), '$register_policy' => array('register_policy', t("Does this site allow new member registration?"), get_config('system','register_policy'), "", $register_choices), -- cgit v1.2.3 From 2d210db1b85e5893afe285fc7b32f9987f1ae565 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 27 Aug 2014 22:01:02 -0700 Subject: ability to create/edit/delete custom profile field definitions - read the source. Currently the created entries aren't added to the allowed fields arrays, but this can be done by hand until that bit is made available. Only choice for input type at the moment is 'text' or a text input, not a textarea. Multiple choice will be added later. --- mod/admin.php | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) (limited to 'mod') diff --git a/mod/admin.php b/mod/admin.php index bcbb6fc26..e54163c62 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -1291,11 +1291,74 @@ readable."); function admin_page_profs_post(&$a) { + if($_REQUEST['id']) { + $r = q("update profdef set field_name = '%s', field_type = '%s', field_desc = '%s' field_help = '%s', field_inputs = '%s' where id = %d limit 1", + dbesc($_REQUEST['field_name']), + dbesc($_REQUEST['field_type']), + dbesc($_REQUEST['field_desc']), + dbesc($_REQUEST['field_help']), + dbesc($_REQUEST['field_inputs']), + intval($_REQUEST['id']) + ); + } + else { + $r = q("insert into profdef ( field_name, field_type, field_desc, field_help, field_inputs ) values ( '%s' , '%s', '%s', '%s', '%s' )", + dbesc($_REQUEST['field_name']), + dbesc($_REQUEST['field_type']), + dbesc($_REQUEST['field_desc']), + dbesc($_REQUEST['field_help']), + dbesc($_REQUEST['field_inputs']) + ); + } + + // add to chosen array basic or advanced + + goaway(z_root() . '/admin/profs'); } function admin_page_profs(&$a) { + if((argc() > 3) && argv(2) == 'drop' && intval(argv(3))) { + $r = q("delete from profdef where id = %d limit 1", + intval(argv(3)) + ); + // remove from allowed fields + + goaway(z_root() . '/admin/profs'); + } + + if((argc() > 2) && argv(2) === 'new') { + return replace_macros(get_markup_template('profdef_edit.tpl'),array( + '$header' => t('New Profile Field'), + '$field_name' => array('field_name',t('Field nickname'),$_REQUEST['field_name'],t('System name of field')), + '$field_type' => array('field_type',t('Input type'),(($_REQUEST['field_type']) ? $_REQUEST['field_type'] : 'text'),''), + '$field_desc' => array('field_desc',t('Field Name'),$_REQUEST['field_desc'],t('Label on profile pages')), + '$field_help' => array('field_help',t('Help text'),$_REQUEST['field_help'],t('Additional info (optional)')), + '$submit' => t('Save') + )); + + } + + if((argc() > 2) && intval(argv(2))) { + $r = q("select * from profdef where id = %d limit 1", + intval(argv(2)) + ); + if(! $r) { + notice( t('Field definition not found') . EOL); + goaway(z_root() . '/admin/profs'); + } + + return replace_macros(get_markup_template('profdef_edit.tpl'),array( + '$id' => intval($r[0]['id']), + '$header' => t('New Profile Field'), + '$field_name' => array('field_name',t('Field nickname'),$r[0]['field_name'],t('System name of field')), + '$field_type' => array('field_type',t('Input type'),$r[0]['field_type'],''), + '$field_desc' => array('field_desc',t('Field Name'),$r[0]['field_desc'],t('Label on profile pages')), + '$field_help' => array('field_help',t('Help text'),$r[0]['field_help'],t('Additional info (optional)')), + '$submit' => t('Save') + )); + } } -- cgit v1.2.3 From a4f734e37c2092b91d3915b5f4bb90eba6a4b605 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 27 Aug 2014 22:56:24 -0700 Subject: begin embeddable/shareable design elements (blocks, webpages, layouts, menus, etc.) --- mod/admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/admin.php b/mod/admin.php index e54163c62..82d199a9b 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -1351,7 +1351,7 @@ function admin_page_profs(&$a) { return replace_macros(get_markup_template('profdef_edit.tpl'),array( '$id' => intval($r[0]['id']), - '$header' => t('New Profile Field'), + '$header' => t('Edit Profile Field'), '$field_name' => array('field_name',t('Field nickname'),$r[0]['field_name'],t('System name of field')), '$field_type' => array('field_type',t('Input type'),$r[0]['field_type'],''), '$field_desc' => array('field_desc',t('Field Name'),$r[0]['field_desc'],t('Label on profile pages')), -- cgit v1.2.3 From ed4896def1f90d903919311312fee974384540d7 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 28 Aug 2014 01:08:42 -0700 Subject: make blocks, webpages, and layouts postable (pre-filled forms if supplied from elsewhere). The only serious issue is with ordering - you have to process and save a named layout before you can save a webpage that uses that layout name. Otherwise it will get unset during the save. --- mod/blocks.php | 17 +++++++++++------ mod/layouts.php | 11 ++++++++++- mod/webpages.php | 11 +++++++++-- 3 files changed, 30 insertions(+), 9 deletions(-) (limited to 'mod') diff --git a/mod/blocks.php b/mod/blocks.php index 74a980c25..3f2bef116 100644 --- a/mod/blocks.php +++ b/mod/blocks.php @@ -45,14 +45,10 @@ function blocks_content(&$a) { return; } -// if(local_user() && local_user() == $owner) { - // $a->set_widget('design',design_tools()); - // } - - // Create a status editor (for now - we'll need a WYSIWYG eventually) to create pages -// Nickname is set to the observers xchan, and profile_uid to the owners. This lets you post pages at other people's channels. +// Nickname is set to the observers xchan, and profile_uid to the owners. +// This lets you post pages at other people's channels. require_once ('include/conversation.php'); $x = array( 'webpage' => ITEM_BUILDBLOCK, @@ -67,6 +63,15 @@ require_once ('include/conversation.php'); 'profile_uid' => intval($owner), ); + if($_REQUEST['title']) + $x['title'] = $_REQUEST['title']; + if($_REQUEST['body']) + $x['body'] = $_REQUEST['body']; + if($_REQUEST['pagetitle']) + $x['pagetitle'] = $_REQUEST['pagetitle']; + + + $o .= status_editor($a,$x); //Get a list of blocks. We can't display all them because endless scroll makes that unusable, so just list titles and an edit link. diff --git a/mod/layouts.php b/mod/layouts.php index 318e6e29f..2d14212cf 100644 --- a/mod/layouts.php +++ b/mod/layouts.php @@ -68,7 +68,8 @@ function layouts_content(&$a) { // Create a status editor (for now - we'll need a WYSIWYG eventually) to create pages - // Nickname is set to the observers xchan, and profile_uid to the owners. This lets you post pages at other people's channels. + // Nickname is set to the observers xchan, and profile_uid to the owners. + // This lets you post pages at other people's channels. require_once ('include/conversation.php'); @@ -85,6 +86,14 @@ function layouts_content(&$a) { 'profile_uid' => intval($owner), ); + if($_REQUEST['title']) + $x['title'] = $_REQUEST['title']; + if($_REQUEST['body']) + $x['body'] = $_REQUEST['body']; + if($_REQUEST['pagetitle']) + $x['pagetitle'] = $_REQUEST['pagetitle']; + + $o .= status_editor($a,$x); // Get a list of blocks. We can't display all them because endless scroll makes that unusable, so just list titles and an edit link. diff --git a/mod/webpages.php b/mod/webpages.php index 431caa628..bfa2ebd7d 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -46,11 +46,11 @@ function webpages_content(&$a) { // } - $mimetype = get_config('system','page_mimetype'); + $mimetype = (($_REQUEST['mimetype']) ? $_REQUEST['mimetype'] : get_config('system','page_mimetype')); if(! $mimetype) $mimetype = 'choose'; - $layout = get_config('system','page_layout'); + $layout = (($_REQUEST['layout']) ? $_REQUEST['layout'] : get_config('system','page_layout')); if(! $layout) $layout = 'choose'; @@ -91,6 +91,13 @@ function webpages_content(&$a) { 'layout' => $layout, ); + if($_REQUEST['title']) + $x['title'] = $_REQUEST['title']; + if($_REQUEST['body']) + $x['body'] = $_REQUEST['body']; + if($_REQUEST['pagetitle']) + $x['pagetitle'] = $_REQUEST['pagetitle']; + $o .= status_editor($a,$x); -- cgit v1.2.3 From 5e5c6c90002908ed2052659a5fe13319c09883b0 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 28 Aug 2014 03:33:19 -0700 Subject: consistency: the diaspora post plugin uses "diaspora_enable". The protocol driver uses "diaspora_enabled" with a 'd'. They got mixed up in a couple of places. --- mod/admin.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mod') diff --git a/mod/admin.php b/mod/admin.php index 82d199a9b..31d3873ff 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -266,11 +266,11 @@ function admin_page_site_post(&$a){ $poll_interval = ((x($_POST,'poll_interval'))? intval(trim($_POST['poll_interval'])) : 0); $maxloadavg = ((x($_POST,'maxloadavg'))? intval(trim($_POST['maxloadavg'])) : 50); $feed_contacts = ((x($_POST,'feed_contacts')) ? intval($_POST['feed_contacts']) : 0); - $diaspora_enable = ((x($_POST,'diaspora_enable')) ? intval($_POST['diaspora_enable']) : 0); + $diaspora_enabled = ((x($_POST,'diaspora_enabled')) ? intval($_POST['diaspora_enabled']) : 0); set_config('system','feed_contacts',$feed_contacts); - set_config('system','diaspora_enable',$diaspora_enable); + set_config('system','diaspora_enabled',$diaspora_enabled); set_config('system','delivery_interval',$delivery_interval); set_config('system','poll_interval',$poll_interval); set_config('system','maxloadavg',$maxloadavg); @@ -426,7 +426,7 @@ function admin_page_site(&$a) { '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile_theme'), t("Theme for mobile devices"), $theme_choices_mobile), '$theme_accessibility' => array('theme_accessibility', t("Accessibility system theme"), get_config('system','accessibility_theme'), t("Accessibility theme"), $theme_choices_accessibility), '$site_channel' => array('site_channel', t("Channel to use for this website's static pages"), get_config('system','site_channel'), t("Site Channel")), - '$diaspora_enable' => array('diaspora_enable',t('Enable Diaspora Protocol'), get_config('system','diaspora_enable'), t('Communicate with Diaspora and Friendica - experimental')), + '$diaspora_enabled' => array('diaspora_enabled',t('Enable Diaspora Protocol'), get_config('system','diaspora_enabled'), t('Communicate with Diaspora and Friendica - experimental')), '$feed_contacts' => array('feed_contacts', t('Allow Feeds as Connections'),get_config('system','feed_contacts'),t('(Heavy system resource usage)')), '$maximagesize' => array('maximagesize', t("Maximum image size"), intval(get_config('system','maximagesize')), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")), '$register_policy' => array('register_policy', t("Does this site allow new member registration?"), get_config('system','register_policy'), "", $register_choices), -- cgit v1.2.3 From d0af6b501fa13c39abd5319e4fce80f3f22d6947 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 28 Aug 2014 04:04:38 -0700 Subject: really really really fix lockview - maybe --- mod/lockview.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/lockview.php b/mod/lockview.php index 6673ae709..51f7c29f3 100644 --- a/mod/lockview.php +++ b/mod/lockview.php @@ -16,11 +16,12 @@ function lockview_content(&$a) { if (!in_array($type, array('item','photo','event'))) killme(); - + $r = q("SELECT * FROM %s WHERE id = %d LIMIT 1", dbesc($type), intval($item_id) ); + if(! $r) killme(); @@ -39,7 +40,7 @@ function lockview_content(&$a) { // as unknown specific recipients. The sender will have the visibility list and will fall through to the // next section. - echo '
  • ' . translate_scope((! $item['public_policy']) ? PERMS_SPECIFIC : $item['public_policy']) . '
  • '; + echo '
  • ' . translate_scope((! $item['public_policy']) ? 'contacts' : $item['public_policy']) . '
  • '; killme(); } -- cgit v1.2.3 From f526a10f07086ffeb5018b913916827a556f2fa1 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 28 Aug 2014 04:14:49 -0700 Subject: let's make this "specific" since that's what it is. --- mod/lockview.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/lockview.php b/mod/lockview.php index 51f7c29f3..e39f2707b 100644 --- a/mod/lockview.php +++ b/mod/lockview.php @@ -40,7 +40,7 @@ function lockview_content(&$a) { // as unknown specific recipients. The sender will have the visibility list and will fall through to the // next section. - echo '
  • ' . translate_scope((! $item['public_policy']) ? 'contacts' : $item['public_policy']) . '
  • '; + echo '
  • ' . translate_scope((! $item['public_policy']) ? 'specific' : $item['public_policy']) . '
  • '; killme(); } -- cgit v1.2.3 From 95def2a247eca54a52744e405e837d5810cca83d Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 28 Aug 2014 19:05:13 -0700 Subject: retro-actively set standalone directory fix, also a fix for directory endless scroll when you hit the end. --- mod/directory.php | 5 +++++ mod/dirsearch.php | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/directory.php b/mod/directory.php index 8dbed4115..39eeb36ce 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -233,6 +233,11 @@ function directory_content(&$a) { } else { + if($_REQUEST['aj']) { + $o = '
    '; + echo $o; + killme(); + } if($a->pager['page'] == 1 && $j['records'] == 0 && strpos($search,'@')) { goaway(z_root() . '/chanview/?f=&address=' . $search); } diff --git a/mod/dirsearch.php b/mod/dirsearch.php index 96e576a19..e292553ad 100644 --- a/mod/dirsearch.php +++ b/mod/dirsearch.php @@ -29,6 +29,7 @@ function dirsearch_content(&$a) { $sql_extra = ''; + $tables = array('name','address','locale','region','postcode','country','gender','marital','sexual','keywords'); if($_REQUEST['query']) { @@ -145,6 +146,11 @@ function dirsearch_content(&$a) { if($hash) $logic = 1; + if($dirmode == DIRECTORY_MODE_STANDALONE) { + $sql_extra .= " and xchan_addr like '%%" . get_app()->get_hostname() . "' "; + } + + $safesql = (($safe > 0) ? " and not ( xchan_flags & " . intval(XCHAN_FLAGS_CENSORED|XCHAN_FLAGS_SELFCENSORED) . " ) " : ''); if($safe < 0) $safesql = " and ( xchan_flags & " . intval(XCHAN_FLAGS_CENSORED|XCHAN_FLAGS_SELFCENSORED) . " ) "; @@ -254,8 +260,8 @@ function dirsearch_content(&$a) { } } } - json_return_and_die($ret); + json_return_and_die($ret); } function dir_query_build($joiner,$field,$s) { -- cgit v1.2.3 From feddf5d7fb1d0cecbad69ecd314af0d106c0a9be Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 28 Aug 2014 22:18:11 -0700 Subject: fix saving of extended profile attributes --- mod/profiles.php | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'mod') diff --git a/mod/profiles.php b/mod/profiles.php index d6df09e9a..1504f55f0 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -254,6 +254,7 @@ function profiles_post(&$a) { // $month = 1; $day = 1; // } + $dob = '0000-00-00'; $dob = sprintf('%04d-%02d-%02d',$year,$month,$day); @@ -264,6 +265,9 @@ function profiles_post(&$a) { $namechanged = true; + + + $pdesc = escape_tags(trim($_POST['pdesc'])); $gender = escape_tags(trim($_POST['gender'])); $address = escape_tags(trim($_POST['address'])); @@ -344,7 +348,41 @@ function profiles_post(&$a) { $with = $orig[0]['with']; } + $profile_fields_basic = get_profile_fields_basic(); + $profile_fields_advanced = get_profile_fields_advanced(); + $advanced = ((feature_enabled(local_user(),'advanced_profiles')) ? true : false); + if($advanced) + $fields = $profile_fields_advanced; + else + $fields = $profile_fields_basic; + $z = q("select * from profdef where true"); + if($z) { + foreach($z as $zz) { + if(array_key_exists($zz['field_name'],$fields)) { + $w = q("select * from profext where channel_id = %d and hash = '%s' and k = '%s' limit 1", + intval(local_user()), + dbesc($orig[0]['profile_guid']), + dbesc($zz['field_name']) + ); + if($w) { + q("update profext set v = '%s' where id = %d limit 1", + dbesc(escape_tags(trim($_POST[$zz['field_name']]))), + intval($w[0]['id']) + ); + } + else { + q("insert into profdef ( channel_id, hash, k, v ) values ( %d, '%s', '%s', '%s') ", + intval(local_user()), + dbesc($orig[0]['profile_guid']), + dbesc($zz['field_name']), + dbesc(escape_tags(trim($_POST[$zz['field_name']]))) + ); + } + } + } + } + $changes = array(); -- cgit v1.2.3 From 0825ec81c130621bdaccba3aa1f627b08c91128e Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 28 Aug 2014 22:27:05 -0700 Subject: except for a typo --- mod/profiles.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'mod') diff --git a/mod/profiles.php b/mod/profiles.php index 1504f55f0..6361f56a3 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -372,7 +372,7 @@ function profiles_post(&$a) { ); } else { - q("insert into profdef ( channel_id, hash, k, v ) values ( %d, '%s', '%s', '%s') ", + q("insert into profext ( channel_id, hash, k, v ) values ( %d, '%s', '%s', '%s') ", intval(local_user()), dbesc($orig[0]['profile_guid']), dbesc($zz['field_name']), @@ -383,8 +383,6 @@ function profiles_post(&$a) { } } - - $changes = array(); $value = ''; if($is_default) { -- cgit v1.2.3 From 88f8900ac52aa1b4bba90d000691dfa311ad2a92 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 29 Aug 2014 17:31:40 -0700 Subject: various diaspora issues --- mod/item.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mod') diff --git a/mod/item.php b/mod/item.php index df51c8a92..c1dd15eb1 100644 --- a/mod/item.php +++ b/mod/item.php @@ -851,6 +851,11 @@ function item_post(&$a) { // NOTREACHED } + if($parent) { + // Store the comment signature information in case we need to relay to Diaspora +//FIXME + store_diaspora_comment_sig($datarray,$channel,$parent_item, $post_id); + } update_remote_id($channel,$post_id,$webpage,$pagetitle,$namespace,$remote_id,$mid); @@ -1312,3 +1317,4 @@ function item_check_service_class($channel_id,$iswebpage) { $ret['success'] = true; return $ret; } + -- cgit v1.2.3 From 393b3bb213ad086f0628418d1511231bedbc370e Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Tue, 2 Sep 2014 01:58:53 +0100 Subject: If you have a new channel (or a new hub searching for an old channel) which uses an xchan_url other than channel or profile, chanview will fail to find $a->poi and fail as there is no way to import the xchan. Instead of giving up and presenting an error, we'll send you to the requested URL anyway. If we send you with a Zid, there's a good chance you'll authenticate because xchans are like glitter - once you've got one, they get everywhere, and there's a good chance you'll know *somebody* at the hub. . --- mod/chanview.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'mod') diff --git a/mod/chanview.php b/mod/chanview.php index 449a98bb1..3bf0f3268 100644 --- a/mod/chanview.php +++ b/mod/chanview.php @@ -74,15 +74,19 @@ function chanview_content(&$a) { } if(! $a->poi) { - notice( t('Channel not found.') . EOL); - return; +// We don't know who this is, and we can't figure it out from the URL +// On the plus side, there's a good chance we know somebody else at that +// hub so sending them there with a Zid will probably work anyway. + $url = ($_REQUEST['url']); + if($observer) + $url = zid($url); } - + if ($a->poi) { $url = $a->poi['xchan_url']; if($observer) $url = zid($url); - + } // let somebody over-ride the iframed viewport presentation // or let's just declare this a failed experiment. @@ -97,4 +101,4 @@ function chanview_content(&$a) { // return $o; -} \ No newline at end of file +} -- cgit v1.2.3 From ab031664facfb640a8a6589fb9abe018549ad173 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Tue, 2 Sep 2014 02:34:04 +0100 Subject: Move achievements on, but just a tad. --- mod/achievements.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'mod') diff --git a/mod/achievements.php b/mod/achievements.php index 1910def73..1d0018b08 100644 --- a/mod/achievements.php +++ b/mod/achievements.php @@ -1,6 +1,9 @@ 1) $which = argv(1); @@ -28,6 +31,9 @@ function achievements_content(&$a) { return; } + $newmembertext = t('Some blurb about what to do when you\'re new here'); + + // By default, all badges are false $contactbadge = false; $profilebadge = false; @@ -70,15 +76,12 @@ function achievements_content(&$a) { if($r) $keywordsbadge = 1; -// FIXME - stick ths in a template, and make it look pretty. - $o .= "Template not implemented"; - $o .= "If this is one, you get the profile badge" . $profilebadge . "
    "; - $o .= "If this is one, you get the contact badge" . $contactbadge . "
    "; - $o .= "If this is one you get the keywords badge" . $keywordsbadge . "
    "; - $o .= "I haven't done the top level posts badge yet" . $toplevelpostsbadge . "
    "; - $o .= "I haven't done the number of channels badge yet" . $channelsbadge; - - -return $o; + return replace_macros(get_markup_template("achievements.tpl"), array( + '$newmembertext' => $newmembertext, + '$profilebadge' => $profilebadge, + '$contactbadge' => $contactbadge, + '$keywordsbadge' => $keywordsbadge, + '$channelsbadge' => $channelsbadge +)); } -- cgit v1.2.3 From 5aa18a11af4ec4d40834abdcc06c2914f9296eb5 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 1 Sep 2014 20:47:01 -0700 Subject: pull in some posts when first connecting to feeds --- mod/follow.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/follow.php b/mod/follow.php index 663fb7536..e480a0964 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -26,10 +26,9 @@ function follow_init(&$a) { // If we can view their stream, pull in some posts - if($result['abook']['abook_their_perms'] & PERMS_R_STREAM) + if(($result['abook']['abook_their_perms'] & PERMS_R_STREAM) || ($result['abook']['xchan_network'] === 'rss')) proc_run('php','include/onepoll.php',$result['abook']['abook_id']); - goaway(z_root() . '/connedit/' . $result['abook']['abook_id'] . '?f=&follow=1'); } -- cgit v1.2.3