| | |
| | | - removed hardcoded data size in iil_ReadLine() |
| | | - added iil_PutLine() wrapper for fputs() |
| | | - code cleanup and identation fixes |
| | | - removed flush() calls in iil_C_HandlePartBody() to prevent from memory leak (#1485187) |
| | | - don't return "??" from iil_C_GetQuota() |
| | | |
| | | ********************************************************/ |
| | | |
| | |
| | | if ($mode == 1) { |
| | | $result .= rtrim($line, "\t\r\n\0\x0B") . "\n"; |
| | | } else if ($mode == 2) { |
| | | echo rtrim($line, "\t\r\n\0\x0B") . "\n"; flush(); |
| | | echo rtrim($line, "\t\r\n\0\x0B") . "\n"; |
| | | } else if ($mode == 3) { |
| | | echo base64_decode($line); flush(); |
| | | echo base64_decode($line); |
| | | } |
| | | } |
| | | } |
| | |
| | | $line = iil_ReadLine($fp, 5000); |
| | | $line = iil_MultLine($fp, $line); |
| | | list(, $index, $cmd, $rest) = explode(' ', $line); |
| | | if ($cmd != 'FETCH' || $index == $id) |
| | | if ($cmd != 'FETCH' || $index == $id || preg_match("/^$key/", $line)) |
| | | $result .= $line; |
| | | } while (!preg_match("/^$key/", $line)); |
| | | |
| | | $result = trim(substr($result, strpos($result, 'BODYSTRUCTURE')+13)); |
| | | $result = trim(substr($result, strpos($result, 'BODYSTRUCTURE')+13, -(strlen($result)-strrpos($result, $key)+1))); |
| | | } |
| | | } |
| | | return $result; |
| | |
| | | $parts = explode(' ', $quota_line); |
| | | $storage_part = array_search('STORAGE', $parts); |
| | | if ($storage_part > 0) { |
| | | $result = array(); |
| | | $used = $parts[$storage_part+1]; |
| | | $total = $parts[$storage_part+2]; |
| | | |
| | | $result['used'] = $used; |
| | | $result['total'] = (empty($total)?"??":$total); |
| | | $result['percent'] = (empty($total)?"??":round(($used/$total)*100)); |
| | | $result['used'] = intval($parts[$storage_part+1]); |
| | | $result['total'] = intval($parts[$storage_part+2]); |
| | | $result['percent'] = min(100, round(($result['used']/max(1,$result['total']))*100)); |
| | | $result['free'] = 100 - $result['percent']; |
| | | } |
| | | } |