Skip to content

Commit 6935aa3

Browse files
author
Till Brehm
committed
Merge branch 'master' of git.ispconfig.org:ispconfig/ispconfig3
2 parents 40317cf + 1fa8f42 commit 6935aa3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+324
-68
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE `directive_snippets` ADD `customer_viewable` ENUM('n','y') NOT NULL DEFAULT 'n' AFTER `snippet`;
2+
ALTER TABLE `web_domain` ADD `directive_snippets_id` int(11) unsigned NOT NULL default '0';

install/sql/ispconfig3.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ CREATE TABLE IF NOT EXISTS `directive_snippets` (
429429
`name` varchar(255) DEFAULT NULL,
430430
`type` varchar(255) DEFAULT NULL,
431431
`snippet` mediumtext,
432+
`customer_viewable` ENUM('n','y') NOT NULL DEFAULT 'n',
432433
`active` enum('n','y') NOT NULL DEFAULT 'y',
433434
PRIMARY KEY (`directive_snippets_id`)
434435
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
@@ -1880,6 +1881,7 @@ CREATE TABLE `web_domain` (
18801881
`rewrite_rules` mediumtext,
18811882
`added_date` date NOT NULL DEFAULT '0000-00-00',
18821883
`added_by` varchar(255) DEFAULT NULL,
1884+
`directive_snippets_id` int(11) unsigned NOT NULL default '0',
18831885
PRIMARY KEY (`domain_id`),
18841886
UNIQUE KEY `serverdomain` ( `server_id` , `ip_address`, `domain` )
18851887
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?php
2+
3+
4+
class plugin_directive_snippets extends plugin_base
5+
{
6+
var $module;
7+
var $form;
8+
var $tab;
9+
var $record_id;
10+
var $formdef;
11+
var $options;
12+
13+
public function onShow()
14+
{
15+
global $app;
16+
17+
$listTpl = new tpl;
18+
$listTpl->newTemplate('templates/web_directive_snippets.htm');
19+
20+
//* Loading language file
21+
$lng_file = "lib/lang/".$_SESSION["s"]["language"]."_web_directive_snippets.lng";
22+
23+
include $lng_file;
24+
$listTpl->setVar($wb);
25+
26+
$message = '';
27+
$error = '';
28+
29+
$server_type = $app->getconf->get_server_config($this->form->dataRecord['server_id'], 'web');
30+
$server_type = $server_type['server_type'];
31+
$records = $app->db->queryAllRecords("SELECT directive_snippets_id, name FROM directive_snippets WHERE customer_viewable = 'y' AND type = ? ORDER BY name ASC", $server_type);
32+
33+
for ($i = 0, $c = count($records); $i < $c; $i++)
34+
{
35+
$records[$i]['is_selected'] = false;
36+
37+
if ($this->form->dataRecord['directive_snippets_id'] === $records[$i]['directive_snippets_id'])
38+
$records[$i]['is_selected'] = true;
39+
}
40+
41+
$listTpl->setLoop('records', $records);
42+
43+
$list_name = 'directive_snippets_list';
44+
$_SESSION["s"]["list"][$list_name]["parent_id"] = $this->form->id;
45+
$_SESSION["s"]["list"][$list_name]["parent_name"] = $app->tform->formDef["name"];
46+
$_SESSION["s"]["list"][$list_name]["parent_tab"] = $_SESSION["s"]["form"]["tab"];
47+
$_SESSION["s"]["list"][$list_name]["parent_script"] = $app->tform->formDef["action"];
48+
$_SESSION["s"]["form"]["return_to"] = $list_name;
49+
50+
return $listTpl->grab();
51+
}
52+
53+
public function onUpdate()
54+
{
55+
global $app, $conf;
56+
57+
if (isset($this->form->dataRecord['directive_snippets_id']) && $this->form->oldDataRecord['directive_snippets_id'] !== $this->form->dataRecord['directive_snippets_id']) {
58+
$app->db->query('UPDATE web_domain SET directive_snippets_id = ? WHERE domain_id = ?', $this->form->dataRecord['directive_snippets_id'], $this->form->id);
59+
}
60+
}
61+
62+
public function onInsert()
63+
{
64+
global $app, $conf;
65+
66+
if (isset($this->form->dataRecord['directive_snippets_id'])) {
67+
$app->db->query('UPDATE web_domain SET directive_snippets_id = ? WHERE domain_id = ?', $this->form->dataRecord['directive_snippets_id'], $this->form->id);
68+
}
69+
}
70+
71+
}
72+
?>

interface/lib/lang/en.lng

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ $wb['delete_txt'] = "Delete";
2626
$wb['filter_txt'] = "Filter";
2727
$wb['add_new_record_txt'] = "Add new record";
2828
$wb['btn_save_txt'] = "Save";
29-
$wb['btn_cancel_txt'] = "Back";
29+
$wb['btn_cancel_txt'] = "Cancel";
3030
$wb['top_menu_system'] = 'System';
3131
$wb['top_menu_client'] = 'Client';
3232
$wb['top_menu_email'] = 'Email';

interface/web/admin/form/directive_snippets.tform.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@
9393
'maxlength' => '255',
9494
'searchable' => 2
9595
),
96+
'customer_viewable' => array (
97+
'datatype' => 'VARCHAR',
98+
'formtype' => 'CHECKBOX',
99+
'default' => 'n',
100+
'value' => array(0 => 'n', 1 => 'y')
101+
),
96102
'active' => array (
97103
'datatype' => 'VARCHAR',
98104
'formtype' => 'CHECKBOX',

interface/web/admin/form/server_config.tform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@
993993
'datatype' => 'VARCHAR',
994994
'formtype' => 'SELECT',
995995
'default' => 'fast-cgi',
996-
'value' => array('no' => 'disabled_txt', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP', 'php-fpm' => 'PHP-FPM'),
996+
'value' => array('no' => 'disabled_txt', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP', 'php-fpm' => 'PHP-FPM', 'hhvm' => 'HHVM'),
997997
'searchable' => 2
998998
),
999999
'nginx_cgi_socket' => array(

interface/web/admin/form/users.tform.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,19 @@
260260
'maxlength' => '2',
261261
'rows' => '',
262262
'cols' => ''
263+
),
264+
'lost_password_function' => array (
265+
'datatype' => 'INTEGER',
266+
'formtype' => 'CHECKBOX',
267+
'regex' => '',
268+
'errmsg' => '',
269+
'default' => 1,
270+
'value' => array(0 => 0, 1 => 1),
271+
'separator' => '',
272+
'width' => '30',
273+
'maxlength' => '255',
274+
'rows' => '',
275+
'cols' => ''
263276
)
264277
//#################################
265278
// ENDE Datenbankfelder

interface/web/admin/lib/lang/de_directive_snippets.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ $wb['active_txt'] = 'Aktiv';
77
$wb['directive_snippets_name_empty'] = 'Bitte geben Sie einen Namen für den Schnipsel an.';
88
$wb['directive_snippets_name_error_unique'] = 'Es existiert schon ein Direktiven-Schnipsel mit diesem Namen.';
99
$wb['variables_txt'] = 'Variablen';
10+
$wb['customer_viewable_txt'] = 'Sichtbar für Kunden';
1011
?>

interface/web/admin/lib/lang/de_server_config.lng

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,4 +256,10 @@ $wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
256256
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
257257
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
258258
$wb['network_filesystem_txt'] = 'Netzwerk-Dateisystem';
259+
$wb['overquota_db_notify_admin_txt'] = 'Datenbank-Quota-Warnungen an den Administrator senden';
260+
$wb['overquota_db_notify_client_txt'] = 'Datenbank-Quota-Warnungen an den Kunden senden';
261+
$wb['php_ini_check_minutes_txt'] = 'Prüfe php.ini alle X Minuten auf Änderungen';
262+
$wb['php_ini_check_minutes_error_empty'] = 'Bitte geben Sie einen Wert an, wie oft die php.ini auf Änderungen geprüft werden soll.';
263+
$wb['php_ini_check_minutes_info_txt'] = '0 = keine Prüfung';
264+
$wb['php_handler_txt'] = 'Standard-PHP-Handler';
259265
?>

interface/web/admin/lib/lang/de_users.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ $wb['password_mismatch_txt'] = 'Die Passwörter stimmen nicht überein.';
3131
$wb['password_match_txt'] = 'Die Passwörter stimmen überein.';
3232
$wb['username_error_collision'] = 'Der Benutzername darf nicht <b>web<b> oder <b>web<b> gefolgt von einer Zahl sein.';
3333
$wb['client_not_admin_err'] = 'A user that belongs to a client can not be set to type: admin';
34+
$wb['lost_password_function_txt'] = 'Passwort vergessen Funktion steht zur Verfügung';
3435
?>

0 commit comments

Comments
 (0)