- show aps-databases also customer-mysql overview, fixes #272
- aps-databases are now increasing the customers mysql-contingent, refs #278 - customers viewing the aps-list are now notified if a package requires a database but the contingent is used up - the update will add all web[X]aps[Y] databases to the according customer regardless of contingent - fix tiny issue in preconfig - setting version to 0.9.10-svn2 refs #272,278
This commit is contained in:
@@ -248,6 +248,7 @@ CREATE TABLE `panel_databases` (
|
||||
`databasename` varchar(255) NOT NULL default '',
|
||||
`description` varchar(255) NOT NULL default '',
|
||||
`dbserver` int(11) unsigned NOT NULL default '0',
|
||||
`apsdb` tinyint(1) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `customerid` (`customerid`)
|
||||
) TYPE=MyISAM ;
|
||||
@@ -451,7 +452,7 @@ INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) V
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (18, 'system', 'vmail_homedir', '/var/customers/mail/');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (19, 'system', 'bindconf_directory', '/etc/bind/');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (20, 'system', 'bindreload_command', '/etc/init.d/bind9 reload');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (22, 'panel', 'version', '0.9.10-svn1');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (22, 'panel', 'version', '0.9.10-svn2');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (23, 'system', 'hostname', 'SERVERNAME');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (24, 'login', 'maxloginattempts', '3');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (25, 'login', 'deactivatetime', '900');
|
||||
|
||||
@@ -837,3 +837,37 @@ if(isFroxlorVersion('0.9.9'))
|
||||
|
||||
updateToVersion('0.9.10-svn1');
|
||||
}
|
||||
|
||||
if(isFroxlorVersion('0.9.10-svn1'))
|
||||
{
|
||||
showUpdateStep("Updating from 0.9.10-svn1 to 0.9.10-svn2", false);
|
||||
|
||||
showUpdateStep("Updating database table definition for panel_databases");
|
||||
$db->query("ALTER TABLE `" . TABLE_PANEL_DATABASES . "` ADD `apsdb` tinyint(1) NOT NULL default '0' AFTER `dbserver`;");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Adding APS databases to customers overview");
|
||||
$count_dbupdates = 0;
|
||||
$db_root = null;
|
||||
openRootDB();
|
||||
$result = $db_root->query("SHOW DATABASES;");
|
||||
while($row = $db_root->fetch_array($result))
|
||||
{
|
||||
if(preg_match('/^web([0-9]+)aps([0-9]+)$/', $row['Database']))
|
||||
{
|
||||
$cid = substr($row['Database'], 3, strpos($row['Database'], 'aps')- 3);
|
||||
$databasedescription = 'APS DB';
|
||||
$result = $db->query('INSERT INTO `' . TABLE_PANEL_DATABASES . '` (`customerid`, `databasename`, `description`, `dbserver`, `apsdb`) VALUES ("' . (int)$cid . '", "' . $db->escape($row['Database']) . '", "' . $db->escape($databasedescription) . '", "0", "1")');
|
||||
$result = $db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `mysqls_used`=`mysqls_used`+1 WHERE `customerid`="' . (int)$cid . '"');
|
||||
$count_dbupdates++;
|
||||
}
|
||||
}
|
||||
closeRootDB();
|
||||
if($count_dbupdates > 0) {
|
||||
lastStepStatus(0, "Found ".$count_dbupdates." customer APS databases");
|
||||
} else {
|
||||
lastStepStatus(0, "None found");
|
||||
}
|
||||
|
||||
updateToVersion('0.9.10-svn2');
|
||||
}
|
||||
|
||||
@@ -192,20 +192,23 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
}
|
||||
}
|
||||
|
||||
$description = 'Please enter the correct username/groupname of the webserver on your system We\'re guessing the user but it might not be correct, so please check.';
|
||||
if($has_nouser)
|
||||
if($has_nouser || $has_nogroup)
|
||||
{
|
||||
$question = '<strong>Please enter the webservers username:</strong> <input type="text" class="text" name="update_httpuser" value="'.$guessed_user.'" />';
|
||||
}
|
||||
elseif($has_nogroup)
|
||||
{
|
||||
$question2 = '<strong>Please enter the webservers groupname:</strong> <input type="text" class="text" name="update_httpgroup" value="'.$guessed_group.'" />';
|
||||
if($has_nouser) {
|
||||
$question .= '<br /><br />'.$question2;
|
||||
} else {
|
||||
$question = $question2;
|
||||
$description = 'Please enter the correct username/groupname of the webserver on your system We\'re guessing the user but it might not be correct, so please check.';
|
||||
if($has_nouser)
|
||||
{
|
||||
$question = '<strong>Please enter the webservers username:</strong> <input type="text" class="text" name="update_httpuser" value="'.$guessed_user.'" />';
|
||||
}
|
||||
elseif($has_nogroup)
|
||||
{
|
||||
$question2 = '<strong>Please enter the webservers groupname:</strong> <input type="text" class="text" name="update_httpgroup" value="'.$guessed_group.'" />';
|
||||
if($has_nouser) {
|
||||
$question .= '<br /><br />'.$question2;
|
||||
} else {
|
||||
$question = $question2;
|
||||
}
|
||||
}
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user