Commit 381520c8 authored by mcramer's avatar mcramer

Implemented FS#1448 - one database user name and multiple databases

Bugfix on db-Class (datalog Update)
parent 307b0302
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `web_database_user`
--
CREATE TABLE IF NOT EXISTS `web_database_user` (
`database_user_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`sys_userid` int(11) unsigned NOT NULL DEFAULT '0',
`sys_groupid` int(11) unsigned NOT NULL DEFAULT '0',
`sys_perm_user` varchar(5) DEFAULT NULL,
`sys_perm_group` varchar(5) DEFAULT NULL,
`sys_perm_other` varchar(5) DEFAULT NULL,
`server_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
`database_user` varchar(64) DEFAULT NULL,
`database_password` varchar(64) DEFAULT NULL,
PRIMARY KEY (`database_user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
ALTER TABLE `web_database` ADD `database_user_id` INT( 11 ) UNSIGNED NULL DEFAULT NULL AFTER `database_password` ,
ADD `database_ro_user_id` INT( 11 ) UNSIGNED NULL DEFAULT NULL AFTER `database_user_id`,
ADD INDEX ( `database_user_id` ),
ADD INDEX ( `database_ro_user_id` ) ;
-- --------------------------------------------------------
UPDATE `web_database`, `web_database_user` SET `web_database`.`database_user_id` = `web_database_user`.`database_user_id` WHERE `web_database_user`.`database_user` = `web_database`.`database_user`;
-- --------------------------------------------------------
ALTER TABLE `web_database`
DROP `database_user`,
DROP `database_password`;
......@@ -1616,19 +1616,39 @@ CREATE TABLE `web_database` (
`parent_domain_id` int(11) unsigned NOT NULL DEFAULT '0',
`type` varchar(16) NOT NULL DEFAULT 'y',
`database_name` varchar(64) DEFAULT NULL,
`database_user` varchar(64) DEFAULT NULL,
`database_password` varchar(64) DEFAULT NULL,
`database_user_id` int(11) unsigned DEFAULT NULL,
`database_ro_user_id` int(11) unsigned DEFAULT NULL,
`database_charset` varchar(64) DEFAULT NULL,
`remote_access` enum('n','y') NOT NULL DEFAULT 'y',
`remote_ips` text NOT NULL,
`backup_interval` VARCHAR( 255 ) NOT NULL DEFAULT 'none',
`backup_copies` INT NOT NULL DEFAULT '1',
`active` enum('n','y') NOT NULL DEFAULT 'y',
PRIMARY KEY (`database_id`)
PRIMARY KEY (`database_id`),
KEY `database_user_id` (`database_user_id`),
KEY `database_ro_user_id` (`database_ro_user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `web_database_user`
--
CREATE TABLE IF NOT EXISTS `web_database_user` (
`database_user_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`sys_userid` int(11) unsigned NOT NULL DEFAULT '0',
`sys_groupid` int(11) unsigned NOT NULL DEFAULT '0',
`sys_perm_user` varchar(5) DEFAULT NULL,
`sys_perm_group` varchar(5) DEFAULT NULL,
`sys_perm_other` varchar(5) DEFAULT NULL,
`database_user` varchar(64) DEFAULT NULL,
`database_password` varchar(64) DEFAULT NULL,
PRIMARY KEY (`database_user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `web_domain`
--
......
......@@ -299,7 +299,7 @@ public function toLower($record) {
$update_data_str = $update_data;
}
$this->query("UPDATE $tablename SET $update_data WHERE $index_field = '$index_value'");
$this->query("UPDATE $tablename SET $update_data_str WHERE $index_field = '$index_value'");
$new_rec = $this->queryOneRecord("SELECT * FROM $tablename WHERE $index_field = '$index_value'");
$this->datalogSave($tablename, 'UPDATE', $index_field, $index_value, $old_rec, $new_rec, $force_update);
......
......@@ -46,6 +46,41 @@ require_once('../../lib/app.inc.php');
$app->auth->check_module_permissions('sites');
$app->uses("tform_actions");
$app->tform_actions->onDelete();
class page_action extends tform_actions {
function onBeforeDelete() {
global $app; $conf;
if($app->tform->checkPerm($this->id,'d') == false) $app->error($app->lng('error_no_delete_permission'));
$old_record = $app->tform->getDataRecord($this->id);
if($old_record['database_user_id']) {
// check if any database on the server still uses this one
$check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . intval($old_record['server_id']) . "' AND (`database_user_id` = '" . intval($old_record['database_user_id']) . "' OR `database_ro_user_id` = '" . intval($old_record['database_user_id']) . "') AND `sys_groupid` = '" . intval($old_record['sys_groupid']) . "' AND `database_id` != '" . intval($this->id) . "'");
if($check['cnt'] < 1) {
// send a datalog delete
$db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . intval($old_record['database_user_id']) . "' AND `sys_groupid` = '" . intval($old_record['sys_groupid']) . "'");
if($db_user) {
$db_user['server_id'] = $old_record['server_id'];
$app->db->datalogSave('web_database_user', 'DELETE', 'database_user_id', $db_user['database_user_id'], $db_user, array());
}
}
}
if($old_record['database_ro_user_id']) {
// check if any database on the server still uses this one
$check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_database` WHERE `server_id` = '" . intval($old_record['server_id']) . "' AND (`database_user_id` = '" . intval($old_record['database_ro_user_id']) . "' OR `database_ro_user_id` = '" . intval($old_record['database_ro_user_id']) . "') AND `sys_groupid` = '" . intval($old_record['sys_groupid']) . "' AND `database_id` != '" . intval($this->id) . "'");
if($check['cnt'] < 1) {
// send a datalog delete
$db_user = $app->db->queryOneRecord("SELECT * FROM `web_database_user` WHERE `database_user_id` = '" . intval($old_record['database_ro_user_id']) . "' AND `sys_groupid` = '" . intval($old_record['sys_groupid']) . "'");
if($db_user) {
$db_user['server_id'] = $old_record['server_id'];
$app->db->datalogSave('web_database_user', 'DELETE', 'database_user_id', $db_user['database_user_id'], $db_user, array());
}
}
}
}
}
$page = new page_action;
$page->onDelete();
?>
\ No newline at end of file
This diff is collapsed.
<?php
/*
Copyright (c) 2008, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/******************************************
* Begin Form configuration
******************************************/
$list_def_file = "list/database_user.list.php";
$tform_def_file = "form/database_user.tform.php";
/******************************************
* End Form configuration
******************************************/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
//* Check permissions for module
$app->auth->check_module_permissions('sites');
$app->uses("tform_actions");
class page_action extends tform_actions {
function onBeforeDelete() {
global $app; $conf;
if($app->tform->checkPerm($this->id,'d') == false) $app->error($app->lng('error_no_delete_permission'));
$old_record = $app->tform->getDataRecord($this->id);
$app->db->datalogDelete('web_database_user', 'database_user_id', $this->id);
}
function onAfterDelete() { // this has to be done on AFTER delete, because we need the db user still in the database when the server plugin processes the datalog
global $app; $conf;
//* Update all records that belog to this user
$records = $app->db->queryAllRecords("SELECT database_id FROM web_database WHERE database_user_id = '".intval($this->id)."'");
foreach($records as $rec) {
$app->db->datalogUpdate('web_database','database_user_id=NULL','database_id', $rec['database_id']);
}
$records = $app->db->queryAllRecords("SELECT database_id FROM web_database WHERE database_ro_user_id = '".intval($this->id)."'");
foreach($records as $rec) {
$app->db->datalogUpdate('web_database','database_ro_user_id=NULL','database_id', $rec['database_id']);
}
}
}
$page = new page_action;
$page->onDelete();
?>
\ No newline at end of file
This diff is collapsed.
<?php
/*
Copyright (c) 2008, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
/******************************************
* Begin Form configuration
******************************************/
$list_def_file = "list/database_user.list.php";
/******************************************
* End Form configuration
******************************************/
//* Check permissions for module
$app->auth->check_module_permissions('sites');
$app->load('listform_actions');
class list_action extends listform_actions {
function onShow() {
global $app,$conf;
parent::onShow();
}
}
$list = new list_action;
$list->SQLOrderBy = 'ORDER BY database_user';
$list->onLoad();
?>
\ No newline at end of file
......@@ -106,31 +106,27 @@ $form["tabs"]['database'] = array (
'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',
......
<?php
/*
Form Definition
Tabledefinition
Datatypes:
- INTEGER (Forces the input to Int)
- DOUBLE
- CURRENCY (Formats the values to currency notation)
- VARCHAR (no format check, maxlength: 255)
- TEXT (no format check)
- DATE (Dateformat, automatic conversion to timestamps)
Formtype:
- TEXT (Textfield)
- TEXTAREA (Textarea)
- PASSWORD (Password textfield, input is not shown when edited)
- SELECT (Select option field)
- RADIO
- CHECKBOX
- CHECKBOXARRAY
- FILE
VALUE:
- Wert oder Array
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
*/
$form["title"] = "Database User";
$form["description"] = "";
$form["name"] = "database_user";
$form["action"] = "database_user_edit.php";
$form["db_table"] = "web_database_user";
$form["db_table_idx"] = "database_user_id";
$form["db_history"] = "no";
$form["tab_default"] = "database_user";
$form["list_default"] = "database_user_list.php";
$form["auth"] = 'yes'; // yes / no
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
$form["tabs"]['database_user'] = array (
'title' => "Database User",
'width' => 100,
'template' => "templates/database_user_edit.htm",
'fields' => array (
##################################
# Begin Datatable fields
##################################
'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'),
),
'default' => '',
'value' => '',
'width' => '30',
'maxlength' => '255',
'searchable' => 2
),
'database_password' => array (
'datatype' => 'VARCHAR',
'formtype' => 'PASSWORD',
'encryption' => 'MYSQL',
'default' => '',
'value' => '',
'width' => '30',
'maxlength' => '255'
),
##################################
# ENDE Datatable fields
##################################
)
);
?>
\ No newline at end of file
......@@ -3,10 +3,14 @@ $wb['server_id_txt'] = 'Server';
$wb['type_txt'] = 'Typ';
$wb['database_name_txt'] = 'Datenbankname';
$wb['database_user_txt'] = 'Datenbank-Benutzer';
$wb['database_ro_user_txt'] = 'Nur-Lesen Datenbank-Benutzer';
$wb['optional_txt'] = 'optional';
$wb['database_password_txt'] = 'Datenbank-Passwort';
$wb['database_charset_txt'] = 'Datenbank Zeichensatz';
$wb['remote_access_txt'] = 'Remotezugang';
$wb['remote_ips_txt'] = 'Remotezugang-IPs (mit Komma trennen, keine Eingabe für <i>alle</i>)';
$wb['select_dbuser_txt'] = 'Datenbank User auswählen';
$wb['no_dbuser_txt'] = 'Keiner';
$wb['remote_access_txt'] = 'Remotezugriff';
$wb['remote_ips_txt'] = 'Remotezugriff-IPs (mit Komma trennen, keine Eingabe für <i>alle</i>)';
$wb['database_remote_error_ips'] = 'Mindestens eine der eingegebenen IP-Adressen ist ungültig.';
$wb['client_txt'] = 'Kunde';
$wb['active_txt'] = 'Aktiv';
......
<?php
$wb['list_head_txt'] = 'Datenbank';
$wb['active_txt'] = 'Aktiv';
$wb['remote_access_txt'] = 'Remotezugang';
$wb['remote_access_txt'] = 'Remotezugriff';
$wb['server_id_txt'] = 'Server';
$wb['database_name_txt'] = 'Datenbankname';
$wb['add_new_record_txt'] = 'Neue Datenbank hinzufügen';
......
<?php
$wb['database_user_txt'] = 'Datenbank-Benutzer';
$wb['database_password_txt'] = 'Datenbank-Passwort';
$wb['client_txt'] = 'Kunde';
$wb['active_txt'] = 'Aktiv';
$wb['database_user_error_empty'] = 'Datenbank Benutzer ist leer.';
$wb['database_user_error_unique'] = 'Es existiert bereits ein Benutzer mit diesem Namen am Server. Um einen eindeutigen Namen zu erhalten können sie z.B. den Domainnamen vor dem Benutzernamen verwenden.';
$wb['database_user_error_regex'] = 'Ungültiger Benutzername. Der Benutzername darf die Zeichen: a-z, A-Z, 0-9 und den Unterstrich beinhalten. Länge: 2 - 64 Zeichen.';
$wb['password_strength_txt'] = 'Passwortkomplexität';
$wb['database_user_error_len'] = 'Datenbank Benutzername - {user} - zu lang. Die max. Datenbank Benutzernamen Länge inkl. Präfix ist 16 Zeichen.';
$wb['generate_password_txt'] = 'Passwort erzeugen';
$wb['repeat_password_txt'] = 'Passwort wiederholen';
$wb['password_mismatch_txt'] = 'Die Passwörter stimmen nicht überein.';
$wb['password_match_txt'] = 'Die Passwörter stimmen überein.';
$wb['btn_save_txt'] = 'Speichern';
$wb['btn_cancel_txt'] = 'Abbrechen';
$wb['globalsearch_resultslimit_of_txt'] = 'von';
$wb['globalsearch_resultslimit_results_txt'] = 'Treffern';
$wb['globalsearch_noresults_text_txt'] = 'Keine Treffer.';
$wb['globalsearch_noresults_limit_txt'] = '0 Treffer';
$wb['globalsearch_searchfield_watermark_txt'] = 'Suche';
$wb['globalsearch_suggestions_text_txt'] = 'Vorschläge';
?>
<?php
$wb['list_head_txt'] = 'Datenbank User';
$wb['add_new_record_txt'] = 'Neuen User hinzufügen';
$wb['database_user_txt'] = 'Datenbank User';
$wb['sys_groupid_txt'] = 'Kunde';
?>
<?php
$wb['list_head_txt'] = 'Datenbank User';
$wb['add_new_record_txt'] = 'Neuen User hinzufügen';
$wb['database_user_txt'] = 'Datenbank User';
?>
......@@ -3,9 +3,13 @@ $wb["server_id_txt"] = 'Server';
$wb["type_txt"] = 'Type';
$wb["database_name_txt"] = 'Database name';
$wb["database_user_txt"] = 'Database user';
$wb['database_ro_user_txt'] = 'Read-only database user';
$wb['optional_txt'] = 'optional';
$wb["database_password_txt"] = 'Database password';
$wb["password_strength_txt"] = 'Password strength';
$wb["database_charset_txt"] = 'Database charset';
$wb['select_dbuser_txt'] = 'Select database user';
$wb['no_dbuser_txt'] = 'None';
$wb["remote_access_txt"] = 'Remote Access';
$wb["remote_ips_txt"] = 'Remote Access IPs (separate by , and leave blank for <i>any</i>)';
$wb["database_remote_error_ips"] = 'At least one of the entered ip addresses is invalid.';
......
<?php
$wb["database_user_txt"] = 'Database user';
$wb["database_password_txt"] = 'Database password';
$wb["password_strength_txt"] = 'Password strength';
$wb["client_txt"] = 'Client';
$wb["active_txt"] = 'Active';
$wb["database_user_error_empty"] = 'Database user is empty.';
$wb["database_user_error_unique"] = 'There is already a database user with this name on the server. To get a unique name, e.g. prepend your domain name to the username.';
$wb["database_user_error_regex"] = 'Invalid database user name. The username may contain these characters: a-z, A-Z, 0-9 and the underscore. Length: 2 - 64 characters.';
$wb["database_user_error_len"] = 'Database username - {user} - too long. The max. database username length incl. prefix is 16 chars.';
$wb["btn_save_txt"] = 'Save';
$wb["btn_cancel_txt"] = 'Cancel';
$wb['generate_password_txt'] = 'Generate Password';
$wb['repeat_password_txt'] = 'Repeat Password';
$wb['password_mismatch_txt'] = 'The passwords do not match.';
$wb['password_match_txt'] = 'The passwords do match.';
$wb['globalsearch_resultslimit_of_txt'] = "of";
$wb['globalsearch_resultslimit_results_txt'] = "results";
$wb['globalsearch_noresults_text_txt'] = "No results.";
$wb['globalsearch_noresults_limit_txt'] = "0 results";
$wb['globalsearch_searchfield_watermark_txt'] = "Search";
$wb['globalsearch_suggestions_text_txt'] = "Suggestions";
?>
<?php
$wb["list_head_txt"] = 'Database User';
$wb["database_user_txt"] = 'Database user';
$wb["add_new_record_txt"] = 'Add new User';
$wb["sys_groupid_txt"] = 'Client';
?>
\ No newline at end of file
<?php
$wb["list_head_txt"] = 'Database user';
$wb["database_user_txt"] = 'Database user';
$wb["add_new_record_txt"] = 'Add new user';
?>
\ No newline at end of file
......@@ -62,15 +62,12 @@ $items[] = array( 'title' => "Database",
'link' => 'sites/database_list.php',
'html_id' => 'database_list');
/*
Database User (for future development)
$items[] = array( 'title' => "Database User",
'target' => 'content',
'link' => 'sites/database_user_list.php',
'html_id' => 'database_user_list'
);
*/
$module["nav"][] = array( 'title' => 'Database',
'open' => 1,
......
<?php
$function_list['sites_cron_get,sites_cron_add,sites_cron_update,sites_cron_delete'] = 'Sites cron functions';
$function_list['sites_database_get,sites_database_add,sites_database_update,sites_database_delete, sites_database_get_all_by_user'] = 'Sites database functions';
$function_list['sites_database_get,sites_database_add,sites_database_update,sites_database_delete, sites_database_get_all_by_user,sites_database_user_get,sites_database_user_add,sites_database_user_update,sites_database_user_delete, sites_database_user_get_all_by_user'] = 'Sites database functions';
$function_list['sites_web_folder_get,sites_web_folder_add,sites_web_folder_update,sites_web_folder_delete,sites_web_folder_user_get,sites_web_folder_user_add,sites_web_folder_user_update,sites_web_folder_user_delete'] = 'Sites Protected folder functions';
$function_list['sites_ftp_user_get,sites_ftp_user_server_get,sites_ftp_user_add,sites_ftp_user_update,sites_ftp_user_delete'] = 'Sites FTP-User functions';
$function_list['sites_shell_user_get,sites_shell_user_add,sites_shell_user_update,sites_shell_user_delete'] = 'Sites Shell-User functions';
......
......@@ -100,12 +100,17 @@ $liste["item"][] = array( 'field' => "server_id",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "database_user",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
$liste["item"][] = array( 'field' => "database_user_id",
'datatype' => "INTEGER",
'formtype' => "SELECT",
'op' => "=",
'prefix' => "",
'suffix' => "",
'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'
),
'width' => "",
'value' => "");
......
<?php
/*
Datatypes:
- INTEGER
- DOUBLE
- CURRENCY
- VARCHAR
- TEXT
- DATE
*/
// Name of the list
if($_SESSION['s']['user']['typ'] == 'admin') {
$liste["name"] = "database_user_admin";
} else {
$liste["name"] = "database_user";
}
// Database table
$liste["table"] = "web_database_user";
// Index index field of the database table
$liste["table_idx"] = "database_user_id";
// Search Field Prefix
$liste["search_prefix"] = "search_";
// Records per page
$liste["records_per_page"] = "15";
// Script File of the list
$liste["file"] = "database_user_list.php";
// Script file of the edit form
$liste["edit_file"] = "database_user_edit.php";
// Script File of the delete script
$liste["delete_file"] = "database_user_del.php";
// Paging Template
$liste["paging_tpl"] = "templates/paging.tpl.htm";
// Enable auth
$liste["auth"] = "yes";