Skip to content

Commit abd0357

Browse files
author
Till Brehm
committed
Fix website quota issues #4176 and #4187
1 parent c8667c4 commit abd0357

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

server/plugins-available/apache2_plugin.inc.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -889,18 +889,19 @@ function update($event_name, $data) {
889889
$file_system = $df_output[0];
890890
$primitive_root = $df_output[1];
891891

892-
if ( in_array($file_system , array('ext2','ext3','ext4','simfs','reiserfs'), true) ) {
893-
exec('setquota -u '. $username . ' ' . $blocks_soft . ' ' . $blocks_hard . ' 0 0 -a &> /dev/null');
894-
exec('setquota -T -u '.$username.' 604800 604800 -a &> /dev/null');
895-
} elseif ($file_system == 'xfs') {
896-
897-
exec("xfs_quota -x -c 'limit -g bsoft=$mb_soft" . 'm'. " bhard=$mb_hard" . 'm'. " $username' $primitive_root");
892+
if($file_system == 'xfs') {
893+
exec("xfs_quota -x -c 'limit -g bsoft=$mb_soft" . 'm'. " bhard=$mb_hard" . 'm'. " $username' $primitive_root");
898894

899895
// xfs only supports timers globally, not per user.
900896
exec("xfs_quota -x -c 'timer -bir -i 604800'");
901897

902898
unset($project_uid, $username_position, $xfs_projects);
903899
unset($primitive_root, $df_output, $mb_hard, $mb_soft);
900+
} else {
901+
if($app->system->is_installed('setquota')) {
902+
exec('setquota -u '. $username . ' ' . $blocks_soft . ' ' . $blocks_hard . ' 0 0 -a &> /dev/null');
903+
exec('setquota -T -u '.$username.' 604800 604800 -a &> /dev/null');
904+
}
904905
}
905906
}
906907

server/plugins-available/nginx_plugin.inc.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -747,18 +747,19 @@ function update($event_name, $data) {
747747
$file_system = $df_output[0];
748748
$primitive_root = $df_output[1];
749749

750-
if ( in_array($file_system , array('ext2','ext3','ext4','simfs','reiserfs'), true) ) {
751-
exec('setquota -u '. $username . ' ' . $blocks_soft . ' ' . $blocks_hard . ' 0 0 -a &> /dev/null');
752-
exec('setquota -T -u '.$username.' 604800 604800 -a &> /dev/null');
753-
} elseif ($file_system == 'xfs') {
754-
755-
exec("xfs_quota -x -c 'limit -g bsoft=$mb_soft" . 'm'. " bhard=$mb_hard" . 'm'. " $username' $primitive_root");
750+
if($file_system == 'xfs') {
751+
exec("xfs_quota -x -c 'limit -g bsoft=$mb_soft" . 'm'. " bhard=$mb_hard" . 'm'. " $username' $primitive_root");
756752

757753
// xfs only supports timers globally, not per user.
758754
exec("xfs_quota -x -c 'timer -bir -i 604800'");
759755

760756
unset($project_uid, $username_position, $xfs_projects);
761757
unset($primitive_root, $df_output, $mb_hard, $mb_soft);
758+
} else {
759+
if($app->system->is_installed('setquota')) {
760+
exec('setquota -u '. $username . ' ' . $blocks_soft . ' ' . $blocks_hard . ' 0 0 -a &> /dev/null');
761+
exec('setquota -T -u '.$username.' 604800 604800 -a &> /dev/null');
762+
}
762763
}
763764
}
764765

0 commit comments

Comments
 (0)