diff options
-rw-r--r-- | done | 12 | ||||
-rw-r--r-- | include/enotify.php | 18 | ||||
-rw-r--r-- | mod/viewsrc.php | 38 |
3 files changed, 35 insertions, 33 deletions
@@ -33,7 +33,7 @@ include/ delivery.php + directory.php - email.php - enotify.php ++ enotify.php event.php + expire.php fcontact.php @@ -56,7 +56,7 @@ include/ oauth.php oembed.php onepoll.php - Photo.php +? Photo.php pidfile.php ? plugin.php poller.php @@ -65,7 +65,7 @@ include/ queue_fn.php queue.php quoteconvert.php - salmon.php +- salmon.php Scrape.php + security.php ? session.php @@ -118,7 +118,7 @@ mod/ install.php invite.php + item.php - like.php ++ like.php lockview.php + login.php lostpass.php @@ -172,8 +172,8 @@ mod/ update_profile.php viewcontacts.php view.php - viewsrc.php - wall_attach.php ++ viewsrc.php +? wall_attach.php (needs remote permissions refactor) wallmessage.php ? wall_upload.php (needs remote permissions refactor) webfinger.php diff --git a/include/enotify.php b/include/enotify.php index c5925f2e7..621f787ed 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -11,7 +11,7 @@ function notification($params) { push_lang($params['language']); - $banner = t('Friendica Notification'); + $banner = t('Red Notification'); $product = FRIENDICA_PLATFORM; $siteurl = $a->get_baseurl(true); $thanks = t('Thank You,'); @@ -39,7 +39,7 @@ function notification($params) { if($params['type'] == NOTIFY_MAIL) { - $subject = sprintf( t('[Friendica:Notify] New mail received at %s'),$sitename); + $subject = sprintf( t('[Red:Notify] New mail received at %s'),$sitename); $preamble = sprintf( t('%1$s sent you a new private message at %2$s.'),$params['source_name'],$sitename); $epreamble = sprintf( t('%1$s sent you %2$s.'),'[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]', '[url=$itemlink]' . t('a private message') . '[/url]'); @@ -109,7 +109,7 @@ function notification($params) { // Before this we have the name of the replier on the subject rendering // differents subjects for messages on the same thread. - $subject = sprintf( t('[Friendica:Notify] Comment to conversation #%1$d by %2$s'), $parent_id, $params['source_name']); + $subject = sprintf( t('[Red:Notify] Comment to conversation #%1$d by %2$s'), $parent_id, $params['source_name']); $preamble = sprintf( t('%s commented on an item/conversation you have been following.'), $params['source_name']); $epreamble = $dest_str; @@ -120,7 +120,7 @@ function notification($params) { } if($params['type'] == NOTIFY_WALL) { - $subject = sprintf( t('[Friendica:Notify] %s posted to your profile wall') , $params['source_name']); + $subject = sprintf( t('[Red:Notify] %s posted to your profile wall') , $params['source_name']); $preamble = sprintf( t('%1$s posted to your profile wall at %2$s') , $params['source_name'], $sitename); @@ -135,7 +135,7 @@ function notification($params) { } if($params['type'] == NOTIFY_TAGSELF) { - $subject = sprintf( t('[Friendica:Notify] %s tagged you') , $params['source_name']); + $subject = sprintf( t('[Red:Notify] %s tagged you') , $params['source_name']); $preamble = sprintf( t('%1$s tagged you at %2$s') , $params['source_name'], $sitename); $epreamble = sprintf( t('%1$s [url=%2$s]tagged you[/url].') , '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]', @@ -149,7 +149,7 @@ function notification($params) { if($params['type'] == NOTIFY_POKE) { - $subject = sprintf( t('[Friendica:Notify] %1$s poked you') , $params['source_name']); + $subject = sprintf( t('[Red:Notify] %1$s poked you') , $params['source_name']); $preamble = sprintf( t('%1$s poked you at %2$s') , $params['source_name'], $sitename); $epreamble = sprintf( t('%1$s [url=%2$s]poked you[/url].') , '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]', @@ -166,7 +166,7 @@ function notification($params) { } if($params['type'] == NOTIFY_TAGSHARE) { - $subject = sprintf( t('[Friendica:Notify] %s tagged your post') , $params['source_name']); + $subject = sprintf( t('[Red:Notify] %s tagged your post') , $params['source_name']); $preamble = sprintf( t('%1$s tagged your post at %2$s') , $params['source_name'], $sitename); $epreamble = sprintf( t('%1$s tagged [url=%2$s]your post[/url]') , '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]', @@ -179,7 +179,7 @@ function notification($params) { } if($params['type'] == NOTIFY_INTRO) { - $subject = sprintf( t('[Friendica:Notify] Introduction received')); + $subject = sprintf( t('[Red:Notify] Introduction received')); $preamble = sprintf( t('You\'ve received an introduction from \'%1$s\' at %2$s'), $params['source_name'], $sitename); $epreamble = sprintf( t('You\'ve received [url=%1$s]an introduction[/url] from %2$s.'), $itemlink, @@ -193,7 +193,7 @@ function notification($params) { } if($params['type'] == NOTIFY_SUGGEST) { - $subject = sprintf( t('[Friendica:Notify] Friend suggestion received')); + $subject = sprintf( t('[Red:Notify] Friend suggestion received')); $preamble = sprintf( t('You\'ve received a friend suggestion from \'%1$s\' at %2$s'), $params['source_name'], $sitename); $epreamble = sprintf( t('You\'ve received [url=%1$s]a friend suggestion[/url] for %2$s from %3$s.'), $itemlink, diff --git a/mod/viewsrc.php b/mod/viewsrc.php index bc7f771d6..d728f96f5 100644 --- a/mod/viewsrc.php +++ b/mod/viewsrc.php @@ -3,34 +3,36 @@ function viewsrc_content(&$a) { + $o = ''; + + $item_id = ((argc() > 1) ? intval(argv(1)) : 0); + $raw_output = ((argc() > 2 && argv[2] === 'raw') ? true : false); + if(! local_user()) { - notice( t('Access denied.') . EOL); - return; + notice( t('Permission denied.') . EOL); } - $item_id = ((argc() > 1) ? intval(argv(1)) : 0); if(! $item_id) { $a->error = 404; notice( t('Item not found.') . EOL); - return; } - $r = q("SELECT `item`.`body` FROM `item` - WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 - and `item`.`moderated` = 0 - AND `item`.`id` = %d LIMIT 1", - intval(local_user()), - intval($item_id) - ); - - if(count($r)) { - $o = str_replace("\n",'<br />',$r[0]['body']); - if(is_ajax()) { - echo $o; - killme(); - } + if(local_user() && $item_id) { + $r = q("select body from item where item_restrict = 0 and uid = %d and id = %d limit 1", + intval(local_user()), + intval($item_id) + ); + + if($r) + $o = (($raw_output) ? $r[0]['body'] : str_replace("\n",'<br />',$r[0]['body'])); } + + if(is_ajax()) { + echo $o; + killme(); + } + return $o; } |