Commit 98f80bef authored by Till Brehm's avatar Till Brehm
Browse files

Merge branch 'stable-3.1' of git.ispconfig.org:ispconfig/ispconfig3 into stable-3.1

parents dc897969 9ae44824
......@@ -25,7 +25,7 @@ ALTER TABLE `client_template`
ALTER TABLE `client` ADD `contact_firstname` VARCHAR( 64 ) NOT NULL DEFAULT '' AFTER `gender`;
UPDATE `dns_template` SET `fields` = 'DOMAIN,IP,NS1,NS2,EMAIL,DKIM' WHERE `dns_template`.`template_id` =1;
UPDATE `dns_template` SET `fields` = 'DOMAIN,IP,NS1,NS2,EMAIL,DKIM,DNSSEC' WHERE `dns_template`.`template_id` =1;
UPDATE `dns_template` SET `template` = '[ZONE]
origin={DOMAIN}.
ns={NS1}.
......
......@@ -2397,7 +2397,7 @@ INSERT INTO `country` (`iso`, `name`, `printable_name`, `iso3`, `numcode`, `eu`)
-- Dumping data for table `dns_template`
--
INSERT INTO `dns_template` (`template_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `name`, `fields`, `template`, `visible`) VALUES (1, 1, 1, 'riud', 'riud', '', 'Default', 'DOMAIN,IP,NS1,NS2,EMAIL,DKIM', '[ZONE]\norigin={DOMAIN}.\nns={NS1}.\nmbox={EMAIL}.\nrefresh=7200\nretry=540\nexpire=604800\nminimum=3600\nttl=3600\n\n[DNS_RECORDS]\nA|{DOMAIN}.|{IP}|0|3600\nA|www|{IP}|0|3600\nA|mail|{IP}|0|3600\nNS|{DOMAIN}.|{NS1}.|0|3600\nNS|{DOMAIN}.|{NS2}.|0|3600\nMX|{DOMAIN}.|mail.{DOMAIN}.|10|3600\nTXT|{DOMAIN}.|v=spf1 mx a ~all|0|3600', 'y');
INSERT INTO `dns_template` (`template_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `name`, `fields`, `template`, `visible`) VALUES (1, 1, 1, 'riud', 'riud', '', 'Default', 'DOMAIN,IP,NS1,NS2,EMAIL,DKIM,DNSSEC', '[ZONE]\norigin={DOMAIN}.\nns={NS1}.\nmbox={EMAIL}.\nrefresh=7200\nretry=540\nexpire=604800\nminimum=3600\nttl=3600\n\n[DNS_RECORDS]\nA|{DOMAIN}.|{IP}|0|3600\nA|www|{IP}|0|3600\nA|mail|{IP}|0|3600\nNS|{DOMAIN}.|{NS1}.|0|3600\nNS|{DOMAIN}.|{NS2}.|0|3600\nMX|{DOMAIN}.|mail.{DOMAIN}.|10|3600\nTXT|{DOMAIN}.|v=spf1 mx a ~all|0|3600', 'y');
-- --------------------------------------------------------
......
......@@ -206,7 +206,7 @@ class page_action extends tform_actions {
if($reseller['customer_no_template'] != '') {
//* Set customer no default
$customer_no = $app->functions->intval($reseller['customer_no_start']+$reseller['customer_no_counter']);
$customer_no_string = str_replace('[CUSTOMER_NO]',$customer_no,$reseller['customer_no_template']);
$customer_no_string = str_replace(array('[CUSTOMER_NO]','[CLIENTID]'),array($customer_no, $reseller['client_id']),$reseller['customer_no_template']);
$app->tpl->setVar('customer_no',$customer_no_string);
}
}
......
......@@ -300,6 +300,7 @@ if($_POST['create'] == 1) {
if($_POST['ns1'] != '') $tpl_content = str_replace('{NS1}', $_POST['ns1'], $tpl_content);
if($_POST['ns2'] != '') $tpl_content = str_replace('{NS2}', $_POST['ns2'], $tpl_content);
if($_POST['email'] != '') $tpl_content = str_replace('{EMAIL}', $_POST['email'], $tpl_content);
$enable_dnssec = (($_POST['dnssec'] == 'Y') ? 'Y' : 'N');
if(isset($_POST['dkim']) && preg_match('/^[\w\.\-\/]{2,255}\.[a-zA-Z0-9\-]{2,30}[\.]{0,1}$/', $_POST['domain'])) {
$sql = $app->db->queryOneRecord("SELECT dkim_public, dkim_selector FROM mail_domain WHERE domain = ? AND dkim = 'y' AND ".$app->tform->getAuthSQL('r'), $_POST['domain']);
$public_key = $sql['dkim_public'];
......@@ -395,7 +396,8 @@ if($_POST['create'] == 1) {
"active" => 'Y',
"xfer" => $xfer,
"also_notify" => $also_notify,
"update_acl" => $update_acl
"update_acl" => $update_acl,
"dnssec_wanted" => $enable_dnssec
);
$dns_soa_id = $app->db->datalogInsert('dns_soa', $insert_data, 'id');
......
......@@ -74,7 +74,7 @@ $form["tabs"]['template'] = array (
'formtype' => 'CHECKBOXARRAY',
'default' => '',
'separator' => ',',
'value' => array('DOMAIN' => 'Domain', 'IP' => 'IP Address', 'IPV6' => 'IPv6 Address', 'NS1' => 'NS 1', 'NS2' => 'NS 2', 'EMAIL' => 'Email', 'DKIM' => 'DKIM'),
'value' => array('DOMAIN' => 'Domain', 'IP' => 'IP Address', 'IPV6' => 'IPv6 Address', 'NS1' => 'NS 1', 'NS2' => 'NS 2', 'EMAIL' => 'Email', 'DKIM' => 'DKIM', 'DNSSEC' => 'DNSSEC'),
'validators' => array ( 0 => array ('type' => 'CUSTOM',
'class' => 'validate_dkim',
'function' => 'check_template',
......
......@@ -89,10 +89,16 @@
<div class="col-sm-9"><input type="text" name="email" id="email" value="{tmpl_var name='email'}" class="form-control" /></div></div>
</tmpl_if>
<tmpl_if name="DKIM_VISIBLE">
<label for="dkim" class="col-sm-3 control-label">{tmpl_var name='dkim_txt'}</label>
&nbsp;&nbsp;<input type="checkbox" disabled readonly checked><input name="dkim" type="hidden" maxlength="255" type="text"/>
<div class="form-group">
<label for="dkim" class="col-sm-3 control-label">{tmpl_var name='dkim_txt'}</label>
<div class="col-sm-9"><input type="checkbox" disabled readonly checked><input name="dkim" type="hidden" maxlength="255" type="text"/></div></div>
</tmpl_if>
<tmpl_if name="DNSSEC_VISIBLE">
<div class="form-group">
<label for="dkim" class="col-sm-3 control-label">{tmpl_var name='dnssec_txt'}</label>
<div class="col-sm-9"><input type="checkbox" name="dnssec" value="Y"></div></div>
</tmpl_if>
<input type="hidden" name="create" value="0" />
......
......@@ -60,7 +60,7 @@ if(count($_POST) > 0) {
//** Check variables
if(!preg_match("/^[\w\.\-\_\@]{1,128}$/", $_POST['username'])) $error = $app->lng('user_regex_error');
if(!preg_match("/^.{1,64}$/i", $_POST['password'])) $error = $app->lng('pw_error_length');
if(!preg_match("/^.{1,256}$/i", $_POST['password'])) $error = $app->lng('pw_error_length');
//** importing variables
$ip = ip2long($_SERVER['REMOTE_ADDR']);
......
......@@ -10,7 +10,7 @@ $wb['pw_error_noinput'] = 'Please enter email address and username.';
$wb['pw_reset_mail_msg'] = 'The password to your ISPConfig 3 control panel account has been reset. The new password is: ';
$wb['pw_reset_mail_title'] = 'ISPConfig 3 Control panel password has been reset.';
$wb['user_regex_error'] = 'Username contains unallowed characters or is longer then 64 characters.';
$wb['pw_error_length'] = 'The password length is < 1 or > 64 characters.';
$wb['pw_error_length'] = 'The password length is < 1 or > 256 characters.';
$wb['username_txt'] = 'Username';
$wb['password_txt'] = 'Password';
$wb['login_button_txt'] = 'Login';
......
......@@ -6,7 +6,7 @@ $wb['pw_error_noinput'] = 'Моля въведете потребителско
$wb['pw_reset_mail_msg'] = 'Новата парола за вашия ISPConfig 3 контролен панел е:';
$wb['pw_reset_mail_title'] = 'Нова парола за вашия ISPConfig 3 контролен панел';
$wb['user_regex_error'] = 'Потребителско име contains unallowed characters or is longer then 64 characters.';
$wb['pw_error_length'] = 'The password length is < 1 or > 64 characters.';
$wb['pw_error_length'] = 'The password length is < 1 or > 256 characters.';
$wb['error_user_password_empty'] = 'Потребителско име or Password empty.';
$wb['error_user_password_incorrect'] = 'Потребителско име or Password wrong.';
$wb['error_user_blocked'] = 'User is blocked.';
......
......@@ -13,7 +13,7 @@ $wb['pw_reset_mail_title'] = 'Ihr Passwort wurde zurückgesetzt';
$wb['pw_reset_act_mail_msg'] = 'Bitte bestätigen Sie die Anforderung eines neuen Passworts, indem Sie folgenden Link besuchen: ';
$wb['pw_reset_act_mail_title'] = 'Anforderung zum Zurücksetzen des Passworts';
$wb['user_regex_error'] = 'Benutzername beinhaltet nicht erlaubte Zeichen oder ist länger als 64 Zeichen.';
$wb['pw_error_length'] = 'Die Passwortlänge ist < 1 oder > 64 Zeichen.';
$wb['pw_error_length'] = 'Die Passwortlänge ist < 1 oder > 256 Zeichen.';
$wb['login_txt'] = 'Anmelden';
$wb['username_txt'] = 'Benutzername';
$wb['password_txt'] = 'Passwort';
......
......@@ -13,7 +13,7 @@ $wb['pw_reset_mail_title'] = 'ISPConfig 3 Control panel password has been reset
$wb['pw_reset_act_mail_title'] = 'Confirm ISPConfig 3 Control panel password reset';
$wb['pw_reset_act_mail_msg'] = 'Please confirm that your want to reset your ISPConfig 3 control panel account password by visiting the following activation link: ';
$wb['user_regex_error'] = 'Username contains unallowed characters or is longer than 64 characters.';
$wb['pw_error_length'] = 'The password length is < 1 or > 64 characters.';
$wb['pw_error_length'] = 'The password length is < 1 or > 256 characters.';
$wb['email_error'] = 'Email contains unallowed characters or has a invalid format.';
$wb['login_txt'] = "Login";
$wb['username_txt'] = "Username";
......
......@@ -10,7 +10,7 @@ $wb['pw_error_noinput'] = 'Unesite email adresu i korisničko ime.';
$wb['pw_reset_mail_msg'] = 'Šifra za ISPConfig 3 control panel račun je resetirana. Vaša nova šifra je: ';
$wb['pw_reset_mail_title'] = 'Resetirana ISPConfig 3 control panel šifra.';
$wb['user_regex_error'] = 'Korisničko ime sadrži nedozvoljene znakove ili je dulje od 64 znaka.';
$wb['pw_error_length'] = 'Duljina šifre je > 64 znakova.';
$wb['pw_error_length'] = 'Duljina šifre je > 256 znakova.';
$wb['username_txt'] = 'Korisničko ime';
$wb['password_txt'] = 'Šifra';
$wb['login_button_txt'] = 'Prijava';
......
......@@ -10,7 +10,7 @@ $wb['pw_error_noinput'] = 'Masukkan alamat email dan nama pengguna.';
$wb['pw_reset_mail_msg'] = 'Kata sandi untuk control panel ISPConfig 3 Anda telah direset. Kata sandi yang baru adalah: ';
$wb['pw_reset_mail_title'] = 'Kata sandi Control Panel ISPConfig 3 telah direset.';
$wb['user_regex_error'] = 'Nama Pengguna mengandung karakter yang tidak diperbolehkan atau lebih dari 64 karakter.';
$wb['pw_error_length'] = 'Panjang kata sandi > 64 karakter.';
$wb['pw_error_length'] = 'Panjang kata sandi > 256 karakter.';
$wb['username_txt'] = 'Nama Pengguna';
$wb['password_txt'] = 'Kata Sandi';
$wb['login_button_txt'] = 'Masuk';
......
......@@ -10,7 +10,7 @@ $wb['pw_error_noinput'] = 'Voer a.u.b. een e-mailadres en gebruikersnaam in.';
$wb['pw_reset_mail_msg'] = 'Het wachtwoord dat toegang biedt tot uw ISPConfig 3 control panel account is gereset. Het nieuwe wachtwoord is: ';
$wb['pw_reset_mail_title'] = 'ISPConfig 3 Control panel wachtwoord is gereset.';
$wb['user_regex_error'] = 'Gebruikersnaam bevat karakters die niet zijn toegestaan of is langer dan 64 karakters.';
$wb['pw_error_length'] = 'De lengte van het wachtwoord is > 64 karakters.';
$wb['pw_error_length'] = 'De lengte van het wachtwoord is > 256 karakters.';
$wb['username_txt'] = 'Gebruikersnaam';
$wb['password_txt'] = 'Wachtwoord';
$wb['login_button_txt'] = 'Login';
......
......@@ -6,7 +6,7 @@ $wb['pw_error_noinput'] = 'Podaj nazwę użytkownika i adres e-mail.';
$wb['pw_reset_mail_msg'] = 'Hasło do Twojego panelu w ISPConfig 3 zostało zresetowane. Twoje nowe hasło to: ';
$wb['pw_reset_mail_title'] = 'Hasło do panelu w ISPConfig 3 zostało zresetowane.';
$wb['user_regex_error'] = 'Nazwa użytkownika zawiera niedozwolone znaki lub jest dłuższa niż 64 znaki.';
$wb['pw_error_length'] = 'Długość hasła jest > 64 znaki.';
$wb['pw_error_length'] = 'Długość hasła jest > 256 znaki.';
$wb['error_user_password_empty'] = 'Pusta nazwa użytkownika lub hasło.';
$wb['error_user_password_incorrect'] = 'Niepoprawna nazwa użytownika lub hasło.';
$wb['error_user_blocked'] = 'Konto użytkownika zostało zablokowane.';
......
......@@ -10,7 +10,7 @@ $wb['pw_error_noinput'] = 'introduceti email address si username.';
$wb['pw_reset_mail_msg'] = 'Parola la panoul de control a fost resetata . Noua parola este : ';
$wb['pw_reset_mail_title'] = 'parola panoului de control a fost schimbata';
$wb['user_regex_error'] = 'Username contine caractere nepermise sau are mai mult de 64 caractere';
$wb['pw_error_length'] = 'Lungime parola > 64 caractere.';
$wb['pw_error_length'] = 'Lungime parola > 256 caractere.';
$wb['username_txt'] = 'Username';
$wb['password_txt'] = 'Password';
$wb['login_button_txt'] = 'Login';
......
......@@ -10,7 +10,7 @@ $wb['pw_error_noinput'] = 'Vänligen fyll i epostadress och användarnamn.';
$wb['pw_reset_mail_msg'] = 'The password to your ISPConfig 3 control panel account has been reset. The new password is: ';
$wb['pw_reset_mail_title'] = 'ISPConfig 3 Control panel password has been reset.';
$wb['user_regex_error'] = 'Username contains unallowed characters or is longer then 64 characters.';
$wb['pw_error_length'] = 'Lösenrodslängden är > 64 tecken.';
$wb['pw_error_length'] = 'Lösenrodslängden är > 256 tecken.';
$wb['username_txt'] = 'Användarnamn';
$wb['password_txt'] = 'Lösenord';
$wb['login_button_txt'] = 'Logga in';
......
......@@ -10,7 +10,7 @@ $wb['pw_error_noinput'] = 'Prosím, zadajte e-mailovú adresu a Užívateľské
$wb['pw_reset_mail_msg'] = 'Heslo k svojmu účtu na ovládacom paneli bol resetnuté. Nové heslo je:';
$wb['pw_reset_mail_title'] = 'Heslo ovládacieho panelu bolo resetnuté.';
$wb['user_regex_error'] = 'Užívateľské meno obsahuje neplatné znaky, alebo je dlhšia ako 64 znakov.';
$wb['pw_error_length'] = 'Dĺžka hesla je > 64 znakov.';
$wb['pw_error_length'] = 'Dĺžka hesla je > 256 znakov.';
$wb['username_txt'] = 'Užívateľské meno';
$wb['password_txt'] = 'Heslo';
$wb['login_button_txt'] = 'Prihlásenie';
......
......@@ -35,6 +35,27 @@ class cronjob_bind_dnssec extends cronjob {
// job schedule
protected $_schedule = '30 3 * * *'; //daily at 3:30 a.m.
private function increase_serial($serial){
global $app, $conf;
// increase serial
$serial_date = $app->functions->intval(substr($serial, 0, 8));
$count = $app->functions->intval(substr($serial, 8, 2));
$current_date = date("Ymd");
if($serial_date >= $current_date){
$count += 1;
if ($count > 99) {
$serial_date += 1;
$count = 0;
}
$count = str_pad($count, 2, "0", STR_PAD_LEFT);
$new_serial = $serial_date.$count;
} else {
$new_serial = $current_date.'01';
}
return $new_serial;
}
public function onRunJob() {
global $app, $conf;
......@@ -54,31 +75,8 @@ class cronjob_bind_dnssec extends cronjob {
$domain = substr($data['origin'], 0, strlen($data['origin'])-1);
if (!file_exists($dns_config['bind_zonefiles_dir'].'/'.$filespre.$domain)) return false;
$app->log('DNSSEC Auto-Resign: Resigning zone '.$domain, LOGLEVEL_INFO);
$zonefile = file_get_contents($dns_config['bind_zonefiles_dir'].'/'.$filespre.$domain);
$keycount=0;
foreach (glob($dns_config['bind_zonefiles_dir'].'/K'.$domain.'*.key') as $keyfile) {
$includeline = '$INCLUDE '.basename($keyfile);
if (!preg_match('@'.preg_quote($includeline).'@', $zonefile)) $zonefile .= "\n".$includeline."\n";
$keycount++;
}
if ($keycount != 2) $app->log('DNSSEC Warning: There are more or less than 2 keyfiles for zone '.$domain, LOGLEVEL_WARN);
file_put_contents($dns_config['bind_zonefiles_dir'].'/'.$filespre.$domain, $zonefile);
//Sign the zone and set it valid for max. 16 days
exec('cd '.escapeshellcmd($dns_config['bind_zonefiles_dir']).';'.
'/usr/sbin/dnssec-signzone -A -e +1382400 -3 $(head -c 1000 /dev/random | sha1sum | cut -b 1-16) -N increment -o '.escapeshellcmd($domain).' -t '.$filespre.escapeshellcmd($domain));
//Write Data back into DB
$dnssecdata = "DS-Records:\n".file_get_contents($dns_config['bind_zonefiles_dir'].'/dsset-'.$domain.'.');
$dnssecdata .= "\n------------------------------------\n\nDNSKEY-Records:\n";
foreach (glob($dns_config['bind_zonefiles_dir'].'/K'.$domain.'*.key') as $keyfile) {
$dnssecdata .= file_get_contents($keyfile)."\n\n";
}
$app->db->query('UPDATE dns_soa SET dnssec_info=\''.$dnssecdata.'\', dnssec_initialized=\'Y\', dnssec_last_signed=\''.time().'\' WHERE id='.$data['id']);
$data = next($soas);
$app->log('DNSSEC Auto-Resign: Touching zone '.$domain, LOGLEVEL_INFO);
$app->db->datalogUpdate('dns_soa', array("serial" => $this->increase_serial($data['serial'])), 'id', $data['id']);
}
parent::onRunJob();
......@@ -86,4 +84,4 @@ class cronjob_bind_dnssec extends cronjob {
}
?>
?>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment