| | |
| | | `database_name` varchar(255) default NULL, |
| | | `database_user` varchar(255) default NULL, |
| | | `database_password` varchar(255) default NULL, |
| | | `database_charset` varchar(64) default NULL, |
| | | `remote_access` varchar(255) NOT NULL default 'y', |
| | | `active` varchar(255) NOT NULL default 'y', |
| | | PRIMARY KEY (`database_id`) |
| | |
| | | function onUpdate() { |
| | | global $app, $conf; |
| | | |
| | | //* Prevent that the database name is changed |
| | | //* Prevent that the database name and charset is changed |
| | | $old_record = $app->tform->getDataRecord($this->id); |
| | | if($old_record["database_name"] != $this->dataRecord["database_name"]) { |
| | | $app->tform->errorMessage .= $app->tform->wordbook["database_name_change_txt"].'<br />'; |
| | | } |
| | | if($old_record["database_charset"] != $this->dataRecord["database_charset"]) { |
| | | $app->tform->errorMessage .= $app->tform->wordbook["database_charset_change_txt"].'<br />'; |
| | | } |
| | | unset($old_record); |
| | | |
| | | parent::onUpdate(); |
| | |
| | | 'width' => '30', |
| | | 'maxlength' => '255' |
| | | ), |
| | | 'database_charset' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'SELECT', |
| | | 'default' => 'y', |
| | | 'value' => array('' => 'MySQL Default','latin1' => 'Latin 1','utf8' => 'UTF-8') |
| | | ), |
| | | 'remote_access' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'CHECKBOX', |
| | |
| | | $wb['database_name_txt'] = 'Database name'; |
| | | $wb['database_user_txt'] = 'Database user'; |
| | | $wb['database_password_txt'] = 'Database password'; |
| | | $wb["database_charset_txt"] = 'Database charset'; |
| | | $wb['remote_access_txt'] = 'Remote Access'; |
| | | $wb['client_txt'] = 'Client'; |
| | | $wb['active_txt'] = 'Active'; |
| | |
| | | $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['limit_database_txt'] = 'The max. number of databases is reached.'; |
| | | $wb['database_name_change_txt'] = 'The database name can not be changed'; |
| | | $wb["database_charset_change_txt"] = 'The database charset can not be changed'; |
| | | ?> |
| | |
| | | $wb["database_name_txt"] = 'Database name'; |
| | | $wb["database_user_txt"] = 'Database user'; |
| | | $wb["database_password_txt"] = 'Database password'; |
| | | $wb["database_charset_txt"] = 'Database charset'; |
| | | $wb["remote_access_txt"] = 'Remote Access'; |
| | | $wb["client_txt"] = 'Client'; |
| | | $wb["active_txt"] = 'Active'; |
| | |
| | | $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["limit_database_txt"] = 'The max. number of databases is reached.'; |
| | | $wb["database_name_change_txt"] = 'The database name can not be changed'; |
| | | $wb["database_charset_change_txt"] = 'The database charset can not be changed'; |
| | | ?> |
| | |
| | | $wb["database_name_txt"] = 'Databasenaam';
|
| | | $wb["database_user_txt"] = 'Database gebruiker';
|
| | | $wb["database_password_txt"] = 'Database wachtwoord';
|
| | | $wb["database_charset_txt"] = 'Database charset';
|
| | | $wb["remote_access_txt"] = 'Remote Access';
|
| | | $wb["client_txt"] = 'Klant';
|
| | | $wb["active_txt"] = 'Actief';
|
| | |
| | | $wb["database_user_error_regex"] = 'Ongeldige database gebruikersnaam. De gebruikersnaam bevat deze karakters: a-z, A-Z, 0-9 en de underscore. Lengte: 2 - 64 karakters.';
|
| | | $wb["limit_database_txt"] = 'The max. aantal databases is bereikt.';
|
| | | $wb["database_name_change_txt"] = 'De databasenaam kan niet worden gewijzigd.';
|
| | | $wb["database_charset_change_txt"] = 'The database charset can not be changed';
|
| | | ?>
|
| | |
| | | $wb["database_name_txt"] = 'Database name'; |
| | | $wb["database_user_txt"] = 'Database user'; |
| | | $wb["database_password_txt"] = 'Database password'; |
| | | $wb["database_charset_txt"] = 'Database charset'; |
| | | $wb["remote_access_txt"] = 'Remote Access'; |
| | | $wb["client_txt"] = 'Client'; |
| | | $wb["active_txt"] = 'Активный'; |
| | |
| | | $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["limit_database_txt"] = 'The max. number of databases is reached.'; |
| | | $wb["database_name_change_txt"] = 'The database name can not be changed'; |
| | | $wb["database_charset_change_txt"] = 'The database charset can not be changed'; |
| | | ?> |
| | |
| | | <td class="frmText11"><input name="database_password" type="password" class="text" value="{tmpl_var name='database_password'}" size="30" maxlength="255"></td> |
| | | </tr> |
| | | <tr> |
| | | <td class="frmText11">{tmpl_var name='database_charset_txt'}:</td> |
| | | <td class="frmText11"> |
| | | <select name="database_charset" class="text"> |
| | | {tmpl_var name='database_charset'} |
| | | </select> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td class="frmText11">{tmpl_var name='remote_access_txt'}:</td> |
| | | <td class="frmText11">{tmpl_var name='remote_access'}</td> |
| | | </tr> |
| | |
| | | return; |
| | | } |
| | | |
| | | // Charset for the new table |
| | | if($data["new"]["database_charset"] != '') { |
| | | $query_charset_table = ' DEFAULT CHARACTER SET '.$data["new"]["database_charset"]; |
| | | } else { |
| | | $query_charset_table = ''; |
| | | } |
| | | |
| | | //* Create the new database |
| | | if (mysql_query('CREATE DATABASE '.mysql_real_escape_string($data["new"]["database_name"]),$link)) { |
| | | if (mysql_query('CREATE DATABASE '.mysql_real_escape_string($data["new"]["database_name"]).$query_charset_table,$link)) { |
| | | $app->log('Created MySQL database: '.$data["new"]["database_name"],LOGLEVEL_DEBUG); |
| | | } else { |
| | | $app->log('Unable to connect to the database'.mysql_error($link),LOGLEVEL_ERROR); |