Skip to content
......@@ -95,8 +95,9 @@ if($do_uninstall == 'yes') {
@unlink("/usr/local/bin/ispconfig_update_from_svn.sh");
@unlink("/var/spool/mail/ispconfig");
@unlink("/var/www/ispconfig");
@unlink("/var/www/php-fcgi-scripts/ispconfig");
@exec('chattr -i /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter');
@unlink("/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter");
@unlink("/var/www/php-fcgi-scripts/ispconfig");
echo "Backups in /var/backup/ and log files in /var/log/ispconfig are not deleted.";
echo "Finished uninstalling.\n";
......
......@@ -284,6 +284,7 @@ class app {
$this->tpl->setVar('datalog_changes_end_txt', $this->lng('datalog_changes_end_txt'));
$this->tpl->setVar('datalog_changes_count', $datalog['count']);
$this->tpl->setLoop('datalog_changes', $datalog['entries']);
$this->tpl->setVar('datalog_changes_close_txt', $this->lng('datalog_changes_close_txt'));
} else {
$this->tpl->setVar('app_version', '');
}
......
......@@ -259,6 +259,8 @@ class db
private function _query($sQuery = '') {
global $app;
$aArgs = func_get_args();
if ($sQuery == '') {
$this->_sqlerror('Keine Anfrage angegeben / No query given');
return false;
......@@ -297,7 +299,6 @@ class db
}
} while($ok == false);
$aArgs = func_get_args();
$sQuery = call_user_func_array(array(&$this, '_build_query_string'), $aArgs);
$this->securityScan($sQuery);
$this->_iQueryId = mysqli_query($this->_iConnId, $sQuery);
......@@ -353,10 +354,17 @@ class db
* @return array result row or NULL if none found
*/
public function queryOneRecord($sQuery = '') {
if(!preg_match('/limit \d+\s*(,\s*\d+)?$/i', $sQuery)) $sQuery .= ' LIMIT 0,1';
$aArgs = func_get_args();
$oResult = call_user_func_array(array(&$this, 'query'), $aArgs);
if(!empty($aArgs)) {
$sQuery = array_shift($aArgs);
if($sQuery && !preg_match('/limit \d+(\s*,\s*\d+)?$/i', $sQuery)) {
$sQuery .= ' LIMIT 0,1';
}
array_unshift($aArgs, $sQuery);
}
$oResult = call_user_func_array([&$this, 'query'], $aArgs);
if(!$oResult) return null;
$aReturn = $oResult->get();
......@@ -1300,7 +1308,7 @@ class fakedb_result {
if(!is_array($this->aLimitedData)) return $aItem;
if(list($vKey, $aItem) = each($this->aLimitedData)) {
foreach($this->aLimitedData as $vKey => $aItem) {
if(!$aItem) $aItem = null;
}
return $aItem;
......
......@@ -65,7 +65,7 @@ class getconf {
} else {
$app->uses('ini_parser');
$security_config_path = '/usr/local/ispconfig/security/security_settings.ini';
if(!is_file($security_config_path)) $security_config_path = realpath(ISPC_ROOT_PATH.'/../security/security_settings.ini');
if(!is_readable($security_config_path)) $security_config_path = realpath(ISPC_ROOT_PATH.'/../security/security_settings.ini');
$this->security_config = $app->ini_parser->parse_ini_string(file_get_contents($security_config_path));
return ($section == '') ? $this->security_config : $this->security_config[$section];
......
......@@ -68,7 +68,7 @@ class ids {
// Get whitelist
$whitelist_path = '/usr/local/ispconfig/security/ids.whitelist';
if(is_file('/usr/local/ispconfig/security/ids.whitelist.custom')) $whitelist_path = '/usr/local/ispconfig/security/ids.whitelist.custom';
if(is_readable('/usr/local/ispconfig/security/ids.whitelist.custom')) $whitelist_path = '/usr/local/ispconfig/security/ids.whitelist.custom';
if(!is_file($whitelist_path)) $whitelist_path = realpath(ISPC_ROOT_PATH.'/../security/ids.whitelist');
$whitelist_lines = file($whitelist_path);
......@@ -91,7 +91,7 @@ class ids {
// Get HTML fields
$htmlfield_path = '/usr/local/ispconfig/security/ids.htmlfield';
if(is_file('/usr/local/ispconfig/security/ids.htmlfield.custom')) $htmlfield_path = '/usr/local/ispconfig/security/ids.htmlfield.custom';
if(is_readable('/usr/local/ispconfig/security/ids.htmlfield.custom')) $htmlfield_path = '/usr/local/ispconfig/security/ids.htmlfield.custom';
if(!is_file($htmlfield_path)) $htmlfield_path = realpath(ISPC_ROOT_PATH.'/../security/ids.htmlfield');
$htmlfield_lines = file($htmlfield_path);
......
......@@ -108,7 +108,7 @@ class remoting_client extends remoting {
if(isset($rec['client_id'])) {
return $app->functions->intval($rec['client_id']);
} else {
throw new SoapFault('no_client_found', 'There is no sysuser account for this client ID.');
throw new SoapFault('no_client_found', 'There is no sys_user account with this userid.');
return false;
}
......
......@@ -472,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');
......@@ -626,6 +648,28 @@ 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');
......@@ -692,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
......
......@@ -206,6 +206,9 @@ class remoting_mail extends remoting {
return false;
}
// Email addresses must always be lower case
$params['email'] = strtolower($params['email']);
//* Check if mail domain exists
$email_parts = explode('@', $params['email']);
$tmp = $app->db->queryOneRecord("SELECT domain FROM mail_domain WHERE domain = ? AND domain NOT IN (SELECT SUBSTR(source,2) FROM mail_forwarding WHERE type = 'aliasdomain')", $email_parts[1]);
......
......@@ -131,7 +131,7 @@ class remoting_lib extends tform_base {
$this->sys_userid = $user['userid'];
$this->sys_default_group = $user['default_group'];
$this->sys_groups = $user['groups'];
// we have to force admin priveliges for the remoting API as some function calls might fail otherwise.
// we have to force admin privileges for the remoting API as some function calls might fail otherwise.
if($client_login == false) $_SESSION["s"]["user"]["typ"] = 'admin';
}
......
......@@ -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;
......
......@@ -49,8 +49,8 @@ class sites_database_plugin {
$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 = ?, 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);
$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);
}
}
......
......@@ -39,6 +39,18 @@ class system {
if(!preg_match('/^[a-z]+$/', $service)) $app->error('Invalid service '.$service);
// Check the servers table to see which kinds of servers we actually have enabled.
// simple query cache
if($this->server_count === null) {
$this->server_count = $app->db->queryOneRecord("SELECT SUM(mail_server) as mail, SUM(web_server) AS web, SUM(dns_server) AS dns, SUM(file_server) AS file,
SUM(db_server) AS db, SUM(vserver_server) AS vserver, SUM(proxy_server) AS proxy, SUM(firewall_server) AS firewall, SUM(xmpp_server) AS xmpp
FROM `server` WHERE mirror_server_id = 0");
}
// Check if we have the service enabled.
if ($this->server_count[$service] == 0) {
return FALSE;
}
if(isset($_SESSION['s']['user']) && $_SESSION['s']['user']['typ'] == 'admin') return true; //* We do not check admin-users
// simple query cache
......@@ -55,6 +67,18 @@ class system {
}
}
public function is_blacklisted_web_path($path) {
$blacklist = array('bin', 'cgi-bin', 'dev', 'etc', 'home', 'lib', 'lib64', 'log', 'ssl', 'usr', 'var', 'proc', 'net', 'sys', 'srv', 'sbin', 'run');
$path = ltrim($path, '/');
$parts = explode('/', $path);
if(in_array(strtolower($parts[0]), $blacklist, true)) {
return true;
}
return false;
}
public function last_exec_out() {
return $this->_last_exec_out;
}
......@@ -65,12 +89,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;
......
......@@ -336,11 +336,11 @@ class tform_base {
}
//* If the parameter 'valuelimit' is set
function applyValueLimit($limit, $values, $current_value = '') {
function applyValueLimit($formtype, $limit, $values, $current_value = '') {
global $app;
// we mas have multiple limits, therefore we explode by ; first
// we may have multiple limits, therefore we explode by ; first
// Example: "system:sites:web_php_options;client:web_php_options"
$limits = explode(';',$limit);
......@@ -400,6 +400,19 @@ class tform_base {
$allowed = $allowed = explode(',',$tmp_conf[$tmp_key]);
}
if($formtype == 'CHECKBOX') {
if(strstr($limit,'force_')) {
// Force the checkbox field to be ticked and enabled
if($allowed[0] == $values[1]) {
$values = 'on';
}
} else {
// Force the checkbox field to be unchecked and disabled
if($allowed[0] == $values[0]) {
$values = 'off';
}
}
} else {
// add the current value to the allowed array
$allowed[] = $current_value;
......@@ -408,8 +421,8 @@ class tform_base {
foreach($values as $key => $val) {
if(in_array($key, $allowed)) $values_new[$key] = $val;
}
$values = $values_new;
}
}
......@@ -479,7 +492,7 @@ class tform_base {
// If a limitation for the values is set
if(isset($field['valuelimit']) && is_array($field["value"])) {
$field["value"] = $this->applyValueLimit($field['valuelimit'], $field["value"], $val);
$field["value"] = $this->applyValueLimit($field['formtype'], $field['valuelimit'], $field["value"], $val);
}
switch ($field['formtype']) {
......@@ -521,8 +534,14 @@ class tform_base {
break;
case 'CHECKBOX':
if($field["value"] == 'off') {
$new_record[$key] = "<input name=\"".$key."\" id=\"".$key."\" value=\"".$field['value'][1]."\" type=\"checkbox\" disabled=\"disabled\" />\r\n";
} elseif ($field["value"] == 'on') {
$new_record[$key] = "<input name=\"".$key."\" id=\"".$key."\" value=\"".$field['value'][1]."\" type=\"checkbox\" disabled=\"disabled\" CHECKED />\r\n";
} else {
$checked = ($val == $field['value'][1])?' CHECKED':'';
$new_record[$key] = "<input name=\"".$key."\" id=\"".$key."\" value=\"".$field['value'][1]."\" type=\"checkbox\" $checked />\r\n";
}
break;
case 'CHECKBOXARRAY':
......@@ -614,7 +633,7 @@ class tform_base {
// If a limitation for the values is set
if(isset($field['valuelimit']) && is_array($field["value"])) {
$field["value"] = $this->applyValueLimit($field['valuelimit'], $field["value"], $field['default']);
$field["value"] = $this->applyValueLimit($field['formtype'], $field['valuelimit'], $field["value"], $field['default']);
}
switch ($field['formtype']) {
......@@ -651,9 +670,15 @@ class tform_base {
break;
case 'CHECKBOX':
if($field["value"] == 'off') {
$new_record[$key] = "<input name=\"".$key."\" id=\"".$key."\" value=\"".$field['value'][1]."\" type=\"checkbox\" disabled=\"disabled\" />\r\n";
} elseif ($field["value"] == 'on') {
$new_record[$key] = "<input name=\"".$key."\" id=\"".$key."\" value=\"".$field['value'][1]."\" type=\"checkbox\" disabled=\"disabled\" CHECKED />\r\n";
} else {
// $checked = (empty($field["default"]))?'':' CHECKED';
$checked = ($field["default"] == $field['value'][1])?' CHECKED':'';
$new_record[$key] = "<input name=\"".$key."\" id=\"".$key."\" value=\"".$field['value'][1]."\" type=\"checkbox\" $checked />\r\n";
}
break;
case 'CHECKBOXARRAY':
......@@ -1065,6 +1090,29 @@ class tform_base {
}
unset($error);
break;
case 'ISEMAILADDRESS':
$error = false;
if($validator['allowempty'] != 'y') $validator['allowempty'] = 'n';
if($validator['allowempty'] == 'y' && $field_value == '') {
//* Do nothing
} else {
if(function_exists('filter_var')) {
if(filter_var($field_value, FILTER_VALIDATE_EMAIL) === false) {
$error = true;
}
if ($error) {
$errmsg = $validator['errmsg'];
if(isset($this->wordbook[$errmsg])) {
$this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n";
} else {
$this->errorMessage .= $errmsg."<br />\r\n";
}
}
} else $this->errorMessage .= "function filter_var missing <br />\r\n";
}
unset($error);
break;
case 'ISINT':
if(function_exists('filter_var') && $field_value < PHP_INT_MAX) {
//if($field_value != '' && filter_var($field_value, FILTER_VALIDATE_INT, array("options" => array('min_range'=>0))) === false) {
......
......@@ -184,9 +184,10 @@ class tools_monitor {
foreach($data as $key => $value) {
if ($key != '') {
$memory = $app->functions->formatBytes($value);
$html .= '<tr>
<td>' . $key . ':</td>
<td>' . $value . '</td>
<td>' . $memory . '</td>
</tr>';
}
}
......
......@@ -31,25 +31,11 @@ include_once 'validate_datetime.inc.php';
class validate_autoresponder extends validate_datetime
{
function start_date($field_name, $field_value, $validator)
{
global $app;
// save field value for later use in end_date()
$this->start_date = $field_value;
if($_POST['autoresponder'] == 'y' && $field_value == '') {
// we need a start date when autoresponder is on
return $app->tform->lng($validator['errmsg']).'<br />';
}
}
function end_date($field_name, $field_value, $validator)
{
global $app;
$start_date = $this->start_date;
//$start_date = $app->tform_actions->dataRecord['autoresponder_start_date'];
$start_date = $app->tform_actions->dataRecord['autoresponder_start_date'];
// Parse date
$datetimeformat = (isset($app->remoting_lib) ? $app->remoting_lib->datetimeformat : $app->tform->datetimeformat);
......@@ -60,8 +46,8 @@ class validate_autoresponder extends validate_datetime
$start_date_tstamp = mktime($start_date_array['hour'], $start_date_array['minute'], $start_date_array['second'], $start_date_array['month'], $start_date_array['day'], $start_date_array['year']);
$end_date_tstamp = mktime($end_date_array['hour'], $end_date_array['minute'], $end_date_array['second'], $end_date_array['month'], $end_date_array['day'], $end_date_array['year']);
// End date has to be > start date
if($end_date_tstamp <= $start_date_tstamp && ($start_date || $field_value)) {
// If both are set, end date has to be > start date
if($start_date && $field_value && $end_date_tstamp <= $start_date_tstamp) {
return $app->tform->lng($validator['errmsg']).'<br />';
}
}
......
......@@ -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);
}
......
......@@ -159,4 +159,6 @@ $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user';
$wb['datalog_status_u_xmpp_user'] = 'Update XMPP user';
$wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user';
$wb['unlimited_txt'] = 'Unlimited';
$wb['server_id_0_error_txt'] = 'Please select a valid Server. Server ID must be > 0.';
$wb['datalog_changes_close_txt'] = 'Close';
?>
\ No newline at end of file
......@@ -159,4 +159,6 @@ $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user';
$wb['datalog_status_u_xmpp_user'] = 'Update XMPP user';
$wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user';
$wb['unlimited_txt'] = 'Неограничен';
$wb['server_id_0_error_txt'] = 'Please select a valid Server. Server ID must be > 0.';
$wb['datalog_changes_close_txt'] = 'Close';
?>
\ No newline at end of file