Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions lib/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ public function __construct(
* Verify the database connection parameters.
*
* @return array The request status.
*
* @AuthorizedAdminSetting(settings=OCA\UserSQL\Settings\Admin)
*/
public function verifyDbConnection()
{
Expand Down Expand Up @@ -189,6 +191,8 @@ private function getConnection()
* Save application properties.
*
* @return array The request status.
*
* @AuthorizedAdminSetting(settings=OCA\UserSQL\Settings\Admin)
*/
public function saveProperties()
{
Expand Down Expand Up @@ -329,6 +333,8 @@ private function cryptoClassConfiguration($cryptoClass)
* Clear the application cache memory.
*
* @return array The request status.
*
* @AuthorizedAdminSetting(settings=OCA\UserSQL\Settings\Admin)
*/
public function clearCache()
{
Expand Down Expand Up @@ -356,6 +362,8 @@ public function clearCache()
* Autocomplete for table select options.
*
* @return array The database table list.
*
* @AuthorizedAdminSetting(settings=OCA\UserSQL\Settings\Admin)
*/
public function tableAutocomplete()
{
Expand Down Expand Up @@ -385,6 +393,8 @@ public function tableAutocomplete()
* Autocomplete for column select options - user table.
*
* @return array The database table's column list.
*
* @AuthorizedAdminSetting(settings=OCA\UserSQL\Settings\Admin)
*/
public function userTableAutocomplete()
{
Expand Down Expand Up @@ -430,6 +440,8 @@ private function columnAutocomplete($table)
* Autocomplete for column select options - user_group table.
*
* @return array The database table's column list.
*
* @AuthorizedAdminSetting(settings=OCA\UserSQL\Settings\Admin)
*/
public function userGroupTableAutocomplete()
{
Expand All @@ -451,6 +463,8 @@ public function userGroupTableAutocomplete()
* Autocomplete for column select options - group table.
*
* @return array The database table's column list.
*
* @AuthorizedAdminSetting(settings=OCA\UserSQL\Settings\Admin)
*/
public function groupTableAutocomplete()
{
Expand All @@ -473,6 +487,8 @@ public function groupTableAutocomplete()
*
* @return array Password algorithm parameters.
* @throws ReflectionException Whenever Opt class cannot be initiated.
*
* @AuthorizedAdminSetting(settings=OCA\UserSQL\Settings\Admin)
*/
public function cryptoParams()
{
Expand Down
12 changes: 10 additions & 2 deletions lib/Settings/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@

use OCA\UserSQL\Properties;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\Settings\ISettings;
use OCP\Settings\IDelegatedSettings;

/**
* The administrator's settings page.
*
* @author Marcin Łojewski <dev@mlojewski.me>
*/
class Admin implements ISettings
class Admin implements IDelegatedSettings
{
/**
* @var string The application name.
Expand Down Expand Up @@ -76,4 +76,12 @@ public function getPriority()
{
return 25;
}

public function getName(): ?string {
return null; // Only one setting in this section
}

public function getAuthorizedAppConfig(): array {
return []; // Custom controller
}
}