Commit 13809829 by Maiyannah Bishop

Merge branch 'master' of git@git.postactiv.com:postActiv/postActiv.git into nightly

# By Bob Mottram
# Via Bob Mottram (1) and Maiyannah Bishop (1)
* 'master' of git@git.postactiv.com:postActiv/postActiv.git:
  Replace GNUsocial with postActiv

# Conflicts:
#	lib/stompqueuemanager.php
#	modules/Poll/actions/respondpoll.php
2 parents 89254791 6fad887c
......@@ -64,7 +64,7 @@ class CancelsubscriptionAction extends FormAction
common_debug('Tried to cancel a non-existing pending subscription');
}
if (GNUsocial::isAjax()) {
if (postActiv::isAjax()) {
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
// TRANS: Title after unsubscribing from a group.
......@@ -80,4 +80,4 @@ class CancelsubscriptionAction extends FormAction
common_redirect(common_local_url('subscriptions', array('nickname' => $this->scoped->getNickname())), 303);
}
}
?>
\ No newline at end of file
?>
......@@ -133,7 +133,7 @@ class NewnoticeAction extends FormAction
$cmd = $inter->handle_command($user, $content);
if ($cmd) {
if (GNUsocial::isAjax()) {
if (postActiv::isAjax()) {
$cmd->execute(new AjaxWebChannel($this));
} else {
$cmd->execute(new WebChannel($this));
......@@ -220,7 +220,7 @@ class NewnoticeAction extends FormAction
Event::handle('EndSaveNewNoticeWeb', array($this, $user, &$content, &$options));
if (!GNUsocial::isAjax()) {
if (!postActiv::isAjax()) {
$url = common_local_url('shownotice', array('notice' => $this->stored->id));
common_redirect($url, 303);
}
......@@ -257,4 +257,4 @@ class NewnoticeAction extends FormAction
// pass
}
}
?>
\ No newline at end of file
?>
......@@ -83,7 +83,7 @@ class ShownoticeAction extends ManagedAction
{
parent::prepare($args);
if ($this->boolean('ajax')) {
GNUsocial::setApi(true);
postActiv::setApi(true);
}
$this->notice = $this->getNotice();
......@@ -264,4 +264,4 @@ class ShownoticeAction extends ManagedAction
'content' => $this->notice->content));
}
}
?>
\ No newline at end of file
?>
......@@ -185,7 +185,7 @@ class AttachmentListItem extends Widget
break;
case 'text/html':
if (!empty($this->attachment->filename)
&& (GNUsocial::isAjax() || common_config('attachments', 'show_html'))) {
&& (postActiv::isAjax() || common_config('attachments', 'show_html'))) {
// Locally-uploaded HTML. Scrub and display inline.
$this->showHtmlFile($this->attachment);
break;
......@@ -271,4 +271,4 @@ class AttachmentListItem extends Widget
$this->out->elementEnd('li');
}
}
?>
\ No newline at end of file
?>
......@@ -105,8 +105,8 @@ class DocFile
$paths = array(INSTALLDIR.'/local/doc-src/',
INSTALLDIR.'/doc-src/');
$site = GNUsocial::currentSite();
$site = postActiv::currentSite();
if (!empty($site)) {
array_unshift($paths, INSTALLDIR.'/local/doc-src/'.$site.'/');
}
......@@ -119,8 +119,8 @@ class DocFile
$paths = array(INSTALLDIR.'/local/mail-src/',
INSTALLDIR.'/mail-src/');
$site = GNUsocial::currentSite();
$site = postActiv::currentSite();
if (!empty($site)) {
array_unshift($paths, INSTALLDIR.'/local/mail-src/'.$site.'/');
}
......@@ -143,4 +143,4 @@ class DocFile
return $defaultFilename;
}
}
?>
\ No newline at end of file
?>
......@@ -49,7 +49,7 @@ abstract class ActivityVerbHandlerPlugin extends ActivityHandlerPlugin
}
protected function showActionContent(ManagedAction $action, $verb, Notice $target, Profile $scoped)
{
if (!GNUsocial::isAjax()) {
if (!postActiv::isAjax()) {
$nl = new NoticeListItem($target, $action, array('options'=>false, 'attachments'=>false,
'item_tag'=>'div', 'id_prefix'=>'fave'));
$nl->show();
......
......@@ -135,7 +135,7 @@ class NewmessageAction extends FormAction
$message = Message::saveNew($this->scoped->id, $this->other->id, $this->content, 'web');
$message->notify();
if (GNUsocial::isAjax()) {
if (postActiv::isAjax()) {
// TRANS: Confirmation text after sending a direct message.
// TRANS: %s is the direct message recipient.
return sprintf(_('Direct message to %s sent.'), $this->other->getNickname());
......
......@@ -100,7 +100,7 @@ if (have_option('u', 'universe')) {
while ($sn->fetch()) {
try {
$server = $sn->getServerName();
GNUsocial::init($server);
postActiv::init($server);
// Different queue manager, maybe!
$qm = QueueManager::get();
foreach ($reminders as $reminder) {
......
......@@ -42,7 +42,7 @@ if (have_option('u', 'universe')) {
if ($sn->find()) {
while ($sn->fetch()) {
$server = $sn->getServerName();
GNUsocial::init($server);
postActiv::init($server);
// Different queue manager, maybe!
$qm = QueueManager::get();
$qm->enqueue(1, 'sitesum');
......
......@@ -166,7 +166,7 @@ class OembedPlugin extends Plugin
if($metadata->thumbnail_url == 'https://s0.wp.com/i/blank.jpg') {
unset($metadata->thumbnail_url);
}
// FIXME: this is also true of locally-installed wordpress so we should watch out for that.
}
return true;
......@@ -387,7 +387,7 @@ class OembedPlugin extends Plugin
case 'video':
case 'link':
if (!empty($oembed->html)
&& (GNUsocial::isAjax() || common_config('attachments', 'show_html'))) {
&& (postActiv::isAjax() || common_config('attachments', 'show_html'))) {
require_once INSTALLDIR.'/extlib/HTMLPurifier/HTMLPurifier.auto.php';
$purifier = new HTMLPurifier();
// FIXME: do we allow <object> and <embed> here? we did that when we used htmLawed, but I'm not sure anymore...
......@@ -407,7 +407,7 @@ class OembedPlugin extends Plugin
// $imgPath = the path to the created thumbnail
// $media = media type the thumbnail was created for
// Man that name is a mouthful.
// This event executes when postActiv is creating a file thumbnail entry in
// This event executes when postActiv is creating a file thumbnail entry in
// the database. We glom onto this to create proper information for oEmbed
// object thumbnails. Returns true if it succeeds (including non-action
// states where it isn't oEmbed data, so it doesn't mess up the event handle
......@@ -499,9 +499,9 @@ class OembedPlugin extends Plugin
// -------------------------------------------------------------------------
// OembedPlugin::isRemoteImage($url) private function.
// A private helper function that uses a CURL lookup to check the mime type
// of a remote URL to see it it's an image. Returns true if the remote URL
// of a remote URL to see it it's an image. Returns true if the remote URL
// is an image, or false otherwise.
// FIXME: We should probably sanity-check the input to make sure it's a
// FIXME: We should probably sanity-check the input to make sure it's a
// valid URL.
private function isRemoteImage($url) {
if ($url==null) {
......@@ -530,7 +530,7 @@ class OembedPlugin extends Plugin
// An internal helper function that parses the php.ini file size limit from
// the 'human-readable' shorthand into something we can use to test against
// in conditionals.
// Returns the php.ini upload limit in machine-readable format, or the
// Returns the php.ini upload limit in machine-readable format, or the
// exception if it fails.
// FIXME: We could probably move this to a public utility library.
private function getPHPUploadLimit() {
......
......@@ -121,7 +121,7 @@ class NewPollAction extends Action
function newPoll()
{
if ($this->boolean('ajax')) {
GNUsocial::setApi(true);
postActiv::setApi(true);
}
try {
if (empty($this->question)) {
......
<?php
/* ============================================================================
/**
* postActiv - a fork of the GNU Social microblogging software
* Copyright (C) 2016, Maiyannah Bishop
* Derived from code copyright various sources:
* GNU Social (C) 2013-2016, Free Software Foundation, Inc
* StatusNet (C) 2008-2012, StatusNet, Inc
* ----------------------------------------------------------------------------
* StatusNet (C) 2008-2011, StatusNet, Inc
*
* Respond to a Poll
*
* PHP version 5
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
......@@ -18,22 +22,30 @@
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ----------------------------------------------------------------------------
*
* @category Poll
* @package postActiv
* @author Mikael Nordfeldth <mmn@hethane.se>
* @author Maiyannah Bishop <maiyannah.bishop@postactiv.com>
* @copyright 2013-2016 Free Software Foundation, Inc
* @copyright 2016 Maiyannah Bishop
* @package StatusNet
* @author Brion Vibber <brion@status.net>
* @copyright 2011 StatusNet, Inc.
* @license https://www.gnu.org/licenses/agpl.html
* @link http://www.postactiv.com/
* ============================================================================
* @link http://status.net/
*/
if (!defined('POSTACTIV')) { exit(1); }
if (!defined('STATUSNET')) {
// This check helps protect against security problems;
// your code file can't be executed directly from the web.
exit(1);
}
/**
* Respond to a Poll
*
* @category Poll
* @package StatusNet
* @author Evan Prodromou <evan@status.net>
* @copyright 2010 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
class RespondPollAction extends Action
{
......@@ -66,7 +78,7 @@ class RespondPollAction extends Action
{
parent::prepare($args);
if ($this->boolean('ajax')) {
GNUsocial::setApi(true);
postActiv::setApi(true);
}
$this->user = common_current_user();
......@@ -188,4 +200,3 @@ class RespondPollAction extends Action
}
}
}
?>
\ No newline at end of file
......@@ -30,7 +30,7 @@
* @license https://www.gnu.org/licenses/agpl.html
* @link http://status.net/
*/
if (!defined('STATUSNET')) {
// This check helps protect against security problems;
// your code file can't be executed directly from the web.
......@@ -78,7 +78,7 @@ class QnaclosequestionAction extends Action
{
parent::prepare($args);
if ($this->boolean('ajax')) {
GNUsocial::setApi(true);
postActiv::setApi(true);
}
$this->user = common_current_user();
......
......@@ -30,7 +30,7 @@
* @license https://www.gnu.org/licenses/agpl.html
* @link http://status.net/
*/
if (!defined('STATUSNET')) {
// This check helps protect against security problems;
// your code file can't be executed directly from the web.
......@@ -78,7 +78,7 @@ class QnanewanswerAction extends Action
{
parent::prepare($args);
if ($this->boolean('ajax')) {
GNUsocial::setApi(true);
postActiv::setApi(true);
}
common_debug("in qnanewanswer");
$this->user = common_current_user();
......
......@@ -125,7 +125,7 @@ class QnanewquestionAction extends Action
function newQuestion()
{
if ($this->boolean('ajax')) {
GNUsocial::setApi(true);
postActiv::setApi(true);
}
try {
if (empty($this->title)) {
......
......@@ -30,7 +30,7 @@
* @license https://www.gnu.org/licenses/agpl.html
* @link http://status.net/
*/
if (!defined('STATUSNET')) {
// This check helps protect against security problems;
// your code file can't be executed directly from the web.
......@@ -77,7 +77,7 @@ class QnareviseanswerAction extends Action
{
parent::prepare($args);
if ($this->boolean('ajax')) {
GNUsocial::setApi(true);
postActiv::setApi(true);
}
$this->user = common_current_user();
......
......@@ -78,7 +78,7 @@ class Qnavote extends Action
{
parent::prepare($args);
if ($this->boolean('ajax')) {
GNUsocial::setApi(true);
postActiv::setApi(true);
}
$this->user = common_current_user();
......
......@@ -70,7 +70,7 @@ class SearchsubAction extends Action
{
parent::prepare($args);
if ($this->boolean('ajax')) {
GNUsocial::setApi(true);
postActiv::setApi(true);
}
// Only allow POST requests
......
......@@ -70,7 +70,7 @@ class TagsubAction extends Action
{
parent::prepare($args);
if ($this->boolean('ajax')) {
GNUsocial::setApi(true);
postActiv::setApi(true);
}
// Only allow POST requests
......
......@@ -49,7 +49,7 @@ class OembedproxyAction extends OembedAction
function handle()
{
// Trigger short error responses; not a human-readable web page.
GNUsocial::setApi(true);
postActiv::setApi(true);
// We're not a general oEmbed proxy service; limit to valid sessions.
$token = $this->trimmed('token');
......
......@@ -62,7 +62,7 @@ if (have_option('u', 'universe')) {
if ($sn->find()) {
while ($sn->fetch()) {
$server = $sn->getServerName();
GNUsocial::init($server);
postActiv::init($server);
cleanupChannels();
}
}
......
......@@ -43,7 +43,7 @@ class StrictTransportSecurityPlugin extends Plugin
function onArgsInitialize($args)
{
$path = common_config('site', 'path');
if (GNUsocial::useHTTPS() && ($path == '/' || mb_strlen($path)==0 )) {
if (postActiv::useHTTPS() && ($path == '/' || mb_strlen($path)==0 )) {
header('Strict-Transport-Security: max-age=' . $this->max_age
. ($this->includeSubDomains ? '; includeSubDomains' : '')
. ($this->preloadToken ? '; preload' : ''));
......
......@@ -63,7 +63,7 @@ class MirrorSettingsAction extends SettingsAction
function showContent()
{
$provider = $this->trimmed('provider');
if (!empty($provider) || GNUsocial::isAjax()) {
if (!empty($provider) || postActiv::isAjax()) {
$this->showAddFeedForm($provider);
} else {
$this->elementStart('div', array('id' => 'add-mirror'));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!