Added termination-date to domains
This commit is contained in:
@@ -96,6 +96,22 @@ if ($page == 'domains'
|
||||
}
|
||||
}
|
||||
$row['ipandport'] = substr($row['ipandport'], 0, -1);
|
||||
$row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date']);
|
||||
|
||||
if($row['termination_date'] != "")
|
||||
{
|
||||
$cdate = strtotime($row['termination_date'] . " 23:59:59");
|
||||
$today = time();
|
||||
|
||||
if($cdate < $today)
|
||||
{
|
||||
$row['termination_css'] = 'domain-expired';
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['termination_css'] = 'domain-canceled';
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($domain_array[$row['domain']])) {
|
||||
$domain_array[$row['domain']] = $row;
|
||||
@@ -362,6 +378,9 @@ if ($page == 'domains'
|
||||
$registration_date = trim($_POST['registration_date']);
|
||||
$registration_date = validate($registration_date, 'registration_date', '/^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/', '', array('0000-00-00', '0', ''));
|
||||
|
||||
$termination_date = trim($_POST['termination_date']);
|
||||
$termination_date = validate($termination_date, 'termination_date', '/^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/', '', array('0000-00-00', '0', ''));
|
||||
|
||||
if ($userinfo['change_serversettings'] == '1') {
|
||||
|
||||
$caneditdomain = isset($_POST['caneditdomain']) ? intval($_POST['caneditdomain']) : 0;
|
||||
@@ -714,6 +733,7 @@ if ($page == 'domains'
|
||||
'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests,
|
||||
'specialsettings' => $specialsettings,
|
||||
'registration_date' => $registration_date,
|
||||
'termination_date' => $termination_date,
|
||||
'issubof' => $issubof,
|
||||
'letsencrypt' => $letsencrypt
|
||||
);
|
||||
@@ -761,6 +781,7 @@ if ($page == 'domains'
|
||||
'ssl_redirect' => $ssl_redirect,
|
||||
'add_date' => time(),
|
||||
'registration_date' => $registration_date,
|
||||
'termination_date' => $termination_date,
|
||||
'phpsettingid' => $phpsettingid,
|
||||
'mod_fcgid_starter' => $mod_fcgid_starter,
|
||||
'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests,
|
||||
@@ -793,6 +814,7 @@ if ($page == 'domains'
|
||||
`ssl_redirect` = :ssl_redirect,
|
||||
`add_date` = :add_date,
|
||||
`registration_date` = :registration_date,
|
||||
`termination_date` => :termination_date,
|
||||
`phpsettingid` = :phpsettingid,
|
||||
`mod_fcgid_starter` = :mod_fcgid_starter,
|
||||
`mod_fcgid_maxrequests` = :mod_fcgid_maxrequests,
|
||||
@@ -1154,6 +1176,8 @@ if ($page == 'domains'
|
||||
$caneditdomain = isset($_POST['caneditdomain']) ? intval($_POST['caneditdomain']) : 0;
|
||||
$registration_date = trim($_POST['registration_date']);
|
||||
$registration_date = validate($registration_date, 'registration_date', '/^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/', '', array('0000-00-00', '0', ''));
|
||||
$termination_date = trim($_POST['termination_date']);
|
||||
$termination_date = validate($termination_date, 'termination_date', '/^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/', '', array('0000-00-00', '0', ''));
|
||||
|
||||
$isemaildomain = 0;
|
||||
if (isset($_POST['isemaildomain'])) {
|
||||
@@ -1466,7 +1490,7 @@ if ($page == 'domains'
|
||||
'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests,
|
||||
'specialsettings' => $specialsettings,
|
||||
'registration_date' => $registration_date,
|
||||
'issubof' => $issubof,
|
||||
'termination_date' => $termination_date, 'issubof' => $issubof,
|
||||
'speciallogfile' => $speciallogfile,
|
||||
'speciallogverified' => $speciallogverified,
|
||||
'ipandport' => serialize($ipandports),
|
||||
@@ -1641,6 +1665,7 @@ if ($page == 'domains'
|
||||
$update_data['mod_fcgid_maxrequests'] = $mod_fcgid_maxrequests;
|
||||
$update_data['specialsettings'] = $specialsettings;
|
||||
$update_data['registration_date'] = $registration_date;
|
||||
$update_data['termination_date'] = $termination_date;
|
||||
$update_data['ismainbutsubto'] = $issubof;
|
||||
$update_data['letsencrypt'] = $letsencrypt;
|
||||
$update_data['id'] = $id;
|
||||
@@ -1668,6 +1693,7 @@ if ($page == 'domains'
|
||||
`mod_fcgid_maxrequests` = :mod_fcgid_maxrequests,
|
||||
`specialsettings` = :specialsettings,
|
||||
`registration_date` = :registration_date,
|
||||
`termination_date` = :termination_date,
|
||||
`ismainbutsubto` = :ismainbutsubto,
|
||||
`letsencrypt` = :letsencrypt
|
||||
WHERE `id` = :id
|
||||
|
||||
@@ -36,7 +36,7 @@ if ($page == 'overview') {
|
||||
'd.domain' => $lng['domains']['domainname']
|
||||
);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_DOMAINS, $fields);
|
||||
$domains_stmt = Database::prepare("SELECT `d`.`id`, `d`.`customerid`, `d`.`domain`, `d`.`documentroot`, `d`.`isemaildomain`, `d`.`caneditdomain`, `d`.`iswildcarddomain`, `d`.`parentdomainid`, `d`.`letsencrypt`, `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain`, `da`.`id` AS `domainaliasid`, `da`.`domain` AS `domainalias` FROM `" . TABLE_PANEL_DOMAINS . "` `d`
|
||||
$domains_stmt = Database::prepare("SELECT `d`.`id`, `d`.`customerid`, `d`.`domain`, `d`.`documentroot`, `d`.`isemaildomain`, `d`.`caneditdomain`, `d`.`iswildcarddomain`, `d`.`parentdomainid`, `d`.`letsencrypt`, `d`.`termination_date`, `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain`, `da`.`id` AS `domainaliasid`, `da`.`domain` AS `domainalias` FROM `" . TABLE_PANEL_DOMAINS . "` `d`
|
||||
LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `ad` ON `d`.`aliasdomain`=`ad`.`id`
|
||||
LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `da` ON `da`.`aliasdomain`=`d`.`id`
|
||||
WHERE `d`.`customerid`= :customerid
|
||||
@@ -86,6 +86,22 @@ if ($page == 'overview') {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date']);
|
||||
if($row['termination_date'] != "")
|
||||
{
|
||||
$cdate = strtotime($row['termination_date'] . " 23:59:59");
|
||||
$today = time();
|
||||
|
||||
if($cdate < $today)
|
||||
{
|
||||
$row['termination_css'] = 'domain-expired';
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['termination_css'] = 'domain-canceled';
|
||||
}
|
||||
}
|
||||
|
||||
$domains_count++;
|
||||
$domain_array[$row['domain']] = $row;
|
||||
|
||||
@@ -245,6 +245,7 @@ CREATE TABLE `panel_domains` (
|
||||
`bindserial` varchar(10) NOT NULL default '2000010100',
|
||||
`add_date` int( 11 ) NOT NULL default '0',
|
||||
`registration_date` date NOT NULL,
|
||||
`termination_date` date NOT NULL,
|
||||
`phpsettingid` INT( 11 ) UNSIGNED NOT NULL DEFAULT '1',
|
||||
`mod_fcgid_starter` int(4) default '-1',
|
||||
`mod_fcgid_maxrequests` int(4) default '-1',
|
||||
|
||||
@@ -3061,3 +3061,11 @@ if (isFroxlorVersion('0.9.35-dev1')) {
|
||||
updateToVersion('0.9.35-dev2');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.35-dev2')) {
|
||||
|
||||
showUpdateStep("Updating from 0.9.35-dev2 to 0.9.35-dev3");
|
||||
Database::query("ALTER TABLE `".TABLE_PANEL_DOMAINS."` ADD `termination_date` date NOT NULL AFTER `registration_date`");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToVersion('0.9.35-dev3');
|
||||
}
|
||||
|
||||
@@ -73,6 +73,13 @@ return array(
|
||||
'desc' => $lng['panel']['dateformat'],
|
||||
'type' => 'text',
|
||||
'size' => 10
|
||||
),
|
||||
'termination_date' => array(
|
||||
'label' => $lng['domains']['termination_date'],
|
||||
'desc' => $lng['panel']['dateformat'],
|
||||
'type' => 'text',
|
||||
'value' => $result['termination_date'],
|
||||
'size' => 10
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
@@ -83,6 +83,13 @@ return array(
|
||||
'type' => 'text',
|
||||
'value' => $result['registration_date'],
|
||||
'size' => 10
|
||||
),
|
||||
'termination_date' => array(
|
||||
'label' => $lng['domains']['termination_date'],
|
||||
'desc' => $lng['panel']['dateformat'],
|
||||
'type' => 'text',
|
||||
'value' => $result['termination_date'],
|
||||
'size' => 10
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
// Main version variable
|
||||
$version = '0.9.35-dev2';
|
||||
$version = '0.9.35-dev3';
|
||||
|
||||
// Database version (unused, old stuff from SysCP)
|
||||
$dbversion = '2';
|
||||
|
||||
@@ -1955,3 +1955,7 @@ $lng['error']['autoupdate_8'] = 'The archive could not be extraxted :(';
|
||||
$lng['error']['autoupdate_9'] = 'The MD5 sum of the downloaded file is not correct. Please try to update again.';
|
||||
|
||||
$lng['admin']['server_php'] = 'PHP';
|
||||
|
||||
// Added for Termination-date
|
||||
$lng['domains']['termination_date'] = 'Date of termination';
|
||||
$lng['domains']['termination_date_overview'] = 'canceled until ';
|
||||
@@ -1596,3 +1596,6 @@ $lng['serversettings']['letsencryptcountrycode']['description'] = "2 - stelliger
|
||||
$lng['serversettings']['letsencryptstate']['title'] = "Let's Encrypt Bundesland";
|
||||
$lng['serversettings']['letsencryptstate']['description'] = "Bundesland, welches benutzt wird um Let's Encrypt - Zertifikate zu bestellen.<br><strong class=\"red\">ATTENTION:</strong>Let's Encrypt befindet sich noch im Test</strong>";
|
||||
|
||||
// Added for Termination-date
|
||||
$lng['domains']['termination_date'] = 'Kündigungsdatum';
|
||||
$lng['domains']['termination_date_overview'] = 'gekündigt zum ';
|
||||
@@ -1,8 +1,19 @@
|
||||
<tr>
|
||||
<if $row['termination_date'] != ''>
|
||||
<tr class="{$row['termination_css']}">
|
||||
</if>
|
||||
<if $row['termination_date'] == ''>
|
||||
<tr>
|
||||
</if>
|
||||
|
||||
|
||||
<td>{$row['domain']}
|
||||
<if (isset($row['standardsubdomain']) && $row['standardsubdomain'] == $row['id'])>
|
||||
({$lng['admin']['stdsubdomain']})
|
||||
</if>
|
||||
<if $row['termination_date'] != ''>
|
||||
<br><small><div class="red">({$lng['domains']['termination_date_overview']} {$row['termination_date']})</div></small>
|
||||
</if>
|
||||
|
||||
</td>
|
||||
<td>{$row['ipandport']}</td>
|
||||
<td>{$row['customername']}
|
||||
|
||||
10
templates/Sparkle/assets/css/main.css
vendored
10
templates/Sparkle/assets/css/main.css
vendored
@@ -1493,3 +1493,13 @@ fieldset.file {
|
||||
padding: 5px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.domain-canceled {
|
||||
/* Color copied from .warningcontainer */
|
||||
background-color: #fffecc;
|
||||
}
|
||||
|
||||
.domain-expired {
|
||||
/* Color copied from .errorcontainer */
|
||||
background-color: rgb(242, 222, 222);
|
||||
}
|
||||
@@ -1,5 +1,14 @@
|
||||
<tr>
|
||||
<td><a href="http://{$row['domain']}" target="_blank">{$row['domain']}</a></td>
|
||||
<if $row['termination_date'] != ''>
|
||||
<tr class="{$row['termination_css']}">
|
||||
</if>
|
||||
<if $row['termination_date'] == ''>
|
||||
<tr>
|
||||
</if>
|
||||
<td><a href="http://{$row['domain']}" target="_blank">{$row['domain']}</a>
|
||||
<if $row['termination_date'] != ''>
|
||||
<br><small><div class="red">({$lng['domains']['termination_date_overview']} {$row['termination_date']})</div></small>
|
||||
</if>
|
||||
</td>
|
||||
<td>
|
||||
<if $row['aliasdomain'] == ''>{$row['documentroot']}</if>
|
||||
<if isset($row['aliasdomainid']) && $row['aliasdomainid'] != 0>{$lng['domains']['aliasdomain']} {$row['aliasdomain']}</if>
|
||||
|
||||
Reference in New Issue
Block a user