]> git.mxchange.org Git - friendica.git/commitdiff
Merge remote-tracking branch 'upstream/develop' into 1501-central-item-storage
authorMichael Vogel <icarus@dabo.de>
Sun, 1 Feb 2015 12:28:32 +0000 (13:28 +0100)
committerMichael Vogel <icarus@dabo.de>
Sun, 1 Feb 2015 12:28:32 +0000 (13:28 +0100)
boot.php
include/acl_selectors.php
include/api.php
include/text.php
mod/contacts.php
mod/display.php
mod/viewcontacts.php
util/vagrant_provision.sh
view/templates/admin_summary.tpl

index e9e0fd360a622c38b17950c38de9c363d036e394..dd6bc6ac5d6f6c58b9fcb7ca28a0c7898dcde193 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -16,7 +16,7 @@ require_once('include/dbstructure.php');
 
 define ( 'FRIENDICA_PLATFORM',     'Friendica');
 define ( 'FRIENDICA_CODENAME',     'Ginger');
-define ( 'FRIENDICA_VERSION',      '3.3.2' );
+define ( 'FRIENDICA_VERSION',      '3.3.3-RC' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.23'    );
 define ( 'DB_UPDATE_VERSION',      1178      );
 define ( 'EOL',                    "<br />\r\n"     );
index 613713630590c7ee761ccf7e8f7027c3f9d637d2..668544b0bcf8df71afd51cc7628a466078157e4c 100644 (file)
@@ -2,13 +2,14 @@
 
 require_once("include/contact_selectors.php");
 require_once("include/features.php");
+require_once("mod/proxy.php");
 
 /**
- * 
+ *
  */
 
 /**
- * @package acl_selectors 
+ * @package acl_selectors
  */
 function group_select($selname,$selclass,$preselected = false,$size = 4) {
 
@@ -245,7 +246,7 @@ function prune_deadguys($arr) {
        $r = q("select id from contact where id in ( " . $str . ") and blocked = 0 and pending = 0 and archive = 0 ");
        if($r) {
                $ret = array();
-               foreach($r as $rr) 
+               foreach($r as $rr)
                        $ret[] = intval($rr['id']);
                return $ret;
        }
@@ -257,7 +258,7 @@ function get_acl_permissions($user = null) {
        $allow_cid = $allow_gid = $deny_cid = $deny_gid = false;
 
        if(is_array($user)) {
-               $allow_cid = ((strlen($user['allow_cid'])) 
+               $allow_cid = ((strlen($user['allow_cid']))
                        ? explode('><', $user['allow_cid']) : array() );
                $allow_gid = ((strlen($user['allow_gid']))
                        ? explode('><', $user['allow_gid']) : array() );
@@ -417,21 +418,21 @@ function acl_lookup(&$a, $out_type = 'json') {
        }
 
        if ($type=='' || $type=='c'){
-               $r = q("SELECT COUNT(*) AS c FROM `contact` 
-                               WHERE `uid` = %d AND `self` = 0 
+               $r = q("SELECT COUNT(*) AS c FROM `contact`
+                               WHERE `uid` = %d AND `self` = 0
                                AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0
                                AND `notify` != '' $sql_extra2" ,
                        intval(local_user())
                );
                $contact_count = (int)$r[0]['c'];
-       } 
+       }
        elseif ($type == 'm') {
 
                // autocomplete for Private Messages
 
-               $r = q("SELECT COUNT(*) AS c FROM `contact` 
-                               WHERE `uid` = %d AND `self` = 0 
-                               AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0 
+               $r = q("SELECT COUNT(*) AS c FROM `contact`
+                               WHERE `uid` = %d AND `self` = 0
+                               AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0
                                AND `network` IN ('%s','%s','%s') $sql_extra2" ,
                        intval(local_user()),
                        dbesc(NETWORK_DFRN),
@@ -445,8 +446,8 @@ function acl_lookup(&$a, $out_type = 'json') {
 
                // autocomplete for Contacts
 
-               $r = q("SELECT COUNT(*) AS c FROM `contact` 
-                               WHERE `uid` = %d AND `self` = 0 
+               $r = q("SELECT COUNT(*) AS c FROM `contact`
+                               WHERE `uid` = %d AND `self` = 0
                                AND `pending` = 0 $sql_extra2" ,
                        intval(local_user())
                );
@@ -455,22 +456,22 @@ function acl_lookup(&$a, $out_type = 'json') {
        } else {
                $contact_count = 0;
        }
-       
-       
+
+
        $tot = $group_count+$contact_count;
-       
+
        $groups = array();
        $contacts = array();
-       
+
        if ($type=='' || $type=='g'){
-               
+
                $r = q("SELECT `group`.`id`, `group`.`name`, GROUP_CONCAT(DISTINCT `group_member`.`contact-id` SEPARATOR ',') as uids
-                               FROM `group`,`group_member` 
-                               WHERE `group`.`deleted` = 0 AND `group`.`uid` = %d 
+                               FROM `group`,`group_member`
+                               WHERE `group`.`deleted` = 0 AND `group`.`uid` = %d
                                        AND `group_member`.`gid`=`group`.`id`
                                        $sql_extra
                                GROUP BY `group`.`id`
-                               ORDER BY `group`.`name` 
+                               ORDER BY `group`.`name`
                                LIMIT %d,%d",
                        intval(local_user()),
                        intval($start),
@@ -478,7 +479,7 @@ function acl_lookup(&$a, $out_type = 'json') {
                );
 
                foreach($r as $g){
-//             logger('acl: group: ' . $g['name'] . ' members: ' . $g['uids']);                
+//             logger('acl: group: ' . $g['name'] . ' members: ' . $g['uids']);
                        $groups[] = array(
                                "type"  => "g",
                                "photo" => "images/twopeople.png",
@@ -490,10 +491,10 @@ function acl_lookup(&$a, $out_type = 'json') {
                        );
                }
        }
-       
+
        if ($type=='' || $type=='c'){
-       
-               $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, forum FROM `contact` 
+
+               $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, forum FROM `contact`
                        WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0 AND `notify` != ''
                        $sql_extra2
                        ORDER BY `name` ASC ",
@@ -501,7 +502,7 @@ function acl_lookup(&$a, $out_type = 'json') {
                );
        }
        elseif($type == 'm') {
-               $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag` FROM `contact` 
+               $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag` FROM `contact`
                        WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0
                        AND `network` IN ('%s','%s','%s')
                        $sql_extra2
@@ -513,7 +514,7 @@ function acl_lookup(&$a, $out_type = 'json') {
                );
        }
        elseif($type == 'a') {
-               $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag` FROM `contact` 
+               $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag` FROM `contact`
                        WHERE `uid` = %d AND `pending` = 0
                        $sql_extra2
                        ORDER BY `name` ASC ",
@@ -533,7 +534,7 @@ function acl_lookup(&$a, $out_type = 'json') {
                $x['data'] = array();
                if(count($r)) {
                        foreach($r as $g) {
-                               $x['photos'][] = $g['micro'];
+                               $x['photos'][] = proxy_url($g['micro']);
                                $x['links'][] = $g['url'];
                                $x['suggestions'][] = $g['name'];
                                $x['data'][] = intval($g['id']);
@@ -547,7 +548,7 @@ function acl_lookup(&$a, $out_type = 'json') {
                foreach($r as $g){
                        $contacts[] = array(
                                "type"  => "c",
-                               "photo" => $g['micro'],
+                               "photo" => proxy_url($g['micro']),
                                "name"  => $g['name'],
                                "id"    => intval($g['id']),
                                "network" => $g['network'],
@@ -555,28 +556,28 @@ function acl_lookup(&$a, $out_type = 'json') {
                                "nick" => ($g['attag']) ? $g['attag'] : $g['nick'],
                                "forum" => $g['forum']
                        );
-               }                       
+               }
        }
-               
+
        $items = array_merge($groups, $contacts);
 
        if ($conv_id) {
-               /* if $conv_id is set, get unknow contacts in thread */ 
+               /* if $conv_id is set, get unknow contacts in thread */
                /* but first get know contacts url to filter them out */
                function _contact_link($i){ return dbesc($i['link']); }
                $known_contacts = array_map(_contact_link, $contacts);
                $unknow_contacts=array();
-               $r = q("select 
+               $r = q("select
                                        `author-avatar`,`author-name`,`author-link`
                                from item where parent=%d
                                and (
                                        `author-name` LIKE '%%%s%%' OR
                                        `author-link` LIKE '%%%s%%'
-                               ) and 
+                               ) and
                                `author-link` NOT IN ('%s')
                                GROUP BY `author-link`
                                ORDER BY `author-name` ASC
-                               ", 
+                               ",
                                intval($conv_id),
                                dbesc($search),
                                dbesc($search),
@@ -592,7 +593,7 @@ function acl_lookup(&$a, $out_type = 'json') {
                                // /nickname
                                $unknow_contacts[] = array(
                                        "type"  => "c",
-                                       "photo" => $row['author-avatar'],
+                                       "photo" => proxy_url($row['author-avatar']),
                                        "name"  => $row['author-name'],
                                        "id"    => '',
                                        "network" => "unknown",
@@ -617,14 +618,14 @@ function acl_lookup(&$a, $out_type = 'json') {
                );
                return $o;
        }
-       
+
        $o = array(
                'tot'   => $tot,
                'start' => $start,
                'count' => $count,
                'items' => $items,
        );
-       
+
        echo json_encode($o);
 
        killme();
index 7cff2af5f3cf1efcbcf24fdc2cc85d95fc275ec3..2d3c31af0c3f7a32209d702d2d8dd315d619541e 100644 (file)
 
 
                $user_info = api_get_user($a);
-               $ret = api_format_items($item,$user_info)[0];
+               $rets = api_format_items($item,$user_info);
+               $ret = $rets[0];
 
                $data = array('$status' => $ret);
                switch($type){
index 9fef4aebb59f761ae4bd81aadd342f5d8eaefc86..b45c2765eb378547e3f7f1ff7c4a2093d9b74331 100644 (file)
@@ -2,6 +2,7 @@
 
 require_once("include/template_processor.php");
 require_once("include/friendica_smarty.php");
+require_once("mod/proxy.php");
 
 if(! function_exists('replace_macros')) {
 /**
@@ -928,7 +929,7 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) {
                        . (($click) ? ' fakelink' : '') . '" '
                        . (($redir) ? ' target="redir" ' : '')
                        . (($url) ? ' href="' . $url . '"' : '') . $click . ' ><img class="contact-block-img' . $class . $sparkle . '" src="'
-                       . $contact['micro'] . '" title="' . $contact['name'] . ' [' . $contact['url'] . ']" alt="' . $contact['name']
+                       . proxy_url($contact['micro']) . '" title="' . $contact['name'] . ' [' . $contact['url'] . ']" alt="' . $contact['name']
                        . '" /></a></div>' . "\r\n";
        }
 }}
index 047dc1ea90951c9a2cd79c6dacaa5437523f5669..300331a9dcdf19be1f09e992691ca3b3aa98f7f9 100644 (file)
@@ -3,6 +3,7 @@
 require_once('include/Contact.php');
 require_once('include/socgraph.php');
 require_once('include/contact_selectors.php');
+require_once('mod/proxy.php');
 
 function contacts_init(&$a) {
        if(! local_user())
@@ -73,12 +74,12 @@ function contacts_init(&$a) {
 function contacts_batch_actions(&$a){
        $contacts_id = $_POST['contact_batch'];
        if (!is_array($contacts_id)) return;
-       
+
        $orig_records = q("SELECT * FROM `contact` WHERE `id` IN (%s) AND `uid` = %d AND `self` = 0",
                implode(",", $contacts_id),
                intval(local_user())
        );
-       
+
        $count_actions=0;
        foreach($orig_records as $orig_record) {
                $contact_id = $orig_record['id'];
@@ -106,7 +107,7 @@ function contacts_batch_actions(&$a){
        if ($count_actions>0) {
                info ( sprintf( tt("%d contact edited.", "%d contacts edited", $count_actions), $count_actions) );
        }
-       
+
        if(x($_SESSION,'return_url'))
                goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']);
        else
@@ -623,11 +624,11 @@ function contacts_content(&$a) {
 
        if($nets)
                $sql_extra .= sprintf(" AND network = '%s' ", dbesc($nets));
-       $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` 
+       $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`
                WHERE `uid` = %d AND `self` = 0 AND `pending` = 0 $sql_extra $sql_extra2 ",
                intval($_SESSION['uid']));
        if(count($r)) {
@@ -681,7 +682,7 @@ function contacts_content(&$a) {
                                'id' => $rr['id'],
                                'alt_text' => $alt_text,
                                'dir_icon' => $dir_icon,
-                               'thumb' => $rr['thumb'],
+                               'thumb' => proxy_url($rr['thumb']),
                                'name' => $rr['name'],
                                'username' => $rr['name'],
                                'sparkle' => $sparkle,
index 217e0685be63c166c004f965eeb5fc9bbc1f7d86..f483977cd4f847aebc639bbe93a4f85a499b921d 100644 (file)
@@ -106,8 +106,8 @@ function display_fetchauthor($a, $item) {
                normalise_link($profiledata["url"]), $item["uid"]);
        if (count($r)) {
                $profiledata["photo"] = proxy_url($r[0]["photo"]);
-               $profiledata["address"] = bbcode($r[0]["location"]);
-               $profiledata["about"] = bbcode($r[0]["about"]);
+               $profiledata["address"] = proxy_parse_html(bbcode($r[0]["location"]));
+               $profiledata["about"] = proxy_parse_html(bbcode($r[0]["about"]));
                if ($r[0]["nick"] != "")
                        $profiledata["nickname"] = $r[0]["nick"];
        }
@@ -118,9 +118,9 @@ function display_fetchauthor($a, $item) {
                if ($profiledata["photo"] == "")
                        $profiledata["photo"] = proxy_url($r[0]["avatar"]);
                if ($profiledata["address"] == "")
-                       $profiledata["address"] = bbcode($r[0]["location"]);
+                       $profiledata["address"] = proxy_parse_html(bbcode($r[0]["location"]));
                if ($profiledata["about"] == "")
-                       $profiledata["about"] = bbcode($r[0]["about"]);
+                       $profiledata["about"] = proxy_parse_html(bbcode($r[0]["about"]));
                if (($profiledata["nickname"] == "") AND ($r[0]["nick"] != ""))
                        $profiledata["nickname"] = $r[0]["nick"];
        }
@@ -184,8 +184,8 @@ function display_fetchauthor($a, $item) {
                        $r = q("SELECT `avatar`, `nick`, `location`, `about` FROM `unique_contacts` WHERE `url` = '%s'", normalise_link($profiledata["url"]));
                        if (count($r)) {
                                $profiledata["photo"] = proxy_url($r[0]["avatar"]);
-                               $profiledata["address"] = bbcode($r[0]["location"]);
-                               $profiledata["about"] = bbcode($r[0]["about"]);
+                               $profiledata["address"] = proxy_parse_html(bbcode($r[0]["location"]));
+                               $profiledata["about"] = proxy_parse_html(bbcode($r[0]["about"]));
                                if ($r[0]["nick"] != "")
                                        $profiledata["nickname"] = $r[0]["nick"];
                        }
index 8e261e71151d1e23e706ceabd89026779caa45c7..3a6c48a3b2fab619688999c7e751796785ce2456 100644 (file)
@@ -13,6 +13,8 @@ function viewcontacts_init(&$a) {
 
 function viewcontacts_content(&$a) {
 
+       require_once("mod/proxy.php");
+
        if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
                notice( t('Public access denied.') . EOL);
                return;
@@ -21,7 +23,7 @@ function viewcontacts_content(&$a) {
        if(((! count($a->profile)) || ($a->profile['hide-friends']))) {
                notice( t('Permission denied.') . EOL);
                return;
-       } 
+       }
 
 
        $r = q("SELECT COUNT(*) as `total` FROM `contact` WHERE `uid` = %d AND `blocked` = 0 AND `pending` = 0 AND `hidden` = 0 AND `archive` = 0 ",
@@ -60,7 +62,7 @@ function viewcontacts_content(&$a) {
                $contacts[] = array(
                        'id' => $rr['id'],
                        'img_hover' => sprintf( t('Visit %s\'s profile [%s]'), $rr['name'], $rr['url']),
-                       'thumb' => $rr['thumb'], 
+                       'thumb' => proxy_url($rr['thumb']),
                        'name' => substr($rr['name'],0,20),
                        'username' => $rr['name'],
                        'url' => $url,
index 9988f36256ecc61eac5b31bef889bc55278dcdc8..cd9f632deacd8166b46491208c6b105951262fd1 100644 (file)
@@ -63,6 +63,13 @@ SQL="${Q1}${Q2}"
 $MYSQL -uroot -proot -e "$SQL"
 service mysql restart
 
+#configure rudimentary mail server (local delivery only)
+#add Friendica accounts for local user accounts, use email address like vagrant@friendica.dev, read the email with 'mail'.
+debconf-set-selections <<< "postfix postfix/mailname string friendica.dev"
+debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Local Only'"
+apt-get install -y postfix
+apt-get install mailutils
+
 #make the vagrant directory the docroot
 sudo rm -rf /var/www/
 sudo ln -fs /vagrant /var/www
index aaa8c9540845941115e497b9c78f13f7d2619df7..8a3ac5bf0ad8b46255eaccb8e9dfb42eff58f305 100644 (file)
@@ -27,7 +27,7 @@
                <dt>{{$plugins.0}}</dt>
                
                {{foreach $plugins.1 as $p}}
-                       <dd>{{$p}}</dd>
+                       <dd><a href="/admin/plugins/{{$p}}/">{{$p}}</a></dd>
                {{/foreach}}
                
        </dl>