Merge branch 'stable-3.1' of git.ispconfig.org:ispconfig/ispconfig3 into stable-3.1
| | |
| | | |
| | | 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}. |
| | |
| | | -- 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'); |
| | | |
| | | |
| | | -- -------------------------------------------------------- |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | 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']; |
| | |
| | | "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'); |
| | | |
| | |
| | | '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', |
| | |
| | | <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"> |
| | | <div class="form-group"> |
| | | <label for="dkim" class="col-sm-3 control-label">{tmpl_var name='dkim_txt'}</label> |
| | | <input type="checkbox" disabled readonly checked><input name="dkim" type="hidden" maxlength="255" type="text"/> |
| | | <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> |
| | | |
| | | |
| | |
| | | |
| | | //** 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']); |
| | |
| | | $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'; |
| | |
| | | $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.'; |
| | |
| | | $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'; |
| | |
| | | $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"; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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.'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | $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'; |
| | |
| | | // 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; |
| | | |
| | |
| | | $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(); |