0) { $exists = true; } return $exists; } $rtorrent = processExists("\"main|rtorrent\"",$username); //Unit Conversion function formatsize($size) { $danwei=array(' B ',' KB ',' MB ',' GB ',' TB '); $allsize=array(); $i=0; for($i = 0; $i <5; $i++) { if(floor($size/pow(1024,$i))==0){break;} } for($l = $i-1; $l >=0; $l--) { $allsize1[$l]=floor($size/pow(1024,$l)); $allsize[$l]=$allsize1[$l]-$allsize1[$l+1]*1024; } $len=count($allsize); for($j = $len-1; $j >=0; $j--) { $fsize=$fsize.$allsize[$j].$danwei[$j]; } return $fsize; } $location = "/home"; $base = 1024; $si_prefix = array( 'b', 'k', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB' ); $torrents = shell_exec("ls /home/".$username."/.sessions/*.torrent|wc -l"); $php_self = $_SERVER['PHP_SELF']; $web_path = substr($php_self, 0, strrpos($php_self, '/')+1); $time = microtime(); $time = explode(" ", $time); $time = $time[1] + $time[0]; $start = $time; if (file_exists('/usr/sbin/repquota')) { $dftotal = shell_exec("sudo /usr/sbin/repquota /mnt|/bin/grep ^".$username."|/usr/bin/awk '{printf \$4/1024/1024}'"); $dffree = shell_exec("sudo /usr/sbin/repquota /mnt|/bin/grep ^".$username."|/usr/bin/awk '{printf (\$4-\$3)/1024/1024}'"); $dfused = shell_exec("sudo /usr/sbin/repquota /mnt|/bin/grep ^".$username."|/usr/bin/awk '{printf \$3/1024/1024}'"); $perused = sprintf('%1.0f', $dfused / $dftotal * 100); } else { $bytesfree = disk_free_space('/mnt'); $class = min((int)log($bytesfree,$base),count($si_prefix) - 1); $bytestotal = disk_total_space($location); $class = min((int)log($bytesfree,$base),count($si_prefix) - 1); $bytesused = $bytestotal - $bytesfree; try { $diskStatus = new DiskStatus('/mnt'); $freeSpace = $diskStatus->freeSpace(); $totalSpace = $diskStatus->totalSpace(); $barWidth = ($diskStatus->usedSpace()/500) * 500; } catch (Exception $e) { $spacebodyerr .= 'Error ('.$e-getMessage().')'; exit(); } //hard disk $dftotal = round(@disk_total_space(".")/(1024*1024*1024),3); //Total $dffree = round(@disk_free_space(".")/(1024*1024*1024),3); //Available $dfused = $dftotal-$dffree; //used $perused = (floatval($dftotal)!=0)?round($dfused/$dftotal*100,2):0; //$perused = sprintf('%1.0f', $bytesused / $bytestotal * 100); } if (file_exists('/home/'.$username.'/.sessions/rtorrent.lock')) { $rtorrents = shell_exec("ls /home/".$username."/.sessions/*.torrent|wc -l"); } ?>

Free: GB

Used: GB

Size: GB

Disk Space

"70") { $diskcolor="progress-bar-warning"; } if ($perused > "90") { $diskcolor="progress-bar-danger"; } ?>
%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="" role="progressbar" class="progress-bar "> % Used

You have used % of your total disk space


Torrents in rtorrent

There are torrents loaded.