diff --git a/var/www/common.php b/var/www/common.php index 06dd05b..cc3c194 100644 --- a/var/www/common.php +++ b/var/www/common.php @@ -964,13 +964,6 @@ function setup_chroot(string $account, string $last_account){ $passwd_line = "$user[name]:$user[passwd]:$user[uid]:$user[gid]:$user[gecos]:/:$user[shell]"; exec('/var/www/setup_chroot.sh ' . escapeshellarg("/home/$system_account")); file_put_contents("/home/$system_account/etc/passwd", $passwd_line, FILE_APPEND); - if($last_account !== false){ - exec('hardlink -c ' . escapeshellarg("/home/$system_account/bin") . ' ' . escapeshellarg("/home/$last_account/bin")); - exec('hardlink -c ' . escapeshellarg("/home/$system_account/etc") . ' ' . escapeshellarg("/home/$last_account/etc")); - exec('hardlink -c ' . escapeshellarg("/home/$system_account/lib") . ' ' . escapeshellarg("/home/$last_account/lib")); - exec('hardlink -c ' . escapeshellarg("/home/$system_account/lib64") . ' ' . escapeshellarg("/home/$last_account/lib64")); - exec('hardlink -c ' . escapeshellarg("/home/$system_account/usr") . ' ' . escapeshellarg("/home/$last_account/usr")); - } foreach(['.cache', '.composer', '.config', '.gnupg', '.local', '.ssh', 'data', 'Maildir'] as $dir){ if(!is_dir("/home/$system_account/$dir")){ mkdir("/home/$system_account/$dir", 0700); @@ -993,6 +986,13 @@ function setup_chroot(string $account, string $last_account){ chown("/home/$system_account/$file", $system_account); chgrp("/home/$system_account/$file", 'www-data'); } + if($last_account !== false){ + exec('hardlink -t -s 0 -m ' . escapeshellarg("/home/$system_account/bin") . ' ' . escapeshellarg("/home/$last_account/bin")); + exec('hardlink -t -s 0 -m ' . escapeshellarg("/home/$system_account/etc") . ' ' . escapeshellarg("/home/$last_account/etc")); + exec('hardlink -t -s 0 -m ' . escapeshellarg("/home/$system_account/lib") . ' ' . escapeshellarg("/home/$last_account/lib")); + exec('hardlink -t -s 0 -m ' . escapeshellarg("/home/$system_account/lib64") . ' ' . escapeshellarg("/home/$last_account/lib64")); + exec('hardlink -t -s 0 -m ' . escapeshellarg("/home/$system_account/usr") . ' ' . escapeshellarg("/home/$last_account/usr")); + } } function update_system_user_password(string $user, string $password){ diff --git a/var/www/cron.php b/var/www/cron.php index de3b8a0..cf1e2bb 100644 --- a/var/www/cron.php +++ b/var/www/cron.php @@ -15,6 +15,8 @@ $newest_account=$db->query('SELECT system_account FROM users WHERE id NOT IN (SE $last_account = $newest_account->fetch(PDO::FETCH_NUM); if(is_array($last_account)){ $last_account = $last_account[0]; +} else { + $last_account = ''; } $del=$db->prepare("DELETE FROM new_account WHERE user_id=?;"); $approval = REQUIRE_APPROVAL ? 'WHERE new_account.approved=1': ''; @@ -144,7 +146,7 @@ while($account=$stmt->fetch(PDO::FETCH_ASSOC)){ echo "ERROR: Account $account[system_account] looks strange\n"; continue; } - exec('quotatool -u '. escapeshellarg($system_account) . ' -i -q ' . escapeshellarg($account['quota_files']) . ' -l ' . escapeshellarg($account['quota_size']) . ' ' . HOME_MOUNT_PATH); - exec('quotatool -u '. escapeshellarg($system_account) . ' -b -q ' . escapeshellarg($account['quota_files']) . ' -l ' . escapeshellarg($account['quota_size']) . ' ' . HOME_MOUNT_PATH); + exec('quotatool -u '. escapeshellarg($system_account) . ' -i -q ' . escapeshellarg($account['quota_files']) . ' -l ' . escapeshellarg($account['quota_files']) . ' ' . HOME_MOUNT_PATH); + exec('quotatool -u '. escapeshellarg($system_account) . ' -b -q ' . escapeshellarg($account['quota_size']) . ' -l ' . escapeshellarg($account['quota_size']) . ' ' . HOME_MOUNT_PATH); $updated->execute([$account['id']]); } diff --git a/var/www/html/index.php b/var/www/html/index.php index 6884f56..48a957c 100644 --- a/var/www/html/index.php +++ b/var/www/html/index.php @@ -12,14 +12,14 @@ header('X-Accel-Expires: 60');

Hosting - Info

Info | Register | Login | List of hosted sites | FAQ

-

Here you can get yourself a hosting account on my server.

-

What you will get:

+

Here you can get yourself a free web hosting account on my server.

+

What you get: