Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ISPConfig
ISPConfig 3
Commits
d2227787
Commit
d2227787
authored
Jan 04, 2016
by
Marius Burkard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- merged different fixes and updates from foreign branches
parent
0cc28615
Changes
41
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
1396 additions
and
175 deletions
+1396
-175
install/install.php
install/install.php
+11
-0
install/lib/installer_base.lib.php
install/lib/installer_base.lib.php
+78
-0
install/sql/ispconfig3.sql
install/sql/ispconfig3.sql
+5
-0
install/tpl/server.ini.master
install/tpl/server.ini.master
+3
-3
interface/lib/classes/functions.inc.php
interface/lib/classes/functions.inc.php
+328
-0
interface/lib/classes/listform.inc.php
interface/lib/classes/listform.inc.php
+31
-2
interface/lib/classes/remote.d/client.inc.php
interface/lib/classes/remote.d/client.inc.php
+38
-4
interface/lib/classes/tform_base.inc.php
interface/lib/classes/tform_base.inc.php
+3
-0
interface/lib/classes/validate_password.inc.php
interface/lib/classes/validate_password.inc.php
+2
-1
interface/web/admin/directive_snippets_edit.php
interface/web/admin/directive_snippets_edit.php
+51
-2
interface/web/admin/directive_snippets_list.php
interface/web/admin/directive_snippets_list.php
+42
-1
interface/web/admin/form/directive_snippets.tform.php
interface/web/admin/form/directive_snippets.tform.php
+1
-1
interface/web/admin/form/server_config.tform.php
interface/web/admin/form/server_config.tform.php
+104
-0
interface/web/admin/list/directive_snippets.list.php
interface/web/admin/list/directive_snippets.list.php
+9
-0
interface/web/admin/templates/directive_snippets_edit.htm
interface/web/admin/templates/directive_snippets_edit.htm
+8
-4
interface/web/admin/templates/directive_snippets_list.htm
interface/web/admin/templates/directive_snippets_list.htm
+6
-3
interface/web/admin/templates/server_config_server_edit.htm
interface/web/admin/templates/server_config_server_edit.htm
+6
-0
interface/web/client/client_del.php
interface/web/client/client_del.php
+2
-2
interface/web/client/client_list.php
interface/web/client/client_list.php
+18
-6
interface/web/client/form/client.tform.php
interface/web/client/form/client.tform.php
+9
-3
interface/web/client/form/reseller.tform.php
interface/web/client/form/reseller.tform.php
+13
-3
interface/web/client/list/client.list.php
interface/web/client/list/client.list.php
+11
-0
interface/web/client/templates/clients_list.htm
interface/web/client/templates/clients_list.htm
+14
-3
interface/web/mail/templates/mail_domain_edit.htm
interface/web/mail/templates/mail_domain_edit.htm
+1
-1
interface/web/sites/ajax_get_json.php
interface/web/sites/ajax_get_json.php
+7
-6
interface/web/sites/database_quota_stats.php
interface/web/sites/database_quota_stats.php
+45
-30
interface/web/sites/form/database.tform.php
interface/web/sites/form/database.tform.php
+1
-1
interface/web/sites/form/web_vhost_domain.tform.php
interface/web/sites/form/web_vhost_domain.tform.php
+15
-3
interface/web/sites/templates/web_vhost_domain_admin_list.htm
...rface/web/sites/templates/web_vhost_domain_admin_list.htm
+5
-5
interface/web/sites/templates/web_vhost_domain_advanced.htm
interface/web/sites/templates/web_vhost_domain_advanced.htm
+9
-1
interface/web/sites/templates/web_vhost_domain_edit.htm
interface/web/sites/templates/web_vhost_domain_edit.htm
+61
-8
interface/web/sites/web_vhost_domain_edit.php
interface/web/sites/web_vhost_domain_edit.php
+240
-28
interface/web/themes/default/templates/sidenav.tpl.htm
interface/web/themes/default/templates/sidenav.tpl.htm
+7
-4
server/conf/hhvm_starter.master
server/conf/hhvm_starter.master
+1
-1
server/conf/nginx_vhost.conf.master
server/conf/nginx_vhost.conf.master
+20
-4
server/conf/vhost.conf.master
server/conf/vhost.conf.master
+1
-0
server/lib/classes/cronjob.inc.php
server/lib/classes/cronjob.inc.php
+27
-4
server/mods-available/web_module.inc.php
server/mods-available/web_module.inc.php
+21
-3
server/plugins-available/apache2_plugin.inc.php
server/plugins-available/apache2_plugin.inc.php
+13
-11
server/plugins-available/nginx_plugin.inc.php
server/plugins-available/nginx_plugin.inc.php
+113
-19
server/plugins-available/shelluser_jailkit_plugin.inc.php
server/plugins-available/shelluser_jailkit_plugin.inc.php
+16
-8
No files found.
install/install.php
View file @
d2227787
...
...
@@ -246,6 +246,8 @@ $conf['services']['xmpp'] = false;
if
(
$install_mode
==
'standard'
)
{
$inst
->
dbmaster
=
$inst
->
db
;
//* Create the MySQL database
$inst
->
configure_database
();
...
...
@@ -500,6 +502,9 @@ if($install_mode == 'standard') {
$inst
->
install_crontab
();
}
else
swriteln
(
'[ERROR] Cron not found'
);
swriteln
(
'Detect IP addresses'
);
$inst
->
detect_ips
();
swriteln
(
'Restarting services ...'
);
if
(
$conf
[
'mysql'
][
'installed'
]
==
true
&&
$conf
[
'mysql'
][
'init_script'
]
!=
''
)
system
(
$inst
->
getinitcommand
(
$conf
[
'mysql'
][
'init_script'
],
'restart'
)
.
' >/dev/null 2>&1'
);
if
(
$conf
[
'postfix'
][
'installed'
]
==
true
&&
$conf
[
'postfix'
][
'init_script'
]
!=
''
)
system
(
$inst
->
getinitcommand
(
$conf
[
'postfix'
][
'init_script'
],
'restart'
));
...
...
@@ -696,6 +701,9 @@ if($install_mode == 'standard') {
swriteln
(
'Configuring Pureftpd'
);
$inst
->
configure_pureftpd
();
}
swriteln
(
'Detect IP addresses'
);
$inst
->
detect_ips
();
//** Configure DNS
if
(
strtolower
(
$inst
->
simple_query
(
'Configure DNS Server'
,
array
(
'y'
,
'n'
),
'y'
,
'configure_dns'
))
==
'y'
)
{
...
...
@@ -866,6 +874,9 @@ if($install_mode == 'standard') {
if
(
$conf
[
'nginx'
][
'php_fpm_init_script'
]
!=
''
)
system
(
$inst
->
getinitcommand
(
$conf
[
'nginx'
][
'php_fpm_init_script'
],
'reload'
));
if
(
$conf
[
'nginx'
][
'init_script'
]
!=
''
)
system
(
$inst
->
getinitcommand
(
$conf
[
'nginx'
][
'init_script'
],
'reload'
));
}
swriteln
(
'Detect IP addresses'
);
$inst
->
detect_ips
();
...
...
install/lib/installer_base.lib.php
View file @
d2227787
...
...
@@ -371,6 +371,84 @@ class installer_base {
}
public
function
detect_ips
(){
global
$conf
;
exec
(
"ip addr show | awk '/global/ { print $2 }' | cut -d '/' -f 1"
,
$output
,
$retval
);
if
(
$retval
==
0
){
if
(
is_array
(
$output
)
&&
!
empty
(
$output
)){
foreach
(
$output
as
$line
){
$line
=
trim
(
$line
);
$ip_type
=
''
;
if
(
filter_var
(
$line
,
FILTER_VALIDATE_IP
,
FILTER_FLAG_IPV4
))
{
$ip_type
=
'IPv4'
;
}
if
(
filter_var
(
$line
,
FILTER_VALIDATE_IP
,
FILTER_FLAG_IPV6
))
{
$ip_type
=
'IPv6'
;
}
if
(
$ip_type
==
''
)
continue
;
if
(
$this
->
db
->
dbHost
!=
$this
->
dbmaster
->
dbHost
){
$this
->
dbmaster
->
query
(
'INSERT INTO server_ip (
sys_userid, sys_groupid, sys_perm_user, sys_perm_group,
sys_perm_other, server_id, client_id, ip_type, ip_address,
virtualhost, virtualhost_port
) VALUES (
1,
1,
"riud",
"riud",
"",
'
.
$conf
[
'server_id'
]
.
',
0,
"'
.
$ip_type
.
'",
"'
.
$line
.
'",
"y",
"80,443"
)'
);
$server_ip_id
=
$this
->
dbmaster
->
insertID
();
$this
->
db
->
query
(
'INSERT INTO server_ip (
server_php_id, sys_userid, sys_groupid, sys_perm_user, sys_perm_group,
sys_perm_other, server_id, client_id, ip_type, ip_address,
virtualhost, virtualhost_port
) VALUES (
'
.
$server_ip_id
.
',
1,
1,
"riud",
"riud",
"",
'
.
$conf
[
'server_id'
]
.
',
0,
"'
.
$ip_type
.
'",
"'
.
$line
.
'",
"y",
"80,443"
)'
);
}
else
{
$this
->
db
->
query
(
'INSERT INTO server_ip (
sys_userid, sys_groupid, sys_perm_user, sys_perm_group,
sys_perm_other, server_id, client_id, ip_type, ip_address,
virtualhost, virtualhost_port
) VALUES (
1,
1,
"riud",
"riud",
"",
'
.
$conf
[
'server_id'
]
.
',
0,
"'
.
$ip_type
.
'",
"'
.
$line
.
'",
"y",
"80,443"
)'
);
}
}
}
}
}
public
function
grant_master_database_rights
(
$verbose
=
false
)
{
global
$conf
;
...
...
install/sql/ispconfig3.sql
View file @
d2227787
...
...
@@ -257,6 +257,9 @@ CREATE TABLE `client` (
`customer_no_counter`
int
(
11
)
NOT
NULL
DEFAULT
'0'
,
`added_date`
date
NOT
NULL
DEFAULT
'0000-00-00'
,
`added_by`
varchar
(
255
)
DEFAULT
NULL
,
`validation_status`
enum
(
'accept'
,
'review'
,
'reject'
)
NOT
NULL
DEFAULT
'accept'
,
`risk_score`
int
(
10
)
unsigned
NOT
NULL
DEFAULT
'0'
,
`activation_code`
varchar
(
10
)
NOT
NULL
DEFAULT
''
,
PRIMARY
KEY
(
`client_id`
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
utf8
AUTO_INCREMENT
=
1
;
...
...
@@ -455,6 +458,7 @@ CREATE TABLE IF NOT EXISTS `directive_snippets` (
`customer_viewable`
ENUM
(
'n'
,
'y'
)
NOT
NULL
DEFAULT
'n'
,
`required_php_snippets`
varchar
(
255
)
NOT
NULL
DEFAULT
''
,
`active`
enum
(
'n'
,
'y'
)
NOT
NULL
DEFAULT
'y'
,
`master_directive_snippets_id`
int
(
11
)
unsigned
NOT
NULL
DEFAULT
'0'
,
PRIMARY
KEY
(
`directive_snippets_id`
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
utf8
AUTO_INCREMENT
=
1
;
...
...
@@ -1946,6 +1950,7 @@ CREATE TABLE `web_domain` (
`enable_pagespeed`
ENUM
(
'y'
,
'n'
)
NOT
NULL
DEFAULT
'n'
,
`http_port`
int
(
11
)
unsigned
NOT
NULL
DEFAULT
'80'
,
`https_port`
int
(
11
)
unsigned
NOT
NULL
DEFAULT
'443'
,
`folder_directive_snippets`
text
NOT
NULL
,
PRIMARY
KEY
(
`domain_id`
),
UNIQUE
KEY
`serverdomain`
(
`server_id`
,
`ip_address`
,
`domain`
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
utf8
AUTO_INCREMENT
=
1
;
...
...
install/tpl/server.ini.master
View file @
d2227787
...
...
@@ -18,6 +18,7 @@ admin_notify_events=1
backup_dir=/var/backup
backup_dir_is_mount=n
backup_mode=rootgz
backup_time=0:00
backup_delete=n
monit_url=
monit_user=
...
...
@@ -46,7 +47,7 @@ relayhost_password=
mailbox_size_limit=0
message_size_limit=0
mailbox_quota_stats=y
realtime_blackhole_list=
realtime_blackhole_list=
zen.spamhaus.org
overquota_notify_admin=y
overquota_notify_client=y
overquota_notify_freq=7
...
...
@@ -78,7 +79,6 @@ apps_vhost_ip=_default_
apps_vhost_servername=
php_open_basedir=[website_path]/web:[website_path]/private:[website_path]/tmp:/var/www/[website_domain]/web:/srv/www/[website_domain]/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin
htaccess_allow_override=All
enable_spdy=y
awstats_conf_dir=/etc/awstats
awstats_data_dir=/var/lib/awstats
awstats_pl=/usr/lib/cgi-bin/awstats.pl
...
...
@@ -131,7 +131,7 @@ fastcgi_config_syntax=1
[jailkit]
jailkit_chroot_home=/home/[username]
jailkit_chroot_app_sections=basicshell editors extendedshell netutils ssh sftp scp groups jk_lsh
jailkit_chroot_app_programs=/usr/bin/groups /usr/bin/id /usr/bin/dircolors /usr/bin/lesspipe /usr/bin/basename /usr/bin/dirname /usr/bin/nano /usr/bin/pico /usr/bin/mysql /usr/bin/mysqldump /usr/bin/git /usr/bin/git-receive-pack /usr/bin/git-upload-pack /usr/bin/unzip /usr/bin/zip /bin/tar /bin/rm /usr/bin/patch
jailkit_chroot_app_programs=/usr/bin/groups /usr/bin/id /usr/bin/dircolors /usr/bin/lesspipe /usr/bin/basename /usr/bin/dirname /usr/bin/nano /usr/bin/pico /usr/bin/mysql /usr/bin/mysqldump /usr/bin/git /usr/bin/git-receive-pack /usr/bin/git-upload-pack /usr/bin/unzip /usr/bin/zip /bin/tar /bin/rm /usr/bin/patch
/usr/bin/which /usr/lib/x86_64-linux-gnu/libmemcached.so.11 /usr/lib/x86_64-linux-gnu/libmemcachedutil.so.2 /usr/lib/x86_64-linux-gnu/libMagickWand-6.Q16.so.2 /opt/php-5.6.8/bin/php /opt/php-5.6.8/include /opt/php-5.6.8/lib
jailkit_chroot_cron_programs=/usr/bin/php /usr/bin/perl /usr/share/perl /usr/share/php
[vlogger]
...
...
interface/lib/classes/functions.inc.php
View file @
d2227787
...
...
@@ -390,6 +390,334 @@ class functions {
return
getimagesizefromstring
(
$string
);
}
}
public
function
password
(
$minLength
=
10
,
$special
=
false
){
global
$app
;
$iteration
=
0
;
$password
=
""
;
$maxLength
=
$minLength
+
5
;
$length
=
$this
->
getRandomInt
(
$minLength
,
$maxLength
);
while
(
$iteration
<
$length
){
$randomNumber
=
(
floor
(((
mt_rand
()
/
mt_getrandmax
())
*
100
))
%
94
)
+
33
;
if
(
!
$special
){
if
((
$randomNumber
>=
33
)
&&
(
$randomNumber
<=
47
))
{
continue
;
}
if
((
$randomNumber
>=
58
)
&&
(
$randomNumber
<=
64
))
{
continue
;
}
if
((
$randomNumber
>=
91
)
&&
(
$randomNumber
<=
96
))
{
continue
;
}
if
((
$randomNumber
>=
123
)
&&
(
$randomNumber
<=
126
))
{
continue
;
}
}
$iteration
++
;
$password
.
=
chr
(
$randomNumber
);
}
$app
->
uses
(
'validate_password'
);
if
(
$app
->
validate_password
->
password_check
(
''
,
$password
,
''
)
!==
false
)
$password
=
$this
->
password
(
$minLength
,
$special
);
return
$password
;
}
public
function
getRandomInt
(
$min
,
$max
){
return
floor
((
mt_rand
()
/
mt_getrandmax
())
*
(
$max
-
$min
+
1
))
+
$min
;
}
public
function
generate_customer_no
(){
global
$app
;
// generate customer no.
$customer_no
=
mt_rand
(
100000
,
999999
);
while
(
$app
->
db
->
queryOneRecord
(
"SELECT client_id FROM client WHERE customer_no = '"
.
$customer_no
.
"'"
)){
$customer_no
=
mt_rand
(
100000
,
999999
);
}
return
$customer_no
;
}
public
function
generate_activation_code
(){
$activation_code
=
str_pad
(
mt_rand
(
0
,
99999999
),
8
,
'0'
,
STR_PAD_LEFT
);
return
$activation_code
;
}
public
function
client_activate
(
$client_id
){
global
$app
,
$conf
;
if
(
!
is_file
(
ISPC_WEB_PATH
.
'/robot/lib/robot_config.inc.php'
))
return
false
;
include
(
ISPC_WEB_PATH
.
'/robot/lib/robot_config.inc.php'
);
$context
=
stream_context_create
(
array
(
'ssl'
=>
array
(
'verify_peer'
=>
false
,
'verify_peer_name'
=>
false
,
)
));
$soap_client
=
new
SoapClient
(
null
,
array
(
'location'
=>
$robot_conf
[
'soap'
][
'soap_location'
],
'uri'
=>
$robot_conf
[
'soap'
][
'soap_uri'
],
'trace'
=>
1
,
'exceptions'
=>
1
,
'stream_context'
=>
$context
));
try
{
if
(
$session_id
=
$soap_client
->
login
(
$robot_conf
[
'soap'
][
'username'
]
,
$robot_conf
[
'soap'
][
'password'
]))
{
//echo 'Logged successfull. Session ID:'.$session_id.'<br />';
}
$error
=
''
;
$client_record
=
$soap_client
->
client_get
(
$session_id
,
$client_id
);
$client_record
[
'password'
]
=
$this
->
password
();
if
(
trim
(
$client_record
[
'customer_no'
])
==
''
)
$client_record
[
'customer_no'
]
=
$this
->
generate_customer_no
();
$client_record
[
'username'
]
=
'c'
.
$client_record
[
'customer_no'
];
//die($client_record['customer_no']);
//$client_record['locked'] = 'n';
$client_record
[
'canceled'
]
=
'n'
;
$soap_client
->
client_update
(
$session_id
,
$client_id
,
0
,
$client_record
);
$app
->
db
->
query
(
"UPDATE client SET validation_status = 'accept', activation_code = '' WHERE client_id = "
.
$client_id
);
$activation_letter_filename
=
ISPC_ROOT_PATH
.
'/pdf/activation_letters/c'
.
$client_id
.
'-'
.
$client_record
[
'activation_code'
]
.
'.pdf'
;
if
(
is_file
(
$activation_letter_filename
))
unlink
(
$activation_letter_filename
);
$webdetails
[
'ispconfiguser'
]
=
$client_record
[
'username'
];
$webdetails
[
'ispconfigpassword'
]
=
$client_record
[
'password'
];
$webdetails
[
'customer_no'
]
=
$client_record
[
'customer_no'
];
$webdetails
[
'contact'
]
=
(
$client_record
[
'contact_firstname'
]
!=
''
?
$client_record
[
'contact_firstname'
]
.
' '
:
''
)
.
$client_record
[
'contact_name'
];
$webdetails
[
'salutation_de'
]
=
(
$client_record
[
'gender'
]
==
'f'
?
'Frau'
:
'Herr'
);
$webdetails
[
'salutation_en'
]
=
(
$client_record
[
'gender'
]
==
'f'
?
'Mrs.'
:
'Mr.'
);
$webdetails
[
'ispconfigurl'
]
=
'http'
.
(
$_SERVER
[
'HTTPS'
]
==
'on'
?
's'
:
''
)
.
'://'
.
$_SERVER
[
'HTTP_HOST'
];
$webdetails
[
'signature_de'
]
=
$robot_conf
[
'textbaustein'
][
'emailfooter'
];
$webdetails
[
'signature_en'
]
=
$robot_conf
[
'textbaustein_en'
][
'emailfooter'
];
if
(
$error
==
''
){
// send email with login details
$invoice_client_settings
=
$app
->
db
->
queryOneRecord
(
"SELECT * FROM invoice_client_settings WHERE client_id = "
.
intval
(
$client_id
));
$company
=
$app
->
db
->
queryOneRecord
(
"SELECT * FROM invoice_company WHERE invoice_company_id = "
.
$invoice_client_settings
[
'invoice_company_id'
]);
$subject
=
'['
.
$company
[
'company_name_short'
]
.
'] Zugangsdaten zu unserem Kundeninterface / Login details for our customer interface'
;
$app
->
uses
(
'tpl'
);
$tpl
=
new
tpl
;
$tpl
->
newTemplate
(
ISPC_WEB_PATH
.
"/client/templates/ispconfig_login.master"
);
$tpl
->
setVar
(
$webdetails
);
$message
=
$tpl
->
grab
();
if
(
$robot_conf
[
'production_mode'
]){
$app
->
functions
->
mail
(
trim
(
$client_record
[
'email'
]),
$subject
,
$message
,
'support@timmehosting.de'
,
''
,
'application/pdf'
,
''
,
''
,
'f.timme@timmehosting.de,hetzner@timmehosting.de'
,
'TimmeHosting.de Support'
);
$app
->
db
->
query
(
"INSERT INTO `th_robot_message` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `client_id`, `subject`, `message`, `message_sent_date`, `message_sent_tstamp`, `email_from`, `email_to`, `email_to_bcc`) VALUES(1, 1, 'riud', 'riud', '', "
.
intval
(
$client_id
)
.
", '"
.
$app
->
db
->
quote
(
$subject
)
.
"', '"
.
$app
->
db
->
quote
(
$message
)
.
"', '"
.
date
(
'Y-m-d'
)
.
"', "
.
time
()
.
", 'support@timmehosting.de', '"
.
trim
(
$client_record
[
'email'
])
.
"', 'f.timme@timmehosting.de,hetzner@timmehosting.de')"
);
}
}
if
(
$soap_client
->
logout
(
$session_id
))
{
//echo 'Logged out.<br />';
}
}
catch
(
SoapFault
$e
)
{
//$error .= $client->__getLastResponse();
$error
.
=
'SOAP Error: '
.
$e
->
getMessage
();
}
}
public
function
client_activation_failed
(
$client
){
global
$app
,
$conf
;
if
(
!
is_file
(
ISPC_WEB_PATH
.
'/robot/lib/robot_config.inc.php'
))
return
false
;
include
(
ISPC_WEB_PATH
.
'/robot/lib/robot_config.inc.php'
);
$client_id
=
intval
(
$client
[
'client_id'
]);
$webdetails
[
'contact'
]
=
(
$client
[
'contact_firstname'
]
!=
''
?
$client
[
'contact_firstname'
]
.
' '
:
''
)
.
$client
[
'contact_name'
];
$webdetails
[
'salutation_de'
]
=
(
$client
[
'gender'
]
==
'f'
?
'Frau'
:
'Herr'
);
$webdetails
[
'salutation_en'
]
=
(
$client
[
'gender'
]
==
'f'
?
'Mrs.'
:
'Mr.'
);
$webdetails
[
'signature_de'
]
=
$robot_conf
[
'textbaustein'
][
'emailfooter'
];
$webdetails
[
'signature_en'
]
=
$robot_conf
[
'textbaustein_en'
][
'emailfooter'
];
// send email with login details
$invoice_client_settings
=
$app
->
db
->
queryOneRecord
(
"SELECT * FROM invoice_client_settings WHERE client_id = "
.
intval
(
$client_id
));
$company
=
$app
->
db
->
queryOneRecord
(
"SELECT * FROM invoice_company WHERE invoice_company_id = "
.
$invoice_client_settings
[
'invoice_company_id'
]);
$subject
=
'['
.
$company
[
'company_name_short'
]
.
'] Aktivierung Ihres Kundenaccounts fehlgeschlagen / Activation of your customer account failed'
;
$app
->
uses
(
'tpl'
);
$tpl
=
new
tpl
;
$tpl
->
newTemplate
(
ISPC_WEB_PATH
.
"/client/templates/ispconfig_client_activation_failed.master"
);
$tpl
->
setVar
(
$webdetails
);
$message
=
$tpl
->
grab
();
if
(
$robot_conf
[
'production_mode'
]){
$app
->
functions
->
mail
(
trim
(
$client
[
'email'
]),
$subject
,
$message
,
'support@timmehosting.de'
,
''
,
'application/pdf'
,
''
,
''
,
'f.timme@timmehosting.de,hetzner@timmehosting.de'
,
'TimmeHosting.de Support'
);
$app
->
db
->
query
(
"INSERT INTO `th_robot_message` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `client_id`, `subject`, `message`, `message_sent_date`, `message_sent_tstamp`, `email_from`, `email_to`, `email_to_bcc`) VALUES(1, 1, 'riud', 'riud', '', "
.
intval
(
$client_id
)
.
", '"
.
$app
->
db
->
quote
(
$subject
)
.
"', '"
.
$app
->
db
->
quote
(
$message
)
.
"', '"
.
date
(
'Y-m-d'
)
.
"', "
.
time
()
.
", 'support@timmehosting.de', '"
.
trim
(
$client
[
'email'
])
.
"', 'f.timme@timmehosting.de,hetzner@timmehosting.de')"
);
}
}
public
function
client_review
(
$client_id
){
global
$app
,
$conf
;
if
(
!
is_file
(
ISPC_WEB_PATH
.
'/robot/lib/robot_config.inc.php'
))
return
false
;
include
(
ISPC_WEB_PATH
.
'/robot/lib/robot_config.inc.php'
);
$context
=
stream_context_create
(
array
(
'ssl'
=>
array
(
'verify_peer'
=>
false
,
'verify_peer_name'
=>
false
,
)
));
$soap_client
=
new
SoapClient
(
null
,
array
(
'location'
=>
$robot_conf
[
'soap'
][
'soap_location'
],
'uri'
=>
$robot_conf
[
'soap'
][
'soap_uri'
],
'trace'
=>
1
,
'exceptions'
=>
1
,
'stream_context'
=>
$context
));
try
{
if
(
$session_id
=
$soap_client
->
login
(
$robot_conf
[
'soap'
][
'username'
]
,
$robot_conf
[
'soap'
][
'password'
]))
{
//echo 'Logged successfull. Session ID:'.$session_id.'<br />';
}
$error
=
''
;
$client_record
=
$soap_client
->
client_get
(
$session_id
,
$client_id
);
if
(
trim
(
$client_record
[
'customer_no'
])
==
''
){
$client_record
[
'customer_no'
]
=
$this
->
generate_customer_no
();
$soap_client
->
client_update
(
$session_id
,
$client_id
,
0
,
$client_record
);
}
$activation_code
=
$this
->
generate_activation_code
();
$app
->
db
->
query
(
"UPDATE client SET activation_code = '"
.
$activation_code
.
"'"
.
(
$client_record
[
'validation_status'
]
!=
'review'
?
", validation_status = 'review'"
:
""
)
.
" WHERE client_id = "
.
$client_id
);
$webdetails
[
'customer_no'
]
=
$client_record
[
'customer_no'
];
$webdetails
[
'contact'
]
=
(
$client_record
[
'contact_firstname'
]
!=
''
?
$client_record
[
'contact_firstname'
]
.
' '
:
''
)
.
$client_record
[
'contact_name'
];
$webdetails
[
'salutation_de'
]
=
(
$client_record
[
'gender'
]
==
'f'
?
'Frau'
:
'Herr'
);
$webdetails
[
'salutation_en'
]
=
(
$client_record
[
'gender'
]
==
'f'
?
'Mrs.'
:
'Mr.'
);
$webdetails
[
'signature_de'
]
=
$robot_conf
[
'textbaustein'
][
'emailfooter'
];
$webdetails
[
'signature_en'
]
=
$robot_conf
[
'textbaustein_en'
][
'emailfooter'
];
$webdetails
[
'email'
]
=
$client_record
[
'email'
];
include
ISPC_LIB_PATH
.
'/lang/'
.
strtolower
(
$client_record
[
'language'
])
.
'.lng'
;
$webdetails
[
'latest_activation_date'
]
=
date
(
$wb
[
'conf_format_dateshort'
],
$client_record
[
'created_at'
]
+
14
*
86400
);
if
(
$error
==
''
){
// send email with login details
$invoice_client_settings
=
$app
->
db
->
queryOneRecord
(
"SELECT * FROM invoice_client_settings WHERE client_id = "
.
intval
(
$client_id
));
$company
=
$app
->
db
->
queryOneRecord
(
"SELECT * FROM invoice_company WHERE invoice_company_id = "
.
$invoice_client_settings
[
'invoice_company_id'
]);
$subject
=
'['
.
$company
[
'company_name_short'
]
.
'] Aktivierung Ihres Kundenkontos / Activation of your customer account'
;
$webdetails
[
'company_name_short'
]
=
$company
[
'company_name_short'
];
$app
->
uses
(
'tpl'
);
$tpl
=
new
tpl
;
$tpl
->
newTemplate
(
ISPC_WEB_PATH
.
"/client/templates/ispconfig_client_activation_email.master"
);
$tpl
->
setVar
(
$webdetails
);
$message
=
$tpl
->
grab
();
if
(
$robot_conf
[
'production_mode'
]){
$app
->
functions
->
mail
(
trim
(
$client_record
[
'email'
]),
$subject
,
$message
,
'support@timmehosting.de'
,
''
,
'application/pdf'
,
''
,
''
,
'f.timme@timmehosting.de,hetzner@timmehosting.de'
,
'TimmeHosting.de Support'
);
$app
->
db
->
query
(
"INSERT INTO `th_robot_message` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `client_id`, `subject`, `message`, `message_sent_date`, `message_sent_tstamp`, `email_from`, `email_to`, `email_to_bcc`) VALUES(1, 1, 'riud', 'riud', '', "
.
intval
(
$client_id
)
.
", '"
.
$app
->
db
->
quote
(
$subject
)
.
"', '"
.
$app
->
db
->
quote
(
$message
)
.
"', '"
.
date
(
'Y-m-d'
)
.
"', "
.
time
()
.
", 'support@timmehosting.de', '"
.
trim
(
$client_record
[
'email'
])
.
"', 'f.timme@timmehosting.de,hetzner@timmehosting.de')"
);
}
}
// create activation letter pdf
$app
->
uses
(
'pdf'
);
$app
->
pdf
->
AliasNbPages
();
$app
->
pdf
->
createActivationLetter
(
$client_id
);
$pdf_content
=
$app
->
pdf
->
Output
(
'doc.pdf'
,
'S'
);
$activation_letter_filename
=
ISPC_ROOT_PATH
.
'/pdf/activation_letters/c'
.
$client_id
.
'-'
.
$activation_code
.
'.pdf'
;
file_put_contents
(
$activation_letter_filename
,
$pdf_content
);
if
(
is_file
(
$activation_letter_filename
)){
include
(
ISPC_WEB_PATH
.
'/billing/lib/onlinebrief24/Net/SFTP.php'
);
$sftp
=
new
Net_SFTP
(
'api.letterei-onlinebrief.de'
);
if
(
!
$sftp
->
login
(
$company
[
'onlinebrief24_user'
],
$company
[
'onlinebrief24_password'
]))
{
$error_msg
=
$app
->
lng
(
'onlinebrief24_login_failed_txt'
);
$app
->
error
(
$error_msg
);
}
$upload_filename
=
(
$company
[
'onlinebrief24_print'
]
==
'coloured'
?
'1'
:
'0'
)
.
'00'
.
(
$client_record
[
'country'
]
==
'DE'
?
'1'
:
'0'
)
.
'000000000-c'
.
$client_id
.
'-'
.
$activation_code
.
'.pdf'
;
//die($upload_filename);
$sftp
->
chdir
(
'upload/api'
);
$sftp
->
put
(
$upload_filename
,
$activation_letter_filename
,
NET_SFTP_LOCAL_FILE
);
}
if
(
$soap_client
->
logout
(
$session_id
))
{
//echo 'Logged out.<br />';
}
}
catch
(
SoapFault
$e
)
{
//$error .= $client->__getLastResponse();
$error
.
=
'SOAP Error: '
.
$e
->
getMessage
();
}
}
public
function
client_reject
(
$client_id
){
global
$app
,
$conf
;
if
(
!
is_file
(
ISPC_WEB_PATH
.
'/robot/lib/robot_config.inc.php'
))
return
false
;
include
(
ISPC_WEB_PATH
.
'/robot/lib/robot_config.inc.php'
);
$context
=
stream_context_create
(
array
(
'ssl'
=>
array
(
'verify_peer'
=>
false
,
'verify_peer_name'
=>
false
,
)
));
$soap_client
=
new
SoapClient
(
null
,
array
(
'location'
=>
$robot_conf
[
'soap'
][
'soap_location'
],
'uri'
=>
$robot_conf
[
'soap'
][
'soap_uri'
],
'trace'
=>
1
,
'exceptions'
=>
1
,
'stream_context'
=>
$context
));
try
{
if
(
$session_id
=
$soap_client
->
login
(
$robot_conf
[
'soap'
][
'username'
]
,
$robot_conf
[
'soap'
][
'password'
]))
{
//echo 'Logged successfull. Session ID:'.$session_id.'<br />';
}
$error
=
''
;
$client_record
=
$soap_client
->
client_get
(
$session_id
,
$client_id
);
$client_record
[
'locked'
]
=
'y'
;
$client_record
[
'canceled'
]
=
'y'
;
$soap_client
->
client_update
(
$session_id
,
$client_id
,
0
,
$client_record
);
$app
->
db
->
query
(
"UPDATE client SET validation_status = 'reject', activation_code = '' WHERE client_id = "
.
$client_id
);
$app
->
db
->
query
(
"DELETE FROM th_order WHERE client_id = "
.
$client_id
);
$activation_letter_filename
=
ISPC_ROOT_PATH
.
'/pdf/activation_letters/c'
.
$client_id
.
'-'
.
$client_record
[
'activation_code'
]
.
'.pdf'
;
if
(
is_file
(
$activation_letter_filename
))
unlink
(
$activation_letter_filename
);
$webdetails
[
'contact'
]
=
(
$client_record
[
'contact_firstname'
]
!=
''
?
$client_record
[
'contact_firstname'
]
.
' '
:
''
)
.
$client_record
[
'contact_name'
];
$webdetails
[
'salutation_de'
]
=
(
$client_record
[
'gender'
]
==
'f'
?
'Frau'
:
'Herr'
);
$webdetails
[
'salutation_en'
]
=
(
$client_record
[
'gender'
]
==
'f'
?
'Mrs.'
:
'Mr.'
);
$webdetails
[
'signature_de'
]
=
$robot_conf
[
'textbaustein'
][
'emailfooter'
];
$webdetails
[
'signature_en'
]
=
$robot_conf
[
'textbaustein_en'
][
'emailfooter'
];
if
(
$error
==
''
){
// send email with login details
$invoice_client_settings
=
$app
->
db
->
queryOneRecord
(
"SELECT * FROM invoice_client_settings WHERE client_id = "
.
intval
(
$client_id
));
$company
=
$app
->
db
->
queryOneRecord
(
"SELECT * FROM invoice_company WHERE invoice_company_id = "
.
$invoice_client_settings
[
'invoice_company_id'
]);
$subject
=
'['
.
$company
[
'company_name_short'
]
.
'] Sperrung Ihres Kundenaccounts / Suspension of your customer account'
;
$app
->
uses
(
'tpl'
);
$tpl
=
new
tpl
;
$tpl
->
newTemplate
(
ISPC_WEB_PATH
.
"/client/templates/ispconfig_client_rejection.master"
);
$tpl
->
setVar
(
$webdetails
);
$message
=
$tpl
->
grab
();
if
(
$robot_conf
[
'production_mode'
]){
$app
->
functions
->
mail
(
trim
(
$client_record
[
'email'
]),
$subject
,
$message
,
'support@timmehosting.de'
,
''
,
'application/pdf'
,
''
,
''
,
'f.timme@timmehosting.de,hetzner@timmehosting.de'
,
'TimmeHosting.de Support'
);
$app
->
db
->
query
(
"INSERT INTO `th_robot_message` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `client_id`, `subject`, `message`, `message_sent_date`, `message_sent_tstamp`, `email_from`, `email_to`, `email_to_bcc`) VALUES(1, 1, 'riud', 'riud', '', "
.
intval
(
$client_id
)
.
", '"
.
$app
->
db
->
quote
(
$subject
)
.
"', '"
.
$app
->
db
->
quote
(
$message
)
.
"', '"
.
date
(
'Y-m-d'
)
.
"', "
.
time
()
.
", 'support@timmehosting.de', '"
.
trim
(
$client_record
[
'email'
])
.
"', 'f.timme@timmehosting.de,hetzner@timmehosting.de')"
);
}
}
if
(
$soap_client
->
logout
(
$session_id
))
{
//echo 'Logged out.<br />';
}
}
catch
(
SoapFault
$e
)
{
//$error .= $client->__getLastResponse();
$error
.
=
'SOAP Error: '
.
$e
->
getMessage
();
}
}
}
...
...
interface/lib/classes/listform.inc.php
View file @
d2227787
...
...
@@ -257,10 +257,23 @@ class listform {
$searchval
=
$year
.
'-'
.
$month
.
'-'
.
$day
;
}
}
if
(
$i
[
'datatype'
]
==
'BOOLEAN'
&&
$searchval
!=
''
){
if
(
!
function_exists
(
'boolval'
))
{
$searchval
=
(
bool
)
$searchval
;
if
(
$searchval
===
true
){
$searchval
=
'TRUE'
;
}
else
{
$searchval
=
'FALSE'
;
}
}
else
{
$searchval
=
boolval
(
$searchval
)
?
'TRUE'
:
'FALSE'
;
}
}
// if($_REQUEST[$search_prefix.$field] != '') $sql_where .= " $field ".$i["op"]." '".$i["prefix"].$_REQUEST[$search_prefix.$field].$i["suffix"]."' and";
if
(
isset
(
$searchval
)
&&
$searchval
!=
''
){
$sql_where
.
=
" "
.
(
$table
!=
''
?
$table
.
'.'
:
$this
->
listDef
[
'table'
]
.
'.'
)
.
"
$field
"
.
$i
[
'op'
]
.
" '"
.
$app
->
db
->
quote
(
$i
[
'prefix'
]
.
$searchval
.
$i
[
'suffix'
])
.
"
'
and"
;
$sql_where
.
=
" "
.
(
$table
!=
''
?
$table
.
'.'
:
$this
->
listDef
[
'table'
]
.
'.'
)
.
"
$field
"
.
$i
[
'op'
]
.
"
"
.
(
$i
[
'datatype'
]
==
'BOOLEAN'
?
""
:
"
'"
)
.
$app
->
db
->
quote
(
$i
[
'prefix'
]
.
$searchval
.
$i
[
'suffix'
])
.
(
$i
[
'datatype'
]
==
'BOOLEAN'
?
""
:
"'"
)
.
" and"
;
}
}
}
...
...
@@ -384,7 +397,7 @@ class listform {
if
(
isset
(
$vars
[
'show_page_back'
])
&&
$vars
[
'show_page_back'
]
==
1
){
$content
.
=
'<li><a href="#" data-load-content="'
.
$vars
[
'list_file'
]
.
'?page=0'
.
$vars
[
'page_params'
]
.
'" aria-label="First">
<span aria-hidden="true">«</span></a></li>'
;
$content
.
=
'<li><a href="#" data-load-content='
.
$vars
[
'list_file'
]
.
'?page='
.
$vars
[
'last_page'
]
.
$vars
[
'page_params'
]
.
'" aria-label="Previous">
$content
.
=
'<li><a href="#" data-load-content=
"
'
.
$vars
[
'list_file'
]
.
'?page='
.
$vars
[
'last_page'
]
.
$vars
[
'page_params'
]
.
'" aria-label="Previous">
<span aria-hidden="true">‹</span></a></li>'
;
}
$prev
=
-
1
;
...
...
@@ -501,6 +514,14 @@ class listform {
case
'CURRENCY'
:
$record
[
$key
]
=
$app
->
functions
->
currency_format
(
$record
[
$key
]);
break
;
case
'BOOLEAN'
:
if
(
!
function_exists
(
'boolval'
))
{
$record
[
$key
]
=
(
bool
)
$record
[
$key
];
}
else
{
$record
[
$key
]
=
boolval
(
$record
[
$key
]);
}
break
;
default
:
$record
[
$key
]
=
htmlentities
(
stripslashes
(
$record
[
$key
]),
ENT_QUOTES
,
$conf
[
"html_content_encoding"
]);
...
...
@@ -564,6 +585,14 @@ class listform {
case
'CURRENCY'
:
$record
[
$key
]
=
str_replace
(
','
,
'.'
,
$record
[
$key
]);
break
;
case
'BOOLEAN'
:
if
(
!
function_exists
(
'boolval'
))
{
$record
[