Compare commits
285 Commits
0.9.32-rc1
...
0.9.33-rc2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7680cd441c | ||
|
|
d7f8586413 | ||
|
|
83e062c845 | ||
|
|
c6c950596a | ||
|
|
4714a458fe | ||
|
|
1672b01426 | ||
|
|
36c7527b2a | ||
|
|
00e74a05cb | ||
|
|
7904946862 | ||
|
|
88ace5785e | ||
|
|
614d9c127b | ||
|
|
f0551ac122 | ||
|
|
bdfbe4947a | ||
|
|
7b8341d826 | ||
|
|
9d008efabc | ||
|
|
6c3f6fd57f | ||
|
|
533279ec25 | ||
|
|
68d678aff8 | ||
|
|
6767edfaff | ||
|
|
b1acc9a8ef | ||
|
|
16dde03f96 | ||
|
|
5a7462972f | ||
|
|
4c60b40c64 | ||
|
|
90bcaee2c9 | ||
|
|
a4973c9c38 | ||
|
|
6c39ac80e6 | ||
|
|
979c5e7c0c | ||
|
|
2250b3c37a | ||
|
|
e578a29058 | ||
|
|
4c50d35945 | ||
|
|
7b8885c05e | ||
|
|
1e6df86b7b | ||
|
|
4e9b2d0e97 | ||
|
|
67f3263a2e | ||
|
|
f61567be81 | ||
|
|
3ee8f6ac25 | ||
|
|
5eb630d858 | ||
|
|
e7d07c7924 | ||
|
|
ab44d27914 | ||
|
|
1889958e2b | ||
|
|
b78729319c | ||
|
|
7d478fd378 | ||
|
|
1cb237e8e1 | ||
|
|
8a3745aee8 | ||
|
|
84ff476dfa | ||
|
|
b3935bfda8 | ||
|
|
2ae64d0abe | ||
|
|
e21b923194 | ||
|
|
9ab90aa3b9 | ||
|
|
797db9aa8b | ||
|
|
982421b9b3 | ||
|
|
d0d7e7f369 | ||
|
|
0b35c833f3 | ||
|
|
aef58921ce | ||
|
|
b681d9ba90 | ||
|
|
caedb34d00 | ||
|
|
251fa70228 | ||
|
|
ced2f0c3d4 | ||
|
|
25514e1030 | ||
|
|
196454c7ab | ||
|
|
331b65e384 | ||
|
|
794140f3c1 | ||
|
|
22eeeaf231 | ||
|
|
aff531a274 | ||
|
|
c1ff010283 | ||
|
|
bb3376d1aa | ||
|
|
bcd49186fb | ||
|
|
c0f2745d30 | ||
|
|
64959c75fe | ||
|
|
82fdb84e61 | ||
|
|
10acd16e17 | ||
|
|
21adfeed89 | ||
|
|
791f12401f | ||
|
|
55c7b2aedf | ||
|
|
40d51dc7ef | ||
|
|
378d66f36a | ||
|
|
fd26beb941 | ||
|
|
c7dc68c848 | ||
|
|
6ae3691f20 | ||
|
|
5d5062c262 | ||
|
|
509033e2b8 | ||
|
|
7584b0acc4 | ||
|
|
dd34ab8d9b | ||
|
|
c6f3b03891 | ||
|
|
d765cc8633 | ||
|
|
4b0507c4d3 | ||
|
|
4523ef87b7 | ||
|
|
2b55ceba7a | ||
|
|
b2eeef8d38 | ||
|
|
d674f4dd70 | ||
|
|
0406948c4b | ||
|
|
366e0f6061 | ||
|
|
3c12e825f5 | ||
|
|
925afbd03f | ||
|
|
bfa9478649 | ||
|
|
19f5f2a7a4 | ||
|
|
c1ca72dd3c | ||
|
|
495a48bc87 | ||
|
|
687c5cea08 | ||
|
|
b0c0918580 | ||
|
|
d78fde88ce | ||
|
|
56b652d185 | ||
|
|
c69d023685 | ||
|
|
99a249ac5c | ||
|
|
060f10f064 | ||
|
|
1e5f80ace6 | ||
|
|
cd5e8801e4 | ||
|
|
7dd6f9b97c | ||
|
|
28b7cd6e90 | ||
|
|
6bfa95f8a8 | ||
|
|
b0d5049e68 | ||
|
|
5a9fa8592a | ||
|
|
bc4cb480be | ||
|
|
897a8a084e | ||
|
|
afe2041e94 | ||
|
|
ad1d8d3cd2 | ||
|
|
4fe33a0b7a | ||
|
|
d927ede388 | ||
|
|
6f5f69db2b | ||
|
|
e64846b2c1 | ||
|
|
8842c02136 | ||
|
|
adbc4bc402 | ||
|
|
3be43c4848 | ||
|
|
e24e8297f1 | ||
|
|
c58446359c | ||
|
|
dc5e13d13c | ||
|
|
cf7c11a106 | ||
|
|
b0d1290e66 | ||
|
|
60d48f2002 | ||
|
|
9627238966 | ||
|
|
d89f2c87e5 | ||
|
|
242b42ba95 | ||
|
|
b1a9c2bf49 | ||
|
|
b6bc386072 | ||
|
|
a1625d1768 | ||
|
|
1e0cc86288 | ||
|
|
b4a8418e10 | ||
|
|
e4ceb962e9 | ||
|
|
c6ed0b63c9 | ||
|
|
4794c21fb4 | ||
|
|
e7f54503c1 | ||
|
|
bdc0a4caf1 | ||
|
|
5499388777 | ||
|
|
4cc3c01dcb | ||
|
|
f5f7bc449a | ||
|
|
0fbc2ab821 | ||
|
|
329197902e | ||
|
|
f303bfdbfd | ||
|
|
0156c3a59d | ||
|
|
6f9f5880ee | ||
|
|
29d755433f | ||
|
|
c63fa7ec97 | ||
|
|
dc2b690fa4 | ||
|
|
97ec269838 | ||
|
|
58ec17ce10 | ||
|
|
1b00a816e3 | ||
|
|
911d3769f6 | ||
|
|
3f3a02147b | ||
|
|
a7450dfe37 | ||
|
|
fe5eff890f | ||
|
|
539ec529c2 | ||
|
|
bc8e56e7da | ||
|
|
332a6bc550 | ||
|
|
480e3a8bfd | ||
|
|
34f20ffd1a | ||
|
|
cbab67a2fd | ||
|
|
559fb4d4a4 | ||
|
|
a47b1e7f5d | ||
|
|
141e728c0f | ||
|
|
024d01b300 | ||
|
|
cbf47f46ea | ||
|
|
74c493f39c | ||
|
|
37624a912e | ||
|
|
997135d7c0 | ||
|
|
31f3639c15 | ||
|
|
70a9ad2f3d | ||
|
|
b1fe737a03 | ||
|
|
6f974c035d | ||
|
|
3c091f9cce | ||
|
|
b2268861b0 | ||
|
|
4b5b9e8d1c | ||
|
|
c5c2f735cc | ||
|
|
ed6c78dd50 | ||
|
|
c303f8a683 | ||
|
|
1d27a27751 | ||
|
|
9776624c32 | ||
|
|
2ebb5259a0 | ||
|
|
ce88d1caae | ||
|
|
80a2b5da34 | ||
|
|
92eea6d7b2 | ||
|
|
25fa9a8121 | ||
|
|
4c4a39994c | ||
|
|
a7a971f444 | ||
|
|
946e5d28e9 | ||
|
|
addd70dfe8 | ||
|
|
6a14cb57e6 | ||
|
|
1c1affa7bd | ||
|
|
8b25ac1685 | ||
|
|
ff549a5ab0 | ||
|
|
74b71bb926 | ||
|
|
f1eb5420a7 | ||
|
|
0d04077d6e | ||
|
|
3fe10d8d3d | ||
|
|
9b0cc70542 | ||
|
|
38599ec4b9 | ||
|
|
7d4ea57381 | ||
|
|
538b99055c | ||
|
|
3acfcd4a95 | ||
|
|
fd3ab6221c | ||
|
|
e05369ffd9 | ||
|
|
2376200a73 | ||
|
|
7e1e7851cc | ||
|
|
7a8e345084 | ||
|
|
9b42200746 | ||
|
|
e8e2731c6f | ||
|
|
4167451da6 | ||
|
|
48f288789f | ||
|
|
0574a9733c | ||
|
|
67bee6d620 | ||
|
|
72dd7fb138 | ||
|
|
92f9cf3621 | ||
|
|
aafea237f3 | ||
|
|
a130013c5d | ||
|
|
9a1b0e6ea8 | ||
|
|
acbaedb44f | ||
|
|
ab667d0bc8 | ||
|
|
73acfb5d7c | ||
|
|
641c0a09e5 | ||
|
|
e053a22f1b | ||
|
|
8d3046269b | ||
|
|
14620d9b52 | ||
|
|
ca4dd8a75d | ||
|
|
41f971a4d5 | ||
|
|
3c8bf348d1 | ||
|
|
6e4ff4705b | ||
|
|
d73b069944 | ||
|
|
9c500f290e | ||
|
|
f82fe620dd | ||
|
|
de89610011 | ||
|
|
c15fb4043b | ||
|
|
7f5c74b502 | ||
|
|
0d1fc17db9 | ||
|
|
32ff9840b8 | ||
|
|
07e5385fa2 | ||
|
|
fb3d0269a1 | ||
|
|
fceffc05e7 | ||
|
|
4a3043e113 | ||
|
|
aa90a4aec8 | ||
|
|
2f9744fe9d | ||
|
|
8fe3945c4c | ||
|
|
db00ef83c0 | ||
|
|
40fd5cd41e | ||
|
|
4dc774c11c | ||
|
|
f48d97e132 | ||
|
|
b341228dd9 | ||
|
|
813a534b41 | ||
|
|
086cd21cea | ||
|
|
69ec85ef19 | ||
|
|
0336f7ccf8 | ||
|
|
4994a90be9 | ||
|
|
d73e5f8dc7 | ||
|
|
3d44d381bc | ||
|
|
39dd832c84 | ||
|
|
1ae58837db | ||
|
|
739c279526 | ||
|
|
8b7dc057e1 | ||
|
|
9c87792c63 | ||
|
|
31fa23a388 | ||
|
|
08ce6be3ff | ||
|
|
2d68216699 | ||
|
|
0002056e51 | ||
|
|
4636409724 | ||
|
|
3b7fa93e72 | ||
|
|
d10a2764af | ||
|
|
718a313673 | ||
|
|
d00cdec296 | ||
|
|
e650be3814 | ||
|
|
c59fe0e4ad | ||
|
|
b191b67f21 | ||
|
|
9c09cb874e | ||
|
|
b661547817 | ||
|
|
2d7ca2a7db | ||
|
|
d6fdf887ce | ||
|
|
4f4689c4e9 | ||
|
|
8ff2c930ee |
1
.gitignore
vendored
@@ -1,4 +1,3 @@
|
|||||||
lib/classes/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/*/
|
|
||||||
templates/*
|
templates/*
|
||||||
logs/*
|
logs/*
|
||||||
install/update.log
|
install/update.log
|
||||||
|
|||||||
@@ -93,23 +93,6 @@ return array(
|
|||||||
'option_options' => array('Manual' => $lng['serversettings']['manual'], 'Dropdown' => $lng['serversettings']['dropdown']),
|
'option_options' => array('Manual' => $lng['serversettings']['manual'], 'Dropdown' => $lng['serversettings']['dropdown']),
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'use_webfonts' => array(
|
|
||||||
'label' => $lng['serversettings']['enablewebfonts'],
|
|
||||||
'settinggroup' => 'panel',
|
|
||||||
'varname' => 'use_webfonts',
|
|
||||||
'type' => 'bool',
|
|
||||||
'default' => true,
|
|
||||||
'save_method' => 'storeSettingField',
|
|
||||||
),
|
|
||||||
'webfont' => array(
|
|
||||||
'label' => $lng['serversettings']['definewebfont']['title'],
|
|
||||||
'settinggroup' => 'panel',
|
|
||||||
'varname' => 'webfont',
|
|
||||||
'type' => 'string',
|
|
||||||
'default' => 'Numans',
|
|
||||||
'string_emptyallowed' => false,
|
|
||||||
'save_method' => 'storeSettingField',
|
|
||||||
),
|
|
||||||
'panel_adminmail' => array(
|
'panel_adminmail' => array(
|
||||||
'label' => $lng['serversettings']['adminmail'],
|
'label' => $lng['serversettings']['adminmail'],
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
@@ -202,6 +185,24 @@ return array(
|
|||||||
'default' => true,
|
'default' => true,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
|
'customer_show_news_feed' => array(
|
||||||
|
'label' => $lng['admin']['customer_show_news_feed'],
|
||||||
|
'settinggroup' => 'customer',
|
||||||
|
'varname' => 'show_news_feed',
|
||||||
|
'type' => 'bool',
|
||||||
|
'default' => true,
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
),
|
||||||
|
'customer_news_feed_url' => array(
|
||||||
|
'label' => $lng['admin']['customer_news_feed_url'],
|
||||||
|
'settinggroup' => 'customer',
|
||||||
|
'varname' => 'news_feed_url',
|
||||||
|
'type' => 'string',
|
||||||
|
'string_type' => 'url',
|
||||||
|
'string_emptyallowed' => true,
|
||||||
|
'default' => '',
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
),
|
||||||
'panel_allow_domain_change_admin' => array(
|
'panel_allow_domain_change_admin' => array(
|
||||||
'label' => $lng['serversettings']['panel_allow_domain_change_admin'],
|
'label' => $lng['serversettings']['panel_allow_domain_change_admin'],
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
|
|||||||
@@ -70,6 +70,46 @@ return array(
|
|||||||
'default' => 0,
|
'default' => 0,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
|
'panel_password_alpha_lower' => array(
|
||||||
|
'label' => $lng['serversettings']['panel_password_alpha_lower'],
|
||||||
|
'settinggroup' => 'panel',
|
||||||
|
'varname' => 'password_alpha_lower',
|
||||||
|
'type' => 'bool',
|
||||||
|
'default' => true,
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
),
|
||||||
|
'panel_password_alpha_upper' => array(
|
||||||
|
'label' => $lng['serversettings']['panel_password_alpha_upper'],
|
||||||
|
'settinggroup' => 'panel',
|
||||||
|
'varname' => 'password_alpha_upper',
|
||||||
|
'type' => 'bool',
|
||||||
|
'default' => true,
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
),
|
||||||
|
'panel_password_numeric' => array(
|
||||||
|
'label' => $lng['serversettings']['panel_password_numeric'],
|
||||||
|
'settinggroup' => 'panel',
|
||||||
|
'varname' => 'password_numeric',
|
||||||
|
'type' => 'bool',
|
||||||
|
'default' => false,
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
),
|
||||||
|
'panel_password_special_char_required' => array(
|
||||||
|
'label' => $lng['serversettings']['panel_password_special_char_required'],
|
||||||
|
'settinggroup' => 'panel',
|
||||||
|
'varname' => 'password_special_char_required',
|
||||||
|
'type' => 'bool',
|
||||||
|
'default' => false,
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
),
|
||||||
|
'panel_password_special_char' => array(
|
||||||
|
'label' => $lng['serversettings']['panel_password_special_char'],
|
||||||
|
'settinggroup' => 'panel',
|
||||||
|
'varname' => 'password_special_char',
|
||||||
|
'type' => 'string',
|
||||||
|
'default' => '!?<>§$%&+#=@',
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
),
|
||||||
'panel_password_regex' => array(
|
'panel_password_regex' => array(
|
||||||
'label' => $lng['serversettings']['panel_password_regex'],
|
'label' => $lng['serversettings']['panel_password_regex'],
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
|
|||||||
@@ -29,6 +29,22 @@ return array(
|
|||||||
'default' => '/etc/cron.d/froxlor',
|
'default' => '/etc/cron.d/froxlor',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
|
'system_send_cron_errors' => array(
|
||||||
|
'label' => $lng['serversettings']['system_send_cron_errors'],
|
||||||
|
'settinggroup' => 'system',
|
||||||
|
'varname' => 'send_cron_errors',
|
||||||
|
'type' => 'bool',
|
||||||
|
'default' => false,
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
),
|
||||||
|
'system_croncmdline' => array(
|
||||||
|
'label' => $lng['serversettings']['system_croncmdline'],
|
||||||
|
'settinggroup' => 'system',
|
||||||
|
'varname' => 'croncmdline',
|
||||||
|
'type' => 'string',
|
||||||
|
'default' => '/usr/bin/nice -n 5 /usr/bin/php5 -q',
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
),
|
||||||
'system_crondreload' => array(
|
'system_crondreload' => array(
|
||||||
'label' => $lng['serversettings']['system_crondreload'],
|
'label' => $lng['serversettings']['system_crondreload'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
@@ -37,6 +53,14 @@ return array(
|
|||||||
'default' => '/etc/init.d/cron reload',
|
'default' => '/etc/init.d/cron reload',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
|
'system_cron_allowautoupdate' => array(
|
||||||
|
'label' => $lng['serversettings']['system_cron_allowautoupdate'],
|
||||||
|
'settinggroup' => 'system',
|
||||||
|
'varname' => 'cron_allowautoupdate',
|
||||||
|
'type' => 'bool',
|
||||||
|
'default' => false,
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
),
|
||||||
'system_debug_cron' => array(
|
'system_debug_cron' => array(
|
||||||
'label' => $lng['serversettings']['cron']['debug'],
|
'label' => $lng['serversettings']['cron']['debug'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
|
|||||||
@@ -185,9 +185,16 @@ return array(
|
|||||||
'default' => 30,
|
'default' => 30,
|
||||||
'save_method' => 'storeSettingField'
|
'save_method' => 'storeSettingField'
|
||||||
),
|
),
|
||||||
|
'system_phpfpm_use_mod_proxy' => array(
|
||||||
|
'label' => $lng['phpfpm']['use_mod_proxy'],
|
||||||
|
'settinggroup' => 'phpfpm',
|
||||||
|
'varname' => 'use_mod_proxy',
|
||||||
|
'type' => 'bool',
|
||||||
|
'default' => false,
|
||||||
|
'visible' => Settings::Get('system.apache24'),
|
||||||
|
'save_method' => 'storeSettingField'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
|
||||||
|
|||||||
@@ -74,10 +74,19 @@ return array(
|
|||||||
'varname' => 'axfrservers',
|
'varname' => 'axfrservers',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'validate_ip',
|
'string_type' => 'validate_ip',
|
||||||
|
'string_delimiter' => ',',
|
||||||
'string_emptyallowed' => true,
|
'string_emptyallowed' => true,
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
|
'system_dns_createhostnameentry' => array(
|
||||||
|
'label' => $lng['serversettings']['dns_createhostnameentry'],
|
||||||
|
'settinggroup' => 'system',
|
||||||
|
'varname' => 'dns_createhostnameentry',
|
||||||
|
'type' => 'bool',
|
||||||
|
'default' => false,
|
||||||
|
'save_method' => 'storeSettingField'
|
||||||
|
),
|
||||||
'system_dns_createmailentry' => array(
|
'system_dns_createmailentry' => array(
|
||||||
'label' => $lng['serversettings']['mail_also_with_mxservers'],
|
'label' => $lng['serversettings']['mail_also_with_mxservers'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ if ($page == 'admins'
|
|||||||
// percent-values for progressbar
|
// percent-values for progressbar
|
||||||
// For Disk usage
|
// For Disk usage
|
||||||
if ($row['diskspace'] > 0) {
|
if ($row['diskspace'] > 0) {
|
||||||
$disk_percent = round(($row['diskspace_used']*100)/$row['diskspace'], 2);
|
$disk_percent = round(($row['diskspace_used']*100)/$row['diskspace'], 0);
|
||||||
$disk_doublepercent = round($disk_percent*2, 2);
|
$disk_doublepercent = round($disk_percent*2, 2);
|
||||||
} else {
|
} else {
|
||||||
$disk_percent = 0;
|
$disk_percent = 0;
|
||||||
@@ -76,15 +76,26 @@ if ($page == 'admins'
|
|||||||
}
|
}
|
||||||
// For Traffic usage
|
// For Traffic usage
|
||||||
if ($row['traffic'] > 0) {
|
if ($row['traffic'] > 0) {
|
||||||
$traffic_percent = round(($row['traffic_used']*100)/$row['traffic'], 2);
|
$traffic_percent = round(($row['traffic_used']*100)/$row['traffic'], 0);
|
||||||
$traffic_doublepercent = round($traffic_percent*2, 2);
|
$traffic_doublepercent = round($traffic_percent*2, 2);
|
||||||
} else {
|
} else {
|
||||||
$traffic_percent = 0;
|
$traffic_percent = 0;
|
||||||
$traffic_doublepercent = 0;
|
$traffic_doublepercent = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// fix progress-bars if value is >100%
|
||||||
|
if ($disk_percent > 100) {
|
||||||
|
$disk_percent = 100;
|
||||||
|
}
|
||||||
|
if ($traffic_percent > 100) {
|
||||||
|
$traffic_percent = 100;
|
||||||
|
}
|
||||||
|
|
||||||
$row = str_replace_array('-1', 'UL', $row, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains tickets');
|
$row = str_replace_array('-1', 'UL', $row, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains tickets');
|
||||||
$row = htmlentities_array($row);
|
$row = htmlentities_array($row);
|
||||||
|
|
||||||
|
$row['custom_notes'] = ($row['custom_notes'] != '') ? nl2br($row['custom_notes']) : '';
|
||||||
|
|
||||||
eval("\$admins.=\"" . getTemplate("admins/admins_admin") . "\";");
|
eval("\$admins.=\"" . getTemplate("admins/admins_admin") . "\";");
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
@@ -190,6 +201,9 @@ if ($page == 'admins'
|
|||||||
$name = validate($_POST['name'], 'name');
|
$name = validate($_POST['name'], 'name');
|
||||||
$email = $idna_convert->encode(validate($_POST['email'], 'email'));
|
$email = $idna_convert->encode(validate($_POST['email'], 'email'));
|
||||||
|
|
||||||
|
$custom_notes = validate(str_replace("\r\n", "\n", $_POST['custom_notes']), 'custom_notes', '/^[^\0]*$/');
|
||||||
|
$custom_notes_show = intval_ressource($_POST['custom_notes_show']);
|
||||||
|
|
||||||
$loginname = validate($_POST['loginname'], 'loginname');
|
$loginname = validate($_POST['loginname'], 'loginname');
|
||||||
$password = validate($_POST['admin_password'], 'password');
|
$password = validate($_POST['admin_password'], 'password');
|
||||||
$password = validatePassword($password);
|
$password = validatePassword($password);
|
||||||
@@ -380,7 +394,9 @@ if ($page == 'admins'
|
|||||||
'tickets_see_all' => $tickets_see_all,
|
'tickets_see_all' => $tickets_see_all,
|
||||||
'mysqls' => $mysqls,
|
'mysqls' => $mysqls,
|
||||||
'ip' => $ipaddress,
|
'ip' => $ipaddress,
|
||||||
'theme' => $_theme
|
'theme' => $_theme,
|
||||||
|
'custom_notes' => $custom_notes,
|
||||||
|
'custom_notes_show' => $custom_notes_show
|
||||||
);
|
);
|
||||||
|
|
||||||
$ins_stmt = Database::prepare("
|
$ins_stmt = Database::prepare("
|
||||||
@@ -408,7 +424,9 @@ if ($page == 'admins'
|
|||||||
`tickets_see_all` = :tickets_see_all,
|
`tickets_see_all` = :tickets_see_all,
|
||||||
`mysqls` = :mysqls,
|
`mysqls` = :mysqls,
|
||||||
`ip` = :ip,
|
`ip` = :ip,
|
||||||
`theme` = :theme
|
`theme` = :theme,
|
||||||
|
`custom_notes` = :custom_notes,
|
||||||
|
`custom_notes_show` = :custom_notes_show
|
||||||
");
|
");
|
||||||
Database::pexecute($ins_stmt, $ins_data);
|
Database::pexecute($ins_stmt, $ins_data);
|
||||||
|
|
||||||
@@ -479,6 +497,9 @@ if ($page == 'admins'
|
|||||||
$name = validate($_POST['name'], 'name');
|
$name = validate($_POST['name'], 'name');
|
||||||
$email = $idna_convert->encode(validate($_POST['email'], 'email'));
|
$email = $idna_convert->encode(validate($_POST['email'], 'email'));
|
||||||
|
|
||||||
|
$custom_notes = validate(str_replace("\r\n", "\n", $_POST['custom_notes']), 'custom_notes', '/^[^\0]*$/');
|
||||||
|
$custom_notes_show = intval_ressource($_POST['custom_notes_show']);
|
||||||
|
|
||||||
if ($result['adminid'] == $userinfo['userid']) {
|
if ($result['adminid'] == $userinfo['userid']) {
|
||||||
|
|
||||||
$password = '';
|
$password = '';
|
||||||
@@ -713,6 +734,8 @@ if ($page == 'admins'
|
|||||||
'mysqls' => $mysqls,
|
'mysqls' => $mysqls,
|
||||||
'ip' => $ipaddress,
|
'ip' => $ipaddress,
|
||||||
'deactivated' => $deactivated,
|
'deactivated' => $deactivated,
|
||||||
|
'custom_notes' => $custom_notes,
|
||||||
|
'custom_notes_show' => $custom_notes_show,
|
||||||
'adminid' => $id
|
'adminid' => $id
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -740,7 +763,9 @@ if ($page == 'admins'
|
|||||||
`tickets_see_all` = :tickets_see_all,
|
`tickets_see_all` = :tickets_see_all,
|
||||||
`mysqls` = :mysqls,
|
`mysqls` = :mysqls,
|
||||||
`ip` = :ip,
|
`ip` = :ip,
|
||||||
`deactivated` = :deactivated
|
`deactivated` = :deactivated,
|
||||||
|
`custom_notes` = :custom_notes,
|
||||||
|
`custom_notes_show` = :custom_notes_show
|
||||||
WHERE `adminid` = :adminid
|
WHERE `adminid` = :adminid
|
||||||
");
|
");
|
||||||
Database::pexecute($upd_stmt, $upd_data);
|
Database::pexecute($upd_stmt, $upd_data);
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ if ($page == 'customers'
|
|||||||
*/
|
*/
|
||||||
//For Disk usage
|
//For Disk usage
|
||||||
if ($row['diskspace'] > 0) {
|
if ($row['diskspace'] > 0) {
|
||||||
$disk_percent = round(($row['diskspace_used']*100)/$row['diskspace'], 2);
|
$disk_percent = round(($row['diskspace_used']*100)/$row['diskspace'], 0);
|
||||||
$disk_doublepercent = round($disk_percent*2, 2);
|
$disk_doublepercent = round($disk_percent*2, 2);
|
||||||
} else {
|
} else {
|
||||||
$disk_percent = 0;
|
$disk_percent = 0;
|
||||||
@@ -103,7 +103,7 @@ if ($page == 'customers'
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($row['traffic'] > 0) {
|
if ($row['traffic'] > 0) {
|
||||||
$traffic_percent = round(($row['traffic_used']*100)/$row['traffic'], 2);
|
$traffic_percent = round(($row['traffic_used']*100)/$row['traffic'], 0);
|
||||||
$traffic_doublepercent = round($traffic_percent*2, 2);
|
$traffic_doublepercent = round($traffic_percent*2, 2);
|
||||||
} else {
|
} else {
|
||||||
$traffic_percent = 0;
|
$traffic_percent = 0;
|
||||||
@@ -119,6 +119,17 @@ if ($page == 'customers'
|
|||||||
|
|
||||||
$row = str_replace_array('-1', 'UL', $row, 'diskspace traffic mysqls emails email_accounts email_forwarders ftps tickets subdomains');
|
$row = str_replace_array('-1', 'UL', $row, 'diskspace traffic mysqls emails email_accounts email_forwarders ftps tickets subdomains');
|
||||||
$row = htmlentities_array($row);
|
$row = htmlentities_array($row);
|
||||||
|
|
||||||
|
// fix progress-bars if value is >100%
|
||||||
|
if ($disk_percent > 100) {
|
||||||
|
$disk_percent = 100;
|
||||||
|
}
|
||||||
|
if ($traffic_percent > 100) {
|
||||||
|
$traffic_percent = 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
$row['custom_notes'] = ($row['custom_notes'] != '') ? nl2br($row['custom_notes']) : '';
|
||||||
|
|
||||||
eval("\$customers.=\"" . getTemplate("customers/customers_customer") . "\";");
|
eval("\$customers.=\"" . getTemplate("customers/customers_customer") . "\";");
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
@@ -267,6 +278,13 @@ if ($page == 'customers'
|
|||||||
Database::pexecute($stmt, array('id' => $id));
|
Database::pexecute($stmt, array('id' => $id));
|
||||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_DATABASES . "` WHERE `customerid` = :id");
|
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_DATABASES . "` WHERE `customerid` = :id");
|
||||||
Database::pexecute($stmt, array('id' => $id));
|
Database::pexecute($stmt, array('id' => $id));
|
||||||
|
// first gather all domain-id's to clean up panel_domaintoip accordingly
|
||||||
|
$did_stmt = Database::prepare("SELECT `id` FROM `".TABLE_PANEL_DOMAINS."` WHERE `customerid` = :id");
|
||||||
|
Database::pexecute($did_stmt, array('id' => $id));
|
||||||
|
while ($row = $did_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
|
$stmt = Database::prepare("DELETE FROM `" . TABLE_DOMAINTOIP . "` WHERE `id_domain` = :did");
|
||||||
|
Database::pexecute($stmt, array('did' => $row['id']));
|
||||||
|
}
|
||||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid` = :id");
|
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid` = :id");
|
||||||
Database::pexecute($stmt, array('id' => $id));
|
Database::pexecute($stmt, array('id' => $id));
|
||||||
$domains_deleted = $stmt->rowCount();
|
$domains_deleted = $stmt->rowCount();
|
||||||
@@ -401,6 +419,9 @@ if ($page == 'customers'
|
|||||||
$def_language = validate($_POST['def_language'], 'default language');
|
$def_language = validate($_POST['def_language'], 'default language');
|
||||||
$gender = intval_ressource($_POST['gender']);
|
$gender = intval_ressource($_POST['gender']);
|
||||||
|
|
||||||
|
$custom_notes = validate(str_replace("\r\n", "\n", $_POST['custom_notes']), 'custom_notes', '/^[^\0]*$/');
|
||||||
|
$custom_notes_show = intval_ressource($_POST['custom_notes_show']);
|
||||||
|
|
||||||
$diskspace = intval_ressource($_POST['diskspace']);
|
$diskspace = intval_ressource($_POST['diskspace']);
|
||||||
if (isset($_POST['diskspace_ul'])) {
|
if (isset($_POST['diskspace_ul'])) {
|
||||||
$diskspace = - 1;
|
$diskspace = - 1;
|
||||||
@@ -616,7 +637,7 @@ if ($page == 'customers'
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($password == '') {
|
if ($password == '') {
|
||||||
$password = substr(md5(uniqid(microtime(), 1)), 12, 6);
|
$password = generatePassword();
|
||||||
}
|
}
|
||||||
|
|
||||||
$_theme = Settings::Get('panel.default_theme');
|
$_theme = Settings::Get('panel.default_theme');
|
||||||
@@ -653,7 +674,9 @@ if ($page == 'customers'
|
|||||||
'imap' => $email_imap,
|
'imap' => $email_imap,
|
||||||
'pop3' => $email_pop3,
|
'pop3' => $email_pop3,
|
||||||
'perlenabled' => $perlenabled,
|
'perlenabled' => $perlenabled,
|
||||||
'theme' => $theme
|
'theme' => $_theme,
|
||||||
|
'custom_notes' => $custom_notes,
|
||||||
|
'custom_notes_show' => $custom_notes_show
|
||||||
);
|
);
|
||||||
|
|
||||||
$ins_stmt = Database::prepare("
|
$ins_stmt = Database::prepare("
|
||||||
@@ -690,7 +713,9 @@ if ($page == 'customers'
|
|||||||
`imap` = :imap,
|
`imap` = :imap,
|
||||||
`pop3` = :pop3,
|
`pop3` = :pop3,
|
||||||
`perlenabled` = :perlenabled,
|
`perlenabled` = :perlenabled,
|
||||||
`theme` = :theme"
|
`theme` = :theme,
|
||||||
|
`custom_notes` = :custom_notes,
|
||||||
|
`custom_notes_show` = :custom_notes_show"
|
||||||
);
|
);
|
||||||
Database::pexecute($ins_stmt, $ins_data);
|
Database::pexecute($ins_stmt, $ins_data);
|
||||||
|
|
||||||
@@ -817,7 +842,21 @@ if ($page == 'customers'
|
|||||||
'guid' => $guid,
|
'guid' => $guid,
|
||||||
'members' => $loginname.','.Settings::Get('system.httpuser')
|
'members' => $loginname.','.Settings::Get('system.httpuser')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// also, add froxlor-local user to ftp-group (if exists!) to
|
||||||
|
// allow access to customer-directories from within the panel, which
|
||||||
|
// is necessary when pathedit = Dropdown
|
||||||
|
if ((int)Settings::Get('system.mod_fcgid_ownvhost') == 1 || (int)Settings::Get('phpfpm.enabled_ownvhost') == 1) {
|
||||||
|
if ((int)Settings::Get('system.mod_fcgid') == 1) {
|
||||||
|
$local_user = Settings::Get('system.mod_fcgid_httpuser');
|
||||||
|
} else {
|
||||||
|
$local_user = Settings::Get('phpfpm.vhost_httpuser');
|
||||||
|
}
|
||||||
|
$ins_data['members'] .= ','.$local_user;
|
||||||
|
}
|
||||||
|
|
||||||
Database::pexecute($ins_stmt, $ins_data);
|
Database::pexecute($ins_stmt, $ins_data);
|
||||||
|
|
||||||
// FTP-Quotatallies
|
// FTP-Quotatallies
|
||||||
$ins_stmt = Database::prepare("
|
$ins_stmt = Database::prepare("
|
||||||
INSERT INTO `" . TABLE_FTP_QUOTATALLIES . "` SET `name` = :name, `quota_type` = 'user', `bytes_in_used` = '0',
|
INSERT INTO `" . TABLE_FTP_QUOTATALLIES . "` SET `name` = :name, `quota_type` = 'user', `bytes_in_used` = '0',
|
||||||
@@ -858,6 +897,9 @@ if ($page == 'customers'
|
|||||||
`openbasedir` = '1',
|
`openbasedir` = '1',
|
||||||
`speciallogfile` = '0',
|
`speciallogfile` = '0',
|
||||||
`specialsettings` = '',
|
`specialsettings` = '',
|
||||||
|
`dkim_id` = '0',
|
||||||
|
`dkim_privkey` = '',
|
||||||
|
`dkim_pubkey` = '',
|
||||||
`add_date` = :adddate"
|
`add_date` = :adddate"
|
||||||
);
|
);
|
||||||
Database::pexecute($ins_stmt, $ins_data);
|
Database::pexecute($ins_stmt, $ins_data);
|
||||||
@@ -990,6 +1032,24 @@ if ($page == 'customers'
|
|||||||
}
|
}
|
||||||
$result = Database::pexecute_first($result_stmt, $result_data);
|
$result = Database::pexecute_first($result_stmt, $result_data);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* information for moving customer
|
||||||
|
*/
|
||||||
|
$available_admins_stmt = Database::prepare("
|
||||||
|
SELECT * FROM `" . TABLE_PANEL_ADMINS . "`
|
||||||
|
WHERE (`customers` = '-1' OR `customers` < `customers_used`)"
|
||||||
|
);
|
||||||
|
Database::pexecute($available_admins_stmt);
|
||||||
|
$admin_select = makeoption("-----", 0, true, true, true);
|
||||||
|
$admin_select_cnt = 0;
|
||||||
|
while ($available_admin = $available_admins_stmt->fetch()) {
|
||||||
|
$admin_select .= makeoption($available_admin['name']." (".$available_admin['loginname'].")", $available_admin['adminid'], null, true, true);
|
||||||
|
$admin_select_cnt++;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* end of moving customer stuff
|
||||||
|
*/
|
||||||
|
|
||||||
if ($result['loginname'] != '') {
|
if ($result['loginname'] != '') {
|
||||||
|
|
||||||
if (isset($_POST['send'])
|
if (isset($_POST['send'])
|
||||||
@@ -1010,6 +1070,11 @@ if ($page == 'customers'
|
|||||||
$password = validate($_POST['new_customer_password'], 'new password');
|
$password = validate($_POST['new_customer_password'], 'new password');
|
||||||
$gender = intval_ressource($_POST['gender']);
|
$gender = intval_ressource($_POST['gender']);
|
||||||
|
|
||||||
|
$move_to_admin = isset($_POST['move_to_admin']) ? intval_ressource($_POST['move_to_admin']) : 0;
|
||||||
|
|
||||||
|
$custom_notes = validate(str_replace("\r\n", "\n", $_POST['custom_notes']), 'custom_notes', '/^[^\0]*$/');
|
||||||
|
$custom_notes_show = intval_ressource($_POST['custom_notes_show']);
|
||||||
|
|
||||||
$diskspace = intval_ressource($_POST['diskspace']);
|
$diskspace = intval_ressource($_POST['diskspace']);
|
||||||
if (isset($_POST['diskspace_ul'])) {
|
if (isset($_POST['diskspace_ul'])) {
|
||||||
$diskspace = - 1;
|
$diskspace = - 1;
|
||||||
@@ -1345,7 +1410,9 @@ if ($page == 'customers'
|
|||||||
'phpenabled' => $phpenabled,
|
'phpenabled' => $phpenabled,
|
||||||
'imap' => $email_imap,
|
'imap' => $email_imap,
|
||||||
'pop3' => $email_pop3,
|
'pop3' => $email_pop3,
|
||||||
'perlenabled' => $perlenabled
|
'perlenabled' => $perlenabled,
|
||||||
|
'custom_notes' => $custom_notes,
|
||||||
|
'custom_notes_show' => $custom_notes_show
|
||||||
);
|
);
|
||||||
$upd_stmt = Database::prepare("
|
$upd_stmt = Database::prepare("
|
||||||
UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET
|
UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET
|
||||||
@@ -1376,7 +1443,9 @@ if ($page == 'customers'
|
|||||||
`email_quota` = :email_quota,
|
`email_quota` = :email_quota,
|
||||||
`imap` = :imap,
|
`imap` = :imap,
|
||||||
`pop3` = :pop3,
|
`pop3` = :pop3,
|
||||||
`perlenabled` = :perlenabled
|
`perlenabled` = :perlenabled,
|
||||||
|
`custom_notes` = :custom_notes,
|
||||||
|
`custom_notes_show` = :custom_notes_show
|
||||||
WHERE `customerid` = :customerid"
|
WHERE `customerid` = :customerid"
|
||||||
);
|
);
|
||||||
Database::pexecute($upd_stmt, $upd_data);
|
Database::pexecute($upd_stmt, $upd_data);
|
||||||
@@ -1488,6 +1557,17 @@ if ($page == 'customers'
|
|||||||
$admin_update_query.= " WHERE `adminid` = '" . (int)$result['adminid'] . "'";
|
$admin_update_query.= " WHERE `adminid` = '" . (int)$result['adminid'] . "'";
|
||||||
Database::query($admin_update_query);
|
Database::query($admin_update_query);
|
||||||
$log->logAction(ADM_ACTION, LOG_INFO, "edited user '" . $result['loginname'] . "'");
|
$log->logAction(ADM_ACTION, LOG_INFO, "edited user '" . $result['loginname'] . "'");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* move customer to another admin/reseller; #1166
|
||||||
|
*/
|
||||||
|
if ($move_to_admin > 0 && $move_to_admin != $result['adminid']) {
|
||||||
|
$move_result = moveCustomerToAdmin($id, $move_to_admin);
|
||||||
|
if ($move_result != true) {
|
||||||
|
standard_error('moveofcustomerfailed', $move_result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$redirect_props = Array(
|
$redirect_props = Array(
|
||||||
'page' => $page,
|
'page' => $page,
|
||||||
's' => $s
|
's' => $s
|
||||||
|
|||||||
@@ -351,7 +351,14 @@ if ($page == 'domains'
|
|||||||
$admin = $userinfo;
|
$admin = $userinfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
$documentroot = $customer['documentroot'];
|
// set default path if admin/reseller has "change_serversettings == false" but we still
|
||||||
|
// need to respect the documentroot_use_default_value - setting
|
||||||
|
$path_suffix = '';
|
||||||
|
if (Settings::Get('system.documentroot_use_default_value') == 1) {
|
||||||
|
$path_suffix = '/'.$domain;
|
||||||
|
}
|
||||||
|
$documentroot = makeCorrectDir($customer['documentroot'] . $path_suffix);
|
||||||
|
|
||||||
$registration_date = trim($_POST['registration_date']);
|
$registration_date = trim($_POST['registration_date']);
|
||||||
$registration_date = validate($registration_date, 'registration_date', '/^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/', '', array('0000-00-00', '0', ''));
|
$registration_date = validate($registration_date, 'registration_date', '/^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/', '', array('0000-00-00', '0', ''));
|
||||||
|
|
||||||
@@ -572,14 +579,26 @@ if ($page == 'domains'
|
|||||||
if ($aliasdomain != 0) {
|
if ($aliasdomain != 0) {
|
||||||
// Overwrite given ipandports with these of the "main" domain
|
// Overwrite given ipandports with these of the "main" domain
|
||||||
$ipandports = array();
|
$ipandports = array();
|
||||||
|
$ssl_ipandports = array();
|
||||||
$origipresult_stmt = Database::prepare("
|
$origipresult_stmt = Database::prepare("
|
||||||
SELECT `id_ipandports` FROM `" . TABLE_DOMAINTOIP ."`
|
SELECT `id_ipandports` FROM `" . TABLE_DOMAINTOIP ."`
|
||||||
WHERE `id_domain` = :id"
|
WHERE `id_domain` = :id"
|
||||||
);
|
);
|
||||||
Database::pexecute($origipresult_stmt, array('id' => $aliasdomain));
|
Database::pexecute($origipresult_stmt, array('id' => $aliasdomain));
|
||||||
|
$ipdata_stmt = Database::prepare("SELECT * FROM `".TABLE_PANEL_IPSANDPORTS."` WHERE `id` = :ipid");
|
||||||
while ($origip = $origipresult_stmt->fetch(PDO::FETCH_ASSOC)) {
|
while ($origip = $origipresult_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
|
$_origip_tmp = Database::pexecute_first($ipdata_stmt, array('ipid' => $origip['id_ipandports']));
|
||||||
|
if ($_origip_tmp['ssl'] == 0) {
|
||||||
$ipandports[] = $origip['id_ipandports'];
|
$ipandports[] = $origip['id_ipandports'];
|
||||||
|
} else {
|
||||||
|
$ssl_ipandports[] = $origip['id_ipandports'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count($ssl_ipandports) == 0) {
|
||||||
|
// we need this for the serialize
|
||||||
|
// if ssl is disabled or no ssl-ip/port exists
|
||||||
|
$ssl_ipandports[] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$aliasdomain_check_stmt = Database::prepare("
|
$aliasdomain_check_stmt = Database::prepare("
|
||||||
@@ -744,6 +763,9 @@ if ($page == 'domains'
|
|||||||
`aliasdomain` = :aliasdomain,
|
`aliasdomain` = :aliasdomain,
|
||||||
`zonefile` = :zonefile,
|
`zonefile` = :zonefile,
|
||||||
`dkim` = :dkim,
|
`dkim` = :dkim,
|
||||||
|
`dkim_id` = '0',
|
||||||
|
`dkim_privkey` = '',
|
||||||
|
`dkim_pubkey` = '',
|
||||||
`wwwserveralias` = :wwwserveralias,
|
`wwwserveralias` = :wwwserveralias,
|
||||||
`iswildcarddomain` = :iswildcarddomain,
|
`iswildcarddomain` = :iswildcarddomain,
|
||||||
`isbinddomain` = :isbinddomain,
|
`isbinddomain` = :isbinddomain,
|
||||||
@@ -771,16 +793,17 @@ if ($page == 'domains'
|
|||||||
);
|
);
|
||||||
Database::pexecute($upd_stmt, array('adminid' => $adminid));
|
Database::pexecute($upd_stmt, array('adminid' => $adminid));
|
||||||
|
|
||||||
foreach ($ipandports as $ipportid) {
|
|
||||||
$ins_data = array(
|
|
||||||
'domainid' => $domainid,
|
|
||||||
'ipandportsid' => $ipportid
|
|
||||||
);
|
|
||||||
$ins_stmt = Database::prepare("
|
$ins_stmt = Database::prepare("
|
||||||
INSERT INTO `" . TABLE_DOMAINTOIP . "` SET
|
INSERT INTO `" . TABLE_DOMAINTOIP . "` SET
|
||||||
`id_domain` = :domainid,
|
`id_domain` = :domainid,
|
||||||
`id_ipandports` = :ipandportsid
|
`id_ipandports` = :ipandportsid
|
||||||
");
|
");
|
||||||
|
|
||||||
|
foreach ($ipandports as $ipportid) {
|
||||||
|
$ins_data = array(
|
||||||
|
'domainid' => $domainid,
|
||||||
|
'ipandportsid' => $ipportid
|
||||||
|
);
|
||||||
Database::pexecute($ins_stmt, $ins_data);
|
Database::pexecute($ins_stmt, $ins_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -790,11 +813,6 @@ if ($page == 'domains'
|
|||||||
'domainid' => $domainid,
|
'domainid' => $domainid,
|
||||||
'ipandportsid' => $ssl_ipportid
|
'ipandportsid' => $ssl_ipportid
|
||||||
);
|
);
|
||||||
$ins_stmt = Database::prepare("
|
|
||||||
INSERT INTO `" . TABLE_DOMAINTOIP . "` SET
|
|
||||||
`id_domain` = :domainid,
|
|
||||||
`id_ipandports` = :ipandportsid
|
|
||||||
");
|
|
||||||
Database::pexecute($ins_stmt, $ins_data);
|
Database::pexecute($ins_stmt, $ins_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -872,7 +890,7 @@ if ($page == 'domains'
|
|||||||
$row_ipandport['ip'] = '[' . $row_ipandport['ip'] . ']';
|
$row_ipandport['ip'] = '[' . $row_ipandport['ip'] . ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
$ipsandports[] = array('label' => $row_ipandport['ip'] . ':' . $row_ipandport['port'], 'value' => $row_ipandport['id']);
|
$ipsandports[] = array('label' => $row_ipandport['ip'] . ':' . $row_ipandport['port'] . '<br />', 'value' => $row_ipandport['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$ssl_ipsandports = array();
|
$ssl_ipsandports = array();
|
||||||
@@ -882,7 +900,7 @@ if ($page == 'domains'
|
|||||||
$row_ssl_ipandport['ip'] = '[' . $row_ssl_ipandport['ip'] . ']';
|
$row_ssl_ipandport['ip'] = '[' . $row_ssl_ipandport['ip'] . ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
$ssl_ipsandports[] = array('label' => $row_ssl_ipandport['ip'] . ':' . $row_ssl_ipandport['port'], 'value' => $row_ssl_ipandport['id']);
|
$ssl_ipsandports[] = array('label' => $row_ssl_ipandport['ip'] . ':' . $row_ssl_ipandport['port'] . '<br />', 'value' => $row_ssl_ipandport['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$standardsubdomains = array();
|
$standardsubdomains = array();
|
||||||
@@ -1351,13 +1369,27 @@ if ($page == 'domains'
|
|||||||
if ($aliasdomain != 0) {
|
if ($aliasdomain != 0) {
|
||||||
// Overwrite given ipandports with these of the "main" domain
|
// Overwrite given ipandports with these of the "main" domain
|
||||||
$ipandports = array();
|
$ipandports = array();
|
||||||
|
$ssl_ipandports = array();
|
||||||
$origipresult_stmt = Database::prepare("
|
$origipresult_stmt = Database::prepare("
|
||||||
SELECT `id_ipandports` FROM `" . TABLE_DOMAINTOIP ."` WHERE `id_domain` = :aliasdomain
|
SELECT `id_ipandports` FROM `" . TABLE_DOMAINTOIP ."` WHERE `id_domain` = :aliasdomain
|
||||||
");
|
");
|
||||||
Database::pexecute($origipresult_stmt, array('aliasdomain' => $aliasdomain));
|
Database::pexecute($origipresult_stmt, array('aliasdomain' => $aliasdomain));
|
||||||
|
$ipdata_stmt = Database::prepare("SELECT * FROM `".TABLE_PANEL_IPSANDPORTS."` WHERE `id` = :ipid");
|
||||||
while ($origip = $origipresult_stmt->fetch(PDO::FETCH_ASSOC)) {
|
while ($origip = $origipresult_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
|
$_origip_tmp = Database::pexecute_first($ipdata_stmt, array('ipid' => $origip['id_ipandports']));
|
||||||
|
if ($_origip_tmp['ssl'] == 0) {
|
||||||
$ipandports[] = $origip['id_ipandports'];
|
$ipandports[] = $origip['id_ipandports'];
|
||||||
|
} else {
|
||||||
|
$ssl_ipandports[] = $origip['id_ipandports'];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count($ssl_ipandports) == 0) {
|
||||||
|
// we need this for the serialize
|
||||||
|
// if ssl is disabled or no ssl-ip/port exists
|
||||||
|
$ssl_ipandports[] = -1;
|
||||||
|
}
|
||||||
|
|
||||||
$aliasdomain_check_stmt = Database::prepare("
|
$aliasdomain_check_stmt = Database::prepare("
|
||||||
SELECT `d`.`id` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_CUSTOMERS . "` `c`
|
SELECT `d`.`id` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_CUSTOMERS . "` `c`
|
||||||
WHERE `d`.`customerid` = :customerid
|
WHERE `d`.`customerid` = :customerid
|
||||||
@@ -1642,6 +1674,8 @@ if ($page == 'domains'
|
|||||||
// FIXME check how many we got and if the amount of assigned IP's
|
// FIXME check how many we got and if the amount of assigned IP's
|
||||||
// has changed so we can insert a config-rebuild task if only
|
// has changed so we can insert a config-rebuild task if only
|
||||||
// the ip's of this domain were changed
|
// the ip's of this domain were changed
|
||||||
|
// -> for now, always insert a rebuild-task
|
||||||
|
inserttask('1');
|
||||||
|
|
||||||
// Cleanup domain <-> ip mapping
|
// Cleanup domain <-> ip mapping
|
||||||
$del_stmt = Database::prepare("
|
$del_stmt = Database::prepare("
|
||||||
@@ -1685,9 +1719,11 @@ if ($page == 'domains'
|
|||||||
Database::pexecute($ins_stmt, array('rowid' => $row['id'], 'ipportid' => $ipportid));
|
Database::pexecute($ins_stmt, array('rowid' => $row['id'], 'ipportid' => $ipportid));
|
||||||
}
|
}
|
||||||
foreach ($ssl_ipandports as $ssl_ipportid) {
|
foreach ($ssl_ipandports as $ssl_ipportid) {
|
||||||
|
if ($ssl_ipportid > 0) {
|
||||||
Database::pexecute($ins_stmt, array('rowid' => $row['id'], 'ipportid' => $ssl_ipportid));
|
Database::pexecute($ins_stmt, array('rowid' => $row['id'], 'ipportid' => $ssl_ipportid));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$log->logAction(ADM_ACTION, LOG_INFO, "edited domain #" . $id);
|
$log->logAction(ADM_ACTION, LOG_INFO, "edited domain #" . $id);
|
||||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||||
@@ -1815,7 +1851,7 @@ if ($page == 'domains'
|
|||||||
if (filter_var($row_ipandport['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
if (filter_var($row_ipandport['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
||||||
$row_ipandport['ip'] = '[' . $row_ipandport['ip'] . ']';
|
$row_ipandport['ip'] = '[' . $row_ipandport['ip'] . ']';
|
||||||
}
|
}
|
||||||
$ipsandports[] = array('label' => $row_ipandport['ip'] . ':' . $row_ipandport['port'], 'value' => $row_ipandport['id']);
|
$ipsandports[] = array('label' => $row_ipandport['ip'] . ':' . $row_ipandport['port'] . '<br />', 'value' => $row_ipandport['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$ssl_ipsandports = array();
|
$ssl_ipsandports = array();
|
||||||
@@ -1823,7 +1859,7 @@ if ($page == 'domains'
|
|||||||
if (filter_var($row_ssl_ipandport['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
if (filter_var($row_ssl_ipandport['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
||||||
$row_ssl_ipandport['ip'] = '[' . $row_ssl_ipandport['ip'] . ']';
|
$row_ssl_ipandport['ip'] = '[' . $row_ssl_ipandport['ip'] . ']';
|
||||||
}
|
}
|
||||||
$ssl_ipsandports[] = array('label' => $row_ssl_ipandport['ip'] . ':' . $row_ssl_ipandport['port'], 'value' => $row_ssl_ipandport['id']);
|
$ssl_ipsandports[] = array('label' => $row_ssl_ipandport['ip'] . ':' . $row_ssl_ipandport['port'] . '<br />', 'value' => $row_ssl_ipandport['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result['specialsettings'] = $result['specialsettings'];
|
$result['specialsettings'] = $result['specialsettings'];
|
||||||
@@ -1867,5 +1903,60 @@ if ($page == 'domains'
|
|||||||
eval("echo \"" . getTemplate("domains/domains_edit") . "\";");
|
eval("echo \"" . getTemplate("domains/domains_edit") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} elseif($action == 'import') {
|
||||||
|
|
||||||
|
if (isset($_POST['send'])
|
||||||
|
&& $_POST['send'] == 'send'
|
||||||
|
) {
|
||||||
|
|
||||||
|
$customerid = intval($_POST['customerid']);
|
||||||
|
$separator = validate($_POST['separator'], 'separator');
|
||||||
|
$offset = (int)validate($_POST['offset'], 'offset', "/[0-9]/i");
|
||||||
|
|
||||||
|
$file_name = $_FILES['file']['tmp_name'];
|
||||||
|
|
||||||
|
$result = array();
|
||||||
|
|
||||||
|
try {
|
||||||
|
$bulk = new DomainBulkAction($file_name, $customerid);
|
||||||
|
$result = $bulk->doImport($separator, $offset);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
standard_error('domain_import_error', $e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
// @FIXME find a way to display $result['notice'] here somehow,
|
||||||
|
// as it might be important if you've reached your maximum allocation of domains
|
||||||
|
|
||||||
|
// update customer/admin counters
|
||||||
|
updateCounters(false);
|
||||||
|
|
||||||
|
$result_str = $result['imported'] . ' / ' . $result['all'];
|
||||||
|
standard_success('domain_import_successfully', $result_str, array('filename' => $filename, 'action' => '', 'page' => 'domains'));
|
||||||
|
} else {
|
||||||
|
$customers = makeoption($lng['panel']['please_choose'], 0, 0, true);
|
||||||
|
$result_customers_stmt = Database::prepare("
|
||||||
|
SELECT `customerid`, `loginname`, `name`, `firstname`, `company`
|
||||||
|
FROM `" . TABLE_PANEL_CUSTOMERS . "` " .
|
||||||
|
($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = '" . (int)$userinfo['adminid'] . "' ") .
|
||||||
|
" ORDER BY `name` ASC"
|
||||||
|
);
|
||||||
|
$params = array();
|
||||||
|
if ($userinfo['customers_see_all'] == '0') {
|
||||||
|
$params['adminid'] = $userinfo['adminid'];
|
||||||
|
}
|
||||||
|
Database::pexecute($result_customers_stmt, $params);
|
||||||
|
|
||||||
|
while ($row_customer = $result_customers_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
|
$customers.= makeoption(getCorrectFullUserDetails($row_customer) . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$domain_import_data = include_once dirname(__FILE__).'/lib/formfields/admin/domains/formfield.domains_import.php';
|
||||||
|
$domain_import_form = htmlform::genHTMLForm($domain_import_data);
|
||||||
|
|
||||||
|
$title = $domain_import_data['domain_import']['title'];
|
||||||
|
$image = $domain_import_data['domain_import']['image'];
|
||||||
|
|
||||||
|
eval("echo \"" . getTemplate("domains/domains_import") . "\";");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,13 +118,13 @@ if ($page == 'overview') {
|
|||||||
$isnewerversion = 0;
|
$isnewerversion = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
redirectTo($update_check_uri.'/pretty', NULL);
|
redirectTo($update_check_uri.'/pretty', NULL, false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
redirectTo($update_check_uri.'/pretty', NULL);
|
redirectTo($update_check_uri.'/pretty', NULL, false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
redirectTo($update_check_uri.'/pretty', NULL);
|
redirectTo($update_check_uri.'/pretty', NULL, false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$lookfornewversion_lable = $lng['admin']['lookfornewversion']['clickhere'];
|
$lookfornewversion_lable = $lng['admin']['lookfornewversion']['clickhere'];
|
||||||
@@ -140,6 +140,8 @@ if ($page == 'overview') {
|
|||||||
$userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), $dec_places);
|
$userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), $dec_places);
|
||||||
$userinfo = str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps tickets subdomains');
|
$userinfo = str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps tickets subdomains');
|
||||||
|
|
||||||
|
$userinfo['custom_notes'] = ($userinfo['custom_notes'] != '') ? nl2br($userinfo['custom_notes']) : '';
|
||||||
|
|
||||||
$cron_last_runs = getCronjobsLastRun();
|
$cron_last_runs = getCronjobsLastRun();
|
||||||
$outstanding_tasks = getOutstandingTasks();
|
$outstanding_tasks = getOutstandingTasks();
|
||||||
|
|
||||||
|
|||||||
@@ -70,9 +70,28 @@ if ($page == 'overview') {
|
|||||||
while ($row2 = $domainresult_stmt->fetch(PDO::FETCH_ASSOC)) {
|
while ($row2 = $domainresult_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$domains.= $row2['domain'] . '<br/>';
|
$domains.= $row2['domain'] . '<br/>';
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
// check whether we use that config as froxor-vhost config
|
||||||
|
if (Settings::Get('system.mod_fcgid_defaultini_ownvhost') == $row['id']
|
||||||
|
|| Settings::Get('phpfpm.vhost_defaultini') == $row['id']
|
||||||
|
) {
|
||||||
|
$domains .= Settings::Get('system.hostname');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($domains == '') {
|
||||||
$domains = $lng['admin']['phpsettings']['notused'];
|
$domains = $lng['admin']['phpsettings']['notused'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check whether this is our default config
|
||||||
|
if ((Settings::Get('system.mod_fcgid') == '1'
|
||||||
|
&& Settings::Get('system.mod_fcgid_defaultini') == $row['id'])
|
||||||
|
|| (Settings::Get('phpfpm.enabled') == '1'
|
||||||
|
&& Settings::Get('phpfpm.defaultini') == $row['id'])
|
||||||
|
) {
|
||||||
|
$row['description'] = '<b>'.$row['description'].'</b>';
|
||||||
|
}
|
||||||
|
|
||||||
$count ++;
|
$count ++;
|
||||||
eval("\$tablecontent.=\"" . getTemplate("phpconfig/overview_overview") . "\";");
|
eval("\$tablecontent.=\"" . getTemplate("phpconfig/overview_overview") . "\";");
|
||||||
}
|
}
|
||||||
@@ -173,6 +192,22 @@ if ($page == 'overview') {
|
|||||||
);
|
);
|
||||||
$result = Database::pexecute_first($result_stmt, array('id' => $id));
|
$result = Database::pexecute_first($result_stmt, array('id' => $id));
|
||||||
|
|
||||||
|
if ((Settings::Get('system.mod_fcgid') == '1'
|
||||||
|
&& Settings::Get('system.mod_fcgid_defaultini_ownvhost') == $id)
|
||||||
|
|| (Settings::Get('phpfpm.enabled') == '1'
|
||||||
|
&& Settings::Get('phpfpm.vhost_defaultini') == $id)
|
||||||
|
) {
|
||||||
|
standard_error('cannotdeletehostnamephpconfig');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((Settings::Get('system.mod_fcgid') == '1'
|
||||||
|
&& Settings::Get('system.mod_fcgid_defaultini') == $id)
|
||||||
|
|| (Settings::Get('phpfpm.enabled') == '1'
|
||||||
|
&& Settings::Get('phpfpm.defaultini') == $id)
|
||||||
|
) {
|
||||||
|
standard_error('cannotdeletedefaultphpconfig');
|
||||||
|
}
|
||||||
|
|
||||||
if ($result['id'] != 0
|
if ($result['id'] != 0
|
||||||
&& $result['id'] == $id
|
&& $result['id'] == $id
|
||||||
&& (int)$userinfo['change_serversettings'] == 1
|
&& (int)$userinfo['change_serversettings'] == 1
|
||||||
@@ -186,7 +221,7 @@ if ($page == 'overview') {
|
|||||||
// config that is to be deleted
|
// config that is to be deleted
|
||||||
$upd_stmt = Database::prepare("
|
$upd_stmt = Database::prepare("
|
||||||
UPDATE `" . TABLE_PANEL_DOMAINS . "` SET
|
UPDATE `" . TABLE_PANEL_DOMAINS . "` SET
|
||||||
`phpsettingid` = 1 WHERE `phpsettingid` = :id"
|
`phpsettingid` = '1' WHERE `phpsettingid` = :id"
|
||||||
);
|
);
|
||||||
Database::pexecute($upd_stmt, array('id' => $id));
|
Database::pexecute($upd_stmt, array('id' => $id));
|
||||||
|
|
||||||
|
|||||||
@@ -143,6 +143,8 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
|
|||||||
eval("\$phpinfohtml .= \"" . getTemplate("settings/phpinfo/phpinfo_table") . "\";");
|
eval("\$phpinfohtml .= \"" . getTemplate("settings/phpinfo/phpinfo_table") . "\";");
|
||||||
}
|
}
|
||||||
$phpinfo = $phpinfohtml;
|
$phpinfo = $phpinfohtml;
|
||||||
|
} else {
|
||||||
|
standard_error($lng['error']['no_phpinfo']);
|
||||||
}
|
}
|
||||||
eval("echo \"" . getTemplate("settings/phpinfo") . "\";");
|
eval("echo \"" . getTemplate("settings/phpinfo") . "\";");
|
||||||
|
|
||||||
@@ -202,7 +204,7 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
|
|||||||
$log->logAction(ADM_ACTION, LOG_WARNING, "wiped all cleartext mail passwords");
|
$log->logAction(ADM_ACTION, LOG_WARNING, "wiped all cleartext mail passwords");
|
||||||
Database::query("UPDATE `" . TABLE_MAIL_USERS . "` SET `password` = '';");
|
Database::query("UPDATE `" . TABLE_MAIL_USERS . "` SET `password` = '';");
|
||||||
Database::query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '0' WHERE `settinggroup` = 'system' AND `varname` = 'mailpwcleartext'");
|
Database::query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '0' WHERE `settinggroup` = 'system' AND `varname` = 'mailpwcleartext'");
|
||||||
redirectTo('admin_settings.php', array('s' => $s));
|
redirectTo($filename, array('s' => $s));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ask_yesno('admin_cleartextmailpws_reallywipe', $filename, array('page' => $page));
|
ask_yesno('admin_cleartextmailpws_reallywipe', $filename, array('page' => $page));
|
||||||
@@ -221,7 +223,7 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
|
|||||||
// Set the quota to 0 which means unlimited
|
// Set the quota to 0 which means unlimited
|
||||||
Database::query("UPDATE `" . TABLE_MAIL_USERS . "` SET `quota` = '0';");
|
Database::query("UPDATE `" . TABLE_MAIL_USERS . "` SET `quota` = '0';");
|
||||||
Database::query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `email_quota_used` = '0'");
|
Database::query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `email_quota_used` = '0'");
|
||||||
redirectTo('admin_settings.php', array('s' => $s));
|
redirectTo($filename, array('s' => $s));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ask_yesno('admin_quotas_reallywipe', $filename, array('page' => $page));
|
ask_yesno('admin_quotas_reallywipe', $filename, array('page' => $page));
|
||||||
@@ -259,7 +261,7 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
|
|||||||
// Update the Customer, if the used quota is bigger than the allowed quota
|
// Update the Customer, if the used quota is bigger than the allowed quota
|
||||||
Database::query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `email_quota` = `email_quota_used` WHERE `email_quota` < `email_quota_used`");
|
Database::query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `email_quota` = `email_quota_used` WHERE `email_quota` < `email_quota_used`");
|
||||||
$log->logAction(ADM_ACTION, LOG_WARNING, 'enforcing mailquota to all customers: ' . Settings::Get('system.mail_quota') . ' MB');
|
$log->logAction(ADM_ACTION, LOG_WARNING, 'enforcing mailquota to all customers: ' . Settings::Get('system.mail_quota') . ' MB');
|
||||||
redirectTo('admin_settings.php', array('s' => $s));
|
redirectTo($filename, array('s' => $s));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ask_yesno('admin_quotas_reallyenforce', $filename, array('page' => $page));
|
ask_yesno('admin_quotas_reallyenforce', $filename, array('page' => $page));
|
||||||
|
|||||||
@@ -214,24 +214,23 @@ if ($action == '') {
|
|||||||
&& $_POST['prepare'] == 'prepare'
|
&& $_POST['prepare'] == 'prepare'
|
||||||
) {
|
) {
|
||||||
//email templates
|
//email templates
|
||||||
$language = validate($_POST['language'], 'language');
|
$language = validate($_POST['language'], 'language', '/^[^\r\n\0"\']+$/', 'nolanguageselect');
|
||||||
$templates = array();
|
$template = validate($_POST['template'], 'template');
|
||||||
$result_stmt = Database::prepare("
|
|
||||||
SELECT `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
|
||||||
WHERE `adminid`= :adminid AND `language`= :lang
|
|
||||||
AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'"
|
|
||||||
);
|
|
||||||
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'lang' => $language));
|
|
||||||
|
|
||||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
$lng_bak = $lng;
|
||||||
$templates[] = str_replace('_subject', '', $row['varname']);
|
foreach ($langs['English'] as $key => $value) {
|
||||||
|
include_once makeSecurePath($value['file']);
|
||||||
|
}
|
||||||
|
if ($language != 'English') {
|
||||||
|
foreach ($langs[$language] as $key => $value) {
|
||||||
|
include makeSecurePath($value['file']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$templates = array_diff($available_templates, $templates);
|
$subject = $lng['mails'][$template]['subject'];
|
||||||
$template_options = '';
|
$body = str_replace('\n', "\n", $lng['mails'][$template]['mailbody']);
|
||||||
foreach ($templates as $template) {
|
|
||||||
$template_options.= makeoption($lng['admin']['templates'][$template], $template, NULL, true);
|
$lng = $lng_bak;
|
||||||
}
|
|
||||||
|
|
||||||
$template_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/templates/formfield.template_add.php';
|
$template_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/templates/formfield.template_add.php';
|
||||||
$template_add_form = htmlform::genHTMLForm($template_add_data);
|
$template_add_form = htmlform::genHTMLForm($template_add_data);
|
||||||
@@ -328,6 +327,7 @@ if ($action == '') {
|
|||||||
//email templates
|
//email templates
|
||||||
$add = false;
|
$add = false;
|
||||||
$language_options = '';
|
$language_options = '';
|
||||||
|
$template_options = '';
|
||||||
|
|
||||||
while (list($language_file, $language_name) = each($languages)) {
|
while (list($language_file, $language_name) = each($languages)) {
|
||||||
$templates = array();
|
$templates = array();
|
||||||
@@ -344,7 +344,13 @@ if ($action == '') {
|
|||||||
|
|
||||||
if (count(array_diff($available_templates, $templates)) > 0) {
|
if (count(array_diff($available_templates, $templates)) > 0) {
|
||||||
$add = true;
|
$add = true;
|
||||||
$language_options.= makeoption($language_name, $language_file, $userinfo['language'], true);
|
$language_options.= makeoption($language_name, $language_file, $userinfo['language'], true, true);
|
||||||
|
|
||||||
|
$templates = array_diff($available_templates, $templates);
|
||||||
|
|
||||||
|
foreach ($templates as $template) {
|
||||||
|
$template_options.= makeoption($lng['admin']['templates'][$template], $template, NULL, true, true, $language_file) . "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -444,6 +450,8 @@ if ($action == '') {
|
|||||||
Database::pexecute($result_stmt, array('id' => $mailbodyid));
|
Database::pexecute($result_stmt, array('id' => $mailbodyid));
|
||||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
$template_name = str_replace('_mailbody', '', $result['varname']);
|
||||||
|
|
||||||
$result = htmlentities_array($result);
|
$result = htmlentities_array($result);
|
||||||
$mailbody = $result['value'];
|
$mailbody = $result['value'];
|
||||||
|
|
||||||
|
|||||||
@@ -158,8 +158,10 @@ if ($page == 'tickets'
|
|||||||
}
|
}
|
||||||
|
|
||||||
$row['subject'] = html_entity_decode($row['subject']);
|
$row['subject'] = html_entity_decode($row['subject']);
|
||||||
if (strlen($row['subject']) > 20) {
|
if (strlen($row['subject']) > 30) {
|
||||||
$row['subject'] = substr($row['subject'], 0, 17) . '...';
|
$ts = wordwrap($row['subject'], 30, "|");
|
||||||
|
$ts = explode("|", $ts);
|
||||||
|
$row['subject'] = $ts[0]. '...';
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("\$tickets.=\"" . getTemplate("tickets/tickets_tickets") . "\";");
|
eval("\$tickets.=\"" . getTemplate("tickets/tickets_tickets") . "\";");
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ if ($page == 'overview') {
|
|||||||
|
|
||||||
$successful_update = true;
|
$successful_update = true;
|
||||||
} else {
|
} else {
|
||||||
$message = '<br /><strong style="color: red">You have to agree that you have read the update notifications.</strong>';
|
$message = '<br /><strong class="red">You have to agree that you have read the update notifications.</strong>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
css/images/animated-overlay.gif
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
css/images/ui-bg_diagonals-thick_18_b81900_40x40.png
Normal file
|
After Width: | Height: | Size: 369 B |
BIN
css/images/ui-bg_diagonals-thick_20_666666_40x40.png
Normal file
|
After Width: | Height: | Size: 387 B |
BIN
css/images/ui-bg_flat_10_000000_40x100.png
Normal file
|
After Width: | Height: | Size: 278 B |
BIN
css/images/ui-bg_glass_100_f6f6f6_1x400.png
Normal file
|
After Width: | Height: | Size: 232 B |
BIN
css/images/ui-bg_glass_100_fdf5ce_1x400.png
Normal file
|
After Width: | Height: | Size: 321 B |
BIN
css/images/ui-bg_glass_65_ffffff_1x400.png
Normal file
|
After Width: | Height: | Size: 280 B |
BIN
css/images/ui-bg_gloss-wave_35_f6a828_500x100.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
Normal file
|
After Width: | Height: | Size: 246 B |
BIN
css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
Normal file
|
After Width: | Height: | Size: 287 B |
BIN
css/images/ui-icons_222222_256x240.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
css/images/ui-icons_228ef1_256x240.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
css/images/ui-icons_ef8c08_256x240.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
css/images/ui-icons_ffd27a_256x240.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
css/images/ui-icons_ffffff_256x240.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
8
css/jquery-ui.min.css
vendored
@@ -230,6 +230,12 @@ if ($page == 'overview') {
|
|||||||
$domain_check = Database::pexecute_first($domain_stmt, array("domain" => $domain, "customerid" => $userinfo['customerid']));
|
$domain_check = Database::pexecute_first($domain_stmt, array("domain" => $domain, "customerid" => $userinfo['customerid']));
|
||||||
|
|
||||||
$completedomain = $subdomain . '.' . $domain;
|
$completedomain = $subdomain . '.' . $domain;
|
||||||
|
|
||||||
|
if ($completedomain == Settings::Get('system.hostname')) {
|
||||||
|
standard_error('admin_domain_emailsystemhostname');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$completedomain_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "`
|
$completedomain_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||||
WHERE `domain` = :domain
|
WHERE `domain` = :domain
|
||||||
AND `customerid` = :customerid
|
AND `customerid` = :customerid
|
||||||
@@ -406,6 +412,7 @@ if ($page == 'overview') {
|
|||||||
$domains_stmt = Database::prepare("SELECT `d`.`id`, `d`.`domain` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_CUSTOMERS . "` `c`
|
$domains_stmt = Database::prepare("SELECT `d`.`id`, `d`.`domain` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_CUSTOMERS . "` `c`
|
||||||
WHERE `d`.`aliasdomain` IS NULL
|
WHERE `d`.`aliasdomain` IS NULL
|
||||||
AND `d`.`id` <> `c`.`standardsubdomain`
|
AND `d`.`id` <> `c`.`standardsubdomain`
|
||||||
|
AND `d`.`parentdomainid` = '0'
|
||||||
AND `d`.`customerid`=`c`.`customerid`
|
AND `d`.`customerid`=`c`.`customerid`
|
||||||
AND `d`.`email_only`='0'
|
AND `d`.`email_only`='0'
|
||||||
AND `d`.`customerid`= :customerid
|
AND `d`.`customerid`= :customerid
|
||||||
@@ -607,6 +614,7 @@ if ($page == 'overview') {
|
|||||||
WHERE `d`.`aliasdomain` IS NULL
|
WHERE `d`.`aliasdomain` IS NULL
|
||||||
AND `d`.`id` <> :id
|
AND `d`.`id` <> :id
|
||||||
AND `c`.`standardsubdomain` <> `d`.`id`
|
AND `c`.`standardsubdomain` <> `d`.`id`
|
||||||
|
AND `d`.`parentdomainid` = '0'
|
||||||
AND `d`.`customerid` = :customerid
|
AND `d`.`customerid` = :customerid
|
||||||
AND `c`.`customerid` = `d`.`customerid`
|
AND `c`.`customerid` = `d`.`customerid`
|
||||||
AND `d`.`id` = `dip`.`id_domain`
|
AND `d`.`id` = `dip`.`id_domain`
|
||||||
|
|||||||
@@ -446,6 +446,9 @@ if ($page == 'overview') {
|
|||||||
}
|
}
|
||||||
elseif ($password == '' && !(Settings::Get('panel.sendalternativemail') == 1 && validateEmail($alternative_email))) {
|
elseif ($password == '' && !(Settings::Get('panel.sendalternativemail') == 1 && validateEmail($alternative_email))) {
|
||||||
standard_error(array('stringisempty', 'mypassword'));
|
standard_error(array('stringisempty', 'mypassword'));
|
||||||
|
}
|
||||||
|
elseif ($password == $email_full) {
|
||||||
|
standard_error('passwordshouldnotbeusername');
|
||||||
} else {
|
} else {
|
||||||
if ($password == '') {
|
if ($password == '') {
|
||||||
$password = substr(md5(uniqid(microtime(), 1)), 12, 6);
|
$password = substr(md5(uniqid(microtime(), 1)), 12, 6);
|
||||||
@@ -632,6 +635,10 @@ if ($page == 'overview') {
|
|||||||
standard_error(array('stringisempty', 'mypassword'));
|
standard_error(array('stringisempty', 'mypassword'));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
elseif ($password == $result['email_full']) {
|
||||||
|
standard_error('passwordshouldnotbeusername');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$password = validatePassword($password);
|
$password = validatePassword($password);
|
||||||
|
|
||||||
@@ -887,5 +894,3 @@ if ($page == 'overview') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
|
|||||||
@@ -133,6 +133,8 @@ if ($page == 'overview') {
|
|||||||
standard_error(array('stringisempty', 'mypassword'));
|
standard_error(array('stringisempty', 'mypassword'));
|
||||||
} elseif ($path == '') {
|
} elseif ($path == '') {
|
||||||
standard_error('patherror');
|
standard_error('patherror');
|
||||||
|
} elseif ($_POST['directory_password'] == $username) {
|
||||||
|
standard_error('passwordshouldnotbeusername');
|
||||||
} else {
|
} else {
|
||||||
$stmt = Database::prepare("INSERT INTO `" . TABLE_PANEL_HTPASSWDS . "` SET
|
$stmt = Database::prepare("INSERT INTO `" . TABLE_PANEL_HTPASSWDS . "` SET
|
||||||
`customerid` = :customerid,
|
`customerid` = :customerid,
|
||||||
@@ -184,6 +186,10 @@ if ($page == 'overview') {
|
|||||||
$password = crypt($_POST['directory_password']);
|
$password = crypt($_POST['directory_password']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($_POST['directory_password'] == $result['username']) {
|
||||||
|
standard_error('passwordshouldnotbeusername');
|
||||||
|
}
|
||||||
|
|
||||||
$params = array(
|
$params = array(
|
||||||
"customerid" => $userinfo['customerid'],
|
"customerid" => $userinfo['customerid'],
|
||||||
"id" => $id
|
"id" => $id
|
||||||
|
|||||||
@@ -192,6 +192,8 @@ if ($page == 'overview') {
|
|||||||
standard_error(array('stringisempty', 'mypassword'));
|
standard_error(array('stringisempty', 'mypassword'));
|
||||||
} elseif ($path == '') {
|
} elseif ($path == '') {
|
||||||
standard_error('patherror');
|
standard_error('patherror');
|
||||||
|
} elseif ($username == $password) {
|
||||||
|
standard_error('passwordshouldnotbeusername');
|
||||||
} else {
|
} else {
|
||||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
||||||
|
|
||||||
@@ -264,7 +266,7 @@ if ($page == 'overview') {
|
|||||||
);
|
);
|
||||||
Database::pexecute($result_stmt, array("adminid" => $userinfo['adminid'], "lang" => $def_language));
|
Database::pexecute($result_stmt, array("adminid" => $userinfo['adminid'], "lang" => $def_language));
|
||||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['customer']['ftp_add']['infomail_subject']), $replace_arr));
|
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['new_ftpaccount_by_customer']['subject']), $replace_arr));
|
||||||
|
|
||||||
$def_language = $userinfo['def_language'];
|
$def_language = $userinfo['def_language'];
|
||||||
$result_stmt = Database::prepare("SELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
$result_stmt = Database::prepare("SELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||||
@@ -275,7 +277,7 @@ if ($page == 'overview') {
|
|||||||
);
|
);
|
||||||
Database::pexecute($result_stmt, array("adminid" => $userinfo['adminid'], "lang" => $def_language));
|
Database::pexecute($result_stmt, array("adminid" => $userinfo['adminid'], "lang" => $def_language));
|
||||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['customer']['ftp_add']['infomail_body']['main']), $replace_arr));
|
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['new_ftpaccount_by_customer']['mailbody']), $replace_arr));
|
||||||
|
|
||||||
$_mailerror = false;
|
$_mailerror = false;
|
||||||
try {
|
try {
|
||||||
@@ -362,6 +364,9 @@ if ($page == 'overview') {
|
|||||||
if ($password == '') {
|
if ($password == '') {
|
||||||
standard_error(array('stringisempty', 'mypassword'));
|
standard_error(array('stringisempty', 'mypassword'));
|
||||||
exit;
|
exit;
|
||||||
|
} elseif ($result['username'] == $password) {
|
||||||
|
standard_error('passwordshouldnotbeusername');
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
$log->logAction(USR_ACTION, LOG_INFO, "updated ftp-account password for '" . $result['username'] . "'");
|
$log->logAction(USR_ACTION, LOG_INFO, "updated ftp-account password for '" . $result['username'] . "'");
|
||||||
$cryptPassword = makeCryptPassword($password);
|
$cryptPassword = makeCryptPassword($password);
|
||||||
|
|||||||
@@ -85,6 +85,8 @@ if ($page == 'overview') {
|
|||||||
$userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), Settings::Get('panel.decimal_places'));
|
$userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), Settings::Get('panel.decimal_places'));
|
||||||
$userinfo = str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps tickets subdomains');
|
$userinfo = str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps tickets subdomains');
|
||||||
|
|
||||||
|
$userinfo['custom_notes'] = ($userinfo['custom_notes'] != '') ? nl2br($userinfo['custom_notes']) : '';
|
||||||
|
|
||||||
$services_enabled = "";
|
$services_enabled = "";
|
||||||
$se = array();
|
$se = array();
|
||||||
if ($userinfo['imap'] == '1') $se[] = "IMAP";
|
if ($userinfo['imap'] == '1') $se[] = "IMAP";
|
||||||
|
|||||||
@@ -178,6 +178,11 @@ if ($page == 'overview') {
|
|||||||
$userinfo['mysql_lastaccountnumber']
|
$userinfo['mysql_lastaccountnumber']
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// we've checked against the password in dbm->createDatabase
|
||||||
|
if ($username == false) {
|
||||||
|
standard_error('passwordshouldnotbeusername');
|
||||||
|
}
|
||||||
|
|
||||||
// Statement modified for Database description -- PH 2004-11-29
|
// Statement modified for Database description -- PH 2004-11-29
|
||||||
$stmt = Database::prepare('INSERT INTO `' . TABLE_PANEL_DATABASES . '`
|
$stmt = Database::prepare('INSERT INTO `' . TABLE_PANEL_DATABASES . '`
|
||||||
(`customerid`, `databasename`, `description`, `dbserver`)
|
(`customerid`, `databasename`, `description`, `dbserver`)
|
||||||
@@ -214,7 +219,7 @@ if ($page == 'overview') {
|
|||||||
'DB_NAME' => $username,
|
'DB_NAME' => $username,
|
||||||
'DB_PASS' => $password,
|
'DB_PASS' => $password,
|
||||||
'DB_DESC' => $databasedescription,
|
'DB_DESC' => $databasedescription,
|
||||||
'DB_SRV' => $sql_root['caption'],
|
'DB_SRV' => $sql_root['host'],
|
||||||
'PMA_URI' => $pma
|
'PMA_URI' => $pma
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -227,7 +232,7 @@ if ($page == 'overview') {
|
|||||||
);
|
);
|
||||||
Database::pexecute($result_stmt, array("adminid" => $userinfo['adminid'], "lang" => $def_language));
|
Database::pexecute($result_stmt, array("adminid" => $userinfo['adminid'], "lang" => $def_language));
|
||||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['customer']['mysql_add']['infomail_subject']), $replace_arr));
|
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['new_database_by_customer']['subject']), $replace_arr));
|
||||||
|
|
||||||
$result_stmt = Database::prepare("SELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
$result_stmt = Database::prepare("SELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||||
WHERE `adminid`= :adminid
|
WHERE `adminid`= :adminid
|
||||||
@@ -237,7 +242,7 @@ if ($page == 'overview') {
|
|||||||
);
|
);
|
||||||
Database::pexecute($result_stmt, array("adminid" => $userinfo['adminid'], "lang" => $def_language));
|
Database::pexecute($result_stmt, array("adminid" => $userinfo['adminid'], "lang" => $def_language));
|
||||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['customer']['mysql_add']['infomail_body']['main']), $replace_arr));
|
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['new_database_by_customer']['mailbody']), $replace_arr));
|
||||||
|
|
||||||
$_mailerror = false;
|
$_mailerror = false;
|
||||||
try {
|
try {
|
||||||
@@ -307,6 +312,10 @@ if ($page == 'overview') {
|
|||||||
// validate password
|
// validate password
|
||||||
$password = validatePassword($password);
|
$password = validatePassword($password);
|
||||||
|
|
||||||
|
if ($password == $result['databasename']) {
|
||||||
|
standard_error('passwordshouldnotbeusername');
|
||||||
|
}
|
||||||
|
|
||||||
// Begin root-session
|
// Begin root-session
|
||||||
Database::needRoot(true);
|
Database::needRoot(true);
|
||||||
foreach (array_map('trim', explode(',', Settings::Get('system.mysql_access_host'))) as $mysql_access_host) {
|
foreach (array_map('trim', explode(',', Settings::Get('system.mysql_access_host'))) as $mysql_access_host) {
|
||||||
|
|||||||
@@ -92,8 +92,10 @@ if ($page == 'overview') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$row['subject'] = html_entity_decode($row['subject']);
|
$row['subject'] = html_entity_decode($row['subject']);
|
||||||
if (strlen($row['subject']) > 20) {
|
if (strlen($row['subject']) > 30) {
|
||||||
$row['subject'] = substr($row['subject'], 0, 17) . '...';
|
$ts = wordwrap($row['subject'], 30, "|");
|
||||||
|
$ts = explode("|", $ts);
|
||||||
|
$row['subject'] = $ts[0]. '...';
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("\$tickets.=\"" . getTemplate("tickets/tickets_tickets") . "\";");
|
eval("\$tickets.=\"" . getTemplate("tickets/tickets_tickets") . "\";");
|
||||||
@@ -313,11 +315,20 @@ if ($page == 'overview') {
|
|||||||
if ($subticket->Get('by') == '1') {
|
if ($subticket->Get('by') == '1') {
|
||||||
$by = $lng['ticket']['staff'];
|
$by = $lng['ticket']['staff'];
|
||||||
} else {
|
} else {
|
||||||
|
$cid = $subticket->Get('customer');
|
||||||
|
$usr_stmt = Database::prepare('
|
||||||
|
SELECT `customerid`, `firstname`, `name`, `company`, `loginname`
|
||||||
|
FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
||||||
|
WHERE `customerid` = :customerid '
|
||||||
|
);
|
||||||
|
$usr = Database::pexecute_first($usr_stmt, array("customerid" => $cid));
|
||||||
$by = getCorrectFullUserDetails($usr);
|
$by = getCorrectFullUserDetails($usr);
|
||||||
}
|
}
|
||||||
|
|
||||||
$subject = $subticket->Get('subject');
|
$subject = $subticket->Get('subject');
|
||||||
$message = $subticket->Get('message');
|
$message = $subticket->Get('message');
|
||||||
|
|
||||||
|
$row2 = htmlentities_array($row2);
|
||||||
eval("\$ticket_replies.=\"" . getTemplate("tickets/tickets_tickets_list") . "\";");
|
eval("\$ticket_replies.=\"" . getTemplate("tickets/tickets_tickets_list") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
61
index.php
@@ -104,7 +104,7 @@ if ($action == 'login') {
|
|||||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => $_SERVER['REMOTE_ADDR']));
|
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => $_SERVER['REMOTE_ADDR']));
|
||||||
$rstlog->logAction(LOGIN_ACTION, LOG_WARNING, "Unknown user '" . $loginname . "' tried to login.");
|
$rstlog->logAction(LOGIN_ACTION, LOG_WARNING, "Unknown user '" . $loginname . "' tried to login.");
|
||||||
|
|
||||||
redirectTo('index.php', array('showmessage' => '2'), true);
|
redirectTo('index.php', array('showmessage' => '2'));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -116,9 +116,9 @@ if ($action == 'login') {
|
|||||||
$userinfo = $userinfo_stmt->fetch(PDO::FETCH_ASSOC);
|
$userinfo = $userinfo_stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
if ($userinfo['loginfail_count'] >= Settings::Get('login.maxloginattempts') && $userinfo['lastlogin_fail'] > (time() - Settings::Get('login.deactivatetime'))) {
|
if ($userinfo['loginfail_count'] >= Settings::Get('login.maxloginattempts') && $userinfo['lastlogin_fail'] > (time() - Settings::Get('login.deactivatetime'))) {
|
||||||
redirectTo('index.php', array('showmessage' => '3'), true);
|
redirectTo('index.php', array('showmessage' => '3'));
|
||||||
exit;
|
exit;
|
||||||
} elseif ($userinfo['password'] == md5($password)) {
|
} elseif (validatePasswordLogin($userinfo, $password, $table, $uid)) {
|
||||||
// login correct
|
// login correct
|
||||||
// reset loginfail_counter, set lastlogin_succ
|
// reset loginfail_counter, set lastlogin_succ
|
||||||
$stmt = Database::prepare("UPDATE $table
|
$stmt = Database::prepare("UPDATE $table
|
||||||
@@ -141,7 +141,7 @@ if ($action == 'login') {
|
|||||||
$rstlog->logAction(LOGIN_ACTION, LOG_WARNING, "User '" . $loginname . "' tried to login with wrong password.");
|
$rstlog->logAction(LOGIN_ACTION, LOG_WARNING, "User '" . $loginname . "' tried to login with wrong password.");
|
||||||
|
|
||||||
unset($userinfo);
|
unset($userinfo);
|
||||||
redirectTo('index.php', array('showmessage' => '2'), true);
|
redirectTo('index.php', array('showmessage' => '2'));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,23 +215,23 @@ if ($action == 'login') {
|
|||||||
|
|
||||||
if ($userinfo['adminsession'] == '1') {
|
if ($userinfo['adminsession'] == '1') {
|
||||||
if (hasUpdates($version)) {
|
if (hasUpdates($version)) {
|
||||||
redirectTo('admin_updates.php', array('s' => $s), true);
|
redirectTo('admin_updates.php', array('s' => $s));
|
||||||
} else {
|
} else {
|
||||||
if (isset($_POST['script']) && $_POST['script'] != "") {
|
if (isset($_POST['script']) && $_POST['script'] != "") {
|
||||||
redirectTo($_POST['script'], $qryparams, true);
|
redirectTo($_POST['script'], $qryparams);
|
||||||
} else {
|
} else {
|
||||||
redirectTo('admin_index.php', $qryparams, true);
|
redirectTo('admin_index.php', $qryparams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (isset($_POST['script']) && $_POST['script'] != "") {
|
if (isset($_POST['script']) && $_POST['script'] != "") {
|
||||||
redirectTo($_POST['script'], $qryparams, true);
|
redirectTo($_POST['script'], $qryparams);
|
||||||
} else {
|
} else {
|
||||||
redirectTo('customer_index.php', $qryparams, true);
|
redirectTo('customer_index.php', $qryparams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
redirectTo('index.php', array('showmessage' => '2'), true);
|
redirectTo('index.php', array('showmessage' => '2'));
|
||||||
}
|
}
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
@@ -280,10 +280,14 @@ if ($action == 'login') {
|
|||||||
$lastscript = "";
|
$lastscript = "";
|
||||||
if (isset($_REQUEST['script']) && $_REQUEST['script'] != "") {
|
if (isset($_REQUEST['script']) && $_REQUEST['script'] != "") {
|
||||||
$lastscript = $_REQUEST['script'];
|
$lastscript = $_REQUEST['script'];
|
||||||
|
|
||||||
|
if (!file_exists(__DIR__."/".$lastscript)) {
|
||||||
|
$lastscript = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$lastqrystr = "";
|
$lastqrystr = "";
|
||||||
if (isset($_REQUEST['qrystr']) && $_REQUEST['qrystr'] != "") {
|
if (isset($_REQUEST['qrystr']) && $_REQUEST['qrystr'] != "") {
|
||||||
$lastqrystr = $_REQUEST['qrystr'];
|
$lastqrystr = strip_tags($_REQUEST['qrystr']);
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("echo \"" . getTemplate('login') . "\";");
|
eval("echo \"" . getTemplate('login') . "\";");
|
||||||
@@ -323,7 +327,7 @@ if ($action == 'forgotpwd') {
|
|||||||
/* Check whether user is banned */
|
/* Check whether user is banned */
|
||||||
if ($user['deactivated']) {
|
if ($user['deactivated']) {
|
||||||
$message = $lng['pwdreminder']['notallowed'];
|
$message = $lng['pwdreminder']['notallowed'];
|
||||||
redirectTo('index.php', array('showmessage' => '5'), true);
|
redirectTo('index.php', array('showmessage' => '5'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($adminchecked && Settings::Get('panel.allow_preset_admin') == '1') || $adminchecked == false) {
|
if (($adminchecked && Settings::Get('panel.allow_preset_admin') == '1') || $adminchecked == false) {
|
||||||
@@ -363,19 +367,26 @@ if ($action == 'forgotpwd') {
|
|||||||
|
|
||||||
// Set together our activation link
|
// Set together our activation link
|
||||||
$protocol = empty( $_SERVER['HTTPS'] ) ? 'http' : 'https';
|
$protocol = empty( $_SERVER['HTTPS'] ) ? 'http' : 'https';
|
||||||
$host = $_SERVER['HTTP_HOST'];
|
// this can be a fixed value to avoid potential exploiting by modifying headers
|
||||||
|
$host = Settings::Get('system.hostname'); // $_SERVER['HTTP_HOST'];
|
||||||
$port = $_SERVER['SERVER_PORT'] != 80 ? ':' . $_SERVER['SERVER_PORT'] : '';
|
$port = $_SERVER['SERVER_PORT'] != 80 ? ':' . $_SERVER['SERVER_PORT'] : '';
|
||||||
$script = $_SERVER['SCRIPT_NAME'];
|
// don't add :443 when https is used, as it is default (and just looks weird!)
|
||||||
|
if ($protocol == 'https' && $_SERVER['SERVER_PORT'] == '443') {
|
||||||
|
$port = '';
|
||||||
|
}
|
||||||
|
// there can be only one script to handle this so we can use a fixed value here
|
||||||
|
$script = "/index.php"; // $_SERVER['SCRIPT_NAME'];
|
||||||
|
if (Settings::Get('system.froxlordirectlyviahostname') == 0) {
|
||||||
|
$script = makeCorrectFile("/".basename(__DIR__)."/".$script);
|
||||||
|
}
|
||||||
$activationlink = $protocol . '://' . $host . $port . $script . '?action=resetpwd&resetcode=' . $activationcode;
|
$activationlink = $protocol . '://' . $host . $port . $script . '?action=resetpwd&resetcode=' . $activationcode;
|
||||||
|
|
||||||
$replace_arr = array(
|
$replace_arr = array(
|
||||||
'SALUTATION' => getCorrectUserSalutation($user),
|
'SALUTATION' => getCorrectUserSalutation($user),
|
||||||
'USERNAME' => $user['loginname'],
|
'USERNAME' => $loginname,
|
||||||
'LINK' => $activationlink
|
'LINK' => $activationlink
|
||||||
);
|
);
|
||||||
|
|
||||||
$body = strtr($lng['pwdreminder']['body'], array('%s' => $user['firstname'] . ' ' . $user['name'], '%a' => $activationlink));
|
|
||||||
|
|
||||||
$def_language = ($user['def_language'] != '') ? $user['def_language'] : Settings::Get('panel.standardlanguage');
|
$def_language = ($user['def_language'] != '') ? $user['def_language'] : Settings::Get('panel.standardlanguage');
|
||||||
$result_stmt = Database::prepare('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '`
|
$result_stmt = Database::prepare('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '`
|
||||||
WHERE `adminid`= :adminid
|
WHERE `adminid`= :adminid
|
||||||
@@ -385,7 +396,7 @@ if ($action == 'forgotpwd') {
|
|||||||
);
|
);
|
||||||
Database::pexecute($result_stmt, array("adminid" => $user['adminid'], "lang" => $def_language));
|
Database::pexecute($result_stmt, array("adminid" => $user['adminid'], "lang" => $def_language));
|
||||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['pwdreminder']['subject']), $replace_arr));
|
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['password_reset']['subject']), $replace_arr));
|
||||||
|
|
||||||
$result_stmt = Database::prepare('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '`
|
$result_stmt = Database::prepare('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '`
|
||||||
WHERE `adminid`= :adminid
|
WHERE `adminid`= :adminid
|
||||||
@@ -395,14 +406,14 @@ if ($action == 'forgotpwd') {
|
|||||||
);
|
);
|
||||||
Database::pexecute($result_stmt, array("adminid" => $user['adminid'], "lang" => $def_language));
|
Database::pexecute($result_stmt, array("adminid" => $user['adminid'], "lang" => $def_language));
|
||||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $body), $replace_arr));
|
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['password_reset']['mailbody']), $replace_arr));
|
||||||
|
|
||||||
$_mailerror = false;
|
$_mailerror = false;
|
||||||
try {
|
try {
|
||||||
$mail->Subject = $mail_subject;
|
$mail->Subject = $mail_subject;
|
||||||
$mail->AltBody = $mail_body;
|
$mail->AltBody = $mail_body;
|
||||||
$mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
|
$mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
|
||||||
$mail->AddAddress($user['email'], $user['firstname'] . ' ' . $user['name']);
|
$mail->AddAddress($user['email'], getCorrectUserSalutation($user));
|
||||||
$mail->Send();
|
$mail->Send();
|
||||||
} catch(phpmailerException $e) {
|
} catch(phpmailerException $e) {
|
||||||
$mailerr_msg = $e->errorMessage();
|
$mailerr_msg = $e->errorMessage();
|
||||||
@@ -415,12 +426,12 @@ if ($action == 'forgotpwd') {
|
|||||||
if ($_mailerror) {
|
if ($_mailerror) {
|
||||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'));
|
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'));
|
||||||
$rstlog->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
|
$rstlog->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
|
||||||
redirectTo('index.php', array('showmessage' => '4', 'customermail' => $user['email']), true);
|
redirectTo('index.php', array('showmessage' => '4', 'customermail' => $user['email']));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$mail->ClearAddresses();
|
$mail->ClearAddresses();
|
||||||
redirectTo('index.php', array('showmessage' => '1'), true);
|
redirectTo('index.php', array('showmessage' => '1'));
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'));
|
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'));
|
||||||
@@ -511,17 +522,17 @@ if ($action == 'resetpwd') {
|
|||||||
AND `userid` = :userid"
|
AND `userid` = :userid"
|
||||||
);
|
);
|
||||||
Database::pexecute($stmt, array("activationcode" => $activationcode, "userid" => $result['userid']));
|
Database::pexecute($stmt, array("activationcode" => $activationcode, "userid" => $result['userid']));
|
||||||
redirectTo('index.php', array("showmessage" => '6'), true);
|
redirectTo('index.php', array("showmessage" => '6'));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
redirectTo('index.php', array("showmessage" => '7'), true);
|
redirectTo('index.php', array("showmessage" => '7'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("echo \"" . getTemplate('rpwd') . "\";");
|
eval("echo \"" . getTemplate('rpwd') . "\";");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
redirectTo('index.php', array("showmessage" => '7'), true);
|
redirectTo('index.php', array("showmessage" => '7'));
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ DROP TABLE IF EXISTS `panel_admins`;
|
|||||||
CREATE TABLE `panel_admins` (
|
CREATE TABLE `panel_admins` (
|
||||||
`adminid` int(11) unsigned NOT NULL auto_increment,
|
`adminid` int(11) unsigned NOT NULL auto_increment,
|
||||||
`loginname` varchar(50) NOT NULL default '',
|
`loginname` varchar(50) NOT NULL default '',
|
||||||
`password` varchar(50) NOT NULL default '',
|
`password` varchar(255) NOT NULL default '',
|
||||||
`name` varchar(255) NOT NULL default '',
|
`name` varchar(255) NOT NULL default '',
|
||||||
`email` varchar(255) NOT NULL default '',
|
`email` varchar(255) NOT NULL default '',
|
||||||
`def_language` varchar(255) NOT NULL default '',
|
`def_language` varchar(255) NOT NULL default '',
|
||||||
@@ -131,6 +131,8 @@ CREATE TABLE `panel_admins` (
|
|||||||
`loginfail_count` int(11) unsigned NOT NULL default '0',
|
`loginfail_count` int(11) unsigned NOT NULL default '0',
|
||||||
`reportsent` tinyint(4) unsigned NOT NULL default '0',
|
`reportsent` tinyint(4) unsigned NOT NULL default '0',
|
||||||
`theme` varchar(255) NOT NULL default 'Sparkle',
|
`theme` varchar(255) NOT NULL default 'Sparkle',
|
||||||
|
`custom_notes` text,
|
||||||
|
`custom_notes_show` tinyint(1) NOT NULL default '0',
|
||||||
PRIMARY KEY (`adminid`),
|
PRIMARY KEY (`adminid`),
|
||||||
UNIQUE KEY `loginname` (`loginname`)
|
UNIQUE KEY `loginname` (`loginname`)
|
||||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||||
@@ -141,7 +143,7 @@ DROP TABLE IF EXISTS `panel_customers`;
|
|||||||
CREATE TABLE `panel_customers` (
|
CREATE TABLE `panel_customers` (
|
||||||
`customerid` int(11) unsigned NOT NULL auto_increment,
|
`customerid` int(11) unsigned NOT NULL auto_increment,
|
||||||
`loginname` varchar(50) NOT NULL default '',
|
`loginname` varchar(50) NOT NULL default '',
|
||||||
`password` varchar(50) NOT NULL default '',
|
`password` varchar(255) NOT NULL default '',
|
||||||
`adminid` int(11) unsigned NOT NULL default '0',
|
`adminid` int(11) unsigned NOT NULL default '0',
|
||||||
`name` varchar(255) NOT NULL default '',
|
`name` varchar(255) NOT NULL default '',
|
||||||
`firstname` varchar(255) NOT NULL default '',
|
`firstname` varchar(255) NOT NULL default '',
|
||||||
@@ -190,6 +192,8 @@ CREATE TABLE `panel_customers` (
|
|||||||
`imap` tinyint(1) NOT NULL default '1',
|
`imap` tinyint(1) NOT NULL default '1',
|
||||||
`perlenabled` tinyint(1) NOT NULL default '0',
|
`perlenabled` tinyint(1) NOT NULL default '0',
|
||||||
`theme` varchar(255) NOT NULL default 'Sparkle',
|
`theme` varchar(255) NOT NULL default 'Sparkle',
|
||||||
|
`custom_notes` text,
|
||||||
|
`custom_notes_show` tinyint(1) NOT NULL default '0',
|
||||||
PRIMARY KEY (`customerid`),
|
PRIMARY KEY (`customerid`),
|
||||||
UNIQUE KEY `loginname` (`loginname`)
|
UNIQUE KEY `loginname` (`loginname`)
|
||||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||||
@@ -217,7 +221,6 @@ CREATE TABLE `panel_domains` (
|
|||||||
`customerid` int(11) unsigned NOT NULL default '0',
|
`customerid` int(11) unsigned NOT NULL default '0',
|
||||||
`aliasdomain` int(11) unsigned NULL,
|
`aliasdomain` int(11) unsigned NULL,
|
||||||
`documentroot` varchar(255) NOT NULL default '',
|
`documentroot` varchar(255) NOT NULL default '',
|
||||||
`ipandport` int(11) unsigned NOT NULL default '1',
|
|
||||||
`isbinddomain` tinyint(1) NOT NULL default '0',
|
`isbinddomain` tinyint(1) NOT NULL default '0',
|
||||||
`isemaildomain` tinyint(1) NOT NULL default '0',
|
`isemaildomain` tinyint(1) NOT NULL default '0',
|
||||||
`email_only` tinyint(1) NOT NULL default '0',
|
`email_only` tinyint(1) NOT NULL default '0',
|
||||||
@@ -226,18 +229,16 @@ CREATE TABLE `panel_domains` (
|
|||||||
`caneditdomain` tinyint(1) NOT NULL default '1',
|
`caneditdomain` tinyint(1) NOT NULL default '1',
|
||||||
`zonefile` varchar(255) NOT NULL default '',
|
`zonefile` varchar(255) NOT NULL default '',
|
||||||
`dkim` tinyint(1) NOT NULL default '0',
|
`dkim` tinyint(1) NOT NULL default '0',
|
||||||
`dkim_id` int(11) unsigned NOT NULL,
|
`dkim_id` int(11) unsigned NOT NULL default '0',
|
||||||
`dkim_privkey` text NOT NULL,
|
`dkim_privkey` text,
|
||||||
`dkim_pubkey` text NOT NULL,
|
`dkim_pubkey` text,
|
||||||
`wwwserveralias` tinyint(1) NOT NULL default '1',
|
`wwwserveralias` tinyint(1) NOT NULL default '1',
|
||||||
`parentdomainid` int(11) unsigned NOT NULL default '0',
|
`parentdomainid` int(11) unsigned NOT NULL default '0',
|
||||||
`openbasedir` tinyint(1) NOT NULL default '0',
|
`openbasedir` tinyint(1) NOT NULL default '0',
|
||||||
`openbasedir_path` tinyint(1) NOT NULL default '0',
|
`openbasedir_path` tinyint(1) NOT NULL default '0',
|
||||||
`speciallogfile` tinyint(1) NOT NULL default '0',
|
`speciallogfile` tinyint(1) NOT NULL default '0',
|
||||||
`ssl` tinyint(4) NOT NULL default '0',
|
|
||||||
`ssl_redirect` tinyint(4) NOT NULL default '0',
|
`ssl_redirect` tinyint(4) NOT NULL default '0',
|
||||||
`ssl_ipandport` tinyint(4) NOT NULL default '0',
|
`specialsettings` text,
|
||||||
`specialsettings` text NOT NULL,
|
|
||||||
`deactivated` tinyint(1) NOT NULL default '0',
|
`deactivated` tinyint(1) NOT NULL default '0',
|
||||||
`bindserial` varchar(10) NOT NULL default '2000010100',
|
`bindserial` varchar(10) NOT NULL default '2000010100',
|
||||||
`add_date` int( 11 ) NOT NULL default '0',
|
`add_date` int( 11 ) NOT NULL default '0',
|
||||||
@@ -263,12 +264,12 @@ CREATE TABLE `panel_ipsandports` (
|
|||||||
`namevirtualhost_statement` tinyint(1) NOT NULL default '0',
|
`namevirtualhost_statement` tinyint(1) NOT NULL default '0',
|
||||||
`vhostcontainer` tinyint(1) NOT NULL default '0',
|
`vhostcontainer` tinyint(1) NOT NULL default '0',
|
||||||
`vhostcontainer_servername_statement` tinyint(1) NOT NULL default '0',
|
`vhostcontainer_servername_statement` tinyint(1) NOT NULL default '0',
|
||||||
`specialsettings` text NOT NULL default '',
|
`specialsettings` text,
|
||||||
`ssl` tinyint(4) NOT NULL default '0',
|
`ssl` tinyint(4) NOT NULL default '0',
|
||||||
`ssl_cert_file` varchar(255) NOT NULL,
|
`ssl_cert_file` varchar(255) NOT NULL,
|
||||||
`ssl_key_file` varchar(255) NOT NULL,
|
`ssl_key_file` varchar(255) NOT NULL,
|
||||||
`ssl_ca_file` varchar(255) NOT NULL,
|
`ssl_ca_file` varchar(255) NOT NULL,
|
||||||
`default_vhostconf_domain` text NOT NULL,
|
`default_vhostconf_domain` text,
|
||||||
`ssl_cert_chainfile` varchar(255) NOT NULL,
|
`ssl_cert_chainfile` varchar(255) NOT NULL,
|
||||||
`docroot` varchar(255) NOT NULL default '',
|
`docroot` varchar(255) NOT NULL default '',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
@@ -341,6 +342,8 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
|||||||
('customer', 'ftpprefix', 'ftp'),
|
('customer', 'ftpprefix', 'ftp'),
|
||||||
('customer', 'mysqlprefix', 'sql'),
|
('customer', 'mysqlprefix', 'sql'),
|
||||||
('customer', 'ftpatdomain', '0'),
|
('customer', 'ftpatdomain', '0'),
|
||||||
|
('customer', 'show_news_feed', '0'),
|
||||||
|
('customer', 'news_feed_url', ''),
|
||||||
('ticket', 'noreply_email', 'NO-REPLY@SERVERNAME'),
|
('ticket', 'noreply_email', 'NO-REPLY@SERVERNAME'),
|
||||||
('ticket', 'worktime_all', '1'),
|
('ticket', 'worktime_all', '1'),
|
||||||
('ticket', 'worktime_begin', '00:00'),
|
('ticket', 'worktime_begin', '00:00'),
|
||||||
@@ -405,6 +408,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
|||||||
('phpfpm', 'defaultini', '1'),
|
('phpfpm', 'defaultini', '1'),
|
||||||
('phpfpm', 'vhost_defaultini', '2'),
|
('phpfpm', 'vhost_defaultini', '2'),
|
||||||
('phpfpm', 'fastcgi_ipcdir', '/var/lib/apache2/fastcgi/'),
|
('phpfpm', 'fastcgi_ipcdir', '/var/lib/apache2/fastcgi/'),
|
||||||
|
('phpfpm', 'use_mod_proxy', '0'),
|
||||||
('nginx', 'fastcgiparams', '/etc/nginx/fastcgi_params'),
|
('nginx', 'fastcgiparams', '/etc/nginx/fastcgi_params'),
|
||||||
('system', 'lastaccountnumber', '0'),
|
('system', 'lastaccountnumber', '0'),
|
||||||
('system', 'lastguid', '9999'),
|
('system', 'lastguid', '9999'),
|
||||||
@@ -440,7 +444,6 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
|||||||
('system', 'mod_fcgid_tmpdir', '/var/customers/tmp'),
|
('system', 'mod_fcgid_tmpdir', '/var/customers/tmp'),
|
||||||
('system', 'ssl_cert_file', '/etc/apache2/apache2.pem'),
|
('system', 'ssl_cert_file', '/etc/apache2/apache2.pem'),
|
||||||
('system', 'use_ssl', '0'),
|
('system', 'use_ssl', '0'),
|
||||||
('system', 'openssl_cnf', '[ req ]\r\ndefault_bits = 1024\r\ndistinguished_name = req_distinguished_name\r\nattributes = req_attributes\r\nprompt = no\r\noutput_password =\r\ninput_password =\r\n[ req_distinguished_name ]\r\nC = DE\r\nST = froxlor\r\nL = froxlor \r\nO = Testcertificate\r\nOU = froxlor \r\nCN = @@domain_name@@\r\nemailAddress = @@email@@ \r\n[ req_attributes ]\r\nchallengePassword =\r\n'),
|
|
||||||
('system', 'default_vhostconf', ''),
|
('system', 'default_vhostconf', ''),
|
||||||
('system', 'mail_quota_enabled', '0'),
|
('system', 'mail_quota_enabled', '0'),
|
||||||
('system', 'mail_quota', '100'),
|
('system', 'mail_quota', '100'),
|
||||||
@@ -489,7 +492,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
|||||||
('system', 'phpreload_command', ''),
|
('system', 'phpreload_command', ''),
|
||||||
('system', 'apache24', '0'),
|
('system', 'apache24', '0'),
|
||||||
('system', 'documentroot_use_default_value', '0'),
|
('system', 'documentroot_use_default_value', '0'),
|
||||||
('system', 'passwordcryptfunc', '1'),
|
('system', 'passwordcryptfunc', '3'),
|
||||||
('system', 'axfrservers', ''),
|
('system', 'axfrservers', ''),
|
||||||
('system', 'customer_ssl_path', '/etc/ssl/froxlor-custom/'),
|
('system', 'customer_ssl_path', '/etc/ssl/froxlor-custom/'),
|
||||||
('system', 'allow_error_report_admin', '1'),
|
('system', 'allow_error_report_admin', '1'),
|
||||||
@@ -501,6 +504,10 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
|||||||
('system', 'mailtraffic_enabled', '1'),
|
('system', 'mailtraffic_enabled', '1'),
|
||||||
('system', 'cronconfig', '/etc/cron.d/froxlor'),
|
('system', 'cronconfig', '/etc/cron.d/froxlor'),
|
||||||
('system', 'crondreload', '/etc/init.d/cron reload'),
|
('system', 'crondreload', '/etc/init.d/cron reload'),
|
||||||
|
('system', 'croncmdline', '/usr/bin/nice -n 5 /usr/bin/php5 -q'),
|
||||||
|
('system', 'cron_allowautoupdate', '0'),
|
||||||
|
('system', 'dns_createhostnameentry', '0'),
|
||||||
|
('system', 'send_cron_errors', '0'),
|
||||||
('panel', 'decimal_places', '4'),
|
('panel', 'decimal_places', '4'),
|
||||||
('panel', 'adminmail', 'admin@SERVERNAME'),
|
('panel', 'adminmail', 'admin@SERVERNAME'),
|
||||||
('panel', 'phpmyadmin_url', ''),
|
('panel', 'phpmyadmin_url', ''),
|
||||||
@@ -523,19 +530,22 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
|||||||
('panel', 'allow_preset', '1'),
|
('panel', 'allow_preset', '1'),
|
||||||
('panel', 'allow_preset_admin', '0'),
|
('panel', 'allow_preset_admin', '0'),
|
||||||
('panel', 'password_regex', ''),
|
('panel', 'password_regex', ''),
|
||||||
('panel', 'use_webfonts', '0'),
|
|
||||||
('panel', 'webfont', 'Numans'),
|
|
||||||
('panel', 'phpconfigs_hidestdsubdomain', '0'),
|
('panel', 'phpconfigs_hidestdsubdomain', '0'),
|
||||||
('panel', 'allow_theme_change_admin', '1'),
|
('panel', 'allow_theme_change_admin', '1'),
|
||||||
('panel', 'allow_theme_change_customer', '1'),
|
('panel', 'allow_theme_change_customer', '1'),
|
||||||
('panel', 'version', '0.9.32-rc1');
|
('panel', 'password_alpha_lower', '1'),
|
||||||
|
('panel', 'password_alpha_upper', '1'),
|
||||||
|
('panel', 'password_numeric', '0'),
|
||||||
|
('panel', 'password_special_char_required', '0'),
|
||||||
|
('panel', 'password_special_char', '!?<>§$%+#=@'),
|
||||||
|
('panel', 'version', '0.9.33-rc2');
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `panel_tasks`;
|
DROP TABLE IF EXISTS `panel_tasks`;
|
||||||
CREATE TABLE `panel_tasks` (
|
CREATE TABLE `panel_tasks` (
|
||||||
`id` int(11) unsigned NOT NULL auto_increment,
|
`id` int(11) unsigned NOT NULL auto_increment,
|
||||||
`type` int(11) NOT NULL default '0',
|
`type` int(11) NOT NULL default '0',
|
||||||
`data` text NOT NULL default '',
|
`data` text NOT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||||
|
|
||||||
@@ -641,20 +651,10 @@ INSERT INTO `panel_languages` (`id`, `language`, `iso`, `file`) VALUES
|
|||||||
(1, 'Deutsch', 'de', 'lng/german.lng.php'),
|
(1, 'Deutsch', 'de', 'lng/german.lng.php'),
|
||||||
(2, 'English', 'en', 'lng/english.lng.php'),
|
(2, 'English', 'en', 'lng/english.lng.php'),
|
||||||
(3, 'Français', 'fr', 'lng/french.lng.php'),
|
(3, 'Français', 'fr', 'lng/french.lng.php'),
|
||||||
(4, 'Chinese', 'zh', 'lng/zh-cn.lng.php'),
|
(4, 'Português', 'pt', 'lng/portugues.lng.php'),
|
||||||
(5, 'Catalan', 'ca', 'lng/catalan.lng.php'),
|
(5, 'Italian', 'it', 'lng/italian.lng.php'),
|
||||||
(6, 'Español', 'es', 'lng/spanish.lng.php'),
|
(6, 'Dutch', 'nl', 'lng/dutch.lng.php'),
|
||||||
(7, 'Português', 'pt', 'lng/portugues.lng.php'),
|
(7, 'Swedish', 'sv', 'lng/swedish.lng.php');
|
||||||
(8, 'Russian', 'ru', 'lng/russian.lng.php'),
|
|
||||||
(9, 'Danish', 'da', 'lng/danish.lng.php'),
|
|
||||||
(10, 'Italian', 'it', 'lng/italian.lng.php'),
|
|
||||||
(11, 'Bulgarian', 'bg', 'lng/bulgarian.lng.php'),
|
|
||||||
(12, 'Slovak', 'sk', 'lng/slovak.lng.php'),
|
|
||||||
(13, 'Dutch', 'nl', 'lng/dutch.lng.php'),
|
|
||||||
(14, 'Hungarian', 'hu', 'lng/hungarian.lng.php'),
|
|
||||||
(15, 'Swedish', 'sv', 'lng/swedish.lng.php'),
|
|
||||||
(16, 'Czech', 'cz', 'lng/czech.lng.php'),
|
|
||||||
(17, 'Polski', 'pl', 'lng/polish.lng.php');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -722,8 +722,8 @@ CREATE TABLE `panel_phpconfigs` (
|
|||||||
|
|
||||||
|
|
||||||
INSERT INTO `panel_phpconfigs` (`id`, `description`, `binary`, `file_extensions`, `mod_fcgid_starter`, `mod_fcgid_maxrequests`, `phpsettings`) VALUES
|
INSERT INTO `panel_phpconfigs` (`id`, `description`, `binary`, `file_extensions`, `mod_fcgid_starter`, `mod_fcgid_maxrequests`, `phpsettings`) VALUES
|
||||||
(1, 'Default Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_call_time_pass_reference = Off\r\nallow_url_fopen = Off\r\nasp_tags = Off\r\ndisable_classes =\r\ndisable_functions = curl_exec,curl_multi_exec,exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\ncgi.force_redirect = 1\r\ngpc_order = "GPC"\r\nhtml_errors = Off\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmagic_quotes_gpc = Off\r\nmagic_quotes_runtime = Off\r\nmagic_quotes_sybase = Off\r\nmax_execution_time = 30\r\nmax_input_time = 60\r\nmemory_limit = 16M\r\n{OPEN_BASEDIR_C}open_basedir = "{OPEN_BASEDIR}"\r\noutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nregister_globals = Off\r\nreport_memleaks = On\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nsession.auto_start = 0\r\nsession.bug_compat_42 = 0\r\nsession.bug_compat_warn = 1\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.entropy_file = /dev/urandom\r\nsession.entropy_length = 16\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 1\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.use_cookies = 1\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nsuhosin.mail.protect = 1\r\nsuhosin.simulation = Off\r\ntrack_errors = Off\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\n'),
|
(1, 'Default Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_call_time_pass_reference = Off\r\nallow_url_fopen = Off\r\nasp_tags = Off\r\ndisable_classes =\r\ndisable_functions = curl_exec,curl_multi_exec,exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\ncgi.force_redirect = 1\r\ngpc_order = "GPC"\r\nhtml_errors = Off\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmagic_quotes_gpc = Off\r\nmagic_quotes_runtime = Off\r\nmagic_quotes_sybase = Off\r\nmax_execution_time = 30\r\nmax_input_time = 60\r\nmemory_limit = 16M\r\n{OPEN_BASEDIR_C}open_basedir = "{OPEN_BASEDIR}"\r\noutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nregister_globals = Off\r\nreport_memleaks = On\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nsession.auto_start = 0\r\nsession.bug_compat_42 = 0\r\nsession.bug_compat_warn = 1\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.entropy_file = /dev/urandom\r\nsession.entropy_length = 16\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 1\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.use_cookies = 1\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nsuhosin.mail.protect = 1\r\nsuhosin.simulation = Off\r\ntrack_errors = Off\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\n;mail.add_x_header = On\r\n;mail.log = "/var/log/phpmail.log"\r\n'),
|
||||||
(2, 'Froxlor Vhost Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_call_time_pass_reference = Off\r\nallow_url_fopen = On\r\nasp_tags = Off\r\ndisable_classes =\r\ndisable_functions = curl_multi_exec,exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\ncgi.force_redirect = 1\r\ngpc_order = "GPC"\r\nhtml_errors = Off\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmagic_quotes_gpc = Off\r\nmagic_quotes_runtime = Off\r\nmagic_quotes_sybase = Off\r\nmax_execution_time = 60\r\nmax_input_time = 60\r\nmemory_limit = 16M\r\nnoutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nregister_globals = Off\r\nreport_memleaks = On\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nsession.auto_start = 0\r\nsession.bug_compat_42 = 0\r\nsession.bug_compat_warn = 1\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.entropy_file = /dev/urandom\r\nsession.entropy_length = 16\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 1\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.use_cookies = 1\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nsuhosin.mail.protect = 1\r\nsuhosin.simulation = Off\r\ntrack_errors = Off\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\n');
|
(2, 'Froxlor Vhost Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_call_time_pass_reference = Off\r\nallow_url_fopen = On\r\nasp_tags = Off\r\ndisable_classes =\r\ndisable_functions = curl_multi_exec,exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\ncgi.force_redirect = 1\r\ngpc_order = "GPC"\r\nhtml_errors = Off\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmagic_quotes_gpc = Off\r\nmagic_quotes_runtime = Off\r\nmagic_quotes_sybase = Off\r\nmax_execution_time = 60\r\nmax_input_time = 60\r\nmemory_limit = 16M\r\nnoutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nregister_globals = Off\r\nreport_memleaks = On\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nsession.auto_start = 0\r\nsession.bug_compat_42 = 0\r\nsession.bug_compat_warn = 1\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.entropy_file = /dev/urandom\r\nsession.entropy_length = 16\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 1\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.use_cookies = 1\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nsuhosin.mail.protect = 1\r\nsuhosin.simulation = Off\r\ntrack_errors = Off\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\n;mail.add_x_header = On\r\n;mail.log = "/var/log/phpmail.log"\r\n');
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `cronjobs_run`;
|
DROP TABLE IF EXISTS `cronjobs_run`;
|
||||||
@@ -818,8 +818,8 @@ CREATE TABLE IF NOT EXISTS `domain_ssl_settings` (
|
|||||||
`domainid` int(11) NOT NULL,
|
`domainid` int(11) NOT NULL,
|
||||||
`ssl_cert_file` text NOT NULL,
|
`ssl_cert_file` text NOT NULL,
|
||||||
`ssl_key_file` text NOT NULL,
|
`ssl_key_file` text NOT NULL,
|
||||||
`ssl_ca_file` text NOT NULL,
|
`ssl_ca_file` text,
|
||||||
`ssl_cert_chainfile` text NOT NULL,
|
`ssl_cert_chainfile` text,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,8 @@ class FroxlorInstall {
|
|||||||
*/
|
*/
|
||||||
private $_languages = array(
|
private $_languages = array(
|
||||||
'german' => 'Deutsch',
|
'german' => 'Deutsch',
|
||||||
'english' => 'English'
|
'english' => 'English',
|
||||||
|
'french' => 'Français'
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -275,7 +276,7 @@ class FroxlorInstall {
|
|||||||
$navigation = '';
|
$navigation = '';
|
||||||
$msgcolor = 'red';
|
$msgcolor = 'red';
|
||||||
$message = $this->_lng['install']['testing_mysql_fail'];
|
$message = $this->_lng['install']['testing_mysql_fail'];
|
||||||
$link = 'install.php';
|
$link = 'install.php?check=1';
|
||||||
$linktext = $this->_lng['click_here_to_goback'];
|
$linktext = $this->_lng['click_here_to_goback'];
|
||||||
} else {
|
} else {
|
||||||
// all good
|
// all good
|
||||||
@@ -478,6 +479,9 @@ class FroxlorInstall {
|
|||||||
$db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_used_tickets_reset.php';");
|
$db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_used_tickets_reset.php';");
|
||||||
$db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_ticketarchive.php';");
|
$db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_ticketarchive.php';");
|
||||||
|
|
||||||
|
// insert task 99 to generate a correct cron.d-file automatically
|
||||||
|
$db->query("INSERT INTO `".TABLE_PANEL_TASKS."` SET `type` = '99';");
|
||||||
|
|
||||||
$content .= $this->_status_message('green', 'OK');
|
$content .= $this->_status_message('green', 'OK');
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
@@ -563,7 +567,7 @@ class FroxlorInstall {
|
|||||||
|
|
||||||
// we have to create a new user and database for the froxlor unprivileged mysql access
|
// we have to create a new user and database for the froxlor unprivileged mysql access
|
||||||
$content .= $this->_status_message('begin', $this->_lng['install']['create_mysqluser_and_db']);
|
$content .= $this->_status_message('begin', $this->_lng['install']['create_mysqluser_and_db']);
|
||||||
$ins_stmt = $db_root->prepare("CREATE DATABASE `".str_replace('`', '', $this->_data['mysql_database'])."`");
|
$ins_stmt = $db_root->prepare("CREATE DATABASE `".str_replace('`', '', $this->_data['mysql_database'])."` CHARACTER SET=utf8 COLLATE=utf8_general_ci");
|
||||||
$ins_stmt->execute();
|
$ins_stmt->execute();
|
||||||
|
|
||||||
$mysql_access_host_array = array_map('trim', explode(',', $this->_data['mysql_access_host']));
|
$mysql_access_host_array = array_map('trim', explode(',', $this->_data['mysql_access_host']));
|
||||||
@@ -688,25 +692,25 @@ class FroxlorInstall {
|
|||||||
$formdata .= $this->_getSectionItemString('mysql_database', true);
|
$formdata .= $this->_getSectionItemString('mysql_database', true);
|
||||||
// unpriv-user has to be different from root
|
// unpriv-user has to be different from root
|
||||||
if ($this->_data['mysql_unpriv_user'] == $this->_data['mysql_root_user']) {
|
if ($this->_data['mysql_unpriv_user'] == $this->_data['mysql_root_user']) {
|
||||||
$style = 'color:blue;';
|
$style = 'blue';
|
||||||
} else { $style = '';
|
} else { $style = '';
|
||||||
}
|
}
|
||||||
$formdata .= $this->_getSectionItemString('mysql_unpriv_user', true, $style);
|
$formdata .= $this->_getSectionItemString('mysql_unpriv_user', true, $style);
|
||||||
// is we posted and no password was given -> red
|
// is we posted and no password was given -> red
|
||||||
if (!empty($_POST['installstep']) && $this->_data['mysql_unpriv_pass'] == '') {
|
if (!empty($_POST['installstep']) && $this->_data['mysql_unpriv_pass'] == '') {
|
||||||
$style = 'color:red;';
|
$style = 'red';
|
||||||
} else { $style = '';
|
} else { $style = '';
|
||||||
}
|
}
|
||||||
$formdata .= $this->_getSectionItemString('mysql_unpriv_pass', true, $style, 'password');
|
$formdata .= $this->_getSectionItemString('mysql_unpriv_pass', true, $style, 'password');
|
||||||
// unpriv-user has to be different from root
|
// unpriv-user has to be different from root
|
||||||
if ($this->_data['mysql_unpriv_user'] == $this->_data['mysql_root_user']) {
|
if ($this->_data['mysql_unpriv_user'] == $this->_data['mysql_root_user']) {
|
||||||
$style = 'color:blue;';
|
$style = 'blue';
|
||||||
} else { $style = '';
|
} else { $style = '';
|
||||||
}
|
}
|
||||||
$formdata .= $this->_getSectionItemString('mysql_root_user', true, $style);
|
$formdata .= $this->_getSectionItemString('mysql_root_user', true, $style);
|
||||||
// is we posted and no password was given -> red
|
// is we posted and no password was given -> red
|
||||||
if (!empty($_POST['installstep']) && $this->_data['mysql_root_pass'] == '') {
|
if (!empty($_POST['installstep']) && $this->_data['mysql_root_pass'] == '') {
|
||||||
$style = 'color:red;';
|
$style = 'red';
|
||||||
} else { $style = '';
|
} else { $style = '';
|
||||||
}
|
}
|
||||||
$formdata .= $this->_getSectionItemString('mysql_root_pass', true, $style, 'password');
|
$formdata .= $this->_getSectionItemString('mysql_root_pass', true, $style, 'password');
|
||||||
@@ -846,7 +850,8 @@ class FroxlorInstall {
|
|||||||
$content .= $this->_status_message('green', PHP_VERSION);
|
$content .= $this->_status_message('green', PHP_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if magic_quotes_runtime is active
|
// Check if magic_quotes_runtime is active | get_magic_quotes_runtime() is always FALSE since 5.4
|
||||||
|
if (version_compare(PHP_VERSION, "5.4.0", "<")) {
|
||||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpmagic_quotes_runtime']);
|
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpmagic_quotes_runtime']);
|
||||||
if (get_magic_quotes_runtime()) {
|
if (get_magic_quotes_runtime()) {
|
||||||
// deactivate it
|
// deactivate it
|
||||||
@@ -855,6 +860,7 @@ class FroxlorInstall {
|
|||||||
} else {
|
} else {
|
||||||
$content .= $this->_status_message('green', 'off');
|
$content .= $this->_status_message('green', 'off');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// check for php_pdo and pdo_mysql
|
// check for php_pdo and pdo_mysql
|
||||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phppdo']);
|
$content .= $this->_status_message('begin', $this->_lng['requirements']['phppdo']);
|
||||||
@@ -976,6 +982,7 @@ class FroxlorInstall {
|
|||||||
) {
|
) {
|
||||||
// use sparkle theme for the notice
|
// use sparkle theme for the notice
|
||||||
$installed_hint = file_get_contents($this->_basepath.'/templates/Sparkle/misc/alreadyinstalledhint.tpl');
|
$installed_hint = file_get_contents($this->_basepath.'/templates/Sparkle/misc/alreadyinstalledhint.tpl');
|
||||||
|
$installed_hint = str_replace("<CURRENT_YEAR>", date('Y', time()), $installed_hint);
|
||||||
die($installed_hint);
|
die($installed_hint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1057,9 +1064,9 @@ class FroxlorInstall {
|
|||||||
*/
|
*/
|
||||||
private function _status_message($case, $text) {
|
private function _status_message($case, $text) {
|
||||||
if ($case == 'begin') {
|
if ($case == 'begin') {
|
||||||
return '<tr><td style="width: 250px;">'.$text;
|
return '<tr><td class="install-step">'.$text;
|
||||||
} else {
|
} else {
|
||||||
return '</td><td><span style="color:'.$case.';">'.$text.'</span></td></tr>';
|
return '</td><td><span class="'.$case.'">'.$text.'</span></td></tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
88
install/lng/french.lng.php
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the Froxlor project.
|
||||||
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the COPYING
|
||||||
|
* file that was distributed with this source code. You can also view the
|
||||||
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
|
*
|
||||||
|
* @copyright (c) the authors
|
||||||
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
|
* @package Language
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
$lng['requirements']['title'] = 'Vérification des prérequis système...';
|
||||||
|
$lng['requirements']['installed'] = 'installé';
|
||||||
|
$lng['requirements']['not_true'] = 'non';
|
||||||
|
$lng['requirements']['notfound'] = 'introuvable';
|
||||||
|
$lng['requirements']['notinstalled'] = 'non installé';
|
||||||
|
$lng['requirements']['activated'] = 'activé';
|
||||||
|
$lng['requirements']['phpversion'] = 'PHP version >= 5.3';
|
||||||
|
$lng['requirements']['phpmagic_quotes_runtime'] = 'magic_quotes_runtime...';
|
||||||
|
$lng['requirements']['phpmagic_quotes_runtime_description'] = 'Le réglage PHP "magic_quotes_runtime" doit être positionné à "Off". Nous l\'avons désactivé temporairement pour l\'instant; merci de corriger le php.ini correspondant.';
|
||||||
|
$lng['requirements']['phppdo'] = 'extension PHP PDO et pilote PDO-MySQL ...';
|
||||||
|
$lng['requirements']['phpxml'] = 'extension PHP XML...';
|
||||||
|
$lng['requirements']['phpfilter'] = 'extension PHP filter ...';
|
||||||
|
$lng['requirements']['phpposix'] = 'extension PHP posix ...';
|
||||||
|
$lng['requirements']['phpbcmath'] = 'extension PHP bcmath ...';
|
||||||
|
$lng['requirements']['phpcurl'] = 'extension PHP curl...';
|
||||||
|
$lng['requirements']['bcmathdescription'] = 'Les fonctions de calcul de traffic ne fonctionneront pas correctement!';
|
||||||
|
$lng['requirements']['curldescription'] = 'Les vérifications de version et les flux d\'information peuvent ne pas fonctionner correctement!';
|
||||||
|
$lng['requirements']['openbasedir'] = 'open_basedir...';
|
||||||
|
$lng['requirements']['openbasedirenabled'] = 'Froxlor ne fonctionnera pas correctement avec open_basedir activé. Merci de désactiver open_basedir pour Froxlor dans le php.ini correspondant';
|
||||||
|
$lng['requirements']['diedbecauseofrequirements'] = 'Impossible d\'installer Froxlor sans ces prérequis! Essayez de les corriger et essayez à nouveau.';
|
||||||
|
$lng['requirements']['froxlor_succ_checks'] = 'Tous les prérequis sont vérifiés';
|
||||||
|
|
||||||
|
$lng['install']['lngtitle'] = 'Installation de Froxlor - choisisez la langue';
|
||||||
|
$lng['install']['language'] = 'Langue d\'installation';
|
||||||
|
$lng['install']['lngbtn_go'] = 'Changer la langue';
|
||||||
|
$lng['install']['title'] = 'Installation de Froxlor - paramètrage';
|
||||||
|
$lng['install']['welcometext'] = 'Merci d\'avoir choisi Froxlor. Merci de remplir les champs suivant avec les informations nécessaires pour démarrer l\'installation.<br /><b>Attention:</b> Si la base de données que vous choisissez existe déjà sur votre système, elle sera écrasée ainsi que les données contenues!';
|
||||||
|
$lng['install']['database'] = 'Connexion à la base de données';
|
||||||
|
$lng['install']['mysql_host'] = 'Nom d\'hôte MySQL';
|
||||||
|
$lng['install']['mysql_database'] = 'Nom de la base de données';
|
||||||
|
$lng['install']['mysql_unpriv_user'] = 'Nom d\'utilisateur pour le compte non priviligié MySQL';
|
||||||
|
$lng['install']['mysql_unpriv_pass'] = 'Mot de passe pour le compte non priviligié MySQL';
|
||||||
|
$lng['install']['mysql_root_user'] = 'Nom d\'utilisateur pour le compte MySQL root';
|
||||||
|
$lng['install']['mysql_root_pass'] = 'Mot de passe pour le compte MySQL root';
|
||||||
|
$lng['install']['admin_account'] = 'Compte administrateur';
|
||||||
|
$lng['install']['admin_user'] = 'Nom d\'utilisateur administrateur';
|
||||||
|
$lng['install']['admin_pass1'] = 'Mot de passe administrateur';
|
||||||
|
$lng['install']['admin_pass2'] = 'Mot de passe administrateur (confirmez)';
|
||||||
|
$lng['install']['serversettings'] = 'Réglages serveur';
|
||||||
|
$lng['install']['servername'] = 'Nom du serveur (FQDN, pas d\'adresse IP)';
|
||||||
|
$lng['install']['serverip'] = 'Adresse IP du serveur';
|
||||||
|
$lng['install']['webserver'] = 'Serveur Web';
|
||||||
|
$lng['install']['apache2'] = 'Apache 2';
|
||||||
|
$lng['install']['lighttpd'] = 'LigHTTPd';
|
||||||
|
$lng['install']['nginx'] = 'NGINX';
|
||||||
|
$lng['install']['httpuser'] = 'Nom d\'utilisateur HTTP';
|
||||||
|
$lng['install']['httpgroup'] = 'Nom de groupe HTTP';
|
||||||
|
|
||||||
|
$lng['install']['testing_mysql'] = 'Vérification de l\'accès root MySQL...';
|
||||||
|
$lng['install']['testing_mysql_fail'] = 'Il semble y avoir un problème avec la connexion à la base de données. Impossible de continuer. Merci de revenir en arrière et de vérifier les informations d\'identification.';
|
||||||
|
$lng['install']['backup_old_db'] = 'Création des sauvegardes de l\'ancienne base de données...';
|
||||||
|
$lng['install']['backup_binary_missing'] = 'Impossible de trouver mysqldump';
|
||||||
|
$lng['install']['backup_failed'] = 'Impossible de sauvegarde la base de données';
|
||||||
|
$lng['install']['prepare_db'] = 'Préparation de la base de données...';
|
||||||
|
$lng['install']['create_mysqluser_and_db'] = 'Création de la base de données et l\'utilisateur...';
|
||||||
|
$lng['install']['testing_new_db'] = 'Teste si la base de données et l\'utilisateur ont été créés correctement...';
|
||||||
|
$lng['install']['importing_data'] = 'Import des données...';
|
||||||
|
$lng['install']['changing_data'] = 'Ajustement des paramètres...';
|
||||||
|
$lng['install']['creating_entries'] = 'Insertion des nouvelles valeurs...';
|
||||||
|
$lng['install']['adding_admin_user'] = 'Création du compte administrateur...';
|
||||||
|
$lng['install']['creating_configfile'] = 'Création du fichier de configuration...';
|
||||||
|
$lng['install']['creating_configfile_temp'] = 'Le fichier a été enregistré dans /tmp/userdata.inc.php, merci de le déplacer dans lib/.';
|
||||||
|
$lng['install']['creating_configfile_failed'] = 'Impossible de créer lib/userdata.inc.php, merci de le créer manuellement avec le contenu suivant:';
|
||||||
|
$lng['install']['froxlor_succ_installed'] = 'Froxlor a été installé avec succès.';
|
||||||
|
|
||||||
|
$lng['click_here_to_refresh'] = 'Cliquez ici pour vérifier à nouveau';
|
||||||
|
$lng['click_here_to_goback'] = 'Cliquez ici pour revenir';
|
||||||
|
$lng['click_here_to_continue'] = 'Cliquez ici pour continuer';
|
||||||
|
$lng['click_here_to_login'] = 'Cliquez ici pour vous connecter.';
|
||||||
@@ -27,13 +27,16 @@ if(@php_sapi_name() != 'cli'
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check argument count
|
// Check argument count
|
||||||
|
/*
|
||||||
if (sizeof($argv) != 2) {
|
if (sizeof($argv) != 2) {
|
||||||
print_help($argv);
|
print_help($argv);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Load the contents of the given path
|
// Load the contents of the given path
|
||||||
$path = $argv[1];
|
$path = $argv[1];
|
||||||
|
$_f = isset($argv[2]) ? $argv[2] : null;
|
||||||
$files = array();
|
$files = array();
|
||||||
|
|
||||||
if ($dh = opendir($path)) {
|
if ($dh = opendir($path)) {
|
||||||
@@ -43,9 +46,11 @@ if ($dh = opendir($path)) {
|
|||||||
&& !is_dir($file)
|
&& !is_dir($file)
|
||||||
&& preg_match('/(.+)\.lng\.php/i', $file)
|
&& preg_match('/(.+)\.lng\.php/i', $file)
|
||||||
) {
|
) {
|
||||||
|
if (is_null($_f) || (!is_null($_f) && ($file == $_f || $file == $baseLanguage))) {
|
||||||
$files[$file] = str_replace('//', '/', $path . '/' . $file);
|
$files[$file] = str_replace('//', '/', $path . '/' . $file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
closedir($dh);
|
closedir($dh);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
@charset "UTF-8";
|
@charset "UTF-8";
|
||||||
|
|
||||||
/* RESET */
|
/* RESET */
|
||||||
html,body,div,ul,ol,li,dl,dt,dd,h1,h2,h3,h4,h5,h6,pre,form,p,blockquote,fieldset,input { margin:0; padding:0; }
|
html,body,div,ul,ol,li,dl,dt,dd,h1,h2,h3,h4,h5,h6,pre,form,p,blockquote,fieldset,input { margin:0; padding:0; }
|
||||||
h1,h2,h3,h4,h5,h6,pre,code,address,caption,cite,code,em,strong,th { font-size:1em; font-weight:400; font-style:normal; }
|
h1,h2,h3,h4,h5,h6,pre,code,address,caption,cite,code,em,strong,th { font-size:1em; font-weight:400; font-style:normal; }
|
||||||
@@ -11,10 +10,10 @@ article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
|
|||||||
|
|
||||||
/* TYPE */
|
/* TYPE */
|
||||||
html,body {
|
html,body {
|
||||||
font:12px/18px Helvetica,Arial,Verdana,sans-serif;
|
font:12px/18px 'Lucida Grande','Lucida Sans Unicode',Helvetica,Arial,Verdana,sans-serif;
|
||||||
background-color:#f2f2f2;
|
background-color: #f5f5f5;
|
||||||
color:#333;
|
color:#444;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: subpixel-antialiased;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@@ -557,3 +556,12 @@ select.dropdown {
|
|||||||
background-color: #35aa47;
|
background-color: #35aa47;
|
||||||
height:5px;
|
height:5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.red { color: #ff0000; }
|
||||||
|
.green { color: green; }
|
||||||
|
.orange { color: orange; }
|
||||||
|
.blue { color: blue; }
|
||||||
|
.install-block { width: 65%; }
|
||||||
|
.install-step { width: 250px; }
|
||||||
|
.install-h3 { text-align: center; }
|
||||||
|
.install-text { margin: 20px 20px 0 !important; }
|
||||||
|
|||||||
BIN
install/templates/assets/img/password.png
Executable file → Normal file
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.3 KiB |
@@ -1,4 +1,4 @@
|
|||||||
<p style="margin: 20px 20px 0 !important">{$this->_lng['install']['title']}</p>
|
<p class="install-text">{$this->_lng['install']['title']}</p>
|
||||||
<form action="{$formaction}" method="get">
|
<form action="{$formaction}" method="get">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
{$formdata}
|
{$formdata}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<p style="margin: 20px 20px 0 !important">{$this->_lng['install']['welcometext']}</p>
|
<p class="install-text">{$this->_lng['install']['welcometext']}</p>
|
||||||
<form action="{$formaction}" method="post">
|
<form action="{$formaction}" method="post">
|
||||||
<hr class="line">
|
<hr class="line">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<p>
|
<p>
|
||||||
<label for="{$fieldname}" style="width:65%;{$style}">{$fieldlabel}:</label>
|
<label for="{$fieldname}" class="install-block {$style}">{$fieldlabel}:</label>
|
||||||
<input type="{$type}" name="{$fieldname}" id="{$fieldname}" value="{$fieldvalue}" {$required} />
|
<input type="{$type}" name="{$fieldname}" id="{$fieldname}" value="{$fieldvalue}" {$required} />
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<p>
|
<p>
|
||||||
<label for="{$fieldname}" style="width:65%;{$style}">{$this->_lng['install']['webserver']} {$fieldlabel}:</label>
|
<label for="{$fieldname}" class="install-block {$style}">{$this->_lng['install']['webserver']} {$fieldlabel}:</label>
|
||||||
<input type="radio" name="webserver" id="{$fieldname}" value="{$fieldname}" {$checked} /><span>{$fieldlabel}<span>
|
<input type="radio" name="webserver" id="{$fieldname}" value="{$fieldname}" {$checked} /><span>{$fieldlabel}<span>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -3,16 +3,11 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta http-equiv="Default-Style" content="text/css" />
|
<meta http-equiv="Default-Style" content="text/css" />
|
||||||
<!--[if lt IE 9]><script src="../js/html5shiv.js"></script><![endif]-->
|
<!--[if lt IE 9]><script src="../js/html5shiv.min.js"></script><![endif]-->
|
||||||
<link href="templates/assets/css/install.css" rel="stylesheet" type="text/css" />
|
<link href="templates/assets/css/install.css" rel="stylesheet" type="text/css" />
|
||||||
<!--[if IE]><link rel="stylesheet" href="../templates/{$theme}/css/main_ie.css" type="text/css" /><![endif]-->
|
<!--[if IE]><link rel="stylesheet" href="../templates/{$theme}/css/main_ie.css" type="text/css" /><![endif]-->
|
||||||
<link href="templates/assets/img/favicon.ico" rel="icon" type="image/x-icon" />
|
<link href="templates/assets/img/favicon.ico" rel="icon" type="image/x-icon" />
|
||||||
<title>Froxlor Server Management Panel - Installation</title>
|
<title>Froxlor Server Management Panel - Installation</title>
|
||||||
<style type="text/css">
|
|
||||||
body {
|
|
||||||
font-family: Verdana, Geneva, sans-serif;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="installsec">
|
<div class="installsec">
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<h3 style="color:{$msgcolor};text-align: center">{$message}</h3>
|
<h3 class="install-h3 {$msgcolor}">{$message}</h3>
|
||||||
<aside>
|
<aside>
|
||||||
<a href="{$link}">{$linktext}</a>
|
<a href="{$link}">{$linktext}</a>
|
||||||
</aside>
|
</aside>
|
||||||
|
|||||||
@@ -15,6 +15,15 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (!defined('AREA')
|
||||||
|
|| (defined('AREA') && AREA != 'admin')
|
||||||
|
|| !isset($userinfo['loginname'])
|
||||||
|
|| (isset($userinfo['loginname']) && $userinfo['loginname'] == '')
|
||||||
|
) {
|
||||||
|
header('Location: ../../../../index.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
if (isFroxlorVersion('0.9-r0')) {
|
if (isFroxlorVersion('0.9-r0')) {
|
||||||
|
|
||||||
showUpdateStep("Updating from 0.9-r0 to 0.9-r1", false);
|
showUpdateStep("Updating from 0.9-r0 to 0.9-r1", false);
|
||||||
@@ -714,7 +723,7 @@ if (isFroxlorVersion('0.9.7-svn1')) {
|
|||||||
showUpdateStep("Updating open_basedir due to security - issue");
|
showUpdateStep("Updating open_basedir due to security - issue");
|
||||||
$result = Database::query("SELECT `id` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `documentroot` LIKE '%:%' AND `documentroot` NOT LIKE 'http://%' AND `openbasedir_path` = '0' AND `openbasedir` = '1'");
|
$result = Database::query("SELECT `id` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `documentroot` LIKE '%:%' AND `documentroot` NOT LIKE 'http://%' AND `openbasedir_path` = '0' AND `openbasedir` = '1'");
|
||||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||||
Database::query("UPDATE `".TABLE_PANEL_DOMAINS."` SET `openbasedir_path` = '1' WHERE `id` = '" . (int)$row['id'])."'";
|
Database::query("UPDATE `".TABLE_PANEL_DOMAINS."` SET `openbasedir_path` = '1' WHERE `id` = '" . (int)$row['id']."'");
|
||||||
}
|
}
|
||||||
lastStepStatus(0);
|
lastStepStatus(0);
|
||||||
|
|
||||||
@@ -2727,3 +2736,143 @@ if (isFroxlorVersion('0.9.32-dev6')) {
|
|||||||
|
|
||||||
updateToVersion('0.9.32-rc1');
|
updateToVersion('0.9.32-rc1');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isFroxlorVersion('0.9.32-rc1')) {
|
||||||
|
|
||||||
|
showUpdateStep("Updating from 0.9.32-rc1 to 0.9.32-rc2", false);
|
||||||
|
|
||||||
|
showUpdateStep("Removing autoresponder-cronjob (deprecated)");
|
||||||
|
Database::query("DELETE FROM `".TABLE_PANEL_CRONRUNS."` WHERE `module` = 'froxlor/autoresponder';");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
showUpdateStep("Adding new settings for cron");
|
||||||
|
// get user-chosen value
|
||||||
|
$croncmdline = isset($_POST['croncmdline']) ? $_POST['croncmdline'] : "/usr/bin/nice -n 5 /usr/bin/php5 -q";
|
||||||
|
Settings::AddNew("system.croncmdline", $croncmdline);
|
||||||
|
// add task to generate cron.d-file
|
||||||
|
inserttask('99');
|
||||||
|
// silenty add the auto-update setting - we do not want everybody to know and use this
|
||||||
|
// as it is a very dangerous setting
|
||||||
|
Settings::AddNew("system.cron_allowautoupdate", 0);
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
showUpdateStep("Removing backup-module ftp-users (deprecated)");
|
||||||
|
Database::query("DELETE FROM `".TABLE_FTP_USERS."` WHERE `username` LIKE '%_backup';");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
updateToVersion('0.9.32-rc2');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isFroxlorVersion('0.9.32-rc2')) {
|
||||||
|
showUpdateStep("Updating from 0.9.32-rc2 to 0.9.32-rc3", false);
|
||||||
|
|
||||||
|
showUpdateStep("Removing outdated languages");
|
||||||
|
Database::query("DELETE FROM `" . TABLE_PANEL_LANGUAGE . "` WHERE `iso` REGEXP '(bg|ca|cz|da|hu|pl|ru|sk|es|zh)';");
|
||||||
|
Database::query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `def_language` = 'English' WHERE `def_language` NOT REGEXP '(Dutch|English|Français|Deutsch|Italian|Portugu\ês|Swedish)';");
|
||||||
|
Database::query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `def_language` = 'English' WHERE `def_language` NOT REGEXP '(Dutch|English|Français|Deutsch|Italian|Português|Swedish)';");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
updateToVersion('0.9.32-rc3');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isFroxlorVersion('0.9.32-rc3')) {
|
||||||
|
showUpdateStep("Updating from 0.9.32-rc3 to 0.9.32 final", false);
|
||||||
|
updateToVersion('0.9.32');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isFroxlorVersion('0.9.32')) {
|
||||||
|
showUpdateStep("Updating from 0.9.32 to 0.9.33-dev1", false);
|
||||||
|
|
||||||
|
showUpdateStep("Adding settings for custom newsfeed on customer-dashboard");
|
||||||
|
Settings::AddNew("customer.show_news_feed", isset($_POST['customer_show_news_feed']) ? (int)$_POST['customer_show_news_feed'] : '0');
|
||||||
|
Settings::AddNew("customer.news_feed_url", isset($_POST['customer_news_feed_url']) ? $_POST['customer_news_feed_url'] : '');
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
updateToVersion('0.9.33-dev1');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isFroxlorVersion('0.9.33-dev1')) {
|
||||||
|
showUpdateStep("Updating from 0.9.33-dev1 to 0.9.33-dev2", false);
|
||||||
|
|
||||||
|
showUpdateStep("Adding settings for hostname-dns-entry");
|
||||||
|
Settings::AddNew("system.dns_createhostnameentry", isset($_POST['dns_createhostnameentry']) ? (int)$_POST['dns_createhostnameentry'] : '0');
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
updateToVersion('0.9.33-dev2');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isFroxlorVersion('0.9.33-dev2')) {
|
||||||
|
showUpdateStep("Updating from 0.9.33-dev2 to 0.9.33-dev3", false);
|
||||||
|
|
||||||
|
showUpdateStep("Adding settings for password-generation options");
|
||||||
|
Settings::AddNew("panel.password_alpha_lower", '1');
|
||||||
|
Settings::AddNew("panel.password_alpha_upper", '1');
|
||||||
|
Settings::AddNew("panel.password_numeric", '0');
|
||||||
|
Settings::AddNew("panel.password_special_char_required", '0');
|
||||||
|
Settings::AddNew("panel.password_special_char", '!?<>§$%&+#=@');
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
showUpdateStep("Adding settings for fpm-apache2.4-mod_proxy integration");
|
||||||
|
Settings::AddNew("phpfpm.use_mod_proxy", '0');
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
updateToVersion('0.9.33-dev3');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isFroxlorVersion('0.9.33-dev3')) {
|
||||||
|
showUpdateStep("Updating from 0.9.33-dev3 to 0.9.33-rc1", false);
|
||||||
|
|
||||||
|
showUpdateStep("Updating database-scheme");
|
||||||
|
Database::query("ALTER TABLE `".TABLE_PANEL_DOMAINS."` MODIFY `dkim_privkey` text");
|
||||||
|
Database::query("ALTER TABLE `".TABLE_PANEL_DOMAINS."` MODIFY `dkim_pubkey` text");
|
||||||
|
Database::query("ALTER TABLE `".TABLE_PANEL_DOMAINS."` MODIFY `specialsettings` text");
|
||||||
|
Database::query("ALTER TABLE `".TABLE_PANEL_IPSANDPORTS."` MODIFY `specialsettings` text");
|
||||||
|
Database::query("ALTER TABLE `".TABLE_PANEL_IPSANDPORTS."` MODIFY `default_vhostconf_domain` text");
|
||||||
|
Database::query("ALTER TABLE `".TABLE_PANEL_DOMAIN_SSL_SETTINGS."` MODIFY `ssl_ca_file` text");
|
||||||
|
Database::query("ALTER TABLE `".TABLE_PANEL_DOMAIN_SSL_SETTINGS."` MODIFY `ssl_cert_chainfile` text");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
showUpdateStep("Removing old settings");
|
||||||
|
Database::query("DELETE FROM `".TABLE_PANEL_SETTINGS."` WHERE `settinggroup`='panel' AND `varname` = 'use_webfonts';");
|
||||||
|
Database::query("DELETE FROM `".TABLE_PANEL_SETTINGS."` WHERE `settinggroup`='panel' AND `varname` = 'webfont';");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
showUpdateStep("Adding local froxlor group to customer groups");
|
||||||
|
if ((int)Settings::Get('system.mod_fcgid_ownvhost') == 1 || (int)Settings::Get('phpfpm.enabled_ownvhost') == 1) {
|
||||||
|
if ((int)Settings::Get('system.mod_fcgid') == 1) {
|
||||||
|
$local_user = Settings::Get('system.mod_fcgid_httpuser');
|
||||||
|
} else {
|
||||||
|
$local_user = Settings::Get('phpfpm.vhost_httpuser');
|
||||||
|
}
|
||||||
|
Database::query("UPDATE `".TABLE_FTP_GROUPS."` SET `members` = CONCAT(`members`, ',".$local_user."');");
|
||||||
|
lastStepStatus(0);
|
||||||
|
} else {
|
||||||
|
lastStepStatus(1, "not needed");
|
||||||
|
}
|
||||||
|
|
||||||
|
updateToVersion('0.9.33-rc1');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isFroxlorVersion('0.9.33-rc1')) {
|
||||||
|
showUpdateStep("Updating from 0.9.33-rc1 to 0.9.33-rc2", false);
|
||||||
|
|
||||||
|
showUpdateStep("Add new setting for sending cron-errors via mail");
|
||||||
|
$sendcronerrors = isset($_POST['system_send_cron_errors']) ? (int)$_POST['system_send_cron_errors'] : "0";
|
||||||
|
Settings::addNew('system.send_cron_errors', $sendcronerrors);
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
showUpdateStep("Add new custom-notes field for admins and customer");
|
||||||
|
Database::query("ALTER TABLE `".TABLE_PANEL_ADMINS."` ADD `custom_notes` text AFTER `theme`");
|
||||||
|
Database::query("ALTER TABLE `".TABLE_PANEL_ADMINS."` ADD `custom_notes_show` tinyint(1) NOT NULL default '0' AFTER `custom_notes`");
|
||||||
|
Database::query("ALTER TABLE `".TABLE_PANEL_CUSTOMERS."` ADD `custom_notes` text AFTER `theme`");
|
||||||
|
Database::query("ALTER TABLE `".TABLE_PANEL_CUSTOMERS."` ADD `custom_notes_show` tinyint(1) NOT NULL default '0' AFTER `custom_notes`");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
// go from varchar(50) to varchar(255) because of some hashes that are longer than that
|
||||||
|
showUpdateStep("Updating table structure of admins and customers");
|
||||||
|
Database::query("ALTER TABLE `".TABLE_PANEL_ADMINS."` MODIFY `password` varchar(255) NOT NULL default ''");
|
||||||
|
Database::query("ALTER TABLE `".TABLE_PANEL_CUSTOMERS."` MODIFY `password` varchar(255) NOT NULL default ''");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
updateToVersion('0.9.33-rc2');
|
||||||
|
}
|
||||||
|
|||||||
@@ -15,6 +15,15 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (!defined('AREA')
|
||||||
|
|| (defined('AREA') && AREA != 'admin')
|
||||||
|
|| !isset($userinfo['loginname'])
|
||||||
|
|| (isset($userinfo['loginname']) && $userinfo['loginname'] == '')
|
||||||
|
) {
|
||||||
|
header('Location: ../../../index.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$updateto = '0.9-r0';
|
$updateto = '0.9-r0';
|
||||||
$frontend = 'froxlor';
|
$frontend = 'froxlor';
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
function getPreConfig($current_version)
|
function getPreConfig($current_version)
|
||||||
{
|
{
|
||||||
$has_preconfig = false;
|
$has_preconfig = false;
|
||||||
$return = '<div class="preconfig"><h3 style="color:#ff0000;">PLEASE NOTE - Important update notifications</h3>';
|
$return = '<div class="preconfig"><h3 class="red">PLEASE NOTE - Important update notifications</h3>';
|
||||||
|
|
||||||
include_once makeCorrectFile(dirname(__FILE__).'/preconfig/0.9/preconfig_0.9.inc.php');
|
include_once makeCorrectFile(dirname(__FILE__).'/preconfig/0.9/preconfig_0.9.inc.php');
|
||||||
parseAndOutputPreconfig($has_preconfig, $return, $current_version);
|
parseAndOutputPreconfig($has_preconfig, $return, $current_version);
|
||||||
|
|||||||
@@ -440,7 +440,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) {
|
|||||||
$description = 'This version introduces a lot of profound changes:';
|
$description = 'This version introduces a lot of profound changes:';
|
||||||
$description .= '<br /><ul><li>Improving the whole template system</li><li>Full UTF-8 support</li><li><strong>Removing support for the former default theme \'Classic\'</strong></li></ul>';
|
$description .= '<br /><ul><li>Improving the whole template system</li><li>Full UTF-8 support</li><li><strong>Removing support for the former default theme \'Classic\'</strong></li></ul>';
|
||||||
$description .= '<br /><br />Notice: This update will <strong>alter your Froxlor database to use UTF-8</strong> as default charset. ';
|
$description .= '<br /><br />Notice: This update will <strong>alter your Froxlor database to use UTF-8</strong> as default charset. ';
|
||||||
$description .= 'Even though this is already tested, we <span style="color:#ff0000;font-weight:bold;">strongly recommend</span> to ';
|
$description .= 'Even though this is already tested, we <span class="red">strongly recommend</span> to ';
|
||||||
$description .= 'test this update in a testing environment using your existing data.<br /><br />';
|
$description .= 'test this update in a testing environment using your existing data.<br /><br />';
|
||||||
|
|
||||||
$question = '<strong>Select your preferred Classic Theme replacement:</strong> ';
|
$question = '<strong>Select your preferred Classic Theme replacement:</strong> ';
|
||||||
@@ -560,7 +560,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) {
|
|||||||
) {
|
) {
|
||||||
$has_preconfig = true;
|
$has_preconfig = true;
|
||||||
$description = 'The PHP-FPM implementation for apache2 has changed. Please look for the "<b>fastcgi.conf</b>" (Debian/Ubuntu) or "<b>70_fastcgi.conf</b>" (Gentoo) within /etc/apache2/ and change it as shown below:<br /><br />';
|
$description = 'The PHP-FPM implementation for apache2 has changed. Please look for the "<b>fastcgi.conf</b>" (Debian/Ubuntu) or "<b>70_fastcgi.conf</b>" (Gentoo) within /etc/apache2/ and change it as shown below:<br /><br />';
|
||||||
$description .= '<pre style="width:500px;border:1px solid #ccc;padding:4px;"><IfModule mod_fastcgi.c>
|
$description .= '<pre class="code-block"><IfModule mod_fastcgi.c>
|
||||||
FastCgiIpcDir /var/lib/apache2/fastcgi/
|
FastCgiIpcDir /var/lib/apache2/fastcgi/
|
||||||
<Location "/fastcgiphp">
|
<Location "/fastcgiphp">
|
||||||
Order Deny,Allow
|
Order Deny,Allow
|
||||||
@@ -650,4 +650,40 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) {
|
|||||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (versionInUpdate($current_version, '0.9.32-rc2')) {
|
||||||
|
$has_preconfig = true;
|
||||||
|
$description = 'To customize the command which executes the cronjob (php - basically) change the path below according to your system.<br /><br />';
|
||||||
|
$question = '<strong>Please specify the command to execute cronscripts</strong> (default: "/usr/bin/nice -n 5 /usr/bin/php5 -q")<br />';
|
||||||
|
$question.= '<input type="text" class="text" name="croncmdline" value="/usr/bin/nice -n 5 /usr/bin/php5 -q" /><br />';
|
||||||
|
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (versionInUpdate($current_version, '0.9.33-dev1')) {
|
||||||
|
$has_preconfig = true;
|
||||||
|
$description = 'You can enable/disable the display/usage of the custom newsfeed for customers.<br /><br />';
|
||||||
|
$question = '<strong>Do you want to enable the custom newsfeed for customer? (default: no):</strong> ';
|
||||||
|
$question.= makeyesno('customer_show_news_feed', '1', '0', '0').'<br />';
|
||||||
|
$question.= '<strong>You have to set the URL for your RSS-feed here, if you have choosen to enable the custom newsfeed on the customer-dashboard:</strong> ';
|
||||||
|
$question.= '<input type="text" class="text" name="customer_news_feed_url" value="" /><br />';
|
||||||
|
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (versionInUpdate($current_version, '0.9.33-dev2')) {
|
||||||
|
// only if bind is used - if not the default will be set, which is '0' (off)
|
||||||
|
if (Settings::get('system.bind_enable') == 1) {
|
||||||
|
$has_preconfig = true;
|
||||||
|
$description = 'You can enable/disable the generation of the bind-zone / config for the system hostname.<br /><br />';
|
||||||
|
$question = '<strong>Do you want to generate a bind-zone for the system-hostname? (default: no):</strong> ';
|
||||||
|
$question.= makeyesno('dns_createhostnameentry', '1', '0', '0').'<br />';
|
||||||
|
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (versionInUpdate($current_version, '0.9.33-rc2')) {
|
||||||
|
$has_preconfig = true;
|
||||||
|
$description = 'You can chose whether you want to receive an e-mail on cronjob errors. Keep in mind that this can lead to an e-mail being sent every 5 minutes.<br /><br />';
|
||||||
|
$question = '<strong>Do you want to receive cron-errors via mail? (default: no):</strong> ';
|
||||||
|
$question.= makeyesno('system_send_cron_errors', '1', '0', '0').'<br />';
|
||||||
|
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,15 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (!defined('AREA')
|
||||||
|
|| (defined('AREA') && AREA != 'admin')
|
||||||
|
|| !isset($userinfo['loginname'])
|
||||||
|
|| (isset($userinfo['loginname']) && $userinfo['loginname'] == '')
|
||||||
|
) {
|
||||||
|
header('Location: ../index.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$updatelog = FroxlorLogger::getInstanceOf(array('loginname' => 'updater'));
|
$updatelog = FroxlorLogger::getInstanceOf(array('loginname' => 'updater'));
|
||||||
|
|
||||||
$updatelogfile = validateUpdateLogFile(makeCorrectFile(dirname(__FILE__).'/update.log'));
|
$updatelogfile = validateUpdateLogFile(makeCorrectFile(dirname(__FILE__).'/update.log'));
|
||||||
|
|||||||
4
js/excanvas.min.js
vendored
8
js/html5shiv.js
vendored
@@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
HTML5 Shiv v3.7.0 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
|
|
||||||
*/
|
|
||||||
(function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
|
|
||||||
a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x<style>article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}</style>";
|
|
||||||
c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||
|
|
||||||
"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);
|
|
||||||
if(g)return a.createDocumentFragment();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d<h;d++)c.createElement(e[d]);return c}};l.html5=e;q(f)})(this,document);
|
|
||||||
4
js/html5shiv.min.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
/**
|
||||||
|
* @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
|
||||||
|
*/
|
||||||
|
!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.2",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b)}(this,document);
|
||||||
6
js/jquery-ui.min.js
vendored
10
js/jquery.flot.min.js
vendored
9
js/jquery.min.js
vendored
133
js/jquery.tablesorter.min.js
vendored
1
js/plugins/flot.resize.min.js
vendored
@@ -1 +0,0 @@
|
|||||||
(function($,t,n){function p(){for(var n=r.length-1;n>=0;n--){var o=$(r[n]);if(o[0]==t||o.is(":visible")){var h=o.width(),d=o.height(),v=o.data(a);!v||h===v.w&&d===v.h?i[f]=i[l]:(i[f]=i[c],o.trigger(u,[v.w=h,v.h=d]))}else v=o.data(a),v.w=0,v.h=0}s!==null&&(s=t.requestAnimationFrame(p))}var r=[],i=$.resize=$.extend($.resize,{}),s,o="setTimeout",u="resize",a=u+"-special-event",f="delay",l="pendingDelay",c="activeDelay",h="throttleWindow";i[l]=250,i[c]=20,i[f]=i[l],i[h]=!0,$.event.special[u]={setup:function(){if(!i[h]&&this[o])return!1;var t=$(this);r.push(this),t.data(a,{w:t.width(),h:t.height()}),r.length===1&&(s=n,p())},teardown:function(){if(!i[h]&&this[o])return!1;var t=$(this);for(var n=r.length-1;n>=0;n--)if(r[n]==this){r.splice(n,1);break}t.removeData(a),r.length||(cancelAnimationFrame(s),s=null)},add:function(t){function s(t,i,s){var o=$(this),u=o.data(a);u.w=i!==n?i:o.width(),u.h=s!==n?s:o.height(),r.apply(this,arguments)}if(!i[h]&&this[o])return!1;var r;if($.isFunction(t))return r=t,s;r=t.handler,t.handler=s}},t.requestAnimationFrame||(t.requestAnimationFrame=function(){return t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(e,n){return t.setTimeout(e,i[f])}}()),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(){return t.webkitCancelRequestAnimationFrame||t.mozCancelRequestAnimationFrame||t.oCancelRequestAnimationFrame||t.msCancelRequestAnimationFrame||clearTimeout}())})(jQuery,this);(function($){var options={};function init(plot){function onResize(){var placeholder=plot.getPlaceholder();if(placeholder.width()==0||placeholder.height()==0)return;plot.resize();plot.setupGrid();plot.draw()}function bindEvents(plot,eventHolder){plot.getPlaceholder().resize(onResize)}function shutdown(plot,eventHolder){plot.getPlaceholder().unbind("resize",onResize)}plot.hooks.bindEvents.push(bindEvents);plot.hooks.shutdown.push(shutdown)}$.plot.plugins.push({init:init,options:options,name:"resize",version:"1.0"})})(jQuery);
|
|
||||||
7
js/plugins/jquery.flot.resize.min.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/* Javascript plotting library for jQuery, version 0.8.3.
|
||||||
|
|
||||||
|
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||||
|
Licensed under the MIT license.
|
||||||
|
|
||||||
|
*/
|
||||||
|
(function($,e,t){"$:nomunge";var i=[],n=$.resize=$.extend($.resize,{}),a,r=false,s="setTimeout",u="resize",m=u+"-special-event",o="pendingDelay",l="activeDelay",f="throttleWindow";n[o]=200;n[l]=20;n[f]=true;$.event.special[u]={setup:function(){if(!n[f]&&this[s]){return false}var e=$(this);i.push(this);e.data(m,{w:e.width(),h:e.height()});if(i.length===1){a=t;h()}},teardown:function(){if(!n[f]&&this[s]){return false}var e=$(this);for(var t=i.length-1;t>=0;t--){if(i[t]==this){i.splice(t,1);break}}e.removeData(m);if(!i.length){if(r){cancelAnimationFrame(a)}else{clearTimeout(a)}a=null}},add:function(e){if(!n[f]&&this[s]){return false}var i;function a(e,n,a){var r=$(this),s=r.data(m)||{};s.w=n!==t?n:r.width();s.h=a!==t?a:r.height();i.apply(this,arguments)}if($.isFunction(e)){i=e;return a}else{i=e.handler;e.handler=a}}};function h(t){if(r===true){r=t||1}for(var s=i.length-1;s>=0;s--){var l=$(i[s]);if(l[0]==e||l.is(":visible")){var f=l.width(),c=l.height(),d=l.data(m);if(d&&(f!==d.w||c!==d.h)){l.trigger(u,[d.w=f,d.h=c]);r=t||true}}else{d=l.data(m);d.w=0;d.h=0}}if(a!==null){if(r&&(t==null||t-r<1e3)){a=e.requestAnimationFrame(h)}else{a=setTimeout(h,n[o]);r=false}}}if(!e.requestAnimationFrame){e.requestAnimationFrame=function(){return e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(t,i){return e.setTimeout(function(){t((new Date).getTime())},n[l])}}()}if(!e.cancelAnimationFrame){e.cancelAnimationFrame=function(){return e.webkitCancelRequestAnimationFrame||e.mozCancelRequestAnimationFrame||e.oCancelRequestAnimationFrame||e.msCancelRequestAnimationFrame||clearTimeout}()}})(jQuery,this);(function($){var options={};function init(plot){function onResize(){var placeholder=plot.getPlaceholder();if(placeholder.width()==0||placeholder.height()==0)return;plot.resize();plot.setupGrid();plot.draw()}function bindEvents(plot,eventHolder){plot.getPlaceholder().resize(onResize)}function shutdown(plot,eventHolder){plot.getPlaceholder().unbind("resize",onResize)}plot.hooks.bindEvents.push(bindEvents);plot.hooks.shutdown.push(shutdown)}$.plot.plugins.push({init:init,options:options,name:"resize",version:"1.0"})})(jQuery);
|
||||||
23
js/plugins/jquery.tablesorter.sizeparser.min.js
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
$.tablesorter.addParser({
|
||||||
|
id: 'filesize',
|
||||||
|
is: function(s) {
|
||||||
|
return s.match(new RegExp(/[0-9]+(\.[0-9]+)?\ (KiB|B|GiB|MiB|TiB)/));
|
||||||
|
},
|
||||||
|
format: function(s) {
|
||||||
|
var suf = s.match(new RegExp(/(KiB|B|GiB|MiB|TiB)/))[1];
|
||||||
|
var num = parseFloat(s.match(new RegExp(/^[0-9]+(\.[0-9]+)?/))[0]);
|
||||||
|
switch (suf) {
|
||||||
|
case 'B':
|
||||||
|
return num;
|
||||||
|
case 'KiB':
|
||||||
|
return num * 1024;
|
||||||
|
case 'MiB':
|
||||||
|
return num * 1024 * 1024;
|
||||||
|
case 'GiB':
|
||||||
|
return num * 1024 * 1024 * 1024;
|
||||||
|
case 'TiB':
|
||||||
|
return num * 1024 * 1024 * 1024 * 1024;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
type: 'numeric'
|
||||||
|
});
|
||||||
33
lib/ajax.php
@@ -16,6 +16,18 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Load the user settings
|
||||||
|
define('FROXLOR_INSTALL_DIR', dirname(dirname(__FILE__)));
|
||||||
|
if (!file_exists('./userdata.inc.php')) {
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
require './userdata.inc.php';
|
||||||
|
require './tables.inc.php';
|
||||||
|
require './classes/database/class.Database.php';
|
||||||
|
require './classes/settings/class.Settings.php';
|
||||||
|
require './functions/validate/function.validate_ip.php';
|
||||||
|
require './functions/validate/function.validateDomain.php';
|
||||||
|
|
||||||
if(isset($_POST['action'])) {
|
if(isset($_POST['action'])) {
|
||||||
$action = $_POST['action'];
|
$action = $_POST['action'];
|
||||||
} elseif(isset($_GET['action'])) {
|
} elseif(isset($_GET['action'])) {
|
||||||
@@ -25,15 +37,16 @@ if(isset($_POST['action'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($action == "newsfeed") {
|
if ($action == "newsfeed") {
|
||||||
|
if (isset($_GET['role']) && $_GET['role'] == "customer") {
|
||||||
|
$feed = Settings::Get("customer.news_feed_url");
|
||||||
|
} else {
|
||||||
$feed = "http://inside.froxlor.org/news/";
|
$feed = "http://inside.froxlor.org/news/";
|
||||||
|
}
|
||||||
|
|
||||||
if (function_exists("simplexml_load_file") == false) {
|
if (function_exists("simplexml_load_file") == false) {
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
// get version
|
|
||||||
require './tables.inc.php';
|
|
||||||
|
|
||||||
if (function_exists('curl_version')) {
|
if (function_exists('curl_version')) {
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt($ch, CURLOPT_URL, $feed);
|
curl_setopt($ch, CURLOPT_URL, $feed);
|
||||||
@@ -61,7 +74,19 @@ if ($action == "newsfeed") {
|
|||||||
$content = preg_replace("/[\r\n]+/", " ", strip_tags($item->description));
|
$content = preg_replace("/[\r\n]+/", " ", strip_tags($item->description));
|
||||||
$content = substr($content, 0, 150) . "...";
|
$content = substr($content, 0, 150) . "...";
|
||||||
|
|
||||||
echo "<tr class=\"newsitem\"><td><small>" . $date . "</small><br /><a href=\"" . $link . "\" target=\"_blank\"><b>" . $title . "</b><br />" . $content . "</a></td></tr>";
|
echo "<li class=\"clearfix\">
|
||||||
|
<div class=\"newsfeed-body clearfix\">
|
||||||
|
<div class=\"header\">
|
||||||
|
<strong class=\"primary-font\"><a href=\"{$link}\" target=\"_blank\">{$title}</a></strong>
|
||||||
|
<small class=\"pull-right text-muted\">
|
||||||
|
<i class=\"fa fa-clock-o fa-fw\"></i> {$date}
|
||||||
|
</small>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
{$content}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</li>";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo "";
|
echo "";
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
Smarty-3.1.15/libs/
|
Smarty-3.1.21/libs/
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Example Application
|
|
||||||
|
|
||||||
* @package Example-application
|
|
||||||
*/
|
|
||||||
|
|
||||||
require '../libs/Smarty.class.php';
|
|
||||||
|
|
||||||
$smarty = new Smarty;
|
|
||||||
|
|
||||||
//$smarty->force_compile = true;
|
|
||||||
$smarty->debugging = true;
|
|
||||||
$smarty->caching = true;
|
|
||||||
$smarty->cache_lifetime = 120;
|
|
||||||
|
|
||||||
$smarty->assign("Name","Fred Irving Johnathan Bradley Peppergill",true);
|
|
||||||
$smarty->assign("FirstName",array("John","Mary","James","Henry"));
|
|
||||||
$smarty->assign("LastName",array("Doe","Smith","Johnson","Case"));
|
|
||||||
$smarty->assign("Class",array(array("A","B","C","D"), array("E", "F", "G", "H"),
|
|
||||||
array("I", "J", "K", "L"), array("M", "N", "O", "P")));
|
|
||||||
|
|
||||||
$smarty->assign("contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"),
|
|
||||||
array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234")));
|
|
||||||
|
|
||||||
$smarty->assign("option_values", array("NY","NE","KS","IA","OK","TX"));
|
|
||||||
$smarty->assign("option_output", array("New York","Nebraska","Kansas","Iowa","Oklahoma","Texas"));
|
|
||||||
$smarty->assign("option_selected", "NE");
|
|
||||||
|
|
||||||
$smarty->display('index.tpl');
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
{config_load file="test.conf" section="setup"}
|
|
||||||
{include file="header.tpl" title=foo}
|
|
||||||
|
|
||||||
<PRE>
|
|
||||||
|
|
||||||
{* bold and title are read from the config file *}
|
|
||||||
{if #bold#}<b>{/if}
|
|
||||||
{* capitalize the first letters of each word of the title *}
|
|
||||||
Title: {#title#|capitalize}
|
|
||||||
{if #bold#}</b>{/if}
|
|
||||||
|
|
||||||
The current date and time is {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
|
|
||||||
|
|
||||||
The value of global assigned variable $SCRIPT_NAME is {$SCRIPT_NAME}
|
|
||||||
|
|
||||||
Example of accessing server environment variable SERVER_NAME: {$smarty.server.SERVER_NAME}
|
|
||||||
|
|
||||||
The value of {ldelim}$Name{rdelim} is <b>{$Name}</b>
|
|
||||||
|
|
||||||
variable modifier example of {ldelim}$Name|upper{rdelim}
|
|
||||||
|
|
||||||
<b>{$Name|upper}</b>
|
|
||||||
|
|
||||||
|
|
||||||
An example of a section loop:
|
|
||||||
|
|
||||||
{section name=outer
|
|
||||||
loop=$FirstName}
|
|
||||||
{if $smarty.section.outer.index is odd by 2}
|
|
||||||
{$smarty.section.outer.rownum} . {$FirstName[outer]} {$LastName[outer]}
|
|
||||||
{else}
|
|
||||||
{$smarty.section.outer.rownum} * {$FirstName[outer]} {$LastName[outer]}
|
|
||||||
{/if}
|
|
||||||
{sectionelse}
|
|
||||||
none
|
|
||||||
{/section}
|
|
||||||
|
|
||||||
An example of section looped key values:
|
|
||||||
|
|
||||||
{section name=sec1 loop=$contacts}
|
|
||||||
phone: {$contacts[sec1].phone}<br>
|
|
||||||
fax: {$contacts[sec1].fax}<br>
|
|
||||||
cell: {$contacts[sec1].cell}<br>
|
|
||||||
{/section}
|
|
||||||
<p>
|
|
||||||
|
|
||||||
testing strip tags
|
|
||||||
{strip}
|
|
||||||
<table border=0>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<A HREF="{$SCRIPT_NAME}">
|
|
||||||
<font color="red">This is a test </font>
|
|
||||||
</A>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
{/strip}
|
|
||||||
|
|
||||||
</PRE>
|
|
||||||
|
|
||||||
This is an example of the html_select_date function:
|
|
||||||
|
|
||||||
<form>
|
|
||||||
{html_select_date start_year=1998 end_year=2010}
|
|
||||||
</form>
|
|
||||||
|
|
||||||
This is an example of the html_select_time function:
|
|
||||||
|
|
||||||
<form>
|
|
||||||
{html_select_time use_24_hours=false}
|
|
||||||
</form>
|
|
||||||
|
|
||||||
This is an example of the html_options function:
|
|
||||||
|
|
||||||
<form>
|
|
||||||
<select name=states>
|
|
||||||
{html_options values=$option_values selected=$option_selected output=$option_output}
|
|
||||||
</select>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
{include file="footer.tpl"}
|
|
||||||
@@ -1,133 +0,0 @@
|
|||||||
{capture name='_smarty_debug' assign=debug_output}
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Smarty Debug Console</title>
|
|
||||||
<style type="text/css">
|
|
||||||
{literal}
|
|
||||||
body, h1, h2, td, th, p {
|
|
||||||
font-family: sans-serif;
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 0.9em;
|
|
||||||
margin: 1px;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
margin: 0;
|
|
||||||
text-align: left;
|
|
||||||
padding: 2px;
|
|
||||||
background-color: #f0c040;
|
|
||||||
color: black;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 1.2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
background-color: #9B410E;
|
|
||||||
color: white;
|
|
||||||
text-align: left;
|
|
||||||
font-weight: bold;
|
|
||||||
padding: 2px;
|
|
||||||
border-top: 1px solid black;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
background: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
p, table, div {
|
|
||||||
background: #f0ead8;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
margin: 0;
|
|
||||||
font-style: italic;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
table {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
th, td {
|
|
||||||
font-family: monospace;
|
|
||||||
vertical-align: top;
|
|
||||||
text-align: left;
|
|
||||||
width: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
td {
|
|
||||||
color: green;
|
|
||||||
}
|
|
||||||
|
|
||||||
.odd {
|
|
||||||
background-color: #eeeeee;
|
|
||||||
}
|
|
||||||
|
|
||||||
.even {
|
|
||||||
background-color: #fafafa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.exectime {
|
|
||||||
font-size: 0.8em;
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
#table_assigned_vars th {
|
|
||||||
color: blue;
|
|
||||||
}
|
|
||||||
|
|
||||||
#table_config_vars th {
|
|
||||||
color: maroon;
|
|
||||||
}
|
|
||||||
{/literal}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<h1>Smarty Debug Console - {if isset($template_name)}{$template_name|debug_print_var nofilter}{else}Total Time {$execution_time|string_format:"%.5f"}{/if}</h1>
|
|
||||||
|
|
||||||
{if !empty($template_data)}
|
|
||||||
<h2>included templates & config files (load time in seconds)</h2>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
{foreach $template_data as $template}
|
|
||||||
<font color=brown>{$template.name}</font>
|
|
||||||
<span class="exectime">
|
|
||||||
(compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"})
|
|
||||||
</span>
|
|
||||||
<br>
|
|
||||||
{/foreach}
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<h2>assigned template variables</h2>
|
|
||||||
|
|
||||||
<table id="table_assigned_vars">
|
|
||||||
{foreach $assigned_vars as $vars}
|
|
||||||
<tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">
|
|
||||||
<th>${$vars@key|escape:'html'}</th>
|
|
||||||
<td>{$vars|debug_print_var nofilter}</td></tr>
|
|
||||||
{/foreach}
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<h2>assigned config file variables (outer template scope)</h2>
|
|
||||||
|
|
||||||
<table id="table_config_vars">
|
|
||||||
{foreach $config_vars as $vars}
|
|
||||||
<tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">
|
|
||||||
<th>{$vars@key|escape:'html'}</th>
|
|
||||||
<td>{$vars|debug_print_var nofilter}</td></tr>
|
|
||||||
{/foreach}
|
|
||||||
|
|
||||||
</table>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
{/capture}
|
|
||||||
<script type="text/javascript">
|
|
||||||
{$id = $template_name|default:''|md5}
|
|
||||||
_smarty_console = window.open("","console{$id}","width=680,height=600,resizable,scrollbars=yes");
|
|
||||||
_smarty_console.document.write("{$debug_output|escape:'javascript' nofilter}");
|
|
||||||
_smarty_console.document.close();
|
|
||||||
</script>
|
|
||||||
@@ -1,277 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Smarty Internal Plugin CacheResource File
|
|
||||||
*
|
|
||||||
* @package Smarty
|
|
||||||
* @subpackage Cacher
|
|
||||||
* @author Uwe Tews
|
|
||||||
* @author Rodney Rehm
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This class does contain all necessary methods for the HTML cache on file system
|
|
||||||
*
|
|
||||||
* Implements the file system as resource for the HTML cache Version ussing nocache inserts.
|
|
||||||
*
|
|
||||||
* @package Smarty
|
|
||||||
* @subpackage Cacher
|
|
||||||
*/
|
|
||||||
class Smarty_Internal_CacheResource_File extends Smarty_CacheResource
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* populate Cached Object with meta data from Resource
|
|
||||||
*
|
|
||||||
* @param Smarty_Template_Cached $cached cached object
|
|
||||||
* @param Smarty_Internal_Template $_template template object
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template)
|
|
||||||
{
|
|
||||||
$_source_file_path = str_replace(':', '.', $_template->source->filepath);
|
|
||||||
$_cache_id = isset($_template->cache_id) ? preg_replace('![^\w\|]+!', '_', $_template->cache_id) : null;
|
|
||||||
$_compile_id = isset($_template->compile_id) ? preg_replace('![^\w\|]+!', '_', $_template->compile_id) : null;
|
|
||||||
$_filepath = $_template->source->uid;
|
|
||||||
// if use_sub_dirs, break file into directories
|
|
||||||
if ($_template->smarty->use_sub_dirs) {
|
|
||||||
$_filepath = substr($_filepath, 0, 2) . DS
|
|
||||||
. substr($_filepath, 2, 2) . DS
|
|
||||||
. substr($_filepath, 4, 2) . DS
|
|
||||||
. $_filepath;
|
|
||||||
}
|
|
||||||
$_compile_dir_sep = $_template->smarty->use_sub_dirs ? DS : '^';
|
|
||||||
if (isset($_cache_id)) {
|
|
||||||
$_cache_id = str_replace('|', $_compile_dir_sep, $_cache_id) . $_compile_dir_sep;
|
|
||||||
} else {
|
|
||||||
$_cache_id = '';
|
|
||||||
}
|
|
||||||
if (isset($_compile_id)) {
|
|
||||||
$_compile_id = $_compile_id . $_compile_dir_sep;
|
|
||||||
} else {
|
|
||||||
$_compile_id = '';
|
|
||||||
}
|
|
||||||
$_cache_dir = $_template->smarty->getCacheDir();
|
|
||||||
if ($_template->smarty->cache_locking) {
|
|
||||||
// create locking file name
|
|
||||||
// relative file name?
|
|
||||||
if (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_cache_dir)) {
|
|
||||||
$_lock_dir = rtrim(getcwd(), '/\\') . DS . $_cache_dir;
|
|
||||||
} else {
|
|
||||||
$_lock_dir = $_cache_dir;
|
|
||||||
}
|
|
||||||
$cached->lock_id = $_lock_dir.sha1($_cache_id.$_compile_id.$_template->source->uid).'.lock';
|
|
||||||
}
|
|
||||||
$cached->filepath = $_cache_dir . $_cache_id . $_compile_id . $_filepath . '.' . basename($_source_file_path) . '.php';
|
|
||||||
$cached->timestamp = @filemtime($cached->filepath);
|
|
||||||
$cached->exists = !!$cached->timestamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* populate Cached Object with timestamp and exists from Resource
|
|
||||||
*
|
|
||||||
* @param Smarty_Template_Cached $cached cached object
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function populateTimestamp(Smarty_Template_Cached $cached)
|
|
||||||
{
|
|
||||||
$cached->timestamp = @filemtime($cached->filepath);
|
|
||||||
$cached->exists = !!$cached->timestamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Read the cached template and process its header
|
|
||||||
*
|
|
||||||
* @param Smarty_Internal_Template $_template template object
|
|
||||||
* @param Smarty_Template_Cached $cached cached object
|
|
||||||
* @return booelan true or false if the cached content does not exist
|
|
||||||
*/
|
|
||||||
public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached=null)
|
|
||||||
{
|
|
||||||
$_smarty_tpl = $_template;
|
|
||||||
|
|
||||||
return @include $_template->cached->filepath;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Write the rendered template output to cache
|
|
||||||
*
|
|
||||||
* @param Smarty_Internal_Template $_template template object
|
|
||||||
* @param string $content content to cache
|
|
||||||
* @return boolean success
|
|
||||||
*/
|
|
||||||
public function writeCachedContent(Smarty_Internal_Template $_template, $content)
|
|
||||||
{
|
|
||||||
if (Smarty_Internal_Write_File::writeFile($_template->cached->filepath, $content, $_template->smarty) === true) {
|
|
||||||
$_template->cached->timestamp = @filemtime($_template->cached->filepath);
|
|
||||||
$_template->cached->exists = !!$_template->cached->timestamp;
|
|
||||||
if ($_template->cached->exists) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Empty cache
|
|
||||||
*
|
|
||||||
* @param Smarty_Internal_Template $_template template object
|
|
||||||
* @param integer $exp_time expiration time (number of seconds, not timestamp)
|
|
||||||
* @return integer number of cache files deleted
|
|
||||||
*/
|
|
||||||
public function clearAll(Smarty $smarty, $exp_time = null)
|
|
||||||
{
|
|
||||||
return $this->clear($smarty, null, null, null, $exp_time);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Empty cache for a specific template
|
|
||||||
*
|
|
||||||
* @param Smarty $_template template object
|
|
||||||
* @param string $resource_name template name
|
|
||||||
* @param string $cache_id cache id
|
|
||||||
* @param string $compile_id compile id
|
|
||||||
* @param integer $exp_time expiration time (number of seconds, not timestamp)
|
|
||||||
* @return integer number of cache files deleted
|
|
||||||
*/
|
|
||||||
public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
|
|
||||||
{
|
|
||||||
$_cache_id = isset($cache_id) ? preg_replace('![^\w\|]+!', '_', $cache_id) : null;
|
|
||||||
$_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null;
|
|
||||||
$_dir_sep = $smarty->use_sub_dirs ? '/' : '^';
|
|
||||||
$_compile_id_offset = $smarty->use_sub_dirs ? 3 : 0;
|
|
||||||
$_dir = $smarty->getCacheDir();
|
|
||||||
$_dir_length = strlen($_dir);
|
|
||||||
if (isset($_cache_id)) {
|
|
||||||
$_cache_id_parts = explode('|', $_cache_id);
|
|
||||||
$_cache_id_parts_count = count($_cache_id_parts);
|
|
||||||
if ($smarty->use_sub_dirs) {
|
|
||||||
foreach ($_cache_id_parts as $id_part) {
|
|
||||||
$_dir .= $id_part . DS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (isset($resource_name)) {
|
|
||||||
$_save_stat = $smarty->caching;
|
|
||||||
$smarty->caching = true;
|
|
||||||
$tpl = new $smarty->template_class($resource_name, $smarty);
|
|
||||||
$smarty->caching = $_save_stat;
|
|
||||||
|
|
||||||
// remove from template cache
|
|
||||||
$tpl->source; // have the template registered before unset()
|
|
||||||
if ($smarty->allow_ambiguous_resources) {
|
|
||||||
$_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id;
|
|
||||||
} else {
|
|
||||||
$_templateId = $smarty->joined_template_dir . '#' . $resource_name . $tpl->cache_id . $tpl->compile_id;
|
|
||||||
}
|
|
||||||
if (isset($_templateId[150])) {
|
|
||||||
$_templateId = sha1($_templateId);
|
|
||||||
}
|
|
||||||
unset($smarty->template_objects[$_templateId]);
|
|
||||||
|
|
||||||
if ($tpl->source->exists) {
|
|
||||||
$_resourcename_parts = basename(str_replace('^', '/', $tpl->cached->filepath));
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$_count = 0;
|
|
||||||
$_time = time();
|
|
||||||
if (file_exists($_dir)) {
|
|
||||||
$_cacheDirs = new RecursiveDirectoryIterator($_dir);
|
|
||||||
$_cache = new RecursiveIteratorIterator($_cacheDirs, RecursiveIteratorIterator::CHILD_FIRST);
|
|
||||||
foreach ($_cache as $_file) {
|
|
||||||
if (substr(basename($_file->getPathname()),0,1) == '.' || strpos($_file, '.svn') !== false) continue;
|
|
||||||
// directory ?
|
|
||||||
if ($_file->isDir()) {
|
|
||||||
if (!$_cache->isDot()) {
|
|
||||||
// delete folder if empty
|
|
||||||
@rmdir($_file->getPathname());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$_parts = explode($_dir_sep, str_replace('\\', '/', substr((string) $_file, $_dir_length)));
|
|
||||||
$_parts_count = count($_parts);
|
|
||||||
// check name
|
|
||||||
if (isset($resource_name)) {
|
|
||||||
if ($_parts[$_parts_count-1] != $_resourcename_parts) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// check compile id
|
|
||||||
if (isset($_compile_id) && (!isset($_parts[$_parts_count-2 - $_compile_id_offset]) || $_parts[$_parts_count-2 - $_compile_id_offset] != $_compile_id)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// check cache id
|
|
||||||
if (isset($_cache_id)) {
|
|
||||||
// count of cache id parts
|
|
||||||
$_parts_count = (isset($_compile_id)) ? $_parts_count - 2 - $_compile_id_offset : $_parts_count - 1 - $_compile_id_offset;
|
|
||||||
if ($_parts_count < $_cache_id_parts_count) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
for ($i = 0; $i < $_cache_id_parts_count; $i++) {
|
|
||||||
if ($_parts[$i] != $_cache_id_parts[$i]) continue 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// expired ?
|
|
||||||
if (isset($exp_time)) {
|
|
||||||
if ($exp_time < 0) {
|
|
||||||
preg_match('#\'cache_lifetime\' =>\s*(\d*)#', file_get_contents($_file), $match);
|
|
||||||
if ($_time < (@filemtime($_file) + $match[1])) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ($_time - @filemtime($_file) < $exp_time) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$_count += @unlink((string) $_file) ? 1 : 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check is cache is locked for this template
|
|
||||||
*
|
|
||||||
* @param Smarty $smarty Smarty object
|
|
||||||
* @param Smarty_Template_Cached $cached cached object
|
|
||||||
* @return booelan true or false if cache is locked
|
|
||||||
*/
|
|
||||||
public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)
|
|
||||||
{
|
|
||||||
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
|
|
||||||
clearstatcache(true, $cached->lock_id);
|
|
||||||
} else {
|
|
||||||
clearstatcache();
|
|
||||||
}
|
|
||||||
$t = @filemtime($cached->lock_id);
|
|
||||||
|
|
||||||
return $t && (time() - $t < $smarty->locking_timeout);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Lock cache for this template
|
|
||||||
*
|
|
||||||
* @param Smarty $smarty Smarty object
|
|
||||||
* @param Smarty_Template_Cached $cached cached object
|
|
||||||
*/
|
|
||||||
public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached)
|
|
||||||
{
|
|
||||||
$cached->is_locked = true;
|
|
||||||
touch($cached->lock_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Unlock cache for this template
|
|
||||||
*
|
|
||||||
* @param Smarty $smarty Smarty object
|
|
||||||
* @param Smarty_Template_Cached $cached cached object
|
|
||||||
*/
|
|
||||||
public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached)
|
|
||||||
{
|
|
||||||
$cached->is_locked = false;
|
|
||||||
@unlink($cached->lock_id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Smarty Internal Plugin Resource Stream
|
|
||||||
*
|
|
||||||
* Implements the streams as resource for Smarty template
|
|
||||||
*
|
|
||||||
* @package Smarty
|
|
||||||
* @subpackage TemplateResources
|
|
||||||
* @author Uwe Tews
|
|
||||||
* @author Rodney Rehm
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Smarty Internal Plugin Resource Stream
|
|
||||||
*
|
|
||||||
* Implements the streams as resource for Smarty template
|
|
||||||
*
|
|
||||||
* @link http://php.net/streams
|
|
||||||
* @package Smarty
|
|
||||||
* @subpackage TemplateResources
|
|
||||||
*/
|
|
||||||
class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* populate Source Object with meta data from Resource
|
|
||||||
*
|
|
||||||
* @param Smarty_Template_Source $source source object
|
|
||||||
* @param Smarty_Internal_Template $_template template object
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
|
|
||||||
{
|
|
||||||
if (strpos($source->resource, '://') !== false) {
|
|
||||||
$source->filepath = $source->resource;
|
|
||||||
} else {
|
|
||||||
$source->filepath = str_replace(':', '://', $source->resource);
|
|
||||||
}
|
|
||||||
$source->uid = false;
|
|
||||||
$source->content = $this->getContent($source);
|
|
||||||
$source->timestamp = false;
|
|
||||||
$source->exists = !!$source->content;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load template's source from stream into current template object
|
|
||||||
*
|
|
||||||
* @param Smarty_Template_Source $source source object
|
|
||||||
* @return string template source
|
|
||||||
* @throws SmartyException if source cannot be loaded
|
|
||||||
*/
|
|
||||||
public function getContent(Smarty_Template_Source $source)
|
|
||||||
{
|
|
||||||
$t = '';
|
|
||||||
// the availability of the stream has already been checked in Smarty_Resource::fetch()
|
|
||||||
$fp = fopen($source->filepath, 'r+');
|
|
||||||
if ($fp) {
|
|
||||||
while (!feof($fp) && ($current_line = fgets($fp)) !== false) {
|
|
||||||
$t .= $current_line;
|
|
||||||
}
|
|
||||||
fclose($fp);
|
|
||||||
|
|
||||||
return $t;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* modify resource_name according to resource handlers specifications
|
|
||||||
*
|
|
||||||
* @param Smarty $smarty Smarty instance
|
|
||||||
* @param string $resource_name resource_name to make unique
|
|
||||||
* @param boolean $is_config flag for config resource
|
|
||||||
* @return string unique resource name
|
|
||||||
*/
|
|
||||||
protected function buildUniqueResourceName(Smarty $smarty, $resource_name, $is_config = false)
|
|
||||||
{
|
|
||||||
return get_class($this) . '#' . $resource_name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
Smarty 3.1.15
|
Smarty 3.1.21
|
||||||
|
|
||||||
Author: Monte Ohrt <monte at ohrt dot com >
|
Author: Monte Ohrt <monte at ohrt dot com >
|
||||||
Author: Uwe Tews
|
Author: Uwe Tews
|
||||||
@@ -1,5 +1,169 @@
|
|||||||
===== trunk =====
|
===== 3.1.22-dev ===== (xx.xx.2014)
|
||||||
===== Smarty-3.1.15 =====
|
===== 3.1.21 ===== (18.10.2014)
|
||||||
|
18.10.2014
|
||||||
|
- composer moved to github
|
||||||
|
- add COMPOSER_RELEASE_NOTES
|
||||||
|
|
||||||
|
17.10.2014
|
||||||
|
- bugfix on $php_handling security and optimization of smarty_internal_parsetree (Thue Kristensen)
|
||||||
|
|
||||||
|
16.10.2014
|
||||||
|
- bugfix composer.json update
|
||||||
|
|
||||||
|
15.10.2014
|
||||||
|
- bugfix calling a new created cache file with fetch() and Smarty::CACHING_LIFETIME_SAVED multiple times did fail (forum 22350)
|
||||||
|
|
||||||
|
14.10.2014
|
||||||
|
- bugfix any tag placed within "<script language=php>" will throw a security exception to close all thinkable holes
|
||||||
|
- bugfix classmap in root composer.json should start at "libs/..."
|
||||||
|
- improvement cache is_file(file_exists) results of loadPlugin() to avoid unnecessary calls during compilation (Issue 201}
|
||||||
|
|
||||||
|
12.10.2014
|
||||||
|
- bugfix a comment like "<script{*foo*} language=php>" bypassed $php_handling checking (Thue Kristensen)
|
||||||
|
- bugfix change of 08.10.2014 could create E_NOTICE meassage when using "<?php" tags
|
||||||
|
- bugfix "<script language=php>" with $php_handling PHP_PASSTHRU was executed in {nocache} sections
|
||||||
|
|
||||||
|
===== 3.1.20 ===== (09.10.2014)
|
||||||
|
08.10.2014
|
||||||
|
- bugfix security mode of "<script language=php>" must be controlled by $php_handling property (Thue Kristensen)
|
||||||
|
|
||||||
|
01.10.2014
|
||||||
|
- bugfix template resource of inheritance blocks could get invalid if the default resource type is not 'file'(Issue 202)
|
||||||
|
- bugfix existing child {block} tag must override parent {block} tag append / prepend setting (topic 25259)
|
||||||
|
|
||||||
|
02.08.2014
|
||||||
|
- bugfix modifier wordwrap did output break string wrong if first word was exceeding length with cut = true (topic 25193)
|
||||||
|
|
||||||
|
24.07.2014
|
||||||
|
- bugfix cache clear when cache folder does not exist
|
||||||
|
|
||||||
|
16.07.2014
|
||||||
|
- enhancement remove BOM automatically from template source (topic 25161)
|
||||||
|
|
||||||
|
04.07.2014
|
||||||
|
- bugfix the bufix of 02.06.2014 broke correct handling of child templates with same name but different template folders in extends resource (issue 194 and topic 25099)
|
||||||
|
|
||||||
|
===== 3.1.19 ===== (06.30.2014)
|
||||||
|
20.06.2014
|
||||||
|
- bugfix template variables could not be passed as parameter in {include} when the include was in a {nocache} section (topic 25131)
|
||||||
|
|
||||||
|
17.06.2014
|
||||||
|
- bugfix large template text of some charsets could cause parsing errors (topic 24630)
|
||||||
|
|
||||||
|
08.06.2014
|
||||||
|
- bugfix registered objects did not work after spelling fixes of 06.06.2014
|
||||||
|
- bugfix {block} tags within {literal} .. {/literal} got not displayed correctly (topic 25024)
|
||||||
|
- bugfix UNC WINDOWS PATH like "\\psf\path\to\dir" did not work as template directory (Issue 192)
|
||||||
|
- bugfix {html_image} security check did fail on files relative to basedir (Issue 191)
|
||||||
|
|
||||||
|
06.06.2014
|
||||||
|
- fixed PHPUnit outputFilterTrimWhitespaceTests.php assertion of test result
|
||||||
|
- fixed spelling, PHPDoc , minor errors, code cleanup
|
||||||
|
|
||||||
|
02.06.2014
|
||||||
|
- using multiple cwd with relative template dirs could result in identical compiled file names. (issue 194 and topic 25099)
|
||||||
|
|
||||||
|
19.04.2014
|
||||||
|
- bugfix calling createTemplate(template, data) with empty data array caused notice of array to string conversion (Issue 189)
|
||||||
|
- bugfix clearCompiledTemplate() did not delete files on WINDOWS when a compile_id was specified
|
||||||
|
|
||||||
|
18.04.2014
|
||||||
|
- revert bugfix of 5.4.2014 because %-e date format is not supported on all operating systems
|
||||||
|
|
||||||
|
===== 3.1.18 ===== (07.04.2014)
|
||||||
|
06.04.2014
|
||||||
|
- bugfix template inheritance fail when using custom resource after patch of 8.3.2014 (Issue 187)
|
||||||
|
- bugfix update of composer file (Issue 168 and 184)
|
||||||
|
|
||||||
|
05.04.2014
|
||||||
|
- bugfix default date format leads to extra spaces when displaying dates with single digit days (Issue 165)
|
||||||
|
|
||||||
|
26.03.2014
|
||||||
|
- bugfix Smart_Resource_Custom should not lowercase the resource name (Issue 183)
|
||||||
|
|
||||||
|
24.03.2014
|
||||||
|
- bugfix using a {foreach} property like @iteration could fail when used in inheritance parent templates (Issue 182)
|
||||||
|
|
||||||
|
20.03.2014
|
||||||
|
- bugfix $smarty->auto_literal and mbsting.func_overload 2, 6 or 7 did fail (forum topic 24899)
|
||||||
|
|
||||||
|
18.03.2014
|
||||||
|
- revert change of 17.03.2014
|
||||||
|
|
||||||
|
17.03.2014
|
||||||
|
- bugfix $smarty->auto_literal and mbsting.func_overload 2, 6 or 7 did fail (forum topic 24899)
|
||||||
|
|
||||||
|
15.03.2014
|
||||||
|
- bugfix Smarty_CacheResource_Keyvaluestore did use different keys on read/writes and clearCache() calls (Issue 169)
|
||||||
|
|
||||||
|
13.03.2014
|
||||||
|
- bugfix clearXxx() change of 27.1.2014 did not work when specifing cache_id or compile_id (forum topic 24868 and 24867)
|
||||||
|
|
||||||
|
===== 3.1.17 =====
|
||||||
|
08.03.2014
|
||||||
|
- bugfix relative file path {include} within {block} of child templates did throw exception on first call (Issue 177)
|
||||||
|
|
||||||
|
17.02.2014
|
||||||
|
- bugfix Smarty failed when executing PHP on HHVM (Hip Hop 2.4) because uniqid('',true) does return string with ',' (forum topic 20343)
|
||||||
|
|
||||||
|
16.02.2014
|
||||||
|
- bugfix a '//' or '\\' in template_dir path could produce wrong path on relative filepath in {include} (Issue 175)
|
||||||
|
|
||||||
|
05.02.2014
|
||||||
|
- bugfix shared.literal_compiler_param.php did throw an exception when literal did contain a '-' (smarty-developers group)
|
||||||
|
|
||||||
|
27.01.2014
|
||||||
|
- bugfix $smarty->debugging = true; did show the variable of the $smarty object not the variables used in display() call (forum topic 24764)
|
||||||
|
- bugfix clearCompiledTemplate(), clearAll() and clear() should use realpath to avoid possible exception from RecursiveDirectoryIterator (Issue 171)
|
||||||
|
|
||||||
|
26.01.2014
|
||||||
|
- bugfix undo block nesting checks for {nocache} for reasons like forum topic 23280 (forum topic 24762)
|
||||||
|
|
||||||
|
18.01.2014
|
||||||
|
- bugfix the compiler did fail when using template inheritance and recursive {include} (smarty-developers group)
|
||||||
|
|
||||||
|
11.01.2014
|
||||||
|
- bugfix "* }" (spaces before right delimiter) was interpreted by mistake as comment end tag (Issue 170)
|
||||||
|
- internals content cache should be clear when updating cache file
|
||||||
|
|
||||||
|
08.01.2014
|
||||||
|
- bugfix Smarty_CacheResource_Custom did not handle template resource type specifications on clearCache() calls (Issue 169)
|
||||||
|
- bugfix SmartyBC.class.php should use require_once to load Smarty.class.php (forum topic 24683)
|
||||||
|
|
||||||
|
===== 3.1.16 =====
|
||||||
|
15.12.2013
|
||||||
|
- bugfix {include} with {block} tag handling (forum topic 24599, 24594, 24682) (Issue 161)
|
||||||
|
Read 3.1.16_RELEASE_NOTES for more details
|
||||||
|
- enhancement additional debug output at $smarty->_parserdebug = true;
|
||||||
|
|
||||||
|
07.11.2013
|
||||||
|
- bugfix too restrictive handling of {include} within {block} tags. 3.1.15 did throw errors where 3.1.14 did not (forum topic 24599)
|
||||||
|
- bugfix compiler could fail if PHP mbstring.func_overload is enabled (Issue 164)
|
||||||
|
|
||||||
|
28.10.2013
|
||||||
|
- bugfix variable resource name at custom resource plugin did not work within {block} tags (Issue 163)
|
||||||
|
- bugfix notice "Trying to get property of non-object" removed (Issue 163)
|
||||||
|
- bugfix correction of modifier capitalize fix from 3.10.2013 (issue 159)
|
||||||
|
- bugfix multiple {block}s with same name in parent did not work (forum topic 24631)
|
||||||
|
|
||||||
|
20.10.2013
|
||||||
|
- bugfix a variable file name at {extends} tag did fail (forum topic 24618)
|
||||||
|
|
||||||
|
14.10.2013
|
||||||
|
- bugfix yesterdays fix could result in an undefined variable
|
||||||
|
|
||||||
|
13.10.2013
|
||||||
|
- bugfix variable names on {include} in template inheritance did unextepted error message (forum topic 24594) (Issue 161)
|
||||||
|
.- bugfix relative includes with same name like {include './foo.tpl'} from different folder failed (forum topic 24590)(Issue 161)
|
||||||
|
|
||||||
|
04.10.2013
|
||||||
|
- bugfix variable file names at {extends} had been disbabled by mistake with the rewrite of
|
||||||
|
template inheritance of 24.08.2013 (forum topic 24585)
|
||||||
|
|
||||||
|
03.10.2013
|
||||||
|
- bugfix loops using modifier capitalize did eat up memory (issue 159)
|
||||||
|
|
||||||
|
===== Smarty 3.1.15 =====
|
||||||
01.10.2013
|
01.10.2013
|
||||||
- use current delimiters in compiler error messages (issue 157)
|
- use current delimiters in compiler error messages (issue 157)
|
||||||
- improvement on performance when using error handler and multiple template folders (issue 152)
|
- improvement on performance when using error handler and multiple template folders (issue 152)
|
||||||
30
lib/classes/Smarty-3.1.21/demo/index.php
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Example Application
|
||||||
|
*
|
||||||
|
* @package Example-application
|
||||||
|
*/
|
||||||
|
|
||||||
|
require '../libs/Smarty.class.php';
|
||||||
|
|
||||||
|
$smarty = new Smarty;
|
||||||
|
|
||||||
|
//$smarty->force_compile = true;
|
||||||
|
$smarty->debugging = true;
|
||||||
|
$smarty->caching = true;
|
||||||
|
$smarty->cache_lifetime = 120;
|
||||||
|
|
||||||
|
$smarty->assign("Name", "Fred Irving Johnathan Bradley Peppergill", true);
|
||||||
|
$smarty->assign("FirstName", array("John", "Mary", "James", "Henry"));
|
||||||
|
$smarty->assign("LastName", array("Doe", "Smith", "Johnson", "Case"));
|
||||||
|
$smarty->assign("Class", array(array("A", "B", "C", "D"), array("E", "F", "G", "H"),
|
||||||
|
array("I", "J", "K", "L"), array("M", "N", "O", "P")));
|
||||||
|
|
||||||
|
$smarty->assign("contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"),
|
||||||
|
array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234")));
|
||||||
|
|
||||||
|
$smarty->assign("option_values", array("NY", "NE", "KS", "IA", "OK", "TX"));
|
||||||
|
$smarty->assign("option_output", array("New York", "Nebraska", "Kansas", "Iowa", "Oklahoma", "Texas"));
|
||||||
|
$smarty->assign("option_selected", "NE");
|
||||||
|
|
||||||
|
$smarty->display('index.tpl');
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* APC CacheResource
|
* APC CacheResource
|
||||||
*
|
|
||||||
* CacheResource Implementation based on the KeyValueStore API to use
|
* CacheResource Implementation based on the KeyValueStore API to use
|
||||||
* memcache as the storage resource for Smarty's output caching.
|
* memcache as the storage resource for Smarty's output caching.
|
||||||
* *
|
* *
|
||||||
|
*
|
||||||
* @package CacheResource-examples
|
* @package CacheResource-examples
|
||||||
* @author Uwe Tews
|
* @author Uwe Tews
|
||||||
*/
|
*/
|
||||||
@@ -23,6 +23,7 @@ class Smarty_CacheResource_Apc extends Smarty_CacheResource_KeyValueStore
|
|||||||
* Read values for a set of keys from cache
|
* Read values for a set of keys from cache
|
||||||
*
|
*
|
||||||
* @param array $keys list of keys to fetch
|
* @param array $keys list of keys to fetch
|
||||||
|
*
|
||||||
* @return array list of values with the given keys used as indexes
|
* @return array list of values with the given keys used as indexes
|
||||||
* @return boolean true on success, false on failure
|
* @return boolean true on success, false on failure
|
||||||
*/
|
*/
|
||||||
@@ -42,6 +43,7 @@ class Smarty_CacheResource_Apc extends Smarty_CacheResource_KeyValueStore
|
|||||||
*
|
*
|
||||||
* @param array $keys list of values to save
|
* @param array $keys list of values to save
|
||||||
* @param int $expire expiration time
|
* @param int $expire expiration time
|
||||||
|
*
|
||||||
* @return boolean true on success, false on failure
|
* @return boolean true on success, false on failure
|
||||||
*/
|
*/
|
||||||
protected function write(array $keys, $expire = null)
|
protected function write(array $keys, $expire = null)
|
||||||
@@ -57,6 +59,7 @@ class Smarty_CacheResource_Apc extends Smarty_CacheResource_KeyValueStore
|
|||||||
* Remove values from cache
|
* Remove values from cache
|
||||||
*
|
*
|
||||||
* @param array $keys list of keys to delete
|
* @param array $keys list of keys to delete
|
||||||
|
*
|
||||||
* @return boolean true on success, false on failure
|
* @return boolean true on success, false on failure
|
||||||
*/
|
*/
|
||||||
protected function delete(array $keys)
|
protected function delete(array $keys)
|
||||||
@@ -2,10 +2,8 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Memcache CacheResource
|
* Memcache CacheResource
|
||||||
*
|
|
||||||
* CacheResource Implementation based on the KeyValueStore API to use
|
* CacheResource Implementation based on the KeyValueStore API to use
|
||||||
* memcache as the storage resource for Smarty's output caching.
|
* memcache as the storage resource for Smarty's output caching.
|
||||||
*
|
|
||||||
* Note that memcache has a limitation of 256 characters per cache-key.
|
* Note that memcache has a limitation of 256 characters per cache-key.
|
||||||
* To avoid complications all cache-keys are translated to a sha1 hash.
|
* To avoid complications all cache-keys are translated to a sha1 hash.
|
||||||
*
|
*
|
||||||
@@ -16,6 +14,7 @@ class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* memcache instance
|
* memcache instance
|
||||||
|
*
|
||||||
* @var Memcache
|
* @var Memcache
|
||||||
*/
|
*/
|
||||||
protected $memcache = null;
|
protected $memcache = null;
|
||||||
@@ -30,6 +29,7 @@ class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore
|
|||||||
* Read values for a set of keys from cache
|
* Read values for a set of keys from cache
|
||||||
*
|
*
|
||||||
* @param array $keys list of keys to fetch
|
* @param array $keys list of keys to fetch
|
||||||
|
*
|
||||||
* @return array list of values with the given keys used as indexes
|
* @return array list of values with the given keys used as indexes
|
||||||
* @return boolean true on success, false on failure
|
* @return boolean true on success, false on failure
|
||||||
*/
|
*/
|
||||||
@@ -55,6 +55,7 @@ class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore
|
|||||||
*
|
*
|
||||||
* @param array $keys list of values to save
|
* @param array $keys list of values to save
|
||||||
* @param int $expire expiration time
|
* @param int $expire expiration time
|
||||||
|
*
|
||||||
* @return boolean true on success, false on failure
|
* @return boolean true on success, false on failure
|
||||||
*/
|
*/
|
||||||
protected function write(array $keys, $expire = null)
|
protected function write(array $keys, $expire = null)
|
||||||
@@ -71,6 +72,7 @@ class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore
|
|||||||
* Remove values from cache
|
* Remove values from cache
|
||||||
*
|
*
|
||||||
* @param array $keys list of keys to delete
|
* @param array $keys list of keys to delete
|
||||||
|
*
|
||||||
* @return boolean true on success, false on failure
|
* @return boolean true on success, false on failure
|
||||||
*/
|
*/
|
||||||
protected function delete(array $keys)
|
protected function delete(array $keys)
|
||||||
@@ -90,6 +92,6 @@ class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore
|
|||||||
*/
|
*/
|
||||||
protected function purge()
|
protected function purge()
|
||||||
{
|
{
|
||||||
return $this->memcache->flush();
|
$this->memcache->flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,10 +2,8 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* MySQL CacheResource
|
* MySQL CacheResource
|
||||||
*
|
|
||||||
* CacheResource Implementation based on the Custom API to use
|
* CacheResource Implementation based on the Custom API to use
|
||||||
* MySQL as the storage resource for Smarty's output caching.
|
* MySQL as the storage resource for Smarty's output caching.
|
||||||
*
|
|
||||||
* Table definition:
|
* Table definition:
|
||||||
* <pre>CREATE TABLE IF NOT EXISTS `output_cache` (
|
* <pre>CREATE TABLE IF NOT EXISTS `output_cache` (
|
||||||
* `id` CHAR(40) NOT NULL COMMENT 'sha1 hash',
|
* `id` CHAR(40) NOT NULL COMMENT 'sha1 hash',
|
||||||
@@ -36,7 +34,8 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty");
|
$this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty");
|
||||||
} catch (PDOException $e) {
|
}
|
||||||
|
catch (PDOException $e) {
|
||||||
throw new SmartyException('Mysql Resource failed: ' . $e->getMessage());
|
throw new SmartyException('Mysql Resource failed: ' . $e->getMessage());
|
||||||
}
|
}
|
||||||
$this->fetch = $this->db->prepare('SELECT modified, content FROM output_cache WHERE id = :id');
|
$this->fetch = $this->db->prepare('SELECT modified, content FROM output_cache WHERE id = :id');
|
||||||
@@ -54,6 +53,7 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom
|
|||||||
* @param string $compile_id compile id
|
* @param string $compile_id compile id
|
||||||
* @param string $content cached content
|
* @param string $content cached content
|
||||||
* @param integer $mtime cache modification timestamp (epoch)
|
* @param integer $mtime cache modification timestamp (epoch)
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function fetch($id, $name, $cache_id, $compile_id, &$content, &$mtime)
|
protected function fetch($id, $name, $cache_id, $compile_id, &$content, &$mtime)
|
||||||
@@ -74,10 +74,12 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom
|
|||||||
* Fetch cached content's modification timestamp from data source
|
* Fetch cached content's modification timestamp from data source
|
||||||
*
|
*
|
||||||
* @note implementing this method is optional. Only implement it if modification times can be accessed faster than loading the complete cached content.
|
* @note implementing this method is optional. Only implement it if modification times can be accessed faster than loading the complete cached content.
|
||||||
|
*
|
||||||
* @param string $id unique cache content identifier
|
* @param string $id unique cache content identifier
|
||||||
* @param string $name template name
|
* @param string $name template name
|
||||||
* @param string $cache_id cache id
|
* @param string $cache_id cache id
|
||||||
* @param string $compile_id compile id
|
* @param string $compile_id compile id
|
||||||
|
*
|
||||||
* @return integer|boolean timestamp (epoch) the template was modified, or false if not found
|
* @return integer|boolean timestamp (epoch) the template was modified, or false if not found
|
||||||
*/
|
*/
|
||||||
protected function fetchTimestamp($id, $name, $cache_id, $compile_id)
|
protected function fetchTimestamp($id, $name, $cache_id, $compile_id)
|
||||||
@@ -98,6 +100,7 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom
|
|||||||
* @param string $compile_id compile id
|
* @param string $compile_id compile id
|
||||||
* @param integer|null $exp_time seconds till expiration time in seconds or null
|
* @param integer|null $exp_time seconds till expiration time in seconds or null
|
||||||
* @param string $content content to cache
|
* @param string $content content to cache
|
||||||
|
*
|
||||||
* @return boolean success
|
* @return boolean success
|
||||||
*/
|
*/
|
||||||
protected function save($id, $name, $cache_id, $compile_id, $exp_time, $content)
|
protected function save($id, $name, $cache_id, $compile_id, $exp_time, $content)
|
||||||
@@ -120,6 +123,7 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom
|
|||||||
* @param string $cache_id cache id
|
* @param string $cache_id cache id
|
||||||
* @param string $compile_id compile id
|
* @param string $compile_id compile id
|
||||||
* @param integer|null $exp_time seconds till expiration or null
|
* @param integer|null $exp_time seconds till expiration or null
|
||||||
|
*
|
||||||
* @return integer number of deleted caches
|
* @return integer number of deleted caches
|
||||||
*/
|
*/
|
||||||
protected function delete($name, $cache_id, $compile_id, $exp_time)
|
protected function delete($name, $cache_id, $compile_id, $exp_time)
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Extends All Resource
|
* Extends All Resource
|
||||||
*
|
|
||||||
* Resource Implementation modifying the extends-Resource to walk
|
* Resource Implementation modifying the extends-Resource to walk
|
||||||
* through the template_dirs and inherit all templates of the same name
|
* through the template_dirs and inherit all templates of the same name
|
||||||
*
|
*
|
||||||
@@ -16,6 +15,7 @@ class Smarty_Resource_Extendsall extends Smarty_Internal_Resource_Extends
|
|||||||
*
|
*
|
||||||
* @param Smarty_Template_Source $source source object
|
* @param Smarty_Template_Source $source source object
|
||||||
* @param Smarty_Internal_Template $_template template object
|
* @param Smarty_Internal_Template $_template template object
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)
|
public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)
|
||||||
@@ -31,7 +31,9 @@ class Smarty_Resource_Extendsall extends Smarty_Internal_Resource_Extends
|
|||||||
}
|
}
|
||||||
$sources[$s->uid] = $s;
|
$sources[$s->uid] = $s;
|
||||||
$uid .= $s->filepath;
|
$uid .= $s->filepath;
|
||||||
} catch (SmartyException $e) {}
|
}
|
||||||
|
catch (SmartyException $e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$sources) {
|
if (!$sources) {
|
||||||
@@ -2,10 +2,8 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* MySQL Resource
|
* MySQL Resource
|
||||||
*
|
|
||||||
* Resource Implementation based on the Custom API to use
|
* Resource Implementation based on the Custom API to use
|
||||||
* MySQL as the storage resource for Smarty's templates and configs.
|
* MySQL as the storage resource for Smarty's templates and configs.
|
||||||
*
|
|
||||||
* Table definition:
|
* Table definition:
|
||||||
* <pre>CREATE TABLE IF NOT EXISTS `templates` (
|
* <pre>CREATE TABLE IF NOT EXISTS `templates` (
|
||||||
* `name` varchar(100) NOT NULL,
|
* `name` varchar(100) NOT NULL,
|
||||||
@@ -13,7 +11,6 @@
|
|||||||
* `source` text,
|
* `source` text,
|
||||||
* PRIMARY KEY (`name`)
|
* PRIMARY KEY (`name`)
|
||||||
* ) ENGINE=InnoDB DEFAULT CHARSET=utf8;</pre>
|
* ) ENGINE=InnoDB DEFAULT CHARSET=utf8;</pre>
|
||||||
*
|
|
||||||
* Demo data:
|
* Demo data:
|
||||||
* <pre>INSERT INTO `templates` (`name`, `modified`, `source`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello world"}{$x}');</pre>
|
* <pre>INSERT INTO `templates` (`name`, `modified`, `source`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello world"}{$x}');</pre>
|
||||||
*
|
*
|
||||||
@@ -33,7 +30,8 @@ class Smarty_Resource_Mysql extends Smarty_Resource_Custom
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty");
|
$this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty");
|
||||||
} catch (PDOException $e) {
|
}
|
||||||
|
catch (PDOException $e) {
|
||||||
throw new SmartyException('Mysql Resource failed: ' . $e->getMessage());
|
throw new SmartyException('Mysql Resource failed: ' . $e->getMessage());
|
||||||
}
|
}
|
||||||
$this->fetch = $this->db->prepare('SELECT modified, source FROM templates WHERE name = :name');
|
$this->fetch = $this->db->prepare('SELECT modified, source FROM templates WHERE name = :name');
|
||||||
@@ -46,6 +44,7 @@ class Smarty_Resource_Mysql extends Smarty_Resource_Custom
|
|||||||
* @param string $name template name
|
* @param string $name template name
|
||||||
* @param string $source template source
|
* @param string $source template source
|
||||||
* @param integer $mtime template modification timestamp (epoch)
|
* @param integer $mtime template modification timestamp (epoch)
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function fetch($name, &$source, &$mtime)
|
protected function fetch($name, &$source, &$mtime)
|
||||||
@@ -66,7 +65,9 @@ class Smarty_Resource_Mysql extends Smarty_Resource_Custom
|
|||||||
* Fetch a template's modification time from database
|
* Fetch a template's modification time from database
|
||||||
*
|
*
|
||||||
* @note implementing this method is optional. Only implement it if modification times can be accessed faster than loading the comple template source.
|
* @note implementing this method is optional. Only implement it if modification times can be accessed faster than loading the comple template source.
|
||||||
|
*
|
||||||
* @param string $name template name
|
* @param string $name template name
|
||||||
|
*
|
||||||
* @return integer timestamp (epoch) the template was modified
|
* @return integer timestamp (epoch) the template was modified
|
||||||
*/
|
*/
|
||||||
protected function fetchTimestamp($name)
|
protected function fetchTimestamp($name)
|
||||||
@@ -2,13 +2,10 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* MySQL Resource
|
* MySQL Resource
|
||||||
*
|
|
||||||
* Resource Implementation based on the Custom API to use
|
* Resource Implementation based on the Custom API to use
|
||||||
* MySQL as the storage resource for Smarty's templates and configs.
|
* MySQL as the storage resource for Smarty's templates and configs.
|
||||||
*
|
|
||||||
* Note that this MySQL implementation fetches the source and timestamps in
|
* Note that this MySQL implementation fetches the source and timestamps in
|
||||||
* a single database query, instead of two separate like resource.mysql.php does.
|
* a single database query, instead of two separate like resource.mysql.php does.
|
||||||
*
|
|
||||||
* Table definition:
|
* Table definition:
|
||||||
* <pre>CREATE TABLE IF NOT EXISTS `templates` (
|
* <pre>CREATE TABLE IF NOT EXISTS `templates` (
|
||||||
* `name` varchar(100) NOT NULL,
|
* `name` varchar(100) NOT NULL,
|
||||||
@@ -16,7 +13,6 @@
|
|||||||
* `source` text,
|
* `source` text,
|
||||||
* PRIMARY KEY (`name`)
|
* PRIMARY KEY (`name`)
|
||||||
* ) ENGINE=InnoDB DEFAULT CHARSET=utf8;</pre>
|
* ) ENGINE=InnoDB DEFAULT CHARSET=utf8;</pre>
|
||||||
*
|
|
||||||
* Demo data:
|
* Demo data:
|
||||||
* <pre>INSERT INTO `templates` (`name`, `modified`, `source`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello world"}{$x}');</pre>
|
* <pre>INSERT INTO `templates` (`name`, `modified`, `source`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello world"}{$x}');</pre>
|
||||||
*
|
*
|
||||||
@@ -34,7 +30,8 @@ class Smarty_Resource_Mysqls extends Smarty_Resource_Custom
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty");
|
$this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty");
|
||||||
} catch (PDOException $e) {
|
}
|
||||||
|
catch (PDOException $e) {
|
||||||
throw new SmartyException('Mysql Resource failed: ' . $e->getMessage());
|
throw new SmartyException('Mysql Resource failed: ' . $e->getMessage());
|
||||||
}
|
}
|
||||||
$this->fetch = $this->db->prepare('SELECT modified, source FROM templates WHERE name = :name');
|
$this->fetch = $this->db->prepare('SELECT modified, source FROM templates WHERE name = :name');
|
||||||
@@ -46,6 +43,7 @@ class Smarty_Resource_Mysqls extends Smarty_Resource_Custom
|
|||||||
* @param string $name template name
|
* @param string $name template name
|
||||||
* @param string $source template source
|
* @param string $source template source
|
||||||
* @param integer $mtime template modification timestamp (epoch)
|
* @param integer $mtime template modification timestamp (epoch)
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function fetch($name, &$source, &$mtime)
|
protected function fetch($name, &$source, &$mtime)
|
||||||
87
lib/classes/Smarty-3.1.21/demo/templates/index.tpl
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
{config_load file="test.conf" section="setup"}
|
||||||
|
{include file="header.tpl" title=foo}
|
||||||
|
|
||||||
|
<PRE>
|
||||||
|
|
||||||
|
{* bold and title are read from the config file *}
|
||||||
|
{if #bold#}<b>{/if}
|
||||||
|
{* capitalize the first letters of each word of the title *}
|
||||||
|
Title: {#title#|capitalize}
|
||||||
|
{if #bold#}</b>{/if}
|
||||||
|
|
||||||
|
The current date and time is {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
|
||||||
|
|
||||||
|
The value of global assigned variable $SCRIPT_NAME is {$SCRIPT_NAME}
|
||||||
|
|
||||||
|
Example of accessing server environment variable SERVER_NAME: {$smarty.server.SERVER_NAME}
|
||||||
|
|
||||||
|
The value of {ldelim}$Name{rdelim} is <b>{$Name}</b>
|
||||||
|
|
||||||
|
variable modifier example of {ldelim}$Name|upper{rdelim}
|
||||||
|
|
||||||
|
<b>{$Name|upper}</b>
|
||||||
|
|
||||||
|
|
||||||
|
An example of a section loop:
|
||||||
|
|
||||||
|
{section name=outer
|
||||||
|
loop=$FirstName}
|
||||||
|
{if $smarty.section.outer.index is odd by 2}
|
||||||
|
{$smarty.section.outer.rownum} . {$FirstName[outer]} {$LastName[outer]}
|
||||||
|
{else}
|
||||||
|
{$smarty.section.outer.rownum} * {$FirstName[outer]} {$LastName[outer]}
|
||||||
|
{/if}
|
||||||
|
{sectionelse}
|
||||||
|
none
|
||||||
|
{/section}
|
||||||
|
|
||||||
|
An example of section looped key values:
|
||||||
|
|
||||||
|
{section name=sec1 loop=$contacts}
|
||||||
|
phone: {$contacts[sec1].phone}
|
||||||
|
<br>
|
||||||
|
|
||||||
|
fax: {$contacts[sec1].fax}
|
||||||
|
<br>
|
||||||
|
|
||||||
|
cell: {$contacts[sec1].cell}
|
||||||
|
<br>
|
||||||
|
{/section}
|
||||||
|
<p>
|
||||||
|
|
||||||
|
testing strip tags
|
||||||
|
{strip}
|
||||||
|
<table border=0>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<A HREF="{$SCRIPT_NAME}">
|
||||||
|
<font color="red">This is a test </font>
|
||||||
|
</A>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
{/strip}
|
||||||
|
|
||||||
|
</PRE>
|
||||||
|
|
||||||
|
This is an example of the html_select_date function:
|
||||||
|
|
||||||
|
<form>
|
||||||
|
{html_select_date start_year=1998 end_year=2010}
|
||||||
|
</form>
|
||||||
|
|
||||||
|
This is an example of the html_select_time function:
|
||||||
|
|
||||||
|
<form>
|
||||||
|
{html_select_time use_24_hours=false}
|
||||||
|
</form>
|
||||||
|
|
||||||
|
This is an example of the html_options function:
|
||||||
|
|
||||||
|
<form>
|
||||||
|
<select name=states>
|
||||||
|
{html_options values=$option_values selected=$option_selected output=$option_output}
|
||||||
|
</select>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{include file="footer.tpl"}
|
||||||
@@ -2,22 +2,18 @@
|
|||||||
/**
|
/**
|
||||||
* Project: Smarty: the PHP compiling template engine
|
* Project: Smarty: the PHP compiling template engine
|
||||||
* File: Smarty.class.php
|
* File: Smarty.class.php
|
||||||
* SVN: $Id: Smarty.class.php 4778 2013-09-17 20:44:41Z Uwe.Tews@googlemail.com $
|
* SVN: $Id: Smarty.class.php 4897 2014-10-14 22:29:58Z Uwe.Tews@googlemail.com $
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* Lesser General Public License for more details.
|
* Lesser General Public License for more details.
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*
|
|
||||||
* For questions, help, comments, discussion, etc., please join the
|
* For questions, help, comments, discussion, etc., please join the
|
||||||
* Smarty mailing list. Send a blank e-mail to
|
* Smarty mailing list. Send a blank e-mail to
|
||||||
* smarty-discussion-subscribe@googlegroups.com
|
* smarty-discussion-subscribe@googlegroups.com
|
||||||
@@ -28,7 +24,7 @@
|
|||||||
* @author Uwe Tews
|
* @author Uwe Tews
|
||||||
* @author Rodney Rehm
|
* @author Rodney Rehm
|
||||||
* @package Smarty
|
* @package Smarty
|
||||||
* @version 3.1.15
|
* @version 3.1.21
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -102,6 +98,7 @@ include_once SMARTY_SYSPLUGINS_DIR.'smarty_internal_cacheresource_file.php';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the main Smarty class
|
* This is the main Smarty class
|
||||||
|
*
|
||||||
* @package Smarty
|
* @package Smarty
|
||||||
*/
|
*/
|
||||||
class Smarty extends Smarty_Internal_TemplateBase
|
class Smarty extends Smarty_Internal_TemplateBase
|
||||||
@@ -113,7 +110,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
/**
|
/**
|
||||||
* smarty version
|
* smarty version
|
||||||
*/
|
*/
|
||||||
const SMARTY_VERSION = 'Smarty-3.1.15';
|
const SMARTY_VERSION = 'Smarty-3.1.21-dev';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* define variable scopes
|
* define variable scopes
|
||||||
@@ -206,106 +203,133 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* auto literal on delimiters with whitspace
|
* auto literal on delimiters with whitspace
|
||||||
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $auto_literal = true;
|
public $auto_literal = true;
|
||||||
/**
|
/**
|
||||||
* display error on not assigned variables
|
* display error on not assigned variables
|
||||||
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $error_unassigned = false;
|
public $error_unassigned = false;
|
||||||
/**
|
/**
|
||||||
* look up relative filepaths in include_path
|
* look up relative filepaths in include_path
|
||||||
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $use_include_path = false;
|
public $use_include_path = false;
|
||||||
/**
|
/**
|
||||||
* template directory
|
* template directory
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
private $template_dir = array();
|
private $template_dir = array();
|
||||||
/**
|
/**
|
||||||
* joined template directory string used in cache keys
|
* joined template directory string used in cache keys
|
||||||
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $joined_template_dir = null;
|
public $joined_template_dir = null;
|
||||||
/**
|
/**
|
||||||
* joined config directory string used in cache keys
|
* joined config directory string used in cache keys
|
||||||
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $joined_config_dir = null;
|
public $joined_config_dir = null;
|
||||||
/**
|
/**
|
||||||
* default template handler
|
* default template handler
|
||||||
|
*
|
||||||
* @var callable
|
* @var callable
|
||||||
*/
|
*/
|
||||||
public $default_template_handler_func = null;
|
public $default_template_handler_func = null;
|
||||||
/**
|
/**
|
||||||
* default config handler
|
* default config handler
|
||||||
|
*
|
||||||
* @var callable
|
* @var callable
|
||||||
*/
|
*/
|
||||||
public $default_config_handler_func = null;
|
public $default_config_handler_func = null;
|
||||||
/**
|
/**
|
||||||
* default plugin handler
|
* default plugin handler
|
||||||
|
*
|
||||||
* @var callable
|
* @var callable
|
||||||
*/
|
*/
|
||||||
public $default_plugin_handler_func = null;
|
public $default_plugin_handler_func = null;
|
||||||
/**
|
/**
|
||||||
* compile directory
|
* compile directory
|
||||||
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $compile_dir = null;
|
private $compile_dir = null;
|
||||||
/**
|
/**
|
||||||
* plugins directory
|
* plugins directory
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
private $plugins_dir = array();
|
private $plugins_dir = array();
|
||||||
/**
|
/**
|
||||||
* cache directory
|
* cache directory
|
||||||
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $cache_dir = null;
|
private $cache_dir = null;
|
||||||
/**
|
/**
|
||||||
* config directory
|
* config directory
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
private $config_dir = array();
|
private $config_dir = array();
|
||||||
/**
|
/**
|
||||||
* force template compiling?
|
* force template compiling?
|
||||||
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $force_compile = false;
|
public $force_compile = false;
|
||||||
/**
|
/**
|
||||||
* check template for modifications?
|
* check template for modifications?
|
||||||
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $compile_check = true;
|
public $compile_check = true;
|
||||||
/**
|
/**
|
||||||
* use sub dirs for compiled/cached files?
|
* use sub dirs for compiled/cached files?
|
||||||
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $use_sub_dirs = false;
|
public $use_sub_dirs = false;
|
||||||
/**
|
/**
|
||||||
* allow ambiguous resources (that are made unique by the resource handler)
|
* allow ambiguous resources (that are made unique by the resource handler)
|
||||||
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $allow_ambiguous_resources = false;
|
public $allow_ambiguous_resources = false;
|
||||||
/**
|
/**
|
||||||
* caching enabled
|
* caching enabled
|
||||||
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $caching = false;
|
public $caching = false;
|
||||||
/**
|
/**
|
||||||
* merge compiled includes
|
* merge compiled includes
|
||||||
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $merge_compiled_includes = false;
|
public $merge_compiled_includes = false;
|
||||||
|
/**
|
||||||
|
* template inheritance merge compiled includes
|
||||||
|
*
|
||||||
|
* @var boolean
|
||||||
|
*/
|
||||||
|
public $inheritance_merge_compiled_includes = true;
|
||||||
/**
|
/**
|
||||||
* cache lifetime in seconds
|
* cache lifetime in seconds
|
||||||
|
*
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
public $cache_lifetime = 3600;
|
public $cache_lifetime = 3600;
|
||||||
/**
|
/**
|
||||||
* force cache file creation
|
* force cache file creation
|
||||||
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $force_cache = false;
|
public $force_cache = false;
|
||||||
@@ -325,11 +349,13 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
public $compile_id = null;
|
public $compile_id = null;
|
||||||
/**
|
/**
|
||||||
* template left-delimiter
|
* template left-delimiter
|
||||||
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $left_delimiter = "{";
|
public $left_delimiter = "{";
|
||||||
/**
|
/**
|
||||||
* template right-delimiter
|
* template right-delimiter
|
||||||
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $right_delimiter = "}";
|
public $right_delimiter = "}";
|
||||||
@@ -338,7 +364,6 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* class name
|
* class name
|
||||||
*
|
|
||||||
* This should be instance of Smarty_Security.
|
* This should be instance of Smarty_Security.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
@@ -365,7 +390,6 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
public $allow_php_templates = false;
|
public $allow_php_templates = false;
|
||||||
/**
|
/**
|
||||||
* Should compiled-templates be prevented from being called directly?
|
* Should compiled-templates be prevented from being called directly?
|
||||||
*
|
|
||||||
* {@internal
|
* {@internal
|
||||||
* Currently used by Smarty_Internal_Template only.
|
* Currently used by Smarty_Internal_Template only.
|
||||||
* }}
|
* }}
|
||||||
@@ -376,7 +400,6 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
/**#@-*/
|
/**#@-*/
|
||||||
/**
|
/**
|
||||||
* debug mode
|
* debug mode
|
||||||
*
|
|
||||||
* Setting this to true enables the debug-console.
|
* Setting this to true enables the debug-console.
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
@@ -388,12 +411,12 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* <li>NONE => no debugging control allowed</li>
|
* <li>NONE => no debugging control allowed</li>
|
||||||
* <li>URL => enable debugging when SMARTY_DEBUG is found in the URL.</li>
|
* <li>URL => enable debugging when SMARTY_DEBUG is found in the URL.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $debugging_ctrl = 'NONE';
|
public $debugging_ctrl = 'NONE';
|
||||||
/**
|
/**
|
||||||
* Name of debugging URL-param.
|
* Name of debugging URL-param.
|
||||||
*
|
|
||||||
* Only used when $debugging_ctrl is set to 'URL'.
|
* Only used when $debugging_ctrl is set to 'URL'.
|
||||||
* The name of the URL-parameter that activates debugging.
|
* The name of the URL-parameter that activates debugging.
|
||||||
*
|
*
|
||||||
@@ -402,16 +425,19 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
public $smarty_debug_id = 'SMARTY_DEBUG';
|
public $smarty_debug_id = 'SMARTY_DEBUG';
|
||||||
/**
|
/**
|
||||||
* Path of debug template.
|
* Path of debug template.
|
||||||
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $debug_tpl = null;
|
public $debug_tpl = null;
|
||||||
/**
|
/**
|
||||||
* When set, smarty uses this value as error_reporting-level.
|
* When set, smarty uses this value as error_reporting-level.
|
||||||
|
*
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
public $error_reporting = null;
|
public $error_reporting = null;
|
||||||
/**
|
/**
|
||||||
* Internal flag for getTags()
|
* Internal flag for getTags()
|
||||||
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $get_used_tags = false;
|
public $get_used_tags = false;
|
||||||
@@ -422,16 +448,19 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Controls whether variables with the same name overwrite each other.
|
* Controls whether variables with the same name overwrite each other.
|
||||||
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $config_overwrite = true;
|
public $config_overwrite = true;
|
||||||
/**
|
/**
|
||||||
* Controls whether config values of on/true/yes and off/false/no get converted to boolean.
|
* Controls whether config values of on/true/yes and off/false/no get converted to boolean.
|
||||||
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $config_booleanize = true;
|
public $config_booleanize = true;
|
||||||
/**
|
/**
|
||||||
* Controls whether hidden config sections/vars are read from the file.
|
* Controls whether hidden config sections/vars are read from the file.
|
||||||
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $config_read_hidden = false;
|
public $config_read_hidden = false;
|
||||||
@@ -444,16 +473,19 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* locking concurrent compiles
|
* locking concurrent compiles
|
||||||
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $compile_locking = true;
|
public $compile_locking = true;
|
||||||
/**
|
/**
|
||||||
* Controls whether cache resources should emply locking mechanism
|
* Controls whether cache resources should emply locking mechanism
|
||||||
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $cache_locking = false;
|
public $cache_locking = false;
|
||||||
/**
|
/**
|
||||||
* seconds to wait for acquiring a lock before ignoring the write lock
|
* seconds to wait for acquiring a lock before ignoring the write lock
|
||||||
|
*
|
||||||
* @var float
|
* @var float
|
||||||
*/
|
*/
|
||||||
public $locking_timeout = 10;
|
public $locking_timeout = 10;
|
||||||
@@ -462,19 +494,19 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* global template functions
|
* global template functions
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $template_functions = array();
|
public $template_functions = array();
|
||||||
/**
|
/**
|
||||||
* resource type used if none given
|
* resource type used if none given
|
||||||
*
|
|
||||||
* Must be an valid key of $registered_resources.
|
* Must be an valid key of $registered_resources.
|
||||||
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $default_resource_type = 'file';
|
public $default_resource_type = 'file';
|
||||||
/**
|
/**
|
||||||
* caching type
|
* caching type
|
||||||
*
|
|
||||||
* Must be an element of $cache_resource_types.
|
* Must be an element of $cache_resource_types.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
@@ -482,121 +514,145 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
public $caching_type = 'file';
|
public $caching_type = 'file';
|
||||||
/**
|
/**
|
||||||
* internal config properties
|
* internal config properties
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $properties = array();
|
public $properties = array();
|
||||||
/**
|
/**
|
||||||
* config type
|
* config type
|
||||||
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $default_config_type = 'file';
|
public $default_config_type = 'file';
|
||||||
/**
|
/**
|
||||||
* cached template objects
|
* cached template objects
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $template_objects = array();
|
public $template_objects = array();
|
||||||
/**
|
/**
|
||||||
* check If-Modified-Since headers
|
* check If-Modified-Since headers
|
||||||
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $cache_modified_check = false;
|
public $cache_modified_check = false;
|
||||||
/**
|
/**
|
||||||
* registered plugins
|
* registered plugins
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $registered_plugins = array();
|
public $registered_plugins = array();
|
||||||
/**
|
/**
|
||||||
* plugin search order
|
* plugin search order
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $plugin_search_order = array('function', 'block', 'compiler', 'class');
|
public $plugin_search_order = array('function', 'block', 'compiler', 'class');
|
||||||
/**
|
/**
|
||||||
* registered objects
|
* registered objects
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $registered_objects = array();
|
public $registered_objects = array();
|
||||||
/**
|
/**
|
||||||
* registered classes
|
* registered classes
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $registered_classes = array();
|
public $registered_classes = array();
|
||||||
/**
|
/**
|
||||||
* registered filters
|
* registered filters
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $registered_filters = array();
|
public $registered_filters = array();
|
||||||
/**
|
/**
|
||||||
* registered resources
|
* registered resources
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $registered_resources = array();
|
public $registered_resources = array();
|
||||||
/**
|
/**
|
||||||
* resource handler cache
|
* resource handler cache
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $_resource_handlers = array();
|
public $_resource_handlers = array();
|
||||||
/**
|
/**
|
||||||
* registered cache resources
|
* registered cache resources
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $registered_cache_resources = array();
|
public $registered_cache_resources = array();
|
||||||
/**
|
/**
|
||||||
* cache resource handler cache
|
* cache resource handler cache
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $_cacheresource_handlers = array();
|
public $_cacheresource_handlers = array();
|
||||||
/**
|
/**
|
||||||
* autoload filter
|
* autoload filter
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $autoload_filters = array();
|
public $autoload_filters = array();
|
||||||
/**
|
/**
|
||||||
* default modifier
|
* default modifier
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $default_modifiers = array();
|
public $default_modifiers = array();
|
||||||
/**
|
/**
|
||||||
* autoescape variable output
|
* autoescape variable output
|
||||||
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $escape_html = false;
|
public $escape_html = false;
|
||||||
/**
|
/**
|
||||||
* global internal smarty vars
|
* global internal smarty vars
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public static $_smarty_vars = array();
|
public static $_smarty_vars = array();
|
||||||
/**
|
/**
|
||||||
* start time for execution time calculation
|
* start time for execution time calculation
|
||||||
|
*
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
public $start_time = 0;
|
public $start_time = 0;
|
||||||
/**
|
/**
|
||||||
* default file permissions
|
* default file permissions
|
||||||
|
*
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
public $_file_perms = 0644;
|
public $_file_perms = 0644;
|
||||||
/**
|
/**
|
||||||
* default dir permissions
|
* default dir permissions
|
||||||
|
*
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
public $_dir_perms = 0771;
|
public $_dir_perms = 0771;
|
||||||
/**
|
/**
|
||||||
* block tag hierarchy
|
* block tag hierarchy
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $_tag_stack = array();
|
public $_tag_stack = array();
|
||||||
/**
|
/**
|
||||||
* self pointer to Smarty object
|
* self pointer to Smarty object
|
||||||
|
*
|
||||||
* @var Smarty
|
* @var Smarty
|
||||||
*/
|
*/
|
||||||
public $smarty;
|
public $smarty;
|
||||||
/**
|
/**
|
||||||
* required by the compiler for BC
|
* required by the compiler for BC
|
||||||
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $_current_file = null;
|
public $_current_file = null;
|
||||||
/**
|
/**
|
||||||
* internal flag to enable parser debugging
|
* internal flag to enable parser debugging
|
||||||
|
*
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
public $_parserdebug = false;
|
public $_parserdebug = false;
|
||||||
@@ -606,11 +662,19 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $merged_templates_func = array();
|
public $merged_templates_func = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cache of is_file results of loadPlugin()
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
public static $_is_file_cache= array();
|
||||||
|
|
||||||
/**#@-*/
|
/**#@-*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize new Smarty object
|
* Initialize new Smarty object
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@@ -651,11 +715,11 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* <<magic>> Generic getter.
|
* <<magic>> Generic getter.
|
||||||
*
|
|
||||||
* Calls the appropriate getter function.
|
* Calls the appropriate getter function.
|
||||||
* Issues an E_USER_NOTICE if no valid getter is found.
|
* Issues an E_USER_NOTICE if no valid getter is found.
|
||||||
*
|
*
|
||||||
* @param string $name property name
|
* @param string $name property name
|
||||||
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function __get($name)
|
public function __get($name)
|
||||||
@@ -677,7 +741,6 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* <<magic>> Generic setter.
|
* <<magic>> Generic setter.
|
||||||
*
|
|
||||||
* Calls the appropriate setter function.
|
* Calls the appropriate setter function.
|
||||||
* Issues an E_USER_NOTICE if no valid setter is found.
|
* Issues an E_USER_NOTICE if no valid setter is found.
|
||||||
*
|
*
|
||||||
@@ -705,6 +768,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* Check if a template resource exists
|
* Check if a template resource exists
|
||||||
*
|
*
|
||||||
* @param string $resource_name template name
|
* @param string $resource_name template name
|
||||||
|
*
|
||||||
* @return boolean status
|
* @return boolean status
|
||||||
*/
|
*/
|
||||||
public function templateExists($resource_name)
|
public function templateExists($resource_name)
|
||||||
@@ -722,8 +786,8 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
/**
|
/**
|
||||||
* Returns a single or all global variables
|
* Returns a single or all global variables
|
||||||
*
|
*
|
||||||
* @param object $smarty
|
|
||||||
* @param string $varname variable name or null
|
* @param string $varname variable name or null
|
||||||
|
*
|
||||||
* @return string variable value or or array of variables
|
* @return string variable value or or array of variables
|
||||||
*/
|
*/
|
||||||
public function getGlobal($varname = null)
|
public function getGlobal($varname = null)
|
||||||
@@ -749,6 +813,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
*
|
*
|
||||||
* @param integer $exp_time expiration time
|
* @param integer $exp_time expiration time
|
||||||
* @param string $type resource type
|
* @param string $type resource type
|
||||||
|
*
|
||||||
* @return integer number of cache files deleted
|
* @return integer number of cache files deleted
|
||||||
*/
|
*/
|
||||||
public function clearAllCache($exp_time = null, $type = null)
|
public function clearAllCache($exp_time = null, $type = null)
|
||||||
@@ -768,6 +833,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* @param string $compile_id compile id
|
* @param string $compile_id compile id
|
||||||
* @param integer $exp_time expiration time
|
* @param integer $exp_time expiration time
|
||||||
* @param string $type resource type
|
* @param string $type resource type
|
||||||
|
*
|
||||||
* @return integer number of cache files deleted
|
* @return integer number of cache files deleted
|
||||||
*/
|
*/
|
||||||
public function clearCache($template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null)
|
public function clearCache($template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null)
|
||||||
@@ -783,6 +849,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* Loads security class and enables security
|
* Loads security class and enables security
|
||||||
*
|
*
|
||||||
* @param string|Smarty_Security $security_class if a string is used, it must be class-name
|
* @param string|Smarty_Security $security_class if a string is used, it must be class-name
|
||||||
|
*
|
||||||
* @return Smarty current Smarty instance for chaining
|
* @return Smarty current Smarty instance for chaining
|
||||||
* @throws SmartyException when an invalid class name is provided
|
* @throws SmartyException when an invalid class name is provided
|
||||||
*/
|
*/
|
||||||
@@ -811,6 +878,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Disable security
|
* Disable security
|
||||||
|
*
|
||||||
* @return Smarty current Smarty instance for chaining
|
* @return Smarty current Smarty instance for chaining
|
||||||
*/
|
*/
|
||||||
public function disableSecurity()
|
public function disableSecurity()
|
||||||
@@ -824,13 +892,14 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* Set template directory
|
* Set template directory
|
||||||
*
|
*
|
||||||
* @param string|array $template_dir directory(s) of template sources
|
* @param string|array $template_dir directory(s) of template sources
|
||||||
|
*
|
||||||
* @return Smarty current Smarty instance for chaining
|
* @return Smarty current Smarty instance for chaining
|
||||||
*/
|
*/
|
||||||
public function setTemplateDir($template_dir)
|
public function setTemplateDir($template_dir)
|
||||||
{
|
{
|
||||||
$this->template_dir = array();
|
$this->template_dir = array();
|
||||||
foreach ((array) $template_dir as $k => $v) {
|
foreach ((array) $template_dir as $k => $v) {
|
||||||
$this->template_dir[$k] = rtrim($v, '/\\') . DS;
|
$this->template_dir[$k] = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->joined_template_dir = join(DIRECTORY_SEPARATOR, $this->template_dir);
|
$this->joined_template_dir = join(DIRECTORY_SEPARATOR, $this->template_dir);
|
||||||
@@ -843,6 +912,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
*
|
*
|
||||||
* @param string|array $template_dir directory(s) of template sources
|
* @param string|array $template_dir directory(s) of template sources
|
||||||
* @param string $key of the array element to assign the template dir to
|
* @param string $key of the array element to assign the template dir to
|
||||||
|
*
|
||||||
* @return Smarty current Smarty instance for chaining
|
* @return Smarty current Smarty instance for chaining
|
||||||
* @throws SmartyException when the given template directory is not valid
|
* @throws SmartyException when the given template directory is not valid
|
||||||
*/
|
*/
|
||||||
@@ -853,20 +923,24 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
|
|
||||||
if (is_array($template_dir)) {
|
if (is_array($template_dir)) {
|
||||||
foreach ($template_dir as $k => $v) {
|
foreach ($template_dir as $k => $v) {
|
||||||
|
$v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS;
|
||||||
if (is_int($k)) {
|
if (is_int($k)) {
|
||||||
// indexes are not merged but appended
|
// indexes are not merged but appended
|
||||||
$this->template_dir[] = rtrim($v, '/\\') . DS;
|
$this->template_dir[] = $v;
|
||||||
} else {
|
} else {
|
||||||
// string indexes are overridden
|
// string indexes are overridden
|
||||||
$this->template_dir[$k] = rtrim($v, '/\\') . DS;
|
$this->template_dir[$k] = $v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ($key !== null) {
|
} else {
|
||||||
|
$v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($template_dir, '/\\')) . DS;
|
||||||
|
if ($key !== null) {
|
||||||
// override directory at specified index
|
// override directory at specified index
|
||||||
$this->template_dir[$key] = rtrim($template_dir, '/\\') . DS;
|
$this->template_dir[$key] = $v;
|
||||||
} else {
|
} else {
|
||||||
// append new directory
|
// append new directory
|
||||||
$this->template_dir[] = rtrim($template_dir, '/\\') . DS;
|
$this->template_dir[] = $v;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$this->joined_template_dir = join(DIRECTORY_SEPARATOR, $this->template_dir);
|
$this->joined_template_dir = join(DIRECTORY_SEPARATOR, $this->template_dir);
|
||||||
|
|
||||||
@@ -876,7 +950,8 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
/**
|
/**
|
||||||
* Get template directories
|
* Get template directories
|
||||||
*
|
*
|
||||||
* @param mixed index of directory to get, null to get all
|
* @param mixed $index index of directory to get, null to get all
|
||||||
|
*
|
||||||
* @return array|string list of template directories, or directory of $index
|
* @return array|string list of template directories, or directory of $index
|
||||||
*/
|
*/
|
||||||
public function getTemplateDir($index = null)
|
public function getTemplateDir($index = null)
|
||||||
@@ -891,14 +966,15 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
/**
|
/**
|
||||||
* Set config directory
|
* Set config directory
|
||||||
*
|
*
|
||||||
* @param string|array $template_dir directory(s) of configuration sources
|
* @param $config_dir
|
||||||
|
*
|
||||||
* @return Smarty current Smarty instance for chaining
|
* @return Smarty current Smarty instance for chaining
|
||||||
*/
|
*/
|
||||||
public function setConfigDir($config_dir)
|
public function setConfigDir($config_dir)
|
||||||
{
|
{
|
||||||
$this->config_dir = array();
|
$this->config_dir = array();
|
||||||
foreach ((array) $config_dir as $k => $v) {
|
foreach ((array) $config_dir as $k => $v) {
|
||||||
$this->config_dir[$k] = rtrim($v, '/\\') . DS;
|
$this->config_dir[$k] = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->joined_config_dir = join(DIRECTORY_SEPARATOR, $this->config_dir);
|
$this->joined_config_dir = join(DIRECTORY_SEPARATOR, $this->config_dir);
|
||||||
@@ -910,7 +986,8 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* Add config directory(s)
|
* Add config directory(s)
|
||||||
*
|
*
|
||||||
* @param string|array $config_dir directory(s) of config sources
|
* @param string|array $config_dir directory(s) of config sources
|
||||||
* @param string key of the array element to assign the config dir to
|
* @param mixed $key key of the array element to assign the config dir to
|
||||||
|
*
|
||||||
* @return Smarty current Smarty instance for chaining
|
* @return Smarty current Smarty instance for chaining
|
||||||
*/
|
*/
|
||||||
public function addConfigDir($config_dir, $key = null)
|
public function addConfigDir($config_dir, $key = null)
|
||||||
@@ -920,20 +997,24 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
|
|
||||||
if (is_array($config_dir)) {
|
if (is_array($config_dir)) {
|
||||||
foreach ($config_dir as $k => $v) {
|
foreach ($config_dir as $k => $v) {
|
||||||
|
$v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($v, '/\\')) . DS;
|
||||||
if (is_int($k)) {
|
if (is_int($k)) {
|
||||||
// indexes are not merged but appended
|
// indexes are not merged but appended
|
||||||
$this->config_dir[] = rtrim($v, '/\\') . DS;
|
$this->config_dir[] = $v;
|
||||||
} else {
|
} else {
|
||||||
// string indexes are overridden
|
// string indexes are overridden
|
||||||
$this->config_dir[$k] = rtrim($v, '/\\') . DS;
|
$this->config_dir[$k] = $v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ($key !== null) {
|
} else {
|
||||||
|
$v = preg_replace('#(\w+)(/|\\\\){1,}#', '$1$2', rtrim($config_dir, '/\\')) . DS;
|
||||||
|
if ($key !== null) {
|
||||||
// override directory at specified index
|
// override directory at specified index
|
||||||
$this->config_dir[$key] = rtrim($config_dir, '/\\') . DS;
|
$this->config_dir[$key] = rtrim($v, '/\\') . DS;
|
||||||
} else {
|
} else {
|
||||||
// append new directory
|
// append new directory
|
||||||
$this->config_dir[] = rtrim($config_dir, '/\\') . DS;
|
$this->config_dir[] = rtrim($v, '/\\') . DS;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->joined_config_dir = join(DIRECTORY_SEPARATOR, $this->config_dir);
|
$this->joined_config_dir = join(DIRECTORY_SEPARATOR, $this->config_dir);
|
||||||
@@ -944,7 +1025,8 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
/**
|
/**
|
||||||
* Get config directory
|
* Get config directory
|
||||||
*
|
*
|
||||||
* @param mixed index of directory to get, null to get all
|
* @param mixed $index index of directory to get, null to get all
|
||||||
|
*
|
||||||
* @return array|string configuration directory
|
* @return array|string configuration directory
|
||||||
*/
|
*/
|
||||||
public function getConfigDir($index = null)
|
public function getConfigDir($index = null)
|
||||||
@@ -960,6 +1042,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* Set plugins directory
|
* Set plugins directory
|
||||||
*
|
*
|
||||||
* @param string|array $plugins_dir directory(s) of plugins
|
* @param string|array $plugins_dir directory(s) of plugins
|
||||||
|
*
|
||||||
* @return Smarty current Smarty instance for chaining
|
* @return Smarty current Smarty instance for chaining
|
||||||
*/
|
*/
|
||||||
public function setPluginsDir($plugins_dir)
|
public function setPluginsDir($plugins_dir)
|
||||||
@@ -975,8 +1058,8 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
/**
|
/**
|
||||||
* Adds directory of plugin files
|
* Adds directory of plugin files
|
||||||
*
|
*
|
||||||
* @param object $smarty
|
* @param $plugins_dir
|
||||||
* @param string $ |array $ plugins folder
|
*
|
||||||
* @return Smarty current Smarty instance for chaining
|
* @return Smarty current Smarty instance for chaining
|
||||||
*/
|
*/
|
||||||
public function addPluginsDir($plugins_dir)
|
public function addPluginsDir($plugins_dir)
|
||||||
@@ -1018,6 +1101,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* Set compile directory
|
* Set compile directory
|
||||||
*
|
*
|
||||||
* @param string $compile_dir directory to store compiled templates in
|
* @param string $compile_dir directory to store compiled templates in
|
||||||
|
*
|
||||||
* @return Smarty current Smarty instance for chaining
|
* @return Smarty current Smarty instance for chaining
|
||||||
*/
|
*/
|
||||||
public function setCompileDir($compile_dir)
|
public function setCompileDir($compile_dir)
|
||||||
@@ -1044,6 +1128,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* Set cache directory
|
* Set cache directory
|
||||||
*
|
*
|
||||||
* @param string $cache_dir directory to store cached templates in
|
* @param string $cache_dir directory to store cached templates in
|
||||||
|
*
|
||||||
* @return Smarty current Smarty instance for chaining
|
* @return Smarty current Smarty instance for chaining
|
||||||
*/
|
*/
|
||||||
public function setCacheDir($cache_dir)
|
public function setCacheDir($cache_dir)
|
||||||
@@ -1070,6 +1155,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* Set default modifiers
|
* Set default modifiers
|
||||||
*
|
*
|
||||||
* @param array|string $modifiers modifier or list of modifiers to set
|
* @param array|string $modifiers modifier or list of modifiers to set
|
||||||
|
*
|
||||||
* @return Smarty current Smarty instance for chaining
|
* @return Smarty current Smarty instance for chaining
|
||||||
*/
|
*/
|
||||||
public function setDefaultModifiers($modifiers)
|
public function setDefaultModifiers($modifiers)
|
||||||
@@ -1083,6 +1169,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* Add default modifiers
|
* Add default modifiers
|
||||||
*
|
*
|
||||||
* @param array|string $modifiers modifier or list of modifiers to add
|
* @param array|string $modifiers modifier or list of modifiers to add
|
||||||
|
*
|
||||||
* @return Smarty current Smarty instance for chaining
|
* @return Smarty current Smarty instance for chaining
|
||||||
*/
|
*/
|
||||||
public function addDefaultModifiers($modifiers)
|
public function addDefaultModifiers($modifiers)
|
||||||
@@ -1106,12 +1193,12 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
return $this->default_modifiers;
|
return $this->default_modifiers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set autoload filters
|
* Set autoload filters
|
||||||
*
|
*
|
||||||
* @param array $filters filters to load automatically
|
* @param array $filters filters to load automatically
|
||||||
* @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types
|
* @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types
|
||||||
|
*
|
||||||
* @return Smarty current Smarty instance for chaining
|
* @return Smarty current Smarty instance for chaining
|
||||||
*/
|
*/
|
||||||
public function setAutoloadFilters($filters, $type = null)
|
public function setAutoloadFilters($filters, $type = null)
|
||||||
@@ -1130,6 +1217,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
*
|
*
|
||||||
* @param array $filters filters to load automatically
|
* @param array $filters filters to load automatically
|
||||||
* @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types
|
* @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' keys as the appropriate types
|
||||||
|
*
|
||||||
* @return Smarty current Smarty instance for chaining
|
* @return Smarty current Smarty instance for chaining
|
||||||
*/
|
*/
|
||||||
public function addAutoloadFilters($filters, $type = null)
|
public function addAutoloadFilters($filters, $type = null)
|
||||||
@@ -1157,6 +1245,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* Get autoload filters
|
* Get autoload filters
|
||||||
*
|
*
|
||||||
* @param string $type type of filter to get autoloads for. Defaults to all autoload filters
|
* @param string $type type of filter to get autoloads for. Defaults to all autoload filters
|
||||||
|
*
|
||||||
* @return array array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type was specified
|
* @return array array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type was specified
|
||||||
*/
|
*/
|
||||||
public function getAutoloadFilters($type = null)
|
public function getAutoloadFilters($type = null)
|
||||||
@@ -1182,6 +1271,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* set the debug template
|
* set the debug template
|
||||||
*
|
*
|
||||||
* @param string $tpl_name
|
* @param string $tpl_name
|
||||||
|
*
|
||||||
* @return Smarty current Smarty instance for chaining
|
* @return Smarty current Smarty instance for chaining
|
||||||
* @throws SmartyException if file is not readable
|
* @throws SmartyException if file is not readable
|
||||||
*/
|
*/
|
||||||
@@ -1203,15 +1293,16 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* @param mixed $compile_id compile id to be used with this template
|
* @param mixed $compile_id compile id to be used with this template
|
||||||
* @param object $parent next higher level of Smarty variables
|
* @param object $parent next higher level of Smarty variables
|
||||||
* @param boolean $do_clone flag is Smarty object shall be cloned
|
* @param boolean $do_clone flag is Smarty object shall be cloned
|
||||||
|
*
|
||||||
* @return object template object
|
* @return object template object
|
||||||
*/
|
*/
|
||||||
public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true)
|
public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true)
|
||||||
{
|
{
|
||||||
if (!empty($cache_id) && (is_object($cache_id) || is_array($cache_id))) {
|
if ($cache_id !== null && (is_object($cache_id) || is_array($cache_id))) {
|
||||||
$parent = $cache_id;
|
$parent = $cache_id;
|
||||||
$cache_id = null;
|
$cache_id = null;
|
||||||
}
|
}
|
||||||
if (!empty($parent) && is_array($parent)) {
|
if ($parent !== null && is_array($parent)) {
|
||||||
$data = $parent;
|
$data = $parent;
|
||||||
$parent = null;
|
$parent = null;
|
||||||
} else {
|
} else {
|
||||||
@@ -1262,7 +1353,6 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
return $tpl;
|
return $tpl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Takes unknown classes and loads plugin files for them
|
* Takes unknown classes and loads plugin files for them
|
||||||
* class name format: Smarty_PluginType_PluginName
|
* class name format: Smarty_PluginType_PluginName
|
||||||
@@ -1270,6 +1360,8 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
*
|
*
|
||||||
* @param string $plugin_name class plugin name to load
|
* @param string $plugin_name class plugin name to load
|
||||||
* @param bool $check check if already loaded
|
* @param bool $check check if already loaded
|
||||||
|
*
|
||||||
|
* @throws SmartyException
|
||||||
* @return string |boolean filepath of loaded file or false
|
* @return string |boolean filepath of loaded file or false
|
||||||
*/
|
*/
|
||||||
public function loadPlugin($plugin_name, $check = true)
|
public function loadPlugin($plugin_name, $check = true)
|
||||||
@@ -1284,15 +1376,12 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
// count($_name_parts) < 3 === !isset($_name_parts[2])
|
// count($_name_parts) < 3 === !isset($_name_parts[2])
|
||||||
if (!isset($_name_parts[2]) || strtolower($_name_parts[0]) !== 'smarty') {
|
if (!isset($_name_parts[2]) || strtolower($_name_parts[0]) !== 'smarty') {
|
||||||
throw new SmartyException("plugin {$plugin_name} is not a valid name format");
|
throw new SmartyException("plugin {$plugin_name} is not a valid name format");
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
// if type is "internal", get plugin from sysplugins
|
// if type is "internal", get plugin from sysplugins
|
||||||
if (strtolower($_name_parts[1]) == 'internal') {
|
if (strtolower($_name_parts[1]) == 'internal') {
|
||||||
$file = SMARTY_SYSPLUGINS_DIR . strtolower($plugin_name) . '.php';
|
$file = SMARTY_SYSPLUGINS_DIR . strtolower($plugin_name) . '.php';
|
||||||
if (file_exists($file)) {
|
if (isset(self::$_is_file_cache[$file]) ? self::$_is_file_cache[$file] : self::$_is_file_cache[$file] = is_file($file)) {
|
||||||
require_once($file);
|
require_once($file);
|
||||||
|
|
||||||
return $file;
|
return $file;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -1310,9 +1399,8 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
$_plugin_dir . strtolower($_plugin_filename),
|
$_plugin_dir . strtolower($_plugin_filename),
|
||||||
);
|
);
|
||||||
foreach ($names as $file) {
|
foreach ($names as $file) {
|
||||||
if (file_exists($file)) {
|
if (isset(self::$_is_file_cache[$file]) ? self::$_is_file_cache[$file] : self::$_is_file_cache[$file] = is_file($file)) {
|
||||||
require_once($file);
|
require_once($file);
|
||||||
|
|
||||||
return $file;
|
return $file;
|
||||||
}
|
}
|
||||||
if ($this->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_plugin_dir)) {
|
if ($this->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_plugin_dir)) {
|
||||||
@@ -1342,6 +1430,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* @param bool $force_compile force all to recompile
|
* @param bool $force_compile force all to recompile
|
||||||
* @param int $time_limit
|
* @param int $time_limit
|
||||||
* @param int $max_errors
|
* @param int $max_errors
|
||||||
|
*
|
||||||
* @return integer number of template files recompiled
|
* @return integer number of template files recompiled
|
||||||
*/
|
*/
|
||||||
public function compileAllTemplates($extension = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null)
|
public function compileAllTemplates($extension = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null)
|
||||||
@@ -1356,6 +1445,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* @param bool $force_compile force all to recompile
|
* @param bool $force_compile force all to recompile
|
||||||
* @param int $time_limit
|
* @param int $time_limit
|
||||||
* @param int $max_errors
|
* @param int $max_errors
|
||||||
|
*
|
||||||
* @return integer number of template files recompiled
|
* @return integer number of template files recompiled
|
||||||
*/
|
*/
|
||||||
public function compileAllConfig($extension = '.conf', $force_compile = false, $time_limit = 0, $max_errors = null)
|
public function compileAllConfig($extension = '.conf', $force_compile = false, $time_limit = 0, $max_errors = null)
|
||||||
@@ -1369,6 +1459,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* @param string $resource_name template name
|
* @param string $resource_name template name
|
||||||
* @param string $compile_id compile id
|
* @param string $compile_id compile id
|
||||||
* @param integer $exp_time expiration time
|
* @param integer $exp_time expiration time
|
||||||
|
*
|
||||||
* @return integer number of template files deleted
|
* @return integer number of template files deleted
|
||||||
*/
|
*/
|
||||||
public function clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null)
|
public function clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null)
|
||||||
@@ -1376,11 +1467,11 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
return Smarty_Internal_Utility::clearCompiledTemplate($resource_name, $compile_id, $exp_time, $this);
|
return Smarty_Internal_Utility::clearCompiledTemplate($resource_name, $compile_id, $exp_time, $this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return array of tag/attributes of all tags used by an template
|
* Return array of tag/attributes of all tags used by an template
|
||||||
*
|
*
|
||||||
* @param object $templae template object
|
* @param Smarty_Internal_Template $template
|
||||||
|
*
|
||||||
* @return array of tag/attributes
|
* @return array of tag/attributes
|
||||||
*/
|
*/
|
||||||
public function getTags(Smarty_Internal_Template $template)
|
public function getTags(Smarty_Internal_Template $template)
|
||||||
@@ -1392,6 +1483,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* Run installation test
|
* Run installation test
|
||||||
*
|
*
|
||||||
* @param array $errors Array to write errors into, rather than outputting them
|
* @param array $errors Array to write errors into, rather than outputting them
|
||||||
|
*
|
||||||
* @return boolean true if setup is fine, false if something is wrong
|
* @return boolean true if setup is fine, false if something is wrong
|
||||||
*/
|
*/
|
||||||
public function testInstall(&$errors = null)
|
public function testInstall(&$errors = null)
|
||||||
@@ -1403,7 +1495,13 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
* Error Handler to mute expected messages
|
* Error Handler to mute expected messages
|
||||||
*
|
*
|
||||||
* @link http://php.net/set_error_handler
|
* @link http://php.net/set_error_handler
|
||||||
|
*
|
||||||
* @param integer $errno Error level
|
* @param integer $errno Error level
|
||||||
|
* @param $errstr
|
||||||
|
* @param $errfile
|
||||||
|
* @param $errline
|
||||||
|
* @param $errcontext
|
||||||
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public static function mutingErrorHandler($errno, $errstr, $errfile, $errline, $errcontext)
|
public static function mutingErrorHandler($errno, $errstr, $errfile, $errline, $errcontext)
|
||||||
@@ -1506,6 +1604,7 @@ if (Smarty::$_CHARSET !== 'UTF-8') {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Smarty exception class
|
* Smarty exception class
|
||||||
|
*
|
||||||
* @package Smarty
|
* @package Smarty
|
||||||
*/
|
*/
|
||||||
class SmartyException extends Exception
|
class SmartyException extends Exception
|
||||||
@@ -1520,6 +1619,7 @@ class SmartyException extends Exception
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Smarty compiler exception class
|
* Smarty compiler exception class
|
||||||
|
*
|
||||||
* @package Smarty
|
* @package Smarty
|
||||||
*/
|
*/
|
||||||
class SmartyCompilerException extends SmartyException
|
class SmartyCompilerException extends SmartyException
|
||||||
@@ -1528,23 +1628,28 @@ class SmartyCompilerException extends SmartyException
|
|||||||
{
|
{
|
||||||
return ' --> Smarty Compiler: ' . $this->message . ' <-- ';
|
return ' --> Smarty Compiler: ' . $this->message . ' <-- ';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The line number of the template error
|
* The line number of the template error
|
||||||
|
*
|
||||||
* @type int|null
|
* @type int|null
|
||||||
*/
|
*/
|
||||||
public $line = null;
|
public $line = null;
|
||||||
/**
|
/**
|
||||||
* The template source snippet relating to the error
|
* The template source snippet relating to the error
|
||||||
|
*
|
||||||
* @type string|null
|
* @type string|null
|
||||||
*/
|
*/
|
||||||
public $source = null;
|
public $source = null;
|
||||||
/**
|
/**
|
||||||
* The raw text of the error message
|
* The raw text of the error message
|
||||||
|
*
|
||||||
* @type string|null
|
* @type string|null
|
||||||
*/
|
*/
|
||||||
public $desc = null;
|
public $desc = null;
|
||||||
/**
|
/**
|
||||||
* The resource identifier or template name
|
* The resource identifier or template name
|
||||||
|
*
|
||||||
* @type string|null
|
* @type string|null
|
||||||
*/
|
*/
|
||||||
public $template = null;
|
public $template = null;
|
||||||
@@ -3,21 +3,17 @@
|
|||||||
* Project: Smarty: the PHP compiling template engine
|
* Project: Smarty: the PHP compiling template engine
|
||||||
* File: SmartyBC.class.php
|
* File: SmartyBC.class.php
|
||||||
* SVN: $Id: $
|
* SVN: $Id: $
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* Lesser General Public License for more details.
|
* Lesser General Public License for more details.
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*
|
|
||||||
* For questions, help, comments, discussion, etc., please join the
|
* For questions, help, comments, discussion, etc., please join the
|
||||||
* Smarty mailing list. Send a blank e-mail to
|
* Smarty mailing list. Send a blank e-mail to
|
||||||
* smarty-discussion-subscribe@googlegroups.com
|
* smarty-discussion-subscribe@googlegroups.com
|
||||||
@@ -32,7 +28,7 @@
|
|||||||
/**
|
/**
|
||||||
* @ignore
|
* @ignore
|
||||||
*/
|
*/
|
||||||
require(dirname(__FILE__) . '/Smarty.class.php');
|
require_once(dirname(__FILE__) . '/Smarty.class.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Smarty Backward Compatability Wrapper Class
|
* Smarty Backward Compatability Wrapper Class
|
||||||
@@ -43,6 +39,7 @@ class SmartyBC extends Smarty
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Smarty 2 BC
|
* Smarty 2 BC
|
||||||
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $_version = self::SMARTY_VERSION;
|
public $_version = self::SMARTY_VERSION;
|
||||||
@@ -122,7 +119,10 @@ class SmartyBC extends Smarty
|
|||||||
* @param object $object_impl the referenced PHP object to register
|
* @param object $object_impl the referenced PHP object to register
|
||||||
* @param array $allowed list of allowed methods (empty = all)
|
* @param array $allowed list of allowed methods (empty = all)
|
||||||
* @param boolean $smarty_args smarty argument format, else traditional
|
* @param boolean $smarty_args smarty argument format, else traditional
|
||||||
* @param array $block_functs list of methods that are block format
|
* @param array $block_methods list of methods that are block format
|
||||||
|
*
|
||||||
|
* @throws SmartyException
|
||||||
|
* @internal param array $block_functs list of methods that are block format
|
||||||
*/
|
*/
|
||||||
public function register_object($object, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
|
public function register_object($object, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
|
||||||
{
|
{
|
||||||
@@ -309,6 +309,7 @@ class SmartyBC extends Smarty
|
|||||||
* @param string $cache_id name of cache_id
|
* @param string $cache_id name of cache_id
|
||||||
* @param string $compile_id name of compile_id
|
* @param string $compile_id name of compile_id
|
||||||
* @param string $exp_time expiration time
|
* @param string $exp_time expiration time
|
||||||
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null)
|
public function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null)
|
||||||
@@ -320,6 +321,7 @@ class SmartyBC extends Smarty
|
|||||||
* clear the entire contents of cache (all templates)
|
* clear the entire contents of cache (all templates)
|
||||||
*
|
*
|
||||||
* @param string $exp_time expire time
|
* @param string $exp_time expire time
|
||||||
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function clear_all_cache($exp_time = null)
|
public function clear_all_cache($exp_time = null)
|
||||||
@@ -333,6 +335,7 @@ class SmartyBC extends Smarty
|
|||||||
* @param string $tpl_file name of template file
|
* @param string $tpl_file name of template file
|
||||||
* @param string $cache_id
|
* @param string $cache_id
|
||||||
* @param string $compile_id
|
* @param string $compile_id
|
||||||
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function is_cached($tpl_file, $cache_id = null, $compile_id = null)
|
public function is_cached($tpl_file, $cache_id = null, $compile_id = null)
|
||||||
@@ -356,6 +359,7 @@ class SmartyBC extends Smarty
|
|||||||
* @param string $tpl_file
|
* @param string $tpl_file
|
||||||
* @param string $compile_id
|
* @param string $compile_id
|
||||||
* @param string $exp_time
|
* @param string $exp_time
|
||||||
|
*
|
||||||
* @return boolean results of {@link smarty_core_rm_auto()}
|
* @return boolean results of {@link smarty_core_rm_auto()}
|
||||||
*/
|
*/
|
||||||
public function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null)
|
public function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null)
|
||||||
@@ -367,6 +371,7 @@ class SmartyBC extends Smarty
|
|||||||
* Checks whether requested template exists.
|
* Checks whether requested template exists.
|
||||||
*
|
*
|
||||||
* @param string $tpl_file
|
* @param string $tpl_file
|
||||||
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function template_exists($tpl_file)
|
public function template_exists($tpl_file)
|
||||||
@@ -378,6 +383,7 @@ class SmartyBC extends Smarty
|
|||||||
* Returns an array containing template variables
|
* Returns an array containing template variables
|
||||||
*
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function get_template_vars($name = null)
|
public function get_template_vars($name = null)
|
||||||
@@ -389,6 +395,7 @@ class SmartyBC extends Smarty
|
|||||||
* Returns an array containing config variables
|
* Returns an array containing config variables
|
||||||
*
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function get_config_vars($name = null)
|
public function get_config_vars($name = null)
|
||||||
@@ -412,6 +419,7 @@ class SmartyBC extends Smarty
|
|||||||
* return a reference to a registered object
|
* return a reference to a registered object
|
||||||
*
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
|
*
|
||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
public function get_registered_object($name)
|
public function get_registered_object($name)
|
||||||
@@ -439,7 +447,6 @@ class SmartyBC extends Smarty
|
|||||||
{
|
{
|
||||||
trigger_error("Smarty error: $error_msg", $error_type);
|
trigger_error("Smarty error: $error_msg", $error_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -449,6 +456,7 @@ class SmartyBC extends Smarty
|
|||||||
* @param string $content contents of the block
|
* @param string $content contents of the block
|
||||||
* @param object $template template object
|
* @param object $template template object
|
||||||
* @param boolean &$repeat repeat flag
|
* @param boolean &$repeat repeat flag
|
||||||
|
*
|
||||||
* @return string content re-formatted
|
* @return string content re-formatted
|
||||||
*/
|
*/
|
||||||
function smarty_php_tag($params, $content, $template, &$repeat)
|
function smarty_php_tag($params, $content, $template, &$repeat)
|
||||||
137
lib/classes/Smarty-3.1.21/libs/debug.tpl
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
{capture name='_smarty_debug' assign=debug_output}
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||||
|
<head>
|
||||||
|
<title>Smarty Debug Console</title>
|
||||||
|
<style type="text/css">
|
||||||
|
{literal}
|
||||||
|
body, h1, h2, td, th, p {
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 0.9em;
|
||||||
|
margin: 1px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
margin: 0;
|
||||||
|
text-align: left;
|
||||||
|
padding: 2px;
|
||||||
|
background-color: #f0c040;
|
||||||
|
color: black;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 1.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
background-color: #9B410E;
|
||||||
|
color: white;
|
||||||
|
text-align: left;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 2px;
|
||||||
|
border-top: 1px solid black;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
p, table, div {
|
||||||
|
background: #f0ead8;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 0;
|
||||||
|
font-style: italic;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
th, td {
|
||||||
|
font-family: monospace;
|
||||||
|
vertical-align: top;
|
||||||
|
text-align: left;
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
color: green;
|
||||||
|
}
|
||||||
|
|
||||||
|
.odd {
|
||||||
|
background-color: #eeeeee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.even {
|
||||||
|
background-color: #fafafa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.exectime {
|
||||||
|
font-size: 0.8em;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
#table_assigned_vars th {
|
||||||
|
color: blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
#table_config_vars th {
|
||||||
|
color: maroon;
|
||||||
|
}
|
||||||
|
|
||||||
|
{/literal}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>Smarty Debug Console
|
||||||
|
- {if isset($template_name)}{$template_name|debug_print_var nofilter}{else}Total Time {$execution_time|string_format:"%.5f"}{/if}</h1>
|
||||||
|
|
||||||
|
{if !empty($template_data)}
|
||||||
|
<h2>included templates & config files (load time in seconds)</h2>
|
||||||
|
<div>
|
||||||
|
{foreach $template_data as $template}
|
||||||
|
<font color=brown>{$template.name}</font>
|
||||||
|
<span class="exectime">
|
||||||
|
(compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"}
|
||||||
|
)
|
||||||
|
</span>
|
||||||
|
<br>
|
||||||
|
{/foreach}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<h2>assigned template variables</h2>
|
||||||
|
|
||||||
|
<table id="table_assigned_vars">
|
||||||
|
{foreach $assigned_vars as $vars}
|
||||||
|
<tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">
|
||||||
|
<th>${$vars@key|escape:'html'}</th>
|
||||||
|
<td>{$vars|debug_print_var nofilter}</td>
|
||||||
|
</tr>
|
||||||
|
{/foreach}
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h2>assigned config file variables (outer template scope)</h2>
|
||||||
|
|
||||||
|
<table id="table_config_vars">
|
||||||
|
{foreach $config_vars as $vars}
|
||||||
|
<tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">
|
||||||
|
<th>{$vars@key|escape:'html'}</th>
|
||||||
|
<td>{$vars|debug_print_var nofilter}</td>
|
||||||
|
</tr>
|
||||||
|
{/foreach}
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
{/capture}
|
||||||
|
<script type="text/javascript">
|
||||||
|
{$id = $template_name|default:''|md5}
|
||||||
|
_smarty_console = window.open("", "console{$id}", "width=680,height=600,resizable,scrollbars=yes");
|
||||||
|
_smarty_console.document.write("{$debug_output|escape:'javascript' nofilter}");
|
||||||
|
_smarty_console.document.close();
|
||||||
|
</script>
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Smarty {textformat}{/textformat} block plugin
|
* Smarty {textformat}{/textformat} block plugin
|
||||||
*
|
|
||||||
* Type: block function<br>
|
* Type: block function<br>
|
||||||
* Name: textformat<br>
|
* Name: textformat<br>
|
||||||
* Purpose: format text a certain way with preset styles
|
* Purpose: format text a certain way with preset styles
|
||||||
@@ -25,10 +24,12 @@
|
|||||||
*
|
*
|
||||||
* @link http://www.smarty.net/manual/en/language.function.textformat.php {textformat}
|
* @link http://www.smarty.net/manual/en/language.function.textformat.php {textformat}
|
||||||
* (Smarty online manual)
|
* (Smarty online manual)
|
||||||
|
*
|
||||||
* @param array $params parameters
|
* @param array $params parameters
|
||||||
* @param string $content contents of the block
|
* @param string $content contents of the block
|
||||||
* @param Smarty_Internal_Template $template template object
|
* @param Smarty_Internal_Template $template template object
|
||||||
* @param boolean &$repeat repeat flag
|
* @param boolean &$repeat repeat flag
|
||||||
|
*
|
||||||
* @return string content re-formatted
|
* @return string content re-formatted
|
||||||
* @author Monte Ohrt <monte at ohrt dot com>
|
* @author Monte Ohrt <monte at ohrt dot com>
|
||||||
*/
|
*/
|
||||||
@@ -76,7 +77,6 @@ function smarty_block_textformat($params, $content, $template, &$repeat)
|
|||||||
}
|
}
|
||||||
// split into paragraphs
|
// split into paragraphs
|
||||||
$_paragraphs = preg_split('![\r\n]{2}!', $content);
|
$_paragraphs = preg_split('![\r\n]{2}!', $content);
|
||||||
$_output = '';
|
|
||||||
|
|
||||||
foreach ($_paragraphs as &$_paragraph) {
|
foreach ($_paragraphs as &$_paragraph) {
|
||||||
if (!$_paragraph) {
|
if (!$_paragraph) {
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Smarty plugin
|
* Smarty plugin
|
||||||
|
*
|
||||||
* @package Smarty
|
* @package Smarty
|
||||||
* @subpackage PluginsFunction
|
* @subpackage PluginsFunction
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Smarty {counter} function plugin
|
* Smarty {counter} function plugin
|
||||||
*
|
|
||||||
* Type: function<br>
|
* Type: function<br>
|
||||||
* Name: counter<br>
|
* Name: counter<br>
|
||||||
* Purpose: print out a counter value
|
* Purpose: print out a counter value
|
||||||
@@ -15,8 +15,10 @@
|
|||||||
* @author Monte Ohrt <monte at ohrt dot com>
|
* @author Monte Ohrt <monte at ohrt dot com>
|
||||||
* @link http://www.smarty.net/manual/en/language.function.counter.php {counter}
|
* @link http://www.smarty.net/manual/en/language.function.counter.php {counter}
|
||||||
* (Smarty online manual)
|
* (Smarty online manual)
|
||||||
|
*
|
||||||
* @param array $params parameters
|
* @param array $params parameters
|
||||||
* @param Smarty_Internal_Template $template template object
|
* @param Smarty_Internal_Template $template template object
|
||||||
|
*
|
||||||
* @return string|null
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
function smarty_function_counter($params, $template)
|
function smarty_function_counter($params, $template)
|
||||||
@@ -66,11 +68,11 @@ function smarty_function_counter($params, $template)
|
|||||||
$counter['direction'] = $params['direction'];
|
$counter['direction'] = $params['direction'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($counter['direction'] == "down")
|
if ($counter['direction'] == "down") {
|
||||||
$counter['count'] -= $counter['skip'];
|
$counter['count'] -= $counter['skip'];
|
||||||
else
|
} else {
|
||||||
$counter['count'] += $counter['skip'];
|
$counter['count'] += $counter['skip'];
|
||||||
|
}
|
||||||
|
|
||||||
return $retval;
|
return $retval;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Smarty {cycle} function plugin
|
* Smarty {cycle} function plugin
|
||||||
*
|
|
||||||
* Type: function<br>
|
* Type: function<br>
|
||||||
* Name: cycle<br>
|
* Name: cycle<br>
|
||||||
* Date: May 3, 2002<br>
|
* Date: May 3, 2002<br>
|
||||||
@@ -38,8 +37,10 @@
|
|||||||
* @author credit to Gerard <gerard@interfold.com>
|
* @author credit to Gerard <gerard@interfold.com>
|
||||||
* @author credit to Jason Sweat <jsweat_php@yahoo.com>
|
* @author credit to Jason Sweat <jsweat_php@yahoo.com>
|
||||||
* @version 1.3
|
* @version 1.3
|
||||||
|
*
|
||||||
* @param array $params parameters
|
* @param array $params parameters
|
||||||
* @param Smarty_Internal_Template $template template object
|
* @param Smarty_Internal_Template $template template object
|
||||||
|
*
|
||||||
* @return string|null
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -60,7 +61,8 @@ function smarty_function_cycle($params, $template)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (isset($cycle_vars[$name]['values'])
|
if (isset($cycle_vars[$name]['values'])
|
||||||
&& $cycle_vars[$name]['values'] != $params['values'] ) {
|
&& $cycle_vars[$name]['values'] != $params['values']
|
||||||
|
) {
|
||||||
$cycle_vars[$name]['index'] = 0;
|
$cycle_vars[$name]['index'] = 0;
|
||||||
}
|
}
|
||||||
$cycle_vars[$name]['values'] = $params['values'];
|
$cycle_vars[$name]['values'] = $params['values'];
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Smarty {fetch} plugin
|
* Smarty {fetch} plugin
|
||||||
*
|
|
||||||
* Type: function<br>
|
* Type: function<br>
|
||||||
* Name: fetch<br>
|
* Name: fetch<br>
|
||||||
* Purpose: fetch file, web or ftp data and display results
|
* Purpose: fetch file, web or ftp data and display results
|
||||||
@@ -16,8 +15,11 @@
|
|||||||
* @link http://www.smarty.net/manual/en/language.function.fetch.php {fetch}
|
* @link http://www.smarty.net/manual/en/language.function.fetch.php {fetch}
|
||||||
* (Smarty online manual)
|
* (Smarty online manual)
|
||||||
* @author Monte Ohrt <monte at ohrt dot com>
|
* @author Monte Ohrt <monte at ohrt dot com>
|
||||||
|
*
|
||||||
* @param array $params parameters
|
* @param array $params parameters
|
||||||
* @param Smarty_Internal_Template $template template object
|
* @param Smarty_Internal_Template $template template object
|
||||||
|
*
|
||||||
|
* @throws SmartyException
|
||||||
* @return string|null if the assign parameter is passed, Smarty assigns the result to a template variable
|
* @return string|null if the assign parameter is passed, Smarty assigns the result to a template variable
|
||||||
*/
|
*/
|
||||||
function smarty_function_fetch($params, $template)
|
function smarty_function_fetch($params, $template)
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Smarty {html_checkboxes} function plugin
|
* Smarty {html_checkboxes} function plugin
|
||||||
*
|
|
||||||
* File: function.html_checkboxes.php<br>
|
* File: function.html_checkboxes.php<br>
|
||||||
* Type: function<br>
|
* Type: function<br>
|
||||||
* Name: html_checkboxes<br>
|
* Name: html_checkboxes<br>
|
||||||
@@ -37,8 +36,10 @@
|
|||||||
* @author Christopher Kvarme <christopher.kvarme@flashjab.com>
|
* @author Christopher Kvarme <christopher.kvarme@flashjab.com>
|
||||||
* @author credits to Monte Ohrt <monte at ohrt dot com>
|
* @author credits to Monte Ohrt <monte at ohrt dot com>
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
|
*
|
||||||
* @param array $params parameters
|
* @param array $params parameters
|
||||||
* @param object $template template object
|
* @param object $template template object
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
* @uses smarty_function_escape_special_chars()
|
* @uses smarty_function_escape_special_chars()
|
||||||
*/
|
*/
|
||||||
@@ -116,7 +117,8 @@ function smarty_function_html_checkboxes($params, $template)
|
|||||||
case 'assign':
|
case 'assign':
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'strict': break;
|
case 'strict':
|
||||||
|
break;
|
||||||
|
|
||||||
case 'disabled':
|
case 'disabled':
|
||||||
case 'readonly':
|
case 'readonly':
|
||||||
@@ -143,8 +145,9 @@ function smarty_function_html_checkboxes($params, $template)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($options) && !isset($values))
|
if (!isset($options) && !isset($values)) {
|
||||||
return ''; /* raise error here? */
|
return '';
|
||||||
|
} /* raise error here? */
|
||||||
|
|
||||||
$_html_result = array();
|
$_html_result = array();
|
||||||
|
|
||||||
@@ -164,7 +167,6 @@ function smarty_function_html_checkboxes($params, $template)
|
|||||||
} else {
|
} else {
|
||||||
return implode("\n", $_html_result);
|
return implode("\n", $_html_result);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $escape = true)
|
function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $escape = true)
|
||||||