Commit be531cf1 authored by Till Brehm's avatar Till Brehm

Merge branch 'master' of git.ispconfig.org:ispconfig/ispconfig3

parents e1f709dc 43e5b660
......@@ -453,6 +453,18 @@ if($install_mode == 'standard') {
//** Customize the port ISPConfig runs on
$ispconfig_vhost_port = $inst->free_query('ISPConfig Port', '8080','ispconfig_port');
$conf['interface_password'] = $inst->free_query('Admin password', 'admin');
if($conf['interface_password'] != 'admin') {
$check = false;
do {
unset($temp_password);
$temp_password = $inst->free_query('Re-enter admin password', '');
$check = @($temp_password == $conf['interface_password'])?true:false;
if(!$check) swriteln('Passwords do not match.');
} while (!$check);
}
unset($check);
unset($temp_password);
if($conf['apache']['installed'] == true) $conf['apache']['vhost_port'] = $ispconfig_vhost_port;
if($conf['nginx']['installed'] == true) $conf['nginx']['vhost_port'] = $ispconfig_vhost_port;
unset($ispconfig_vhost_port);
......@@ -792,6 +804,18 @@ if($install_mode == 'standard') {
//** Customise the port ISPConfig runs on
$ispconfig_vhost_port = $inst->free_query('ISPConfig Port', '8080','ispconfig_port');
$conf['interface_password'] = $inst->free_query('Admin password', 'admin');
if($conf['interface_password'] != 'admin') {
$check = false;
do {
unset($temp_password);
$temp_password = $inst->free_query('Re-enter admin password', '');
$check = @($temp_password == $conf['interface_password'])?true:false;
if(!$check) swriteln('Passwords do not match.');
} while (!$check);
}
unset($check);
unset($temp_password);
if($conf['apache']['installed'] == true) $conf['apache']['vhost_port'] = $ispconfig_vhost_port;
if($conf['nginx']['installed'] == true) $conf['nginx']['vhost_port'] = $ispconfig_vhost_port;
unset($ispconfig_vhost_port);
......@@ -837,4 +861,4 @@ chmod($md5_filename,0700);
echo "Installation completed.\n";
?>
?>
\ No newline at end of file
......@@ -2201,6 +2201,11 @@ Email Address []:
$command = "chmod +x $install_dir/server/scripts/*.sh";
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
if ($this->install_ispconfig_interface == true && isset($conf['interface_password']) && $conf['interface_password']!='admin') {
$sql = "UPDATE sys_user SET passwort = md5(?) WHERE username = 'admin';";
$this->db->query($sql, $conf['interface_password']);
}
if($conf['apache']['installed'] == true && $this->install_ispconfig_interface == true){
//* Copy the ISPConfig vhost for the controlpanel
$vhost_conf_dir = $conf['apache']['vhost_conf_dir'];
......
......@@ -255,9 +255,13 @@ class tform extends tform_base {
if ($display_seconds === true) {
$dselect[] = 'second';
}
$tmp_dt = strtr($this->datetimeformat,array('d' => 'dd', 'm' => 'mm', 'Y' => 'yyyy', 'y' => 'yy', 'H' => 'hh', 'h' => 'HH', 'i' => 'ii')) . ($display_seconds ? ':ss' : '');
$out = '';
return '<input type="text" class="form-control" name="' . $form_element . '" value="' . ($_showdate ? date($this->datetimeformat . ($display_seconds ? ':s' : ''), $_datetime) : '') . '" data-input-element="datetime" data-date-format="' . $tmp_dt . '" />';
/*
foreach ($dselect as $dt_element)
{
$dt_options = array();
......@@ -318,7 +322,7 @@ class tform extends tform_base {
$selected_value = (int)floor(date('s', $_datetime));
break;
}
$out .= "<select name=\"".$form_element."[$dt_element]\" id=\"".$form_element."_$dt_element\" class=\"selectInput\" style=\"width: auto; float: none;\">";
if (!$_showdate) {
$out .= "<option value=\"-\" selected=\"selected\">--</option>" . PHP_EOL;
......@@ -337,7 +341,7 @@ class tform extends tform_base {
$out .= '</select>' . str_repeat('&nbsp;', $dt_space);
}
return $out;
return $out;*/
}
}
......
......@@ -98,6 +98,7 @@ class tform_base {
var $errorMessage = '';
var $dateformat = "d.m.Y";
var $datetimeformat = 'd.m.Y H:i';
var $formDef = array();
var $wordbook;
var $module;
......@@ -153,6 +154,7 @@ class tform_base {
$this->wordbook = $wb;
$this->dateformat = $app->lng('conf_format_dateshort');
$this->datetimeformat = $app->lng('conf_format_datetime');
return true;
}
......@@ -708,13 +710,8 @@ class tform_base {
if($record[$key] != '' && $record[$key] != '0000-00-00') {
if(function_exists('date_parse_from_format')) {
$date_parts = date_parse_from_format($this->dateformat, $record[$key]);
//list($tag,$monat,$jahr) = explode('.',$record[$key]);
$new_record[$key] = $date_parts['year'].'-'.$date_parts['month'].'-'.$date_parts['day'];
//$tmp = strptime($record[$key],$this->dateformat);
//$new_record[$key] = ($tmp['tm_year']+1900).'-'.($tmp['tm_mon']+1).'-'.$tmp['tm_mday'];
} else {
//$tmp = strptime($record[$key],$this->dateformat);
//$new_record[$key] = ($tmp['tm_year']+1900).'-'.($tmp['tm_mon']+1).'-'.$tmp['tm_mday'];
$tmp = strtotime($record[$key]);
$new_record[$key] = date('Y-m-d', $tmp);
}
......@@ -724,8 +721,6 @@ class tform_base {
break;
case 'INTEGER':
$new_record[$key] = (isset($record[$key]))?$app->functions->intval($record[$key]):0;
//if($new_record[$key] != $record[$key]) $new_record[$key] = $field['default'];
//if($key == 'refresh') die($record[$key]);
break;
case 'DOUBLE':
$new_record[$key] = $record[$key];
......@@ -735,7 +730,7 @@ class tform_base {
break;
case 'DATETIME':
if (is_array($record[$key]))
/*if (is_array($record[$key]))
{
$filtered_values = array_map(create_function('$item', 'return (int)$item;'), $record[$key]);
extract($filtered_values, EXTR_PREFIX_ALL, '_dt');
......@@ -743,7 +738,14 @@ class tform_base {
if ($_dt_day != 0 && $_dt_month != 0 && $_dt_year != 0) {
$new_record[$key] = date( 'Y-m-d H:i:s', mktime($_dt_hour, $_dt_minute, $_dt_second, $_dt_month, $_dt_day, $_dt_year) );
}
}
} else {*/
if($record[$key] != '' && $record[$key] != '0000-00-00 00:00:00') {
$tmp = strtotime($record[$key]);
$new_record[$key] = date($this->datetimeformat, $tmp);
} else {
$new_record[$key] = '0000-00-00 00:00:00';
}
/*}*/
break;
}
......
jQuery.fn.uniform = function(settings) {
settings = jQuery.extend({
valid_class : 'valid',
invalid_class : 'invalid',
focused_class : 'focused',
holder_class : 'ctrlHolder',
field_selector : 'input, select, textarea'
}, settings);
return this.each(function() {
var form = jQuery(this);
// Focus specific control holder
var focusControlHolder = function(element) {
var parent = element.parent();
while(typeof(parent) == 'object') {
if(parent) {
if(parent[0] && (parent[0].className.indexOf(settings.holder_class) >= 0)) {
parent.addClass(settings.focused_class);
return;
} // if
} // if
parent = jQuery(parent.parent());
} // while
};
// Select form fields and attach them higlighter functionality
form.find(settings.field_selector).focus(function() {
form.find('.' + settings.focused_class).removeClass(settings.focused_class);
focusControlHolder(jQuery(this));
}).blur(function() {
form.find('.' + settings.focused_class).removeClass(settings.focused_class);
});
});
};
// Auto set on page load...
$(document).ready(function() {
jQuery('form.uniForm').uniform();
});
function AR_ResetDates()
{
if ($("#autoresponder:checked").val() == null) {
$("form.uniForm select").each(
function(){
$(this).val( $("#" + $(this).attr("id") + " option:first").val() );
}
);
}
}
function AR_SetNow()
{
DateTime_SetValues('autoresponder_start_date');
now = new Date();
end_date = new Date(now.getFullYear(), now.getMonth(), now.getDate()+2, 0, 0);
DateTime_SetValues('autoresponder_end_date', end_date);
}
function DateTime_SetValues(datetime_id, date_obj)
{
var selects = ['day', 'month', 'year', 'hour', 'minute', 'second'];
if ( (typeof(date_obj) == 'object') && (typeof(date_obj.getDate()) == 'number') ) {
var now = date_obj;
} else {
var now = new Date();
}
jQuery.each(selects, function() {
var unit_name = this.toString();
var unit_value = '';
switch(unit_name)
{
case 'day':
unit_value = now.getDate();
break;
case 'month':
unit_value = now.getMonth() + 1;
if(unit_value < 10) unit_value = '0'+unit_value;
break;
case 'year':
unit_value = now.getFullYear();
break;
case 'hour':
unit_value = now.getHours();
break;
case 'minute':
unit_value = Math.round(parseInt(now.getMinutes())/5)*5;
break;
case 'second':
unit_value = now.getSeconds();
break;
}
unit_obj = $("#"+ datetime_id + "_" + unit_name);
if (unit_obj.val() !== null) {
unit_obj.val(unit_value);
unit_obj.change();
}
});
}
\ No newline at end of file
......@@ -16,27 +16,27 @@
<div class="col-sm-9"><input type="text" name="dir" id="dir" value="{tmpl_var name='dir'}" class="form-control" /></div></div>
<div class="form-group">
<label for="quota_files" class="col-sm-3 control-label">{tmpl_var name='quota_files_txt'}</label>
<div class="col-sm-9"><input type="text" name="quota_files" id="quota_files" value="{tmpl_var name='quota_files'}" class="form-control" /></div><label class="col-sm-3 control-label">{tmpl_var name='quota_files_unity_txt'}</label>
<div class="col-sm-8"><input type="text" name="quota_files" id="quota_files" value="{tmpl_var name='quota_files'}" class="form-control" /></div><div class="col-sm-1">{tmpl_var name='quota_files_unity_txt'}</div>
</div>
<div class="form-group">
<label for="ul_ratio" class="col-sm-3 control-label">{tmpl_var name='ul_ratio_txt'}</label>
<div class="col-sm-9"><input type="text" name="ul_ratio" id="ul_ratio" value="{tmpl_var name='ul_ratio'}" class="form-control" /></div><label class="col-sm-3 control-label"></label>
<div class="col-sm-8"><input type="text" name="ul_ratio" id="ul_ratio" value="{tmpl_var name='ul_ratio'}" class="form-control" /></div><div class="col-sm-1"></div>
</div>
<div class="form-group">
<label for="dl_ratio" class="col-sm-3 control-label">{tmpl_var name='dl_ratio_txt'}</label>
<div class="col-sm-9"><input type="text" name="dl_ratio" id="dl_ratio" value="{tmpl_var name='dl_ratio'}" class="form-control" /></div><label class="col-sm-3 control-label"></label>
<div class="col-sm-8"><input type="text" name="dl_ratio" id="dl_ratio" value="{tmpl_var name='dl_ratio'}" class="form-control" /></div><div class="col-sm-1"></div>
</div>
<div class="form-group">
<label for="ul_bandwidth" class="col-sm-3 control-label">{tmpl_var name='ul_bandwidth_txt'}</label>
<div class="col-sm-9"><input type="text" name="ul_bandwidth" id="ul_bandwidth" value="{tmpl_var name='ul_bandwidth'}" class="form-control" /></div><label class="col-sm-3 control-label">kb/s</label>
<div class="col-sm-8"><input type="text" name="ul_bandwidth" id="ul_bandwidth" value="{tmpl_var name='ul_bandwidth'}" class="form-control" /></div><div class="col-sm-1">kb/s</div>
</div>
<div class="form-group">
<label for="dl_bandwidth" class="col-sm-3 control-label">{tmpl_var name='dl_bandwidth_txt'}</label>
<div class="col-sm-9"><input type="text" name="dl_bandwidth" id="dl_bandwidth" value="{tmpl_var name='dl_bandwidth'}" class="form-control" /></div><label class="col-sm-3 control-label">kb/s</label>
<div class="col-sm-8"><input type="text" name="dl_bandwidth" id="dl_bandwidth" value="{tmpl_var name='dl_bandwidth'}" class="form-control" /></div><div class="col-sm-1">kb/s</div>
</div>
<div class="form-group">
<label for="expires" class="col-sm-3 control-label">{tmpl_var name='expires_txt'}</label>
{tmpl_var name='expires'}
<div class="col-sm-9">{tmpl_var name='expires'}</div>
</div>
......
......@@ -10,7 +10,7 @@
<div class="col-sm-9"><input type="text" name="dir" id="dir" value="{tmpl_var name='dir'}" class="form-control" /></div></div>
<div class="form-group">
<label for="expires" class="col-sm-3 control-label">{tmpl_var name='expires_txt'}</label>
{tmpl_var name='expires'}
<div class="col-sm-9">{tmpl_var name='expires'}</div>
</div>
......
......@@ -121,6 +121,24 @@ var ISPConfig = {
});
}
$('input[data-input-element="date"]').datetimepicker({
'language': 'en', // TODO
'todayHighlight': true,
'todayBtn': 'linked',
'bootcssVer': 3,
'fontAwesome': true,
'autoclose': true,
'minView': 'month'
});
$('input[data-input-element="datetime"]').datetimepicker({
'language': 'en', // TODO
'todayHighlight': true,
'todayBtn': 'linked',
'bootcssVer': 3,
'fontAwesome': true,
'autoclose': true
});
ISPConfig.callHook('onAfterContentLoad', {'url': url, 'data': data });
},
......
......@@ -14,6 +14,7 @@
<link rel='stylesheet' href='themes/<tmpl_var name='current_theme'>/assets/stylesheets/fonts.min.css' />
<link rel='stylesheet' href='themes/<tmpl_var name='current_theme'>/assets/stylesheets/ispconfig.min.css' />
<link rel='stylesheet' href='themes/<tmpl_var name='current_theme'>/assets/stylesheets/pushy.min.css' />
<link rel='stylesheet' href='themes/<tmpl_var name='current_theme'>/assets/stylesheets/bootstrap-datetimepicker.min.css' />
<link rel='stylesheet' href='themes/<tmpl_var name='current_theme'>/assets/stylesheets/responsive.min.css' />
<link rel='stylesheet' href='themes/<tmpl_var name='current_theme'>/assets/stylesheets/themes/default/theme.min.css' />
<link rel='stylesheet' href='themes/<tmpl_var name='current_theme'>/assets/stylesheets/select2.css' />
......@@ -82,6 +83,7 @@
<script type="text/javascript" src="js/jquery.min.js"></script>
<script src='themes/<tmpl_var name='current_theme'>/assets/javascripts/bootstrap.min.js'></script>
<script src='themes/<tmpl_var name='current_theme'>/assets/javascripts/bootstrap-datetimepicker.min.js'></script>
<script src='themes/<tmpl_var name='current_theme'>/assets/javascripts/ispconfig.min.js'></script>
<script src='themes/<tmpl_var name='current_theme'>/assets/javascripts/modernizr.custom.min.js'></script>
<script src='themes/<tmpl_var name='current_theme'>/assets/javascripts/pushy.min.js'></script>
......
......@@ -193,6 +193,7 @@ class page_action extends tform_actions {
$trans = array("d" => "dd", "m" => "mm", "Y" => "yy");
$date_format = strtr($date_format, $trans);
$app->tpl->setVar("date_format", $date_format);
$app->tpl->setVar("conf_format_datetime_js", strtr($app->lng('conf_format_dateshort'), array('d' => 'dd', 'm' => 'mm', 'Y' => 'yyyy', 'y' => 'yy', 'H' => 'hh', 'h' => 'HH', 'i' => 'ii')));
$app->tpl->setVar("daynamesmin_su", $app->lng('daynamesmin_su'));
$app->tpl->setVar("daynamesmin_mo", $app->lng('daynamesmin_mo'));
......
......@@ -83,7 +83,7 @@
</div>
<div class="form-group">
<label for="active_until_date" class="col-sm-3 control-label">{tmpl_var name='active_until_date_txt'}</label>
<div class="col-sm-9"><input type="text" name="active_until_date" id="active_until_date" value="{tmpl_var name='active_until_date'}" class="form-control" /></div></div>
<div class="col-sm-9"><input type="text" name="active_until_date" id="active_until_date" value="{tmpl_var name='active_until_date'}" class="form-control" data-input-element="date" data-date-format="{tmpl_var name='conf_format_datetime_js'}" /></div></div>
<div class="form-group">
<label for="description" class="col-sm-3 control-label">{tmpl_var name='description_txt'}</label>
<div class="col-sm-9"><textarea class="form-control" name="description" id="description" rows='5' cols='30' style='height:60px;'>{tmpl_var name='description'}</textarea></div>
......@@ -95,7 +95,4 @@
<div class="clear"><div class="right">
<button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="vm/openvz_vm_edit.php">{tmpl_var name='btn_save_txt'}</button>
<button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="vm/openvz_vm_list.php">{tmpl_var name='btn_cancel_txt'}</button>
</div></div>
<script language="JavaScript" type="text/javascript">
jQuery( "#active_until_date" ).datepicker({ dateFormat: '<tmpl_var name="date_format">', changeMonth: true, changeYear: true, yearRange: '-100:+100', dayNamesMin: ['<tmpl_var name="daynamesmin_su">','<tmpl_var name="daynamesmin_mo">','<tmpl_var name="daynamesmin_tu">','<tmpl_var name="daynamesmin_we">','<tmpl_var name="daynamesmin_th">','<tmpl_var name="daynamesmin_fr">','<tmpl_var name="daynamesmin_sa">'], dayNames: ['<tmpl_var name="daynames_sunday">','<tmpl_var name="daynames_monday">','<tmpl_var name="daynames_tuesday">','<tmpl_var name="daynames_wednesday">','<tmpl_var name="daynames_thursday">','<tmpl_var name="daynames_friday">','<tmpl_var name="daynames_saturday">'], monthNamesShort: ['<tmpl_var name="monthnamesshort_jan">','<tmpl_var name="monthnamesshort_feb">','<tmpl_var name="monthnamesshort_mar">','<tmpl_var name="monthnamesshort_apr">','<tmpl_var name="monthnamesshort_may">','<tmpl_var name="monthnamesshort_jun">','<tmpl_var name="monthnamesshort_jul">','<tmpl_var name="monthnamesshort_aug">','<tmpl_var name="monthnamesshort_sep">','<tmpl_var name="monthnamesshort_oct">','<tmpl_var name="monthnamesshort_nov">','<tmpl_var name="monthnamesshort_dec">'], nextText: '<tmpl_var name="datepicker_nextText">', prevText: '<tmpl_var name="datepicker_prevText">', firstDay: 1 });
</script>
\ No newline at end of file
</div></div>
\ 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