Skip to content
......@@ -37,6 +37,34 @@ class plugin_backuplist extends plugin_base {
var $formdef;
var $options;
/**
* Process request to make a backup. This request is triggered manually by the user in the ISPConfig interface.
* @param string $message
* @param string $error
* @param string[] $wb language text
* @author Ramil Valitov <ramilvalitov@gmail.com>
* @uses backup_plugin::make_backup_callback() this method is called later in the plugin to run the backup
*/
protected function makeBackup(&$message, &$error, $wb)
{
global $app;
$mode = $_GET['make_backup'];
$action_type = ($mode == 'web') ? 'backup_web_files' : 'backup_database';
$domain_id = intval($this->form->id);
$sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = ? AND action_param = ?";
$tmp = $app->db->queryOneRecord($sql, $action_type, $domain_id);
if ($tmp['number'] == 0) {
$server_id = $this->form->dataRecord['server_id'];
$message .= $wb['backup_info_txt'];
$sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) VALUES (?, UNIX_TIMESTAMP(), ?, ?, 'pending', '')";
$app->db->query($sql, $server_id, $action_type, $domain_id);
} else {
$error .= $wb['backup_pending_txt'];
}
}
function onShow() {
global $app;
......@@ -52,6 +80,10 @@ class plugin_backuplist extends plugin_base {
$message = '';
$error = '';
if (isset($_GET['make_backup'])) {
$this->makeBackup($message, $error, $wb);
}
if(isset($_GET['backup_action'])) {
$backup_id = $app->functions->intval($_GET['backup_id']);
......@@ -137,7 +169,30 @@ class plugin_backuplist extends plugin_base {
$rec["bgcolor"] = $bgcolor;
$rec['date'] = date($app->lng('conf_format_datetime'), $rec['tstamp']);
$backup_format = $rec['backup_format'];
if (empty($backup_format)) {
//We have a backup from old version of ISPConfig
switch ($rec['backup_type']) {
case 'mysql':
$backup_format = 'gzip';
break;
case 'web':
$backup_format = ($rec['backup_mode'] == 'userzip') ? 'zip' : 'tar_gzip';
break;
default:
$app->log('Unsupported backup type "' . $rec['backup_type'] . '" for backup id ' . $rec['backup_id'], LOGLEVEL_ERROR);
break;
}
}
$rec['backup_type'] = $wb[('backup_type_' . $rec['backup_type'])];
$backup_format = (!empty($backup_format)) ? $wb[('backup_format_' . $backup_format . '_txt')] : $wb["backup_format_unknown_txt"];
if (empty($backup_format))
$backup_format = $wb["backup_format_unknown_txt"];
$rec['backup_format'] = $backup_format;
$rec['backup_encrypted'] = empty($rec['backup_password']) ? $wb["no_txt"] : $wb["yes_txt"];
$backup_manual_prefix = 'manual-';
$rec['backup_job'] = (substr($rec['filename'], 0, strlen($backup_manual_prefix)) == $backup_manual_prefix) ? $wb["backup_job_manual_txt"] : $wb["backup_job_auto_txt"];
$rec['download_available'] = true;
if($rec['server_id'] != $web['server_id']) $rec['download_available'] = false;
......
......@@ -428,6 +428,28 @@ class remoting_dns extends remoting {
// ----------------------------------------------------------------------------------------------------------------
//* Get record details
public function dns_caa_get($session_id, $primary_id) {
return $this->dns_rr_get($session_id, $primary_id, 'CAA');
}
//* Add a record
public function dns_caa_add($session_id, $client_id, $params, $update_serial=false) {
return $this->dns_rr_add($session_id, $client_id, $params, $update_serial, 'CAA');
}
//* Update a record
public function dns_caa_update($session_id, $client_id, $primary_id, $params, $update_serial=false) {
return $this->dns_rr_update($session_id, $client_id, $primary_id, $params, $update_serial, 'CAA');
}
//* Delete a record
public function dns_caa_delete($session_id, $primary_id, $update_serial=false) {
return $this->dns_rr_delete($session_id, $primary_id, $update_serial, 'CAA');
}
// ----------------------------------------------------------------------------------------------------------------
//* Get record details
public function dns_cname_get($session_id, $primary_id) {
return $this->dns_rr_get($session_id, $primary_id, 'CNAME');
......@@ -450,6 +472,28 @@ class remoting_dns extends remoting {
// ----------------------------------------------------------------------------------------------------------------
//* Get record details
public function dns_dname_get($session_id, $primary_id) {
return $this->dns_rr_get($session_id, $primary_id, 'DNAME');
}
//* Add a record
public function dns_dname_add($session_id, $client_id, $params, $update_serial=false) {
return $this->dns_rr_add($session_id, $client_id, $params, $update_serial, 'DNAME');
}
//* Update a record
public function dns_dname_update($session_id, $client_id, $primary_id, $params, $update_serial=false) {
return $this->dns_rr_update($session_id, $client_id, $primary_id, $params, $update_serial, 'DNAME');
}
//* Delete a record
public function dns_dname_delete($session_id, $primary_id, $update_serial=false) {
return $this->dns_rr_delete($session_id, $primary_id, $update_serial, 'DNAME');
}
// ----------------------------------------------------------------------------------------------------------------
//* Get record details
public function dns_hinfo_get($session_id, $primary_id) {
return $this->dns_rr_get($session_id, $primary_id, 'HINFO');
......@@ -494,6 +538,28 @@ class remoting_dns extends remoting {
// ----------------------------------------------------------------------------------------------------------------
//* Get record details
public function dns_naptr_get($session_id, $primary_id) {
return $this->dns_rr_get($session_id, $primary_id, 'NAPTR');
}
//* Add a record
public function dns_naptr_add($session_id, $client_id, $params, $update_serial=false) {
return $this->dns_rr_add($session_id, $client_id, $params, $update_serial, 'NAPTR');
}
//* Update a record
public function dns_naptr_update($session_id, $client_id, $primary_id, $params, $update_serial=false) {
return $this->dns_rr_update($session_id, $client_id, $primary_id, $params, $update_serial, 'NAPTR');
}
//* Delete a record
public function dns_naptr_delete($session_id, $primary_id, $update_serial=false) {
return $this->dns_rr_delete($session_id, $primary_id, $update_serial, 'NAPTR');
}
// ----------------------------------------------------------------------------------------------------------------
//* Get record details
public function dns_ns_get($session_id, $primary_id) {
return $this->dns_rr_get($session_id, $primary_id, 'NS');
......@@ -582,6 +648,50 @@ class remoting_dns extends remoting {
// ----------------------------------------------------------------------------------------------------------------
//* Get record details
public function dns_sshfp_get($session_id, $primary_id) {
return $this->dns_rr_get($session_id, $primary_id, 'SSHFP');
}
//* Add a record
public function dns_sshfp_add($session_id, $client_id, $params, $update_serial=false) {
return $this->dns_rr_add($session_id, $client_id, $params, $update_serial, 'SSHFP');
}
//* Update a record
public function dns_sshfp_update($session_id, $client_id, $primary_id, $params, $update_serial=false) {
return $this->dns_rr_update($session_id, $client_id, $primary_id, $params, $update_serial, 'SSHFP');
}
//* Delete a record
public function dns_sshfp_delete($session_id, $primary_id, $update_serial=false) {
return $this->dns_rr_delete($session_id, $primary_id, $update_serial, 'SSHFP');
}
// ----------------------------------------------------------------------------------------------------------------
//* Get record details
public function dns_tlsa_get($session_id, $primary_id) {
return $this->dns_rr_get($session_id, $primary_id, 'TLSA');
}
//* Add a record
public function dns_tlsa_add($session_id, $client_id, $params, $update_serial=false) {
return $this->dns_rr_add($session_id, $client_id, $params, $update_serial, 'TLSA');
}
//* Update a record
public function dns_tlsa_update($session_id, $client_id, $primary_id, $params, $update_serial=false) {
return $this->dns_rr_update($session_id, $client_id, $primary_id, $params, $update_serial, 'TLSA');
}
//* Delete a record
public function dns_tlsa_delete($session_id, $primary_id, $update_serial=false) {
return $this->dns_rr_delete($session_id, $primary_id, $update_serial, 'TLSA');
}
// ----------------------------------------------------------------------------------------------------------------
//* Get record details
public function dns_txt_get($session_id, $primary_id) {
return $this->dns_rr_get($session_id, $primary_id, 'TXT');
......@@ -626,6 +736,24 @@ class remoting_dns extends remoting {
//* Get All DNS Zones Templates by etruel and thom
public function dns_templatezone_get_all($session_id) {
global $app, $conf;
if(!$this->checkPerm($session_id, 'dns_templatezone_add')) {
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
$sql ="SELECT * FROM dns_template";
$result = $app->db->queryAllRecords($sql);
if(isset($result)) {
return $result;
}
else {
throw new SoapFault('template_id_error', 'There is no DNS templates.');
return false;
}
}
/**
* Get all dns records for a zone
* @param int session id
......
......@@ -132,10 +132,12 @@ class remoting_sites extends remoting {
$app->sites_database_plugin->processDatabaseInsert($this);
// set correct values for backup_interval and backup_copies
if(isset($params['backup_interval']) || isset($params['backup_copies'])){
if(isset($params['backup_interval']) || isset($params['backup_copies']) || isset($params['backup_format_web']) || isset($params['backup_format_db'])){
$sql_set = array();
if(isset($params['backup_interval'])) $sql_set[] = "backup_interval = '".$app->db->quote($params['backup_interval'])."'";
if(isset($params['backup_copies'])) $sql_set[] = "backup_copies = ".$app->functions->intval($params['backup_copies']);
if(isset($params['backup_format_web'])) $sql_set[] = "backup_format_web = ".$app->functions->intval($params['backup_format_web']);
if(isset($params['backup_format_db'])) $sql_set[] = "backup_format_db = ".$app->functions->intval($params['backup_format_db']);
$this->updateQueryExecute("UPDATE web_database SET ".implode(', ', $sql_set)." WHERE database_id = ".$retval, $retval, $params);
}
......@@ -165,10 +167,12 @@ class remoting_sites extends remoting {
$retval = $this->updateQueryExecute($sql, $primary_id, $params);
// set correct values for backup_interval and backup_copies
if(isset($params['backup_interval']) || isset($params['backup_copies'])){
if(isset($params['backup_interval']) || isset($params['backup_copies']) || isset($params['backup_format_web']) || isset($params['backup_format_db'])){
$sql_set = array();
if(isset($params['backup_interval'])) $sql_set[] = "backup_interval = '".$app->db->quote($params['backup_interval'])."'";
if(isset($params['backup_copies'])) $sql_set[] = "backup_copies = ".$app->functions->intval($params['backup_copies']);
if(isset($params['backup_format_web'])) $sql_set[] = "backup_format_web = ".$app->functions->intval($params['backup_format_web']);
if(isset($params['backup_format_db'])) $sql_set[] = "backup_format_db = ".$app->functions->intval($params['backup_format_db']);
$this->updateQueryExecute("UPDATE web_database SET ".implode(', ', $sql_set)." WHERE database_id = ".$primary_id, $primary_id, $params);
}
......
......@@ -735,7 +735,7 @@ class simplepie
* @param string $cache_location This is where you want the cache to be stored.
* @param int $cache_duration This is the number of seconds that you want to store the cache file for.
*/
function SimplePie($feed_url = null, $cache_location = null, $cache_duration = null)
function __construct($feed_url = null, $cache_location = null, $cache_duration = null)
{
// Other objects, instances created here so we can set options on them
$this->sanitize = new SimplePie_Sanitize;
......@@ -3165,7 +3165,7 @@ class SimplePie_Item
var $feed;
var $data = array();
function SimplePie_Item($feed, $data)
function __construct($feed, $data)
{
$this->feed = $feed;
$this->data = $data;
......@@ -5789,7 +5789,7 @@ class SimplePie_Source
var $item;
var $data = array();
function SimplePie_Source($item, $data)
function __construct($item, $data)
{
$this->item = $item;
$this->data = $data;
......@@ -6344,7 +6344,7 @@ class SimplePie_Author
var $email;
// Constructor, used to input the data
function SimplePie_Author($name = null, $link = null, $email = null)
function __construct($name = null, $link = null, $email = null)
{
$this->name = $name;
$this->link = $link;
......@@ -6402,7 +6402,7 @@ class SimplePie_Category
var $label;
// Constructor, used to input the data
function SimplePie_Category($term = null, $scheme = null, $label = null)
function __construct($term = null, $scheme = null, $label = null)
{
$this->term = $term;
$this->scheme = $scheme;
......@@ -6484,7 +6484,7 @@ class SimplePie_Enclosure
var $width;
// Constructor, used to input the data
function SimplePie_Enclosure($link = null, $type = null, $length = null, $javascript = null, $bitrate = null, $captions = null, $categories = null, $channels = null, $copyright = null, $credits = null, $description = null, $duration = null, $expression = null, $framerate = null, $hashes = null, $height = null, $keywords = null, $lang = null, $medium = null, $player = null, $ratings = null, $restrictions = null, $samplingrate = null, $thumbnails = null, $title = null, $width = null)
function __construct($link = null, $type = null, $length = null, $javascript = null, $bitrate = null, $captions = null, $categories = null, $channels = null, $copyright = null, $credits = null, $description = null, $duration = null, $expression = null, $framerate = null, $hashes = null, $height = null, $keywords = null, $lang = null, $medium = null, $player = null, $ratings = null, $restrictions = null, $samplingrate = null, $thumbnails = null, $title = null, $width = null)
{
$this->bitrate = $bitrate;
$this->captions = $captions;
......@@ -7419,7 +7419,7 @@ class SimplePie_Caption
var $text;
// Constructor, used to input the data
function SimplePie_Caption($type = null, $lang = null, $startTime = null, $endTime = null, $text = null)
function __construct($type = null, $lang = null, $startTime = null, $endTime = null, $text = null)
{
$this->type = $type;
$this->lang = $lang;
......@@ -7503,7 +7503,7 @@ class SimplePie_Credit
var $name;
// Constructor, used to input the data
function SimplePie_Credit($role = null, $scheme = null, $name = null)
function __construct($role = null, $scheme = null, $name = null)
{
$this->role = $role;
$this->scheme = $scheme;
......@@ -7560,7 +7560,7 @@ class SimplePie_Copyright
var $label;
// Constructor, used to input the data
function SimplePie_Copyright($url = null, $label = null)
function __construct($url = null, $label = null)
{
$this->url = $url;
$this->label = $label;
......@@ -7604,7 +7604,7 @@ class SimplePie_Rating
var $value;
// Constructor, used to input the data
function SimplePie_Rating($scheme = null, $value = null)
function __construct($scheme = null, $value = null)
{
$this->scheme = $scheme;
$this->value = $value;
......@@ -7649,7 +7649,7 @@ class SimplePie_Restriction
var $value;
// Constructor, used to input the data
function SimplePie_Restriction($relationship = null, $type = null, $value = null)
function __construct($relationship = null, $type = null, $value = null)
{
$this->relationship = $relationship;
$this->type = $type;
......@@ -7715,7 +7715,7 @@ class SimplePie_File
var $error;
var $method = SIMPLEPIE_FILE_SOURCE_NONE;
function SimplePie_File($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false)
function __construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false)
{
if (class_exists('idna_convert'))
{
......@@ -8036,7 +8036,7 @@ class SimplePie_HTTP_Parser
* @access public
* @param string $data Input data
*/
function SimplePie_HTTP_Parser($data)
function __construct($data)
{
$this->data = $data;
$this->data_length = strlen($this->data);
......@@ -8512,7 +8512,7 @@ class SimplePie_gzdecode
*
* @access public
*/
function SimplePie_gzdecode($data)
function __construct($data)
{
$this->compressed_data = $data;
$this->compressed_size = strlen($data);
......@@ -8705,7 +8705,7 @@ class SimplePie_Cache
*
* @access private
*/
function SimplePie_Cache()
function __construct()
{
trigger_error('Please call SimplePie_Cache::create() instead of the constructor', E_USER_ERROR);
}
......@@ -8743,7 +8743,7 @@ class SimplePie_Cache_File
var $extension;
var $name;
function SimplePie_Cache_File($location, $filename, $extension)
function __construct($location, $filename, $extension)
{
$this->location = $location;
$this->filename = $filename;
......@@ -8905,7 +8905,7 @@ class SimplePie_Cache_MySQL extends SimplePie_Cache_DB
var $options;
var $id;
function SimplePie_Cache_MySQL($mysql_location, $name, $extension)
function __construct($mysql_location, $name, $extension)
{
$host = $mysql_location->get_host();
if (SimplePie_Misc::stripos($host, 'unix(') === 0 && substr($host, -1) === ')')
......@@ -11532,7 +11532,7 @@ class SimplePie_Decode_HTML_Entities
* @access public
* @param string $data Input data
*/
function SimplePie_Decode_HTML_Entities($data)
function __construct($data)
{
$this->data = $data;
}
......@@ -11795,7 +11795,7 @@ class SimplePie_IRI
* @param string $iri
* @return SimplePie_IRI
*/
function SimplePie_IRI($iri)
function __construct($iri)
{
$iri = (string) $iri;
if ($iri !== '')
......@@ -13184,7 +13184,7 @@ class SimplePie_Parse_Date
*
* @access private
*/
function SimplePie_Parse_Date()
function __construct()
{
$this->day_pcre = '(' . implode(array_keys($this->day), '|') . ')';
$this->month_pcre = '(' . implode(array_keys($this->month), '|') . ')';
......@@ -13658,7 +13658,7 @@ class SimplePie_Content_Type_Sniffer
* @access public
* @param SimplePie_Content_Type_Sniffer $file Input file
*/
function SimplePie_Content_Type_Sniffer($file)
function __construct($file)
{
$this->file = $file;
}
......@@ -13990,7 +13990,7 @@ class SimplePie_XML_Declaration_Parser
* @access public
* @param string $data Input data
*/
function SimplePie_XML_Declaration_Parser($data)
function __construct($data)
{
$this->data = $data;
$this->data_length = strlen($this->data);
......@@ -14259,7 +14259,7 @@ class SimplePie_Locator
var $max_checked_feeds = 10;
var $content_type_sniffer_class = 'SimplePie_Content_Type_Sniffer';
function SimplePie_Locator(&$file, $timeout = 10, $useragent = null, $file_class = 'SimplePie_File', $max_checked_feeds = 10, $content_type_sniffer_class = 'SimplePie_Content_Type_Sniffer')
function __construct(&$file, $timeout = 10, $useragent = null, $file_class = 'SimplePie_File', $max_checked_feeds = 10, $content_type_sniffer_class = 'SimplePie_Content_Type_Sniffer')
{
$this->file =& $file;
$this->file_class = $file_class;
......
......@@ -45,10 +45,12 @@ class sites_database_plugin {
//* The Database user shall be owned by the same group then the website
$sys_groupid = $app->functions->intval($web['sys_groupid']);
$backup_interval = $web['backup_interval'];
$backup_format_web = $web['backup_format_web'];
$backup_format_db = $web['backup_format_db'];
$backup_copies = $app->functions->intval($web['backup_copies']);
$sql = "UPDATE web_database SET sys_groupid = ?, backup_interval = ?, backup_copies = ? WHERE database_id = ?";
$app->db->query($sql, $sys_groupid, $backup_interval, $backup_copies, $form_page->id);
$sql = "UPDATE web_database SET sys_groupid = ?, backup_interval = ?, backup_copies = ?, backup_format_web = ?, backup_format_db = ? WHERE database_id = ?";
$app->db->query($sql, $sys_groupid, $backup_interval, $backup_copies, $backup_format_web, $backup_format_db, $form_page->id);
}
}
......
......@@ -65,12 +65,13 @@ class system {
public function exec_safe($cmd) {
$arg_count = func_num_args();
$args = func_get_args();
if($arg_count != substr_count($cmd, '?') + 1) {
trigger_error('Placeholder count not matching argument list.', E_USER_WARNING);
return false;
}
if($arg_count > 1) {
$args = func_get_args();
array_shift($args);
$pos = 0;
......@@ -98,4 +99,16 @@ class system {
return implode("\n", $this->_last_exec_out);
}
//* Check if a application is installed
public function is_installed($appname) {
$this->exec_safe('which ? 2> /dev/null', $appname);
$out = $this->last_exec_out();
$returncode = $this->last_exec_retcode();
if(isset($out[0]) && stristr($out[0], $appname) && $returncode == 0) {
return true;
} else {
return false;
}
}
} //* End Class
......@@ -52,7 +52,7 @@ class validate_cron {
if($parsed["scheme"] != "http" && $parsed["scheme"] != "https") return $this->get_error($validator['errmsg']);
if(preg_match("'^([a-z0-9][a-z0-9_\-]{0,62}\.)+([A-Za-z0-9\-]{2,30})$'i", $parsed["host"]) == false) return $this->get_error($validator['errmsg']);
if(preg_match("'^([a-z0-9][a-z0-9_\-]{0,62}\.)+([A-Za-z0-9\-]{2,63})$'i", $parsed["host"]) == false) return $this->get_error($validator['errmsg']);
}
if(strpos($field_value, "\n") !== false || strpos($field_value, "\r") !== false || strpos($field_value, chr(0)) !== false) {
return $this->get_error($validator['errmsg']);
......
......@@ -191,7 +191,7 @@ class validate_domain {
/* internal validator function to match regexp */
function _regex_validate($domain_name, $allow_wildcard = false) {
$pattern = '/^' . ($allow_wildcard == true ? '(\*\.)?' : '') . '[\w\.\-]{1,255}\.[a-zA-Z0-9\-]{2,30}$/';
$pattern = '/^' . ($allow_wildcard == true ? '(\*\.)?' : '') . '[\w\.\-]{1,255}\.[a-zA-Z0-9\-]{2,63}$/';
return preg_match($pattern, $domain_name);
}
......
<?php
/*
Copyright (c) 2020, Florian Schaal, schaal @it UG
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
class validate_server_directive_snippets {
function get_error($errmsg) {
global $app;
if(isset($app->tform->wordbook[$errmsg])) {
return $app->tform->wordbook[$errmsg]."<br>\r\n";
} else {
return $errmsg."<br>\r\n";
}
}
function validate_snippet($field_name, $field_value, $validator) {
global $app;
$type=(isset($app->remoting_lib->dataRecord['type']))?$app->remoting_lib->dataRecord['type']:$_POST['type'];
$types = array('apache','nginx','php','proxy');
if(!in_array($type,$types)) return $this->get_error('directive_snippets_invalid_type');
$check = $app->db->queryAllRecords('SELECT * FROM directive_snippets WHERE name = ? AND type = ?', $field_value, $type);
if(!empty($check)) return $this->get_error('directive_snippets_name_error_unique');
}
}
File mode changed from 100755 to 100644
......@@ -249,18 +249,22 @@ class sites_web_vhost_domain_plugin {
}
//* Change database backup options when web backup options have been changed
if(isset($page_form->dataRecord['backup_interval']) && ($page_form->dataRecord['backup_interval'] != $page_form->oldDataRecord['backup_interval'] || $page_form->dataRecord['backup_copies'] != $page_form->oldDataRecord['backup_copies'])) {
if(isset($page_form->dataRecord['backup_interval']) && ($page_form->dataRecord['backup_interval'] != $page_form->oldDataRecord['backup_interval'] || $page_form->dataRecord['backup_copies'] != $page_form->oldDataRecord['backup_copies'] || $page_form->dataRecord['backup_format_web'] != $page_form->oldDataRecord['backup_format_web'] || $page_form->dataRecord['backup_format_db'] != $page_form->oldDataRecord['backup_format_db'])) {
//* Update all databases
$backup_interval = $page_form->dataRecord['backup_interval'];
$backup_copies = $app->functions->intval($page_form->dataRecord['backup_copies']);
$backup_format_web = $page_form->dataRecord['backup_format_web'];
$backup_format_db = $page_form->dataRecord['backup_format_db'];
$records = $app->db->queryAllRecords("SELECT database_id FROM web_database WHERE parent_domain_id = ".$page_form->id);
foreach($records as $rec) {
$app->db->datalogUpdate('web_database', array("backup_interval" => $backup_interval, "backup_copies" => $backup_copies), 'database_id', $rec['database_id']);
$app->db->datalogUpdate('web_database', array("backup_interval" => $backup_interval, "backup_copies" => $backup_copies, "backup_format_web" => $backup_format_web, "backup_format_db" => $backup_format_db), 'database_id', $rec['database_id']);
}
unset($records);
unset($rec);
unset($backup_copies);
unset($backup_interval);
unset($backup_format_web);
unset($backup_format_db);
}
//* Change vhost subdomain and alias ip/ipv6 if domain ip/ipv6 has changed
......
......@@ -66,10 +66,9 @@ $form["tabs"]['directive_snippets'] = array (
'name' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'directive_snippets_name_empty'),
1 => array ( 'type' => 'UNIQUE',
'errmsg'=> 'directive_snippets_name_error_unique'),
'validators' => array (
0 => array ( 'type' => 'NOTEMPTY', 'errmsg'=> 'directive_snippets_name_empty'),
1 => array ( 'type' => 'CUSTOM', 'class' => 'validate_server_directive_snippets', 'function' => 'validate_snippet'),
),
'filters' => array(
0 => array( 'event' => 'SAVE',
......
......@@ -45,7 +45,7 @@ if(is_array($modules)) {
}
}
$form["title"] = "Remote user";
$form["title"] = "remote_user_txt";
$form["description"] = "";
$form["name"] = "remote_user";
$form["action"] = "remote_user_edit.php";
......@@ -63,7 +63,7 @@ $form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update,
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
$form["tabs"]['remote_user'] = array (
'title' => "Remote User",
'title' => "remote_user_txt",
'width' => 100,
'template' => "templates/remote_user_edit.htm",
'fields' => array (
......
......@@ -33,7 +33,7 @@
*/
$form["title"] = "Server Config";
$form["title"] = "server_config";
$form["description"] = "";
$form["name"] = "server_config";
$form["action"] = "server_config_edit.php";
......@@ -131,7 +131,7 @@ $form["tabs"]['server'] = array(
'validators' => array( 0 => array('type' => 'NOTEMPTY',
'errmsg' => 'hostname_error_empty'),
1 => array ('type' => 'REGEX',
'regex' => '/^[\w\.\-]{2,255}\.[a-zA-Z0-9\-]{2,30}$/',
'regex' => '/^[\w\.\-]{2,255}\.[a-zA-Z0-9\-]{2,63}$/',
'errmsg'=> 'hostname_error_regex'),
),
'value' => '',
......@@ -1274,6 +1274,12 @@ $form["tabs"]['web'] = array(
'value' => array('no' => 'disabled_txt', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP', 'php-fpm' => 'PHP-FPM', 'hhvm' => 'HHVM'),
'searchable' => 2
),
'php_fpm_default_chroot' => array(
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'n',
'value' => array(0 => 'n', 1 => 'y')
),
'php_fpm_incron_reload' => array(
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
......
......@@ -64,8 +64,8 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
$form["title"] = "IP Addresses";
$form["description"] = "Form to edit system IP Addresses";
$form["title"] = "server_ip_edit_title";
$form["description"] = "server_ip_edit_desc";
$form["name"] = "server_ip";
$form["action"] = "server_ip_edit.php";
$form["db_table"] = "server_ip";
......
......@@ -28,8 +28,8 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
$form["title"] = "IPv4 Address mapping";
$form["description"] = "Form to map IPv4-addresses for Web-Server";
$form["title"] = "server_ip_map_title";
$form["description"] = "server_ip_map_desc";
$form["name"] = "server_ip_map";
$form["action"] = "server_ip_map_edit.php";
$form["db_table"] = "server_ip_map";
......@@ -46,7 +46,7 @@ $form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update,
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
$form["tabs"]['server_ip_map'] = array (
'title' => "IP Address Mapping",
'title' => "server_ip_map_title",
'width' => 80,
'template' => "templates/server_ip_map_edit.htm",
'fields' => array (
......
......@@ -33,7 +33,7 @@
*/
$form["title"] = "System Config";
$form["title"] = "system_config_title";
$form["description"] = "system_config_desc_txt";
$form["name"] = "system_config";
$form["action"] = "system_config_edit.php";
......@@ -747,6 +747,12 @@ $form["tabs"]['misc'] = array (
'formtype' => 'SELECT',
'default' => '',
'value' => array('' => 'None', '1' => 'strength_1', '2' => 'strength_2', '3' => 'strength_3', '4' => 'strength_4', '5' => 'strength_5')
),
'ssh_authentication' => array(
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
'default' => '',
'value' => array('' => 'ssh_authentication_password_key', 'password' => 'ssh_authentication_password', 'key' => 'ssh_authentication_key')
)
//#################################
// END Datatable fields
......
......@@ -60,8 +60,8 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
$form['title'] = 'Users';
$form['description'] = 'Form to edit systemusers.';
$form['title'] = 'users_txt';
//$form['description'] = 'Form to edit systemusers.';
$form['name'] = 'users';
$form['action'] = 'users_edit.php';
$form['db_table'] = 'sys_user';
......@@ -129,7 +129,7 @@ if(is_array($tmp_records)) {
}
$form['tabs']['users'] = array (
'title' => 'Users',
'title' => 'users_txt',
'width' => 80,
'template' => 'templates/users_user_edit.htm',
'fields' => array (
......
<?php
$wb['remote_user_txt'] = 'Remote User';
$wb['username_txt'] = 'Username';
$wb['password_txt'] = 'Password';
$wb['function_txt'] = 'Functions';
......@@ -34,6 +35,7 @@ $wb['DNS alias functions'] = 'DNS alias functions';
$wb['DNS cname functions'] = 'DNS cname functions';
$wb['DNS hinfo functions'] = 'DNS hinfo functions';
$wb['DNS mx functions'] = 'DNS mx functions';
$wb['DNS naptr functions'] = 'DNS naptr functions';
$wb['DNS ns functions'] = 'DNS ns functions';
$wb['DNS ptr functions'] = 'DNS ptr functions';
$wb['DNS rp functions'] = 'DNS rp functions';
......
<?php
$wb['server_config'] = 'Server Config';
$wb['server_config_error_not_updated'] = 'Error in Server Config: not updated';
$wb['server_config_error_section_not_updated'] = 'Error in Server Config: %s section not updated';
$wb['jailkit_chroot_home_txt'] = 'Jailkit chroot home';
$wb['jailkit_chroot_app_sections_txt'] = 'Jailkit chroot app sections';
$wb['jailkit_chroot_app_programs_txt'] = 'Jailkit chrooted applications';
......@@ -264,6 +267,7 @@ $wb['backup_dir_mount_cmd_txt'] = 'Mount command, if backup directory not mounte
$wb['overquota_db_notify_admin_txt'] = 'Send DB quota warnings to admin';
$wb['overquota_db_notify_client_txt'] = 'Send DB quota warnings to client';
$wb['php_handler_txt'] = 'Default PHP Handler';
$wb['php_fpm_default_chroot_txt'] = 'Default chrooted PHP-FPM';
$wb['php_fpm_incron_reload_txt'] = 'Install incron trigger file to reload PHP-FPM';
$wb['disabled_txt'] = 'Disabled';
$wb['dkim_strength_txt'] = 'DKIM strength';
......