diff --git a/var/www/cron.php b/var/www/cron.php index 2334dbb..2278c5a 100644 --- a/var/www/cron.php +++ b/var/www/cron.php @@ -36,7 +36,36 @@ $reload[$account['instance']] = true; //add and manage rights of system user $shell = ENABLE_SHELL_ACCESS ? '/bin/bash' : '/usr/sbin/nologin'; - exec('useradd -l -g www-data -k /var/www/skel -m -s ' . escapeshellarg($shell) . ' ' . escapeshellarg($system_account)); + exec('useradd -l -g www-data -m -s ' . escapeshellarg($shell) . ' ' . escapeshellarg($system_account)); + //generate default hosting page + $home = "/home/$system_account"; + $dir = "$home/www"; + $file = "$dir/index.hosting.html"; + if (!is_dir($dir)) { + mkdir($dir, 0755, true); + } + $content = sprintf( + ' + + + + Site hosted by %s service + + + +

This site is hosted by %s service.

+ + ', + htmlspecialchars(SITE_NAME, ENT_QUOTES, 'UTF-8'), + htmlspecialchars(ADDRESS, ENT_QUOTES, 'UTF-8'), + htmlspecialchars(SITE_NAME, ENT_QUOTES, 'UTF-8') + ); + file_put_contents($file, $content); + chown($dir, $system_account); + chgrp($dir, 'www-data'); + chown($file, $system_account); + chgrp($file, 'www-data'); + //////// update_system_user_password($system_account, $account['password']); setup_chroot($system_account, $last_account); $last_account = $system_account;