From 381520c8866a5f3be7e743e3ae16b6fb2988c495 Mon Sep 17 00:00:00 2001 From: mcramer <m.cramer@pixcept.de> Date: Tue, 21 Aug 2012 13:51:27 -0400 Subject: [PATCH] Implemented FS#1448 - one database user name and multiple databases Bugfix on db-Class (datalog Update) --- interface/web/sites/form/database.tform.php | 40 ++++++++++++++++++---------------------- 1 files changed, 18 insertions(+), 22 deletions(-) diff --git a/interface/web/sites/form/database.tform.php b/interface/web/sites/form/database.tform.php index b26a1e4..c8a7ac9 100644 --- a/interface/web/sites/form/database.tform.php +++ b/interface/web/sites/form/database.tform.php @@ -106,31 +106,27 @@ 'maxlength' => '255', 'searchable' => 1 ), - 'database_user' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'database_user_error_empty'), - 1 => array ( 'type' => 'UNIQUE', - 'errmsg'=> 'database_user_error_unique'), - 2 => array ( 'type' => 'REGEX', - 'regex' => '/^[a-zA-Z0-9_]{2,64}$/', - 'errmsg'=> 'database_user_error_regex'), - ), + 'database_user_id' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255', - 'searchable' => 2 + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => "SELECT database_user_id,database_user FROM web_database_user WHERE {AUTHSQL} ORDER BY database_user", + 'keyfield'=> 'database_user_id', + 'valuefield'=> 'database_user' + ), + 'value' => array('0' => $app->tform->lng('select_dbuser_txt')) ), - 'database_password' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'PASSWORD', - 'encryption' => 'MYSQL', + 'database_ro_user_id' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => "SELECT database_user_id,database_user FROM web_database_user WHERE {AUTHSQL} ORDER BY database_user", + 'keyfield'=> 'database_user_id', + 'valuefield'=> 'database_user' + ), + 'value' => array('0' => $app->tform->lng('no_dbuser_txt')) ), 'database_charset' => array ( 'datatype' => 'VARCHAR', -- Gitblit v1.9.1