Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/user_sql.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Controller/SettingsController.php3
-rw-r--r--lib/Platform/AbstractPlatform.php9
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php
index 8c4a9fb..a192daf 100644
--- a/lib/Controller/SettingsController.php
+++ b/lib/Controller/SettingsController.php
@@ -315,7 +315,8 @@ class SettingsController extends Controller
$connection = $this->getConnection();
$platform = PlatformFactory::getPlatform($connection);
$columns = $platform->getColumns(
- $this->request->getParam($table)
+ $this->request->getParam($table),
+ $this->request->getParam("input")
);
return $columns;
diff --git a/lib/Platform/AbstractPlatform.php b/lib/Platform/AbstractPlatform.php
index 38d8f61..59052d4 100644
--- a/lib/Platform/AbstractPlatform.php
+++ b/lib/Platform/AbstractPlatform.php
@@ -108,12 +108,13 @@ abstract class AbstractPlatform
/**
* Get all the columns defined in the table.
*
- * @param string $table The table name.
+ * @param string $table The table name.
+ * @param string $phrase Show only columns containing given phrase.
*
* @return array Array with column names.
* @throws DBALException On a database exception.
*/
- public function getColumns($table)
+ public function getColumns($table, $phrase = "")
{
$platform = $this->connection->getDatabasePlatform();
$query = $platform->getListTableColumnsSQL($table);
@@ -123,7 +124,9 @@ abstract class AbstractPlatform
while ($row = $result->fetch()) {
$name = $this->getColumnName($row);
- $columns[] = $name;
+ if (preg_match("/.*$phrase.*/i", $name)) {
+ $columns[] = $name;
+ }
}
return $columns;