diff options
author | zottel <github@zottel.net> | 2012-03-27 13:20:59 +0200 |
---|---|---|
committer | zottel <github@zottel.net> | 2012-03-27 13:20:59 +0200 |
commit | fb817a29a934a68f194a42c29d3ed11da2da558f (patch) | |
tree | fdeb88be9d8545ead92c5d63a9d9af7f6a7ccc23 /mod | |
parent | fabd4f4d2ebd9d1623db7e20d6e4e8f6bd0611ff (diff) | |
parent | 928e6c7ef78d251429a7d5c1fd4fdb8e6c282d41 (diff) | |
download | volse-hubzilla-fb817a29a934a68f194a42c29d3ed11da2da558f.tar.gz volse-hubzilla-fb817a29a934a68f194a42c29d3ed11da2da558f.tar.bz2 volse-hubzilla-fb817a29a934a68f194a42c29d3ed11da2da558f.zip |
Merge remote branch 'upstream/master'
Diffstat (limited to 'mod')
-rwxr-xr-x | mod/acl.php | 10 | ||||
-rwxr-xr-x | mod/admin.php | 8 | ||||
-rwxr-xr-x | mod/dfrn_poll.php | 21 | ||||
-rwxr-xr-x | mod/friendica.php | 19 | ||||
-rwxr-xr-x | mod/invite.php | 21 | ||||
-rwxr-xr-x | mod/item.php | 2 | ||||
-rwxr-xr-x | mod/message.php | 7 | ||||
-rwxr-xr-x | mod/network.php | 20 | ||||
-rwxr-xr-x | mod/photos.php | 23 | ||||
-rw-r--r-- | mod/pretheme.php | 16 | ||||
-rwxr-xr-x | mod/profile.php | 2 |
11 files changed, 107 insertions, 42 deletions
diff --git a/mod/acl.php b/mod/acl.php index 375c618c8..fe353d1eb 100755 --- a/mod/acl.php +++ b/mod/acl.php @@ -7,10 +7,10 @@ function acl_init(&$a){ return ""; - $start = (x($_POST,'start')?$_POST['start']:0); - $count = (x($_POST,'count')?$_POST['count']:100); - $search = (x($_POST,'search')?$_POST['search']:""); - $type = (x($_POST,'type')?$_POST['type']:""); + $start = (x($_REQUEST,'start')?$_REQUEST['start']:0); + $count = (x($_REQUEST,'count')?$_REQUEST['count']:100); + $search = (x($_REQUEST,'search')?$_REQUEST['search']:""); + $type = (x($_REQUEST,'type')?$_REQUEST['type']:""); if ($search!=""){ @@ -34,7 +34,7 @@ function acl_init(&$a){ $r = q("SELECT COUNT(`id`) AS c FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 - AND `notify` != '' $sql_extra" , + AND `notify` != '' $sql_extra2" , intval(local_user()) ); $contact_count = (int)$r[0]['c']; diff --git a/mod/admin.php b/mod/admin.php index a64b26903..53b5ee354 100755 --- a/mod/admin.php +++ b/mod/admin.php @@ -583,6 +583,7 @@ function admin_page_plugins(&$a){ '$admin_form' => $admin_form, '$function' => 'plugins', + '$screenshot' => '', '$readme' => $readme )); } @@ -738,7 +739,11 @@ function admin_page_themes(&$a){ } $admin_form=""; - + + $screenshot = array( get_theme_screenshot($theme), t('Screenshot')); + if(! stristr($screenshot[0],$theme)) + $screenshot = null; + $t = get_markup_template("admin_plugins_details.tpl"); return replace_macros($t, array( '$title' => t('Administration'), @@ -755,6 +760,7 @@ function admin_page_themes(&$a){ '$admin_form' => $admin_form, '$str_author' => t('Author: '), '$str_maintainer' => t('Maintainer: '), + '$screenshot' => $screenshot, '$readme' => $readme )); } diff --git a/mod/dfrn_poll.php b/mod/dfrn_poll.php index fe5cd4906..6030587ce 100755 --- a/mod/dfrn_poll.php +++ b/mod/dfrn_poll.php @@ -26,21 +26,24 @@ function dfrn_poll_init(&$a) { $dfrn_id = substr($dfrn_id,2); } - if(($dfrn_id === '') && (! x($_POST,'dfrn_id')) && ($a->argc > 1)) { + if(($dfrn_id === '') && (! x($_POST,'dfrn_id'))) { if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) { killme(); } - $r = q("SELECT `hidewall` FROM `user` WHERE `user`.`nickname` = '%s' LIMIT 1", - dbesc($a->argv[1]) - ); - if(count($r) && $r[0]['hidewall']) - killme(); + $user = ''; + if($a->argc > 1) { + $r = q("SELECT `hidewall` FROM `user` WHERE `user`.`nickname` = '%s' LIMIT 1", + dbesc($a->argv[1]) + ); + if((! count($r)) || (count($r) && $r[0]['hidewall'])) + killme(); + $user = $r[0]['nickname']; + } - logger('dfrn_poll: public feed request from ' . $_SERVER['REMOTE_ADDR'] ); + logger('dfrn_poll: public feed request from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $user); header("Content-type: application/atom+xml"); - $o = get_feed_for($a, '', $a->argv[1],$last_update); - echo $o; + echo get_feed_for($a, '', $user,$last_update); killme(); } diff --git a/mod/friendica.php b/mod/friendica.php index ab92e31ed..d5dad9448 100755 --- a/mod/friendica.php +++ b/mod/friendica.php @@ -51,15 +51,20 @@ function friendica_content(&$a) { $o .= '<p></p>'; if(count($a->plugins)) { - $o .= '<p>' . t('Installed plugins/addons/apps') . '</p>'; - $o .= '<ul>'; - foreach($a->plugins as $p) - if(strlen($p)) - $o .= '<li>' . $p . '</li>'; - $o .= '</ul>'; + $o .= '<p>' . t('Installed plugins/addons/apps:') . '</p>'; + $sorted = $a->plugins; + $s = ''; + sort($sorted); + foreach($sorted as $p) { + if(strlen($p)) { + if(strlen($s)) $s .= ', '; + $s .= $p; + } + } + $o .= '<div style="margin-left: 25px; margin-right: 25px;">' . $s . '</div>'; } else - $o .= '<p>' . t('No installed plugins/addons/apps'); + $o .= '<p>' . t('No installed plugins/addons/apps') . '</p>'; call_hooks('about_hook', $o); diff --git a/mod/invite.php b/mod/invite.php index d4eb9c5ef..2dbf93c59 100755 --- a/mod/invite.php +++ b/mod/invite.php @@ -56,7 +56,7 @@ function invite_post(&$a) { else $nmessage = $message; - $res = mail($recip, sprintf( t('Please join my network on %s'), $a->config['sitename']), + $res = mail($recip, sprintf( t('Please join us on Friendica'), $a->config['sitename']), $nmessage, "From: " . $a->user['email'] . "\n" . 'Content-type: text/plain; charset=UTF-8' . "\n" @@ -94,15 +94,28 @@ function invite_content(&$a) { } } + $dirloc = get_config('system','directory_submit_url'); + if(strlen($dirloc)) { + if($a->config['register_policy'] == REGISTER_CLOSED) + $linktxt = sprintf( t('Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks.'), dirname($dirloc) . '/siteinfo'); + elseif($a->config['register_policy'] != REGISTER_CLOSED) + $linktxt = sprintf( t('To accept this invitation, please visit and register at %s or any other public Friendica website.'), $a->get_baseurl()) + . "\r\n" . "\r\n" . sprintf( t('Friendica sites all inter-connect to create a huge privacy-enhanced social web that is owned and controlled by its members. They can also connect with many traditional social networks. See %s for a list of alternate Friendica sites you can join.'),dirname($dirloc) . '/siteinfo'); + } + else { + $o = t('Our apologies. This system is not currently configured to connect with other public sites or invite members.'); + return $o; + } $o = replace_macros($tpl, array( '$invite' => t('Send invitations'), '$addr_text' => t('Enter email addresses, one per line:'), '$msg_text' => t('Your message:'), - '$default_message' => sprintf(t('Please join my social network on %s'), $a->config['sitename']) . "\r\n" . "\r\n" - . t('To accept this invitation, please visit:') . "\r\n" . "\r\n" . $a->get_baseurl() + '$default_message' => t('You are cordially invited to join me and other close friends on Friendica - and help us to create a better social web.') . "\r\n" . "\r\n" + . $linktxt . "\r\n" . "\r\n" . (($invonly) ? t('You will need to supply this invitation code: $invite_code') . "\r\n" . "\r\n" : '') .t('Once you have registered, please connect with me via my profile page at:') - . "\r\n" . "\r\n" . $a->get_baseurl() . '/profile/' . $a->user['nickname'] , + . "\r\n" . "\r\n" . $a->get_baseurl() . '/profile/' . $a->user['nickname'] + . "\r\n" . "\r\n" . t('For more information about the Friendica project and why we feel it is important, please visit http://friendica.com') . "\r\n" . "\r\n" , '$submit' => t('Submit') )); diff --git a/mod/item.php b/mod/item.php index fc1c5fd0f..5baae2bde 100755 --- a/mod/item.php +++ b/mod/item.php @@ -624,7 +624,7 @@ function item_post(&$a) { dbesc($datarray['attach']), intval($datarray['bookmark']), intval($datarray['origin']), - intval($datarry['moderated']) + intval($datarray['moderated']) ); $r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' LIMIT 1", diff --git a/mod/message.php b/mod/message.php index 0907abd77..8991f643d 100755 --- a/mod/message.php +++ b/mod/message.php @@ -15,6 +15,13 @@ function message_post(&$a) { $body = ((x($_REQUEST,'body')) ? escape_tags(trim($_REQUEST['body'])) : ''); $recipient = ((x($_REQUEST,'messageto')) ? intval($_REQUEST['messageto']) : 0 ); + // Work around doubled linefeeds in Tinymce 3.5b2 + + $plaintext = intval(get_pconfig(local_user(),'system','plaintext')); + if(! $plaintext) { + $body = str_replace("\r\n","\n",$body); + $body = str_replace("\n\n","\n",$body); + } $ret = send_message($recipient, $body, $subject, $replyto); $norecip = false; diff --git a/mod/network.php b/mod/network.php index 9ec8c23b5..5ca0a8c7d 100755 --- a/mod/network.php +++ b/mod/network.php @@ -250,6 +250,20 @@ function network_content(&$a, $update = 0) { if($cid) $def_acl = array('allow_cid' => '<' . intval($cid) . '>'); + if($nets) { + $r = q("select id from contact where uid = %d and network = '%s' and self = 0", + intval(local_user()), + dbesc($nets) + ); + + $str = ''; + if(count($r)) + foreach($r as $rr) + $str .= '<' . $rr['id'] . '>'; + if(strlen($str)) + $def_acl = array('allow_cid' => $str); + } + if(! $update) { if($group) { if(($t = group_public_members($group)) && (! get_pconfig(local_user(),'system','nowarn_insecure'))) { @@ -269,9 +283,9 @@ function network_content(&$a, $update = 0) { 'allow_location' => $a->user['allow_location'], 'default_location' => $a->user['default-location'], 'nickname' => $a->user['nickname'], - 'lockstate' => ((($group) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'), - 'acl' => populate_acl((($group || $cid) ? $def_acl : $a->user), $celeb), - 'bang' => (($group || $cid) ? '!' : ''), + 'lockstate' => ((($group) || ($cid) || ($nets) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'), + 'acl' => populate_acl((($group || $cid || $nets) ? $def_acl : $a->user), $celeb), + 'bang' => (($group || $cid || $nets) ? '!' : ''), 'visitor' => 'block', 'profile_uid' => local_user() ); diff --git a/mod/photos.php b/mod/photos.php index b294f0a66..2a808cb41 100755 --- a/mod/photos.php +++ b/mod/photos.php @@ -38,21 +38,22 @@ function photos_init(&$a) { $o .= '<div id="profile-photo-wrapper"><img class="photo" style="width: 175px; height: 175px;" src="' . $a->get_baseurl() . '/photo/profile/' . $a->data['user']['uid'] . '.jpg" alt="' . $a->data['user']['username'] . '" /></div>'; $o .= '</div>'; - $o .= '<div id="side-bar-photos-albums" class="widget">'; - $o .= '<h3>' . '<a href="' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '">' . t('Photo Albums') . '</a></h3>'; + if(! intval($a->data['user']['hidewall'])) { + $o .= '<div id="side-bar-photos-albums" class="widget">'; + $o .= '<h3>' . '<a href="' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '">' . t('Photo Albums') . '</a></h3>'; - $o .= '<ul>'; - foreach($albums as $album) { + $o .= '<ul>'; + foreach($albums as $album) { - // don't show contact photos. We once translated this name, but then you could still access it under - // a different language setting. Now we store the name in English and check in English (and translated for legacy albums). + // don't show contact photos. We once translated this name, but then you could still access it under + // a different language setting. Now we store the name in English and check in English (and translated for legacy albums). - if((! strlen($album['album'])) || ($album['album'] === 'Contact Photos') || ($album['album'] === t('Contact Photos'))) - continue; - $o .= '<li>' . '<a href="photos/' . $a->argv[1] . '/album/' . bin2hex($album['album']) . '" >' . $album['album'] . '</a></li>'; + if((! strlen($album['album'])) || ($album['album'] === 'Contact Photos') || ($album['album'] === t('Contact Photos'))) + continue; + $o .= '<li>' . '<a href="photos/' . $a->argv[1] . '/album/' . bin2hex($album['album']) . '" >' . $album['album'] . '</a></li>'; + } + $o .= '</ul>'; } - $o .= '</ul>'; - if(local_user() && $a->data['user']['uid'] == local_user()) { $o .= '<div id="photo-albums-upload-link"><a href="' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/upload" >' .t('Upload New Photos') . '</a></div>'; } diff --git a/mod/pretheme.php b/mod/pretheme.php new file mode 100644 index 000000000..0efa587d8 --- /dev/null +++ b/mod/pretheme.php @@ -0,0 +1,16 @@ +<?php + +function pretheme_init(&$a) { + + if($_REQUEST['theme']) { + $theme = $_REQUEST['theme']; + $info = get_theme_info($theme); + if($info) { + // unfortunately there will be no translation for this string + $desc = $info['description'] . ' ' . $info['version']; + } + else $desc = ''; + echo json_encode(array('img' => get_theme_screenshot($theme), 'desc' => $desc)); + } + killme(); +} diff --git a/mod/profile.php b/mod/profile.php index 428679ffc..782d17d83 100755 --- a/mod/profile.php +++ b/mod/profile.php @@ -107,7 +107,7 @@ function profile_content(&$a, $update = 0) { $is_owner = ((local_user()) && (local_user() == $a->profile['profile_uid']) ? true : false); - if($a->user['hidewall'] && (! $is_owner) && (! $remote_contact)) { + if($a->profile['hidewall'] && (! $is_owner) && (! $remote_contact)) { notice( t('Access to this profile has been restricted.') . EOL); return; } |