fixing OCI and others
This commit is contained in:
parent
6f7aa3392f
commit
f6446a64b6
5 changed files with 9 additions and 20 deletions
|
@ -22,10 +22,10 @@
|
|||
|
||||
namespace OCA\Federation\API;
|
||||
|
||||
use OC\BackgroundJob\JobList;
|
||||
use OCA\Federation\DbHandler;
|
||||
use OCA\Federation\TrustedServers;
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\BackgroundJob\IJobList;
|
||||
use OCP\IRequest;
|
||||
use OCP\Security\ISecureRandom;
|
||||
use OCP\Security\StringUtils;
|
||||
|
@ -45,7 +45,7 @@ class OCSAuthAPI {
|
|||
/** @var ISecureRandom */
|
||||
private $secureRandom;
|
||||
|
||||
/** @var JobList */
|
||||
/** @var IJobList */
|
||||
private $jobList;
|
||||
|
||||
/** @var TrustedServers */
|
||||
|
@ -55,18 +55,18 @@ class OCSAuthAPI {
|
|||
private $dbHandler;
|
||||
|
||||
/**
|
||||
* AuthController constructor.
|
||||
* OCSAuthAPI constructor.
|
||||
*
|
||||
* @param IRequest $request
|
||||
* @param ISecureRandom $secureRandom
|
||||
* @param JobList $jobList
|
||||
* @param IJobList $jobList
|
||||
* @param TrustedServers $trustedServers
|
||||
* @param DbHandler $dbHandler
|
||||
*/
|
||||
public function __construct(
|
||||
IRequest $request,
|
||||
ISecureRandom $secureRandom,
|
||||
JobList $jobList,
|
||||
IJobList $jobList,
|
||||
TrustedServers $trustedServers,
|
||||
DbHandler $dbHandler
|
||||
) {
|
||||
|
|
|
@ -87,19 +87,6 @@ class Application extends \OCP\AppFramework\App {
|
|||
$c->query('TrustedServers')
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
$container->registerService('AuthController', function (IAppContainer $c) {
|
||||
$server = $c->getServer();
|
||||
return new AuthController(
|
||||
$c->getAppName(),
|
||||
$server->getRequest(),
|
||||
$server->getSecureRandom(),
|
||||
$server->getJobList(),
|
||||
$c->query('TrustedServers'),
|
||||
$c->query('DbHandler')
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
private function registerMiddleware() {
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
namespace OCA\Federation\BackgroundJob;
|
||||
|
||||
use GuzzleHttp\Exception\ClientException;
|
||||
use OC\BackgroundJob\JobList;
|
||||
use OC\BackgroundJob\QueuedJob;
|
||||
use OCA\Federation\DbHandler;
|
||||
use OCA\Federation\TrustedServers;
|
||||
|
|
|
@ -24,6 +24,7 @@ namespace OCA\Federation\BackgroundJob;
|
|||
|
||||
|
||||
use GuzzleHttp\Exception\ClientException;
|
||||
use OC\BackgroundJob\JobList;
|
||||
use OC\BackgroundJob\QueuedJob;
|
||||
use OCA\Federation\DbHandler;
|
||||
use OCA\Federation\TrustedServers;
|
||||
|
|
|
@ -82,7 +82,7 @@ class DbHandler {
|
|||
$result = $query->execute();
|
||||
|
||||
if ($result) {
|
||||
return $this->connection->lastInsertId($this->dbTable);
|
||||
return $this->connection->lastInsertId('*PREFIX*'.$this->dbTable);
|
||||
} else {
|
||||
$message = 'Internal failure, Could not add ownCloud as trusted server: ' . $url;
|
||||
$message_t = $this->l->t('Could not add server');
|
||||
|
@ -110,7 +110,7 @@ class DbHandler {
|
|||
*/
|
||||
public function getAllServer() {
|
||||
$query = $this->connection->getQueryBuilder();
|
||||
$query->select('url', 'id', 'status')->from($this->dbTable);
|
||||
$query->select(['url', 'id', 'status'])->from($this->dbTable);
|
||||
$result = $query->execute()->fetchAll();
|
||||
return $result;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue