From 35edf79abe08bcc1833dc695cb9aebfa5d4a78c0 Mon Sep 17 00:00:00 2001 From: Friendika Date: Sat, 9 Jul 2011 15:06:53 -0700 Subject: [PATCH 01/29] bug #102 --- boot.php | 2 +- mod/parse_url.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/boot.php b/boot.php index 8ff029a5c3..3f64310fc4 100644 --- a/boot.php +++ b/boot.php @@ -4,7 +4,7 @@ set_time_limit(0); ini_set('pcre.backtrack_limit', 250000); -define ( 'FRIENDIKA_VERSION', '2.2.1034' ); +define ( 'FRIENDIKA_VERSION', '2.2.1036' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DB_UPDATE_VERSION', 1075 ); diff --git a/mod/parse_url.php b/mod/parse_url.php index ec28d74111..bf6639b300 100644 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -39,6 +39,12 @@ function parse_url_content(&$a) { killme(); } + if(strpos($s,'')) { + $title = substr($s,strpos($s,'<title>')+7,64); + if(strpos($title,'<') !== false) + $title = substr($title,0,strpos($title,'<')); + } + $config = HTMLPurifier_Config::createDefault(); $config->set('Cache.DefinitionImpl', null); From eb604deff5da8262f4b32e5a7ac70c9991b0284d Mon Sep 17 00:00:00 2001 From: Friendika <info@friendika.com> Date: Sun, 10 Jul 2011 20:46:00 -0700 Subject: [PATCH 02/29] log twitter post result --- addon/twitter/twitter.php | 7 +++++-- boot.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/addon/twitter/twitter.php b/addon/twitter/twitter.php index 1dce9d2f66..7f2b2e1c79 100644 --- a/addon/twitter/twitter.php +++ b/addon/twitter/twitter.php @@ -243,8 +243,11 @@ function twitter_post_hook(&$a,&$b) { $msg .= '... ' . $shortlink; } // and now tweet it :-) - if(strlen($msg)) - $tweet->post('statuses/update', array('status' => $msg)); + if(strlen($msg)) { + $result = $tweet->post('statuses/update', array('status' => $msg)); + logger('twitter_post returns: ' . $result); + } + } } } diff --git a/boot.php b/boot.php index 3f64310fc4..0a98399cd4 100644 --- a/boot.php +++ b/boot.php @@ -4,7 +4,7 @@ set_time_limit(0); ini_set('pcre.backtrack_limit', 250000); -define ( 'FRIENDIKA_VERSION', '2.2.1036' ); +define ( 'FRIENDIKA_VERSION', '2.2.1037' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DB_UPDATE_VERSION', 1075 ); From 2a65d01ce29eff486dcffc47c9d297e1eb7472ea Mon Sep 17 00:00:00 2001 From: Friendika <info@friendika.com> Date: Mon, 11 Jul 2011 17:23:42 -0700 Subject: [PATCH 03/29] several fixes to parse_url --- boot.php | 2 +- mod/parse_url.php | 34 ++++++++++++++++++++++------------ 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/boot.php b/boot.php index 0a98399cd4..ae7d94dac6 100644 --- a/boot.php +++ b/boot.php @@ -4,7 +4,7 @@ set_time_limit(0); ini_set('pcre.backtrack_limit', 250000); -define ( 'FRIENDIKA_VERSION', '2.2.1037' ); +define ( 'FRIENDIKA_VERSION', '2.2.1038' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DB_UPDATE_VERSION', 1075 ); diff --git a/mod/parse_url.php b/mod/parse_url.php index bf6639b300..46c6b46e97 100644 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -13,7 +13,7 @@ function parse_url_content(&$a) { $text = null; - $template = "<a href=\"%s\" >%s</a>\n%s"; + $template = "<br /><a href=\"%s\" >%s</a>%s<br />"; $arr = array('url' => $url, 'text' => ''); @@ -42,7 +42,7 @@ function parse_url_content(&$a) { if(strpos($s,'<title>')) { $title = substr($s,strpos($s,'<title>')+7,64); if(strpos($title,'<') !== false) - $title = substr($title,0,strpos($title,'<')); + $title = strip_tags(substr($title,0,strpos($title,'<'))); } $config = HTMLPurifier_Config::createDefault(); @@ -51,6 +51,8 @@ function parse_url_content(&$a) { $purifier = new HTMLPurifier($config); $s = $purifier->purify($s); +// logger('parse_url: purified: ' . $s, LOGGER_DATA); + $dom = @HTML5_Parser::parse($s); if(! $dom) { @@ -71,21 +73,27 @@ function parse_url_content(&$a) { if($divs) { foreach($divs as $div) { $class = $div->getAttribute('class'); - if($class && stristr($class,'article')) { + if($class && (stristr($class,'article') || stristr($class,'content'))) { $items = $div->getElementsByTagName('p'); if($items) { foreach($items as $item) { - if($item->getElementsByTagName('script')) - continue; $text = $item->textContent; - $text = strip_tags($text); - if(strlen($text) < 100) + if(stristr($text,'<script')) { + $text = ''; continue; + } + $text = strip_tags($text); + if(strlen($text) < 100) { + $text = ''; + continue; + } $text = substr($text,0,250) . '...' ; break; } } } + if($text) + break; } } @@ -93,12 +101,14 @@ function parse_url_content(&$a) { $items = $dom->getElementsByTagName('p'); if($items) { foreach($items as $item) { - if($item->getElementsByTagName('script')) - continue; $text = $item->textContent; - $text = strip_tags($text); - if(strlen($text) < 100) + if(stristr($text,'<script')) continue; + $text = strip_tags($text); + if(strlen($text) < 100) { + $text = ''; + continue; + } $text = substr($text,0,250) . '...' ; break; } @@ -106,7 +116,7 @@ function parse_url_content(&$a) { } if(strlen($text)) { - $text = '<br />' . $text; + $text = '<br /><br />' . $text; } echo sprintf($template,$url,($title) ? $title : $url,$text); From 180c15cdf86172edf58b071149e10af648ec90d4 Mon Sep 17 00:00:00 2001 From: Friendika <info@friendika.com> Date: Mon, 11 Jul 2011 18:28:13 -0700 Subject: [PATCH 04/29] zot scraper --- boot.php | 2 ++ include/Scrape.php | 24 +++++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/boot.php b/boot.php index ae7d94dac6..88d72dec38 100644 --- a/boot.php +++ b/boot.php @@ -89,6 +89,7 @@ define ( 'PAGE_FREELOVE', 3 ); * Network and protocol family types */ +define ( 'NETWORK_ZOT', 'zot!'); // Zot! define ( 'NETWORK_DFRN', 'dfrn'); // Friendika, Mistpark, other DFRN implementations define ( 'NETWORK_OSTATUS', 'stat'); // status.net, identi.ca, GNU-social, other OStatus implementations define ( 'NETWORK_FEED', 'feed'); // RSS/Atom feeds with no known "post/notify" protocol @@ -117,6 +118,7 @@ define ( 'NOTIFY_MAIL', 0x0010 ); * various namespaces we may need to parse */ +define ( 'NAMESPACE_ZOT', 'http://purl.org/macgirvin/zot' ); define ( 'NAMESPACE_DFRN' , 'http://purl.org/macgirvin/dfrn/1.0' ); define ( 'NAMESPACE_THREAD' , 'http://purl.org/syndication/thread/1.0' ); define ( 'NAMESPACE_TOMB' , 'http://purl.org/atompub/tombstones/1.0' ); diff --git a/include/Scrape.php b/include/Scrape.php index fbfec176f8..3599d7df3e 100644 --- a/include/Scrape.php +++ b/include/Scrape.php @@ -300,6 +300,8 @@ function probe_url($url) { if(count($links)) { logger('probe_url: found lrdd links: ' . print_r($links,true), LOGGER_DATA); foreach($links as $link) { + if($link['@attributes']['rel'] === NAMESPACE_ZOT) + $zot = unamp($link['@attributes']['href']); if($link['@attributes']['rel'] === NAMESPACE_DFRN) $dfrn = unamp($link['@attributes']['href']); if($link['@attributes']['rel'] === 'salmon') @@ -379,6 +381,25 @@ function probe_url($url) { } } + if(strlen($zot)) { + $s = fetch_url($zot); + if($s) { + $j = json_decode($s); + if($j) { + $network = NETWORK_ZOT; + $vcard = array( + 'fn' => $j->name, + 'nick' => $j->username, + 'photo' => $j->photo + ); + $profile = $j->url; + $notify = $j->post; + $key = $j->pubkey; + $poll = 'N/A'; + } + } + } + if(strlen($dfrn)) { $ret = scrape_dfrn($dfrn); if(is_array($ret) && x($ret,'dfrn-request')) { @@ -390,7 +411,7 @@ function probe_url($url) { } } - if($network !== NETWORK_DFRN && $network !== NETWORK_MAIL) { + if($network !== NETWORK_ZOT && $network !== NETWORK_DFRN && $network !== NETWORK_MAIL) { $network = NETWORK_OSTATUS; $priority = 0; @@ -549,6 +570,7 @@ function probe_url($url) { $result['priority'] = $priority; $result['network'] = $network; $result['alias'] = $alias; + $result['key'] = $key; logger('probe_url: ' . print_r($result,true), LOGGER_DEBUG); From 55bbe2108abeb69d55eb2fa8a9a472af7b2251b1 Mon Sep 17 00:00:00 2001 From: Friendika <info@friendika.com> Date: Tue, 12 Jul 2011 01:24:07 -0700 Subject: [PATCH 05/29] event ownership from remote feeds messed up, this is one step - may require more --- mod/item.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mod/item.php b/mod/item.php index 8a4f8293c8..f6f665a189 100644 --- a/mod/item.php +++ b/mod/item.php @@ -184,12 +184,10 @@ function item_post(&$a) { if($post_type === 'net-comment') { if($parent_item !== null) { - if($parent_item['type'] === 'remote') { - $post_type = 'remote-comment'; - } - else { + if($parent_item['wall'] == 1) $post_type = 'wall-comment'; - } + else + $post_type = 'remote-comment'; } } From 706b6e8c84be332ff8310fffe13c83e784e46904 Mon Sep 17 00:00:00 2001 From: Friendika <info@friendika.com> Date: Tue, 12 Jul 2011 05:09:07 -0700 Subject: [PATCH 06/29] email notifications not working - unable to change notification settings --- mod/settings.php | 15 +++++---------- view/field_intcheckbox.tpl | 6 ++++++ view/settings.tpl | 10 +++++----- 3 files changed, 16 insertions(+), 15 deletions(-) create mode 100644 view/field_intcheckbox.tpl diff --git a/mod/settings.php b/mod/settings.php index e115556879..844b06a715 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -435,11 +435,6 @@ function settings_content(&$a) { )); - - - - - $invisible = (((! $profile['publish']) && (! $profile['net-publish'])) ? true : false); @@ -527,11 +522,11 @@ function settings_content(&$a) { '$h_not' => t('Notification Settings'), '$lbl_not' => t('Send a notification email when:'), - '$notify1' => array('notify1', t('You receive an introduction'), ($notify & NOTIFY_INTRO), ''), - '$notify2' => array('notify1', t('Your introductions are confirmed'), ($notify & NOTIFY_CONFIRM), ''), - '$notify3' => array('notify1', t('Someone writes on your profile wall'), ($notify & NOTIFY_WALL), ''), - '$notify4' => array('notify1', t('Someone writes a followup comment'), ($notify & NOTIFY_COMMENT), ''), - '$notify5' => array('notify1', t('You receive a private message'), ($notify & NOTIFY_MAIL), ''), + '$notify1' => array('notify1', t('You receive an introduction'), ($notify & NOTIFY_INTRO), NOTIFY_INTRO, ''), + '$notify2' => array('notify2', t('Your introductions are confirmed'), ($notify & NOTIFY_CONFIRM), NOTIFY_CONFIRM, ''), + '$notify3' => array('notify3', t('Someone writes on your profile wall'), ($notify & NOTIFY_WALL), NOTIFY_WALL, ''), + '$notify4' => array('notify4', t('Someone writes a followup comment'), ($notify & NOTIFY_COMMENT), NOTIFY_COMMENT, ''), + '$notify5' => array('notify5', t('You receive a private message'), ($notify & NOTIFY_MAIL), NOTIFY_MAIL, ''), diff --git a/view/field_intcheckbox.tpl b/view/field_intcheckbox.tpl new file mode 100644 index 0000000000..47a513a55e --- /dev/null +++ b/view/field_intcheckbox.tpl @@ -0,0 +1,6 @@ + + <div class='field checkbox'> + <label for='id_$field.0'>$field.1</label> + <input type="checkbox" name='$field.0' id='id_$field.0' value="$field.3" {{ if $field.2 }}checked="true"{{ endif }}> + <span class='field_help'>$field.4</span> + </div> diff --git a/view/settings.tpl b/view/settings.tpl index 5e8b907695..fb35c8e45d 100644 --- a/view/settings.tpl +++ b/view/settings.tpl @@ -82,11 +82,11 @@ $hide_wall <div id="settings-notify-desc">$lbl_not </div> <div class="group"> -{{inc field_checkbox.tpl with $field=$notify1 }}{{endinc}} -{{inc field_checkbox.tpl with $field=$notify2 }}{{endinc}} -{{inc field_checkbox.tpl with $field=$notify3 }}{{endinc}} -{{inc field_checkbox.tpl with $field=$notify4 }}{{endinc}} -{{inc field_checkbox.tpl with $field=$notify5 }}{{endinc}} +{{inc field_intcheckbox.tpl with $field=$notify1 }}{{endinc}} +{{inc field_intcheckbox.tpl with $field=$notify2 }}{{endinc}} +{{inc field_intcheckbox.tpl with $field=$notify3 }}{{endinc}} +{{inc field_intcheckbox.tpl with $field=$notify4 }}{{endinc}} +{{inc field_intcheckbox.tpl with $field=$notify5 }}{{endinc}} </div> From 74a608e1c77ab1d378ed6f09c8d70df3ea61cbca Mon Sep 17 00:00:00 2001 From: Friendika <info@friendika.com> Date: Tue, 12 Jul 2011 23:14:38 -0700 Subject: [PATCH 07/29] openid settings appearing when disabled, don't tag numbers, install admin not getting set --- boot.php | 5 ++++- mod/install.php | 2 +- mod/settings.php | 1 + view/install_db.tpl | 2 +- view/settings.tpl | 3 ++- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/boot.php b/boot.php index 88d72dec38..5f0898a537 100644 --- a/boot.php +++ b/boot.php @@ -4,7 +4,7 @@ set_time_limit(0); ini_set('pcre.backtrack_limit', 250000); -define ( 'FRIENDIKA_VERSION', '2.2.1038' ); +define ( 'FRIENDIKA_VERSION', '2.2.1039' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DB_UPDATE_VERSION', 1075 ); @@ -2058,6 +2058,9 @@ function get_tags($s) { // we might be inside a bbcode color tag - leave it alone continue; } + // ignore strictly numeric tags like #1 + if((strpos($mtch,'#') === 0) && ctype_digit(substr($mtch,1))) + continue; if(substr($mtch,-1,1) === '.') $ret[] = substr($mtch,0,-1); else diff --git a/mod/install.php b/mod/install.php index 301630528b..970ff6af8f 100644 --- a/mod/install.php +++ b/mod/install.php @@ -140,7 +140,7 @@ function install_content(&$a) { '$dbpass' => notags(trim($_POST['dbpass'])), '$dbdata' => notags(trim($_POST['dbdata'])), '$phpath' => $phpath, - '$adminemail' => notags(trim($_POST['adminemail'])) + '$adminmail' => notags(trim($_POST['adminmail'])) )); return $o; diff --git a/mod/settings.php b/mod/settings.php index 844b06a715..1b4098de8f 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -490,6 +490,7 @@ function settings_content(&$a) { '$h_pass' => t('Password Settings'), '$password1'=> array('npassword', t('New Password:'), '', ''), '$password2'=> array('confirm', t('Confirm:'), '', t('Leave password fields blank unless changing')), + '$oid_enable' => (! get_config('system','no_openid')), '$openid' => $openid_field, '$h_basic' => t('Basic Settings'), diff --git a/view/install_db.tpl b/view/install_db.tpl index 6a4d1e2a24..ff4e11ab16 100644 --- a/view/install_db.tpl +++ b/view/install_db.tpl @@ -27,7 +27,7 @@ $lbl_03 $lbl_04 $lbl_05 <div id="install-dbdata-end"></div> <label for="install-admin" id="install-admin-label">$lbl_11</label> -<input type="text" name="adminemail" id="install-admin" value="$adminemail" /> +<input type="text" name="adminmail" id="install-admin" value="$adminmail" /> <div id="install-admin-end"></div> <div id="install-tz-desc"> diff --git a/view/settings.tpl b/view/settings.tpl index fb35c8e45d..b79fbfe43c 100644 --- a/view/settings.tpl +++ b/view/settings.tpl @@ -15,8 +15,9 @@ $nickname_block {{inc field_password.tpl with $field=$password1 }}{{endinc}} {{inc field_password.tpl with $field=$password2 }}{{endinc}} +{{ if $oid_enable }} {{inc field_input.tpl with $field=$openid }}{{endinc}} - +{{ endif }} <div class="settings-submit-wrapper" > <input type="submit" name="submit" class="settings-submit" value="$submit" /> From 7534b8873b7d0e857dbfe4c8085957f8a826ec03 Mon Sep 17 00:00:00 2001 From: Friendika <info@friendika.com> Date: Thu, 14 Jul 2011 03:05:54 -0700 Subject: [PATCH 08/29] link tips on nav bar --- boot.php | 2 +- include/Scrape.php | 4 ++-- include/nav.php | 38 +++++++++++++++++++------------------- view/nav.tpl | 34 +++++++++++++++++----------------- 4 files changed, 39 insertions(+), 39 deletions(-) diff --git a/boot.php b/boot.php index 5f0898a537..6993282016 100644 --- a/boot.php +++ b/boot.php @@ -4,7 +4,7 @@ set_time_limit(0); ini_set('pcre.backtrack_limit', 250000); -define ( 'FRIENDIKA_VERSION', '2.2.1039' ); +define ( 'FRIENDIKA_VERSION', '2.2.1040' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DB_UPDATE_VERSION', 1075 ); diff --git a/include/Scrape.php b/include/Scrape.php index 3599d7df3e..e0075d44d9 100644 --- a/include/Scrape.php +++ b/include/Scrape.php @@ -388,8 +388,8 @@ function probe_url($url) { if($j) { $network = NETWORK_ZOT; $vcard = array( - 'fn' => $j->name, - 'nick' => $j->username, + 'fn' => $j->fullname, + 'nick' => $j->nickname, 'photo' => $j->photo ); $profile = $j->url; diff --git a/include/nav.php b/include/nav.php index 3b15c2b8a9..b3e1aa8e88 100644 --- a/include/nav.php +++ b/include/nav.php @@ -30,7 +30,7 @@ function nav(&$a) { $sitelocation = $myident . substr($a->get_baseurl(),strpos($a->get_baseurl(),'//') + 2 ); - // nav links: array of array('href', 'text', 'extra css classes') + // nav links: array of array('href', 'text', 'extra css classes', 'title') $nav = Array(); /** @@ -38,10 +38,10 @@ function nav(&$a) { */ if(local_user()) { - $nav['logout'] = Array('logout',t('Logout'), ""); + $nav['logout'] = Array('logout',t('Logout'), "", t('End this session')); } else { - $nav['login'] = Array('login',t('Login'), ($a->module == 'login'?'nav-selected':'')); + $nav['login'] = Array('login',t('Login'), ($a->module == 'login'?'nav-selected':''), t('Sign in')); } @@ -52,21 +52,21 @@ function nav(&$a) { $homelink = ((x($_SESSION,'visitor_home')) ? $_SESSION['visitor_home'] : ''); if(($a->module != 'home') && (! (local_user()))) - $nav['home'] = array($homelink, t('Home'), ""); + $nav['home'] = array($homelink, t('Home'), "", t('Home Page')); if(($a->config['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user())) - $nav['register'] = array('register',t('Register'), ""); + $nav['register'] = array('register',t('Register'), "", t('Create an account')); $help_url = $a->get_baseurl() . '/help'; if(! get_config('system','hide_help')) - $nav['help'] = array($help_url, t('Help'), ""); + $nav['help'] = array($help_url, t('Help'), "", t('Help and documentation')); if($a->apps) - $nav['apps'] = array('apps', t('Apps'), ""); + $nav['apps'] = array('apps', t('Apps'), "", t('Addon applications, utilities, games')); - $nav['search'] = array('search', t('Search'), ""); + $nav['search'] = array('search', t('Search'), "", t('Search site content')); $gdirpath = 'directory'; @@ -76,9 +76,9 @@ function nav(&$a) { $gdirpath = $gdir; } elseif(! get_config('system','no_community_page')) - $nav['community'] = array('community', t('Community'), ""); + $nav['community'] = array('community', t('Community'), "", t('Conversations on this site')); - $nav['directory'] = array($gdirpath, t('Directory'), ""); + $nav['directory'] = array($gdirpath, t('Directory'), "", t('People directory')); /** * @@ -88,33 +88,33 @@ function nav(&$a) { if(local_user()) { - $nav['network'] = array('network', t('Network'), ""); + $nav['network'] = array('network', t('Network'), "", t('Conversations from my friends')); - $nav['home'] = array('profile/' . $a->user['nickname'], t('Home'), ""); + $nav['home'] = array('profile/' . $a->user['nickname'], t('Home'), "", t('My posts and conversations')); /* only show friend requests for normal pages. Other page types have automatic friendship. */ if($_SESSION['page_flags'] == PAGE_NORMAL) { - $nav['notifications'] = array('notifications', t('Notifications'), ""); + $nav['notifications'] = array('notifications', t('Notifications'), "", t('Friend requests')); } - $nav['messages'] = array('message', t('Messages'), ""); + $nav['messages'] = array('message', t('Messages'), "", t('Private mail')); if(is_array($a->identities) && count($a->identities) > 1) { - $nav['manage'] = array('manage', t('Manage'), ""); + $nav['manage'] = array('manage', t('Manage'), "", t('Manage other pages')); } - $nav['settings'] = array('settings', t('Settings'),""); - $nav['profiles'] = array('profiles', t('Profiles'),""); - $nav['contacts'] = array('contacts', t('Contacts'),""); + $nav['settings'] = array('settings', t('Settings'),"", t('Account settings')); + $nav['profiles'] = array('profiles', t('Profiles'),"", t('Manage/edit profiles')); + $nav['contacts'] = array('contacts', t('Contacts'),"", t('Manage/edit friends and contacts')); } /** * Admin page */ if (is_site_admin()){ - $nav['admin'] = array('admin/', t('Admin'), ""); + $nav['admin'] = array('admin/', t('Admin'), "", t('Site setup and configuration')); } diff --git a/view/nav.tpl b/view/nav.tpl index 008278dc4b..09a25ac837 100644 --- a/view/nav.tpl +++ b/view/nav.tpl @@ -2,48 +2,48 @@ $langselector <div id="site-location">$sitelocation</div> -{{ if $nav.logout }}<a id="nav-logout-link" class="nav-link $nav.logout.2" href="$nav.logout.0">$nav.logout.1</a> {{ endif }} -{{ if $nav.login }}<a id="nav-login-link" class="nav-login-link $nav.login.2" href="$nav.login.0">$nav.login.1</a> {{ endif }} +{{ if $nav.logout }}<a id="nav-logout-link" class="nav-link $nav.logout.2" href="$nav.logout.0" title="$nav.logout.3" >$nav.logout.1</a> {{ endif }} +{{ if $nav.login }}<a id="nav-login-link" class="nav-login-link $nav.login.2" href="$nav.login.0" title="$nav.login.3" >$nav.login.1</a> {{ endif }} <span id="nav-link-wrapper" > -{{ if $nav.register }}<a id="nav-register-link" class="nav-commlink $nav.register.2" href="$nav.register.0">$nav.register.1</a>{{ endif }} +{{ if $nav.register }}<a id="nav-register-link" class="nav-commlink $nav.register.2" href="$nav.register.0" title="$nav.register.3" >$nav.register.1</a>{{ endif }} -<a id="nav-help-link" class="nav-link $nav.help.2" target="friendika-help" href="$nav.help.0">$nav.help.1</a> +<a id="nav-help-link" class="nav-link $nav.help.2" target="friendika-help" href="$nav.help.0" title="$nav.help.3" >$nav.help.1</a> -{{ if $nav.apps }}<a id="nav-apps-link" class="nav-link $nav.apps.2" href="$nav.apps.0">$nav.apps.1</a>{{ endif }} +{{ if $nav.apps }}<a id="nav-apps-link" class="nav-link $nav.apps.2" href="$nav.apps.0" title="$nav.apps.3" >$nav.apps.1</a>{{ endif }} -<a id="nav-search-link" class="nav-link $nav.search.2" href="$nav.search.0">$nav.search.1</a> -<a id="nav-directory-link" class="nav-link $nav.directory.2" href="$nav.directory.0">$nav.directory.1</a> +<a id="nav-search-link" class="nav-link $nav.search.2" href="$nav.search.0" title="$nav.search.3" >$nav.search.1</a> +<a id="nav-directory-link" class="nav-link $nav.directory.2" href="$nav.directory.0" title="$nav.directory.3" >$nav.directory.1</a> -{{ if $nav.admin }}<a id="nav-admin-link" class="nav-link $nav.admin.2" href="$nav.admin.0">$nav.admin.1</a>{{ endif }} +{{ if $nav.admin }}<a id="nav-admin-link" class="nav-link $nav.admin.2" href="$nav.admin.0" title="$nav.admin.3" >$nav.admin.1</a>{{ endif }} {{ if $nav.network }} -<a id="nav-network-link" class="nav-commlink $nav.network.2" href="$nav.network.0">$nav.network.1</a> +<a id="nav-network-link" class="nav-commlink $nav.network.2" href="$nav.network.0" title="$nav.network.3" >$nav.network.1</a> <span id="net-update" class="nav-ajax-left"></span> {{ endif }} {{ if $nav.home }} -<a id="nav-home-link" class="nav-commlink $nav.home.2" href="$nav.home.0">$nav.home.1</a> +<a id="nav-home-link" class="nav-commlink $nav.home.2" href="$nav.home.0" title="$nav.home.3" >$nav.home.1</a> <span id="home-update" class="nav-ajax-left"></span> {{ endif }} {{ if $nav.community }} -<a id="nav-community-link" class="nav-commlink $nav.community.2" href="$nav.community.0">$nav.community.1</a> +<a id="nav-community-link" class="nav-commlink $nav.community.2" href="$nav.community.0" title="$nav.community.3" >$nav.community.1</a> {{ endif }} {{ if $nav.notifications }} -<a id="nav-notify-link" class="nav-commlink $nav.notifications.2" href="$nav.notifications.0">$nav.notifications.1</a> +<a id="nav-notify-link" class="nav-commlink $nav.notifications.2" href="$nav.notifications.0" title="$nav.notifications.3" >$nav.notifications.1</a> <span id="notify-update" class="nav-ajax-left"></span> {{ endif }} {{ if $nav.messages }} -<a id="nav-messages-link" class="nav-commlink $nav.messages.2" href="$nav.messages.0">$nav.messages.1</a> +<a id="nav-messages-link" class="nav-commlink $nav.messages.2" href="$nav.messages.0" title="$nav.messages.3" >$nav.messages.1</a> <span id="mail-update" class="nav-ajax-left"></span> {{ endif }} -{{ if $nav.manage }}<a id="nav-manage-link" class="nav-commlink $nav.manage.2" href="$nav.manage.0">$nav.manage.1</a>{{ endif }} +{{ if $nav.manage }}<a id="nav-manage-link" class="nav-commlink $nav.manage.2" href="$nav.manage.0" title="$nav.manage.3">$nav.manage.1</a>{{ endif }} -{{ if $nav.settings }}<a id="nav-settings-link" class="nav-link $nav.settings.2" href="$nav.settings.0">$nav.settings.1</a>{{ endif }} -{{ if $nav.profiles }}<a id="nav-profiles-link" class="nav-link $nav.profiles.2" href="$nav.profiles.0">$nav.profiles.1</a>{{ endif }} +{{ if $nav.settings }}<a id="nav-settings-link" class="nav-link $nav.settings.2" href="$nav.settings.0" title="$nav.settings.3">$nav.settings.1</a>{{ endif }} +{{ if $nav.profiles }}<a id="nav-profiles-link" class="nav-link $nav.profiles.2" href="$nav.profiles.0" title="$nav.profiles.3" >$nav.profiles.1</a>{{ endif }} -{{ if $nav.contacts }}<a id="nav-contacts-link" class="nav-link $nav.contacts.2" href="$nav.contacts.0">$nav.contacts.1</a>{{ endif }} +{{ if $nav.contacts }}<a id="nav-contacts-link" class="nav-link $nav.contacts.2" href="$nav.contacts.0" title="$nav.contacts.3" >$nav.contacts.1</a>{{ endif }} </span> <span id="nav-end"></span> <span id="banner">$banner</span> From c8d969e84c06b210001bc6e4cabc646c47077147 Mon Sep 17 00:00:00 2001 From: Friendika <info@friendika.com> Date: Thu, 14 Jul 2011 03:08:48 -0700 Subject: [PATCH 09/29] my -> your --- include/nav.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/nav.php b/include/nav.php index b3e1aa8e88..895c321e6a 100644 --- a/include/nav.php +++ b/include/nav.php @@ -88,9 +88,9 @@ function nav(&$a) { if(local_user()) { - $nav['network'] = array('network', t('Network'), "", t('Conversations from my friends')); + $nav['network'] = array('network', t('Network'), "", t('Conversations from your friends')); - $nav['home'] = array('profile/' . $a->user['nickname'], t('Home'), "", t('My posts and conversations')); + $nav['home'] = array('profile/' . $a->user['nickname'], t('Home'), "", t('Your posts and conversations')); /* only show friend requests for normal pages. Other page types have automatic friendship. */ From ed940288946801cabc6ed715444f23652e3023b1 Mon Sep 17 00:00:00 2001 From: Friendika <info@friendika.com> Date: Thu, 14 Jul 2011 03:38:25 -0700 Subject: [PATCH 10/29] template for statusnet api config.xml --- view/apiconfig.tpl | 67 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 view/apiconfig.tpl diff --git a/view/apiconfig.tpl b/view/apiconfig.tpl new file mode 100644 index 0000000000..71ab241ce0 --- /dev/null +++ b/view/apiconfig.tpl @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<config> + <site> + <name>$sitedesc</name> + <server>$sitename</server> + <theme>default</theme> + <path></path> + <logo>$sitelogo</logo> + + <fancy>true</fancy> + <language>en</language> + <email>$adminemail</email> + <broughtby></broughtby> + <broughtbyurl></broughtbyurl> + <timezone>UTC</timezone> + <closed>$siteclosed</closed> + + <inviteonly>false</inviteonly> + <private>$siteprivate</private> + <textlimit>$textlimit</textlimit> + <ssl>$has_ssl</ssl> + <sslserver>$ssl_server</sslserver> + <shorturllength>30</shorturllength> + +</site> + <license> + <type>cc</type> + <owner></owner> + <url>http://creativecommons.org/licenses/by/3.0/</url> + <title>Creative Commons Attribution 3.0 + http://i.creativecommons.org/l/by/3.0/80x15.png + + + + + + + + + + + + + + + + + false + 20 + 600 + + + + false + INVALID SERVER + 5222 + update + + + StatusNet + + + + false + 0 + + From 2efb59e4396c711c52996296d6717ab05144d8cb Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 14 Jul 2011 15:34:00 -0700 Subject: [PATCH 11/29] make lighttpd patch specific to lighttpd, intros don't work on apache --- boot.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/boot.php b/boot.php index 6993282016..2bd7830d7d 100644 --- a/boot.php +++ b/boot.php @@ -4,7 +4,7 @@ set_time_limit(0); ini_set('pcre.backtrack_limit', 250000); -define ( 'FRIENDIKA_VERSION', '2.2.1040' ); +define ( 'FRIENDIKA_VERSION', '2.2.1041' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DB_UPDATE_VERSION', 1075 ); @@ -758,11 +758,13 @@ function post_url($url,$params, $headers = null, &$redirects = 0) { $curl_time = intval(get_config('system','curl_timeout')); curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60)); - if(!is_array($headers)) { - $headers = array('Expect:'); - } else { - if(!in_array('Expect:', $headers)) { - array_push($headers, 'Expect:'); + if(defined('LIGHTTPD')) { + if(!is_array($headers)) { + $headers = array('Expect:'); + } else { + if(!in_array('Expect:', $headers)) { + array_push($headers, 'Expect:'); + } } } From 69f4db9e1229e9dacd0d71ecd3ac13c1647bc36d Mon Sep 17 00:00:00 2001 From: Friendika Date: Fri, 15 Jul 2011 03:08:43 -0700 Subject: [PATCH 12/29] zot stuff --- boot.php | 7 ++ include/Scrape.php | 4 +- include/zotfns.php | 192 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 201 insertions(+), 2 deletions(-) create mode 100644 include/zotfns.php diff --git a/boot.php b/boot.php index 2bd7830d7d..9866077d23 100644 --- a/boot.php +++ b/boot.php @@ -104,6 +104,13 @@ define ( 'NETWORK_FACEBOOK', 'face'); // Facebook API define ( 'MAX_LIKERS', 75); +/** + * Communication timeout + */ + +define ( 'ZCURL_TIMEOUT' , (-1)); + + /** * email notification options */ diff --git a/include/Scrape.php b/include/Scrape.php index e0075d44d9..6726d0b151 100644 --- a/include/Scrape.php +++ b/include/Scrape.php @@ -394,7 +394,7 @@ function probe_url($url) { ); $profile = $j->url; $notify = $j->post; - $key = $j->pubkey; + $pubkey = $j->pubkey; $poll = 'N/A'; } } @@ -570,7 +570,7 @@ function probe_url($url) { $result['priority'] = $priority; $result['network'] = $network; $result['alias'] = $alias; - $result['key'] = $key; + $result['pubkey'] = $pubkey; logger('probe_url: ' . print_r($result,true), LOGGER_DEBUG); diff --git a/include/zotfns.php b/include/zotfns.php new file mode 100644 index 0000000000..a95a064cd1 --- /dev/null +++ b/include/zotfns.php @@ -0,0 +1,192 @@ + $v) { + if($argstr) + $argstr .= '&'; + $argstr .= $k . '=' . $v; + } + $s = fetch_url($url . '?' . $argstr); + if($s) { + $j = json_decode($s); + if($j) + return($j); + } + return false; +} + +function zot_post($url,$args) { + $s = post_url($url,$args); + if($s) { + $j = json_decode($s); + if($j) + return($j); + } + return false; +} + + +function zot_prv_encode($s,$prvkey) { + $x = ''; + $res = openssl_private_encrypt($s,$x,$prvkey); + return base64url_encode($y); +} +function zot_pub_encode($s,$pubkey) { + $x = ''; + $res = openssl_public_encrypt($s,$x,$pubkey); + return base64url_encode($x); +} + +function zot_prv_decode($s,$prvkey) { + $s = base64url_decode($s); + $x = ''; + openssl_private_decrypt($s,$x,$prvkey); + return $x; +} + +function zot_pub_decode($s,$pubkey) { + $s = base64url_decode($s); + $x = ''; + openssl_public_decrypt($s,$x,$pubkey); + return $x; +} + + +function zot_getzid($url,$myaddress,$myprvkey) { + $ret = array(); + $j = zot_get($url,array('sender' => $myaddress)); + if($j->zid_encoded) + $ret['zid'] = zot_prv_decode($j->zid_encoded,$myprvkey); + if($j->zkey_encoded) + $ret['zkey'] = zot_prv_decode($j->zkey_encoded,$myprvkey); + return $ret; +} + +function zot_post_init($url,$zid,$myprvkey,$theirpubkey) { + $ret = array(); + + $zinit = random_string(32); + + $j = zot_get($url,array('zid' => $zid,'zinit' => $zinit)); + + $a = get_app(); + if(! $a->get_curl_code()) + return ZCURL_TIMEOUT; + if(! $j->zinit) { + logger('zot_post_init: no zinit returned.'); + return false; + } + if(zot_pub_decode($j->zinit,$thierpubkey) !== $zinit) { + logger('zot_post_init: incorrect zinit returned.'); + return false; + } + + if($j->challenge) { + $s = zot_prv_decode($j->challenge,$myprvkey); + $s1 = substr($s,0,strpos($s,'.')); + if($s1 != $zid) { + logger("zot_post_init: incorrect zid returned"); + return false; + } + $ret['result'] = substr($s,strpos($s,'.') + 1); + $ret['perms'] = $j->perms; + } + return $ret; +} + + +function zot_encrypt_data($data,&$key) { + $key = random_string(); + return aes_encrypt($data,$key); +} + + +// encrypt the data prior to calling this function so it only need be done once per message +// regardless of the number of recipients. + +function zot_post_data($url,$zid,$myprvkey,$theirpubkey,$encrypted_data,$key, $intro = false) { + $i = zot_post_init($url,$zid,$myprvkey,$theirpubkey); + if($i === ZCURL_TIMEOUT) + return ZCURL_TIMEOUT; + + if((! $i) || (! array_key_exists('perms',$i)) || (! array_key_exists('result',$i))) + return false; + if((! stristr($i['perms'],'post')) && ($intro === false)) { + logger("zot_post_data: no permission to post: url=$url zid=$zid"); + return false; + } + $p = array(); + $p['zid'] = $zid; + $p['result'] = zot_pub_encode($i['result'],$theirpubkey); + $p['aes_key'] = zot_prv_encode($key,$myprvkey); + $p['data'] = $encrypted_data; + $s = zot_post($url,$p); + $a = get_app(); + if(! $a->get_curl_code()) + return ZCURL_TIMEOUT; + + if($s) { + $j = json_decode($s); + return $j; + } + return false; +} + +function zot_deliver($recipients,$myprvkey,$data) { + + if(is_array($recipients) && count($recipients)) { + + $key = ''; + $encrypted = zot_encrypt_data($data,$key); + + + foreach($recipients as $r) { + $result = zot_post_data( + $r['post'], + $r['zid'], + $myprvkey, + $r['pubkey'], + $encrypted, + $key + ); + if($result === false) { + // post failed + logger('zot_deliver: failed: ' . print_r($r,true)); + } + elseif($result === ZCURL_TIMEOUT) { + // queue for redelivery + } + elseif($result->error) { + // failed at other end + logger('zot_deliver: remote failure: ' . $result->error . ' ' . print_r($r,true)); + } + elseif($result->success) { + logger('zot_deliver: success ' . print_r($r,true, LOGGER_DEBUG)); + } + else + logger('zot_deliver: unknown failure.'); + } + } +} + + +function zot_new_contact($user,$cc) { + + $zid = random_string(32); + $zkey = random_string(32); + + logger("zot_new_contact: zid=$zid zkey=$zkey uid={$user['uid']} " . print_r($cc,true)); + + $ret = array(); + $ret['zid_encoded'] = zot_pub_encode($zid,$cc['pubkey']); + $ret['zkey_encoded'] = zot_pub_encode($zkey,$cc['pubkey']); + return $ret; + + + + + +} \ No newline at end of file From 542585f62e070aa096685a7bd834501d8433ec83 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 15 Jul 2011 21:43:23 +0200 Subject: [PATCH 13/29] fix for login problems with StatusNet --- addon/statusnet/statusnet.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addon/statusnet/statusnet.php b/addon/statusnet/statusnet.php index 9357b0ebd9..63cdd28df6 100644 --- a/addon/statusnet/statusnet.php +++ b/addon/statusnet/statusnet.php @@ -260,7 +260,7 @@ function statusnet_settings(&$a,&$s) { $s .= ''; $s .= ''; $s .= '
'; - $s .= '
'; + $s .= '
'; $s .= '

'.t('Cancel Connection Process').'

'; $s .= '
'; $s .= '

'.t('Current StatusNet API is').': '.$api.'

'; From d31f7203857ff96b7ffd2350a5aea9dd73e92de1 Mon Sep 17 00:00:00 2001 From: Friendika Date: Fri, 15 Jul 2011 15:20:16 -0700 Subject: [PATCH 14/29] revup --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot.php b/boot.php index 9866077d23..634c2b926d 100644 --- a/boot.php +++ b/boot.php @@ -4,7 +4,7 @@ set_time_limit(0); ini_set('pcre.backtrack_limit', 250000); -define ( 'FRIENDIKA_VERSION', '2.2.1041' ); +define ( 'FRIENDIKA_VERSION', '2.2.1042' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DB_UPDATE_VERSION', 1075 ); From 2f0ab97fd75c269b77dd7164a6ab96394f1bc0ec Mon Sep 17 00:00:00 2001 From: Friendika Date: Sat, 16 Jul 2011 15:57:47 -0700 Subject: [PATCH 15/29] header fix post_url --- boot.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/boot.php b/boot.php index 634c2b926d..6a622dbc0e 100644 --- a/boot.php +++ b/boot.php @@ -4,7 +4,7 @@ set_time_limit(0); ini_set('pcre.backtrack_limit', 250000); -define ( 'FRIENDIKA_VERSION', '2.2.1042' ); +define ( 'FRIENDIKA_VERSION', '2.2.1043' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DB_UPDATE_VERSION', 1075 ); @@ -774,8 +774,8 @@ function post_url($url,$params, $headers = null, &$redirects = 0) { } } } - - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + if($headers) + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $check_cert = get_config('system','verifyssl'); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false)); From 944f03d3675779e32a6ed8bed28609ca59a66554 Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 17 Jul 2011 03:34:16 -0700 Subject: [PATCH 16/29] change license --- LICENSE | 42 ------------------------------------------ mod/friendika.php | 1 - 2 files changed, 43 deletions(-) delete mode 100644 LICENSE diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 1bb0861466..0000000000 --- a/LICENSE +++ /dev/null @@ -1,42 +0,0 @@ -* Friendika -* Copyright (c) 2010, 2011 Mike Macgirvin -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of Friendika nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY Mike Macgirvin ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL Mike Macgirvin BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Friendika incorporates other software which may be licensed under different -terms and conditions. Some system libraries which are supplied with and -incorporated into Friendika were provided by their respective authors under -the LGPL (Lesser GNU Public License) and may result in legal encumberance if -you make any code changes to these libraries. - -Addon or "plugin" modules (projects by other authors and fully contained within -the 'addon' and 'theme' directories) are licensed under terms provided by the -respective software author or authors of those works, and MAY include copyleft -licenses such as GPLv3, AGPL, and/or commercial licenses. For the purposes of -licensing, addon modules and themes are considered separate standalone works, -where the "work as a whole" is defined as the embodiment of the theme or -addon module. - - - diff --git a/mod/friendika.php b/mod/friendika.php index 8c034c4acc..753a9f478f 100644 --- a/mod/friendika.php +++ b/mod/friendika.php @@ -39,7 +39,6 @@ function friendika_content(&$a) { $o .= '

'; - $o .= 'View License' . '

'; $o .= t('This is Friendika version') . ' ' . FRIENDIKA_VERSION . ' '; $o .= t('running at web location') . ' ' . $a->get_baseurl() . '

'; From 43110db749850e49d309ad8b3e72266bd373a2a8 Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 17 Jul 2011 16:08:47 -0700 Subject: [PATCH 17/29] begin invites, fb setup changes --- addon/facebook/README | 2 ++ addon/facebook/facebook.php | 3 +++ boot.php | 2 +- doc/Installing-Connectors.md | 4 ++++ include/zotfns.php | 2 -- mod/contacts.php | 17 +++++++++++++-- mod/invite.php | 40 +++++++++++++++++++++++++++++++++--- 7 files changed, 62 insertions(+), 8 deletions(-) diff --git a/addon/facebook/README b/addon/facebook/README index 42ec01383c..19c5948866 100644 --- a/addon/facebook/README +++ b/addon/facebook/README @@ -15,6 +15,8 @@ Installing the Friendika/Facebook connector $a->config['facebook']['appid'] = 'xxxxxxxxxxx'; $a->config['facebook']['appsecret'] = 'xxxxxxxxxxxxxxx'; Replace with the settings Facebook gives you. + d. Navigate to Set Web->Site URL & Domain -> Website Settings. Set Site URL + to yoursubdomain.yourdomain.com. Set Site Domain to your yourdomain.com. 2. Enable the facebook plugin by including it in .htconfig.php - e.g. $a->config['system']['addon'] = 'plugin1,plugin2,facebook'; 3. Visit the Facebook Settings section of the "Settings->Plugin Settings" page. diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php index c54d5b5f09..73518afb2d 100644 --- a/addon/facebook/facebook.php +++ b/addon/facebook/facebook.php @@ -23,6 +23,9 @@ * $a->config['facebook']['appid'] = 'xxxxxxxxxxx'; * $a->config['facebook']['appsecret'] = 'xxxxxxxxxxxxxxx'; * Replace with the settings Facebook gives you. + * d. Navigate to Set Web->Site URL & Domain -> Website Settings. Set + * Site URL to yoursubdomain.yourdomain.com. Set Site Domain to your + * yourdomain.com. * 2. Enable the facebook plugin by including it in .htconfig.php - e.g. * $a->config['system']['addon'] = 'plugin1,plugin2,facebook'; * 3. Visit the Facebook Settings section of the "Settings->Plugin Settings" page. diff --git a/boot.php b/boot.php index 6a622dbc0e..af510a808b 100644 --- a/boot.php +++ b/boot.php @@ -4,7 +4,7 @@ set_time_limit(0); ini_set('pcre.backtrack_limit', 250000); -define ( 'FRIENDIKA_VERSION', '2.2.1043' ); +define ( 'FRIENDIKA_VERSION', '2.2.1044' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DB_UPDATE_VERSION', 1075 ); diff --git a/doc/Installing-Connectors.md b/doc/Installing-Connectors.md index e43f17fe3c..c8fc8e7905 100644 --- a/doc/Installing-Connectors.md +++ b/doc/Installing-Connectors.md @@ -129,6 +129,10 @@ $a->config['facebook']['appsecret'] = 'xxxxxxxxxxxxxxx'; Replace with the settings Facebook gives you. +d. Navigate to Set Web->Site URL & Domain -> Website Settings. Set Site URL +to yoursubdomain.yourdomain.com. Set Site Domain to your yourdomain.com. + + Visit the Facebook Settings section of the "Settings->Plugin Settings" page. and click 'Install Facebook Connector'. diff --git a/include/zotfns.php b/include/zotfns.php index a95a064cd1..1ec39aefca 100644 --- a/include/zotfns.php +++ b/include/zotfns.php @@ -1,7 +1,5 @@ $v) { diff --git a/mod/contacts.php b/mod/contacts.php index 7a97b53d23..388bf08e63 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -3,13 +3,26 @@ require_once('include/Contact.php'); function contacts_init(&$a) { + if(! local_user()) + return; + require_once('include/group.php'); if(! x($a->page,'aside')) $a->page['aside'] = ''; $a->page['aside'] .= group_side(); - if($a->config['register_policy'] != REGISTER_CLOSED) - $a->page['aside'] .= '

'; + $inv = ''; + + if(get_config('system','invitations_only')) { + $x = get_pconfig(local_user(),'system','invites_remaining'); + if($x || is_site_admin()) { + $a->page['aside'] .= '' . $inv; + } + } + elseif($a->config['register_policy'] != REGISTER_CLOSED) + $a->page['aside'] .= $inv; $a->page['aside'] .= '