*/
function s2p($s)
{
+ $block_size = 8;
$p = '';
for ($i = 0; $i < strlen($s); $i++) {
- $p .= $s{$i} . '/';
+ $p .= $s{$i};
+ if (($i + 1) % $block_size == 0) {
+ $p .= '/';
+ }
+ }
+ if (strlen($s) % $block_size != 0) {
+ $p .= '/';
}
return $p;
}
echo t('LS_FILES');
}
echo '</legend>';
- echo '<table>';
+ echo '<table border="1" width="1100">';
echo '<tr>';
- echo '<td>' . t('FILENAME') . '</td>';
- echo '<td>' . t('TYPE') . '</td>';
- echo '<td>' . t('SIZE') . '</td>';
- echo '<td>' . t('EXPIRE') . '</td>';
- echo '<td>' . t('ONETIME') . '</td>';
- echo '<td>' . t('UPLOAD_DATE') . '</td>';
- echo '<td>' . t('ORIGIN') . '</td>';
- echo '<td>' . t('ACTION') . '</td>';
+ echo '<th>' . t('FILENAME') . '</th>';
+ echo '<th>' . t('TYPE') . '</th>';
+ echo '<th>' . t('SIZE') . '</th>';
+ echo '<th>' . t('EXPIRE') . '</th>';
+ echo '<th>' . t('ONETIME') . '</th>';
+ echo '<th>' . t('UPLOAD_DATE') . '</th>';
+ echo '<th>' . t('ORIGIN') . '</th>';
+ echo '<th>' . t('ACTION') . '</th>';
echo '</tr>';
/* Get all links files. */
return true;
}
+ // Allow if ip is in array (no password)
+ foreach ($cfg['upload_ip_nopassword'] as $i) {
+ if ($i == $ip) {
+ return true;
+ }
+ // CIDR test for IPv4 only.
+ if (strpos ($i, '/') !== false)
+ {
+ list ($subnet, $mask) = explode('/', $i);
+ if ((ip2long ($ip) & ~((1 << (32 - $mask)) - 1) ) == ip2long ($subnet)) {
+ return true;
+ }
+ }
+ }
+
// Allow if ip is in array
foreach ($cfg['upload_ip'] as $i) {
if ($i == $ip) {