Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/462/head
Maxence Lange 2019-04-20 13:04:35 -01:00
rodzic 9038dc4fb4
commit e70f67cea9
5 zmienionych plików z 106 dodań i 7 usunięć

Wyświetl plik

@ -46,6 +46,7 @@
<commands>
<command>OCA\Social\Command\CacheRefresh</command>
<command>OCA\Social\Command\CheckInstall</command>
<command>OCA\Social\Command\NoteCreate</command>
<command>OCA\Social\Command\NoteBoost</command>
<command>OCA\Social\Command\Reset</command>

Wyświetl plik

@ -0,0 +1,88 @@
<?php
declare(strict_types=1);
/**
* Nextcloud - Social Support
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2018, Maxence Lange <maxence@artificial-owl.com>
* @license GNU AGPL version 3 or any later version
*
* 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 (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* 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/>.
*
*/
namespace OCA\Social\Command;
use Exception;
use OC\Core\Command\Base;
use OCA\Social\Service\CheckService;
use OCA\Social\Service\MiscService;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class CheckInstall extends Base {
/** @var CheckService */
private $checkService;
/** @var MiscService */
private $miscService;
/**
* CacheUpdate constructor.
*
* @param CheckService $checkService
* @param MiscService $miscService
*/
public function __construct(CheckService $checkService, MiscService $miscService) {
parent::__construct();
$this->checkService = $checkService;
$this->miscService = $miscService;
}
/**
*
*/
protected function configure() {
parent::configure();
$this->setName('social:check:install')
->setDescription('Check the integrity of the installation');
}
/**
* @param InputInterface $input
* @param OutputInterface $output
*
* @throws Exception
*/
protected function execute(InputInterface $input, OutputInterface $output) {
$this->checkService->checkInstallationStatus();
}
}

Wyświetl plik

@ -189,15 +189,15 @@ class NavigationController extends Controller {
}
private function setupCloudAddress(): string {
$frontControllerActive =
($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true
|| getenv('front_controller_active') === 'true');
// $frontControllerActive =
// ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true
// || getenv('front_controller_active') === 'true');
$cloudAddress = rtrim($this->config->getSystemValue('overwrite.cli.url', ''), '/');
if ($cloudAddress !== '') {
if (!$frontControllerActive) {
$cloudAddress .= '/index.php';
}
// if (!$frontControllerActive) {
// $cloudAddress .= '/index.php';
// }
$this->configService->setCloudAddress($cloudAddress);
return $cloudAddress;

Wyświetl plik

@ -33,6 +33,7 @@ namespace OCA\Social\Db;
use daita\MySmallPhpTools\Traits\TArrayTools;
use DateTime;
use Exception;
use OCA\Social\Exceptions\FollowDoesNotExistException;
use OCA\Social\Model\ActivityPub\Object\Follow;
use OCP\DB\QueryBuilder\IQueryBuilder;
@ -53,6 +54,8 @@ class FollowsRequest extends FollowsRequestBuilder {
* Insert a new Note in the database.
*
* @param Follow $follow
*
* @throws Exception
*/
public function save(Follow $follow) {
$qb = $this->getFollowsInsertSql();

Wyświetl plik

@ -262,6 +262,12 @@ class ConfigService {
throw new SocialAppConfigException();
}
// fixing address for alpha2
if (substr($address, -10) === '/index.php') {
$address = substr($address, 0, -10);
$this->setCloudAddress($address);
}
if ($host === true) {
$parsed = parse_url($address);
$result = $this->get('host', $parsed, '');
@ -288,7 +294,8 @@ class ConfigService {
$path = $this->urlGenerator->linkToRoute('social.Navigation.navigate');
}
return 'https://' . $this->getCloudAddress(true) . $path;
return $this->getCloudAddress() . $path;
// return 'https://' . $this->getCloudAddress(true) . $path;
}