From 7d52e00a51450bc4a080d4e21b7dda02c0a65191 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Thu, 14 Nov 2013 05:42:06 -0500
Subject: [PATCH] Fixed list sorting
---
interface/web/sites/form/ftp_user.tform.php | 27 ++++++++++++++++++++++-----
1 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/interface/web/sites/form/ftp_user.tform.php b/interface/web/sites/form/ftp_user.tform.php
index 6077dee..7dece14 100644
--- a/interface/web/sites/form/ftp_user.tform.php
+++ b/interface/web/sites/form/ftp_user.tform.php
@@ -29,6 +29,11 @@
Hint:
The ID field of the database table is not part of the datafield definition.
The ID field must be always auto incement (int or bigint).
+
+ Search:
+ - searchable = 1 or searchable = 2 include the field in the search
+ - searchable = 1: this field will be the title of the search result
+ - searchable = 2: this field will be included in the description of the search result
*/
@@ -74,9 +79,9 @@
'formtype' => 'SELECT',
'default' => '',
'datasource' => array ( 'type' => 'SQL',
- 'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
+ 'querystring' => "SELECT web_domain.domain_id, CONCAT(web_domain.domain, ' :: ', server.server_name) AS parent_domain FROM web_domain, server WHERE web_domain.type = 'vhost' AND web_domain.server_id = server.server_id AND {AUTHSQL::web_domain} ORDER BY web_domain.domain",
'keyfield'=> 'domain_id',
- 'valuefield'=> 'domain'
+ 'valuefield'=> 'parent_domain'
),
'value' => ''
),
@@ -92,7 +97,16 @@
'default' => '',
'value' => '',
'width' => '30',
- 'maxlength' => '255'
+ 'maxlength' => '255',
+ 'searchable' => 1
+ ),
+ 'username_prefix' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '25'
),
'password' => array (
'datatype' => 'VARCHAR',
@@ -108,6 +122,9 @@
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'quota_size_error_empty'),
+ 1 => array ( 'type' => 'REGEX',
+ 'regex' => '/^(\-1|[0-9]{1,10})$/',
+ 'errmsg'=> 'quota_size_error_regex'),
),
'default' => '-1',
'value' => '',
@@ -126,7 +143,7 @@
)
);
-if($_SESSION["s"]["user"]["typ"] == 'admin') {
+if($app->auth->is_admin()) {
$form["tabs"]['advanced'] = array (
'title' => "Options",
@@ -151,7 +168,7 @@
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
- 'errmsg'=> 'uid_error_empty'),
+ 'errmsg'=> 'gid_error_empty'),
),
'default' => '0',
'value' => '',
--
Gitblit v1.9.1