Skip to content

Commit e94a9fb

Browse files
committed
Merged revisions 3049-3051,3053-3054,3058,3070,3074-3077,3082,3086-3088,3091-3092,3094-3095 from stable branch.
1 parent 4c28d9c commit e94a9fb

File tree

220 files changed

+2515
-261
lines changed

Some content is hidden

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

220 files changed

+2515
-261
lines changed

install/dist/conf/opensuse110.conf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
$conf['web']['apps_vhost_group'] = 'ispapps';
9898

9999
//* Fastcgi
100-
$conf['fastcgi']['fastcgi_phpini_path'] = '/etc/php5/cgi/';
100+
$conf['fastcgi']['fastcgi_phpini_path'] = '/etc/php5/fastcgi/';
101101
$conf['fastcgi']['fastcgi_starter_path'] = '/srv/www/php-fcgi-scripts/[system_user]/';
102102

103103
//* Postfix

install/dist/lib/fedora.lib.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,9 +1043,8 @@ public function install_ispconfig()
10431043
replaceLine('/etc/sudoers','Defaults requiretty','#Defaults requiretty',0,0);
10441044

10451045
if(is_dir($install_dir.'/interface/invoices')) {
1046-
chmod($install_dir.'/interface/invoices', 0770);
1047-
chown($install_dir.'/interface/invoices', 'ispconfig');
1048-
chgrp($install_dir.'/interface/invoices', 'ispconfig');
1046+
exec('chmod -R 770 '.escapeshellarg($install_dir.'/interface/invoices'));
1047+
exec('chown -R ispconfig:ispconfig '.escapeshellarg($install_dir.'/interface/invoices'));
10491048
}
10501049

10511050
}

install/dist/lib/gentoo.lib.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -874,9 +874,8 @@ public function install_ispconfig()
874874
}
875875

876876
if(is_dir($install_dir.'/interface/invoices')) {
877-
chmod($install_dir.'/interface/invoices', 0770);
878-
chown($install_dir.'/interface/invoices', 'ispconfig');
879-
chgrp($install_dir.'/interface/invoices', 'ispconfig');
877+
exec('chmod -R 770 '.escapeshellarg($install_dir.'/interface/invoices'));
878+
exec('chown -R ispconfig:ispconfig '.escapeshellarg($install_dir.'/interface/invoices'));
880879
}
881880

882881
// TODO: FIXME: add the www-data user to the ispconfig group. This is just for testing

install/dist/lib/opensuse.lib.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,9 +1084,8 @@ public function install_ispconfig()
10841084
}
10851085

10861086
if(is_dir($install_dir.'/interface/invoices')) {
1087-
chmod($install_dir.'/interface/invoices', 0770);
1088-
chown($install_dir.'/interface/invoices', 'ispconfig');
1089-
chgrp($install_dir.'/interface/invoices', 'ispconfig');
1087+
exec('chmod -R 770 '.escapeshellarg($install_dir.'/interface/invoices'));
1088+
exec('chown -R ispconfig:ispconfig '.escapeshellarg($install_dir.'/interface/invoices'));
10901089
}
10911090

10921091

install/lib/installer_base.lib.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,9 +1784,8 @@ public function install_ispconfig() {
17841784
}
17851785

17861786
if(is_dir($install_dir.'/interface/invoices')) {
1787-
chmod($install_dir.'/interface/invoices', 0770);
1788-
chown($install_dir.'/interface/invoices', 'ispconfig');
1789-
chgrp($install_dir.'/interface/invoices', 'ispconfig');
1787+
exec('chmod -R 770 '.escapeshellarg($install_dir.'/interface/invoices'));
1788+
exec('chown -R ispconfig:ispconfig '.escapeshellarg($install_dir.'/interface/invoices'));
17901789
}
17911790

17921791
// TODO: FIXME: add the www-data user to the ispconfig group. This is just for testing

interface/lib/classes/validate_client.inc.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,36 @@ function username_unique($field_name, $field_value, $validator) {
6565
}
6666
}
6767

68+
function username_collision($field_name, $field_value, $validator) {
69+
global $app;
70+
71+
if(isset($app->remoting_lib->primary_id)) {
72+
$client_id = $app->remoting_lib->primary_id;
73+
} else {
74+
$client_id = $app->tform->primary_id;
75+
}
76+
77+
$app->uses('getconf');
78+
$global_config = $app->getconf->get_global_config('sites');
79+
80+
if((trim($field_value) == 'web' || preg_match('/^web[0-9]/',$field_value)) &&
81+
($global_config['ftpuser_prefix'] == '[CLIENTNAME]' ||
82+
$global_config['ftpuser_prefix'] == '' ||
83+
$global_config['shelluser_prefix'] == '[CLIENTNAME]' ||
84+
$global_config['shelluser_prefix'] == '' )) {
85+
$errmsg = $validator['errmsg'];
86+
if(isset($app->tform->wordbook[$errmsg])) {
87+
return $app->tform->wordbook[$errmsg]."<br>\r\n";
88+
} else {
89+
return $errmsg."<br>\r\n";
90+
}
91+
}
92+
93+
94+
95+
96+
}
97+
6898

6999

70100

interface/lib/plugins/vm_openvz_plugin.inc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ private function makeOpenVZConfig() {
173173
$tpl->setVar('numfile',$vm_template['numfile']);
174174
$tpl->setVar('avnumproc',$vm_template['avnumproc']);
175175
$tpl->setVar('numiptent',$vm_template['numiptent']);
176+
$tpl->setVar('swappages',$vm_template['swappages']);
176177

177178
$diskspace = $vm['diskspace']*1048576;
178179
$diskinodes = $vm['diskspace']*524288;

interface/web/client/client_edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/*
3-
Copyright (c) 2005 - 2008, Till Brehm, projektfarm Gmbh
3+
Copyright (c) 2005 - 2012, Till Brehm, projektfarm Gmbh, ISPConfig UG
44
All rights reserved.
55
66
Redistribution and use in source and binary forms, with or without modification,
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
<?php
2+
/*
3+
Copyright (c) 2012, Till Brehm, ISPConfig UG
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without modification,
7+
are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice,
10+
this list of conditions and the following disclaimer.
11+
* Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
* Neither the name of ISPConfig nor the names of its contributors
15+
may be used to endorse or promote products derived from this software without
16+
specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
22+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
*/
29+
30+
require_once('../../lib/config.inc.php');
31+
require_once('../../lib/app.inc.php');
32+
33+
//* Check permissions for module
34+
$app->auth->check_module_permissions('client');
35+
36+
//* This function is not available in demo mode
37+
if($conf['demo_mode'] == true) $app->error('This function is disabled in demo mode.');
38+
39+
$app->uses('tpl');
40+
41+
$app->tpl->newTemplate('form.tpl.htm');
42+
$app->tpl->setInclude('content_tpl', 'templates/client_message.htm');
43+
44+
//* load language file
45+
$lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_client_message.lng';
46+
include($lng_file);
47+
$app->tpl->setVar($wb);
48+
49+
$msg = '';
50+
$error = '';
51+
52+
//* Save data
53+
if(isset($_POST) && count($_POST) > 1) {
54+
55+
//* Check values
56+
if(!preg_match("/^\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\w+\.[a-zA-Z0-9\-]{2,30}$/i", $_POST['sender'])) $error .= $wb['sender_invalid_error'].'<br />';
57+
if(empty($_POST['subject'])) $error .= $wb['subject_invalid_error'].'<br />';
58+
if(empty($_POST['message'])) $error .= $wb['message_invalid_error'].'<br />';
59+
60+
//* Send message
61+
if($error == '') {
62+
//* Select all clients and resellers
63+
if($_SESSION["s"]["user"]["typ"] == 'admin'){
64+
$sql = "SELECT * FROM client WHERE email != ''";
65+
} else {
66+
$client_id = intval($_SESSION['s']['user']['client_id']);
67+
if($client_id == 0) die('Invalid Client ID.');
68+
$sql = "SELECT * FROM client WHERE email != '' AND parent_client_id = '$client_id'";
69+
}
70+
71+
//* Get clients
72+
$clients = $app->db->queryAllRecords($sql);
73+
if(is_array($clients)) {
74+
$msg = $wb['email_sent_to_txt'].' ';
75+
foreach($clients as $client) {
76+
77+
//* Parse cleint details into message
78+
$message = $_POST['message'];
79+
foreach($client as $key => $val) {
80+
$message = str_replace('{'.$key.'}', $val, $message);
81+
}
82+
83+
//* Send the email
84+
$app->functions->mail($client['email'], $_POST['subject'], $message, $_POST['sender']);
85+
$msg .= $client['email'].', ';
86+
}
87+
$msg = substr($msg,0,-2);
88+
}
89+
90+
} else {
91+
$app->tpl->setVar('sender',$_POST['sender']);
92+
$app->tpl->setVar('subject',$_POST['subject']);
93+
$app->tpl->setVar('message',$_POST['message']);
94+
}
95+
}
96+
97+
if($_SESSION["s"]["user"]["typ"] == 'admin'){
98+
$app->tpl->setVar('form_legend_txt',$wb['form_legend_admin_txt']);
99+
} else {
100+
$app->tpl->setVar('form_legend_txt',$wb['form_legend_client_txt']);
101+
}
102+
103+
$app->tpl->setVar('okmsg',$msg);
104+
$app->tpl->setVar('error',$error);
105+
106+
$app->tpl_defaults();
107+
$app->tpl->pparse();
108+
109+
110+
?>

interface/web/client/form/client.tform.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,11 @@
134134
'class' => 'validate_client',
135135
'function' => 'username_unique',
136136
'errmsg'=> 'username_error_unique'),
137-
2 => array ( 'type' => 'REGEX',
137+
2 => array ( 'type' => 'CUSTOM',
138+
'class' => 'validate_client',
139+
'function' => 'username_collision',
140+
'errmsg'=> 'username_error_collision'),
141+
3 => array ( 'type' => 'REGEX',
138142
'regex' => '/^[\w\.\-\_]{0,64}$/',
139143
'errmsg'=> 'username_error_regex'),
140144
),

0 commit comments

Comments
 (0)