Example #1
0
             }
         }
         if (!$error) {
             // Got a file of some sort
             $message = process_csv(e_UPLOAD . $files[0]['name'], intval(varset($_POST['ban_over_import'], 0)), intval(varset($_POST['ban_over_expiry'], 0)), $separator_char[intval(varset($_POST['ban_separator'], 1))], $quote_char[intval(varset($_POST['ban_quote'], 3))]);
             banlist_adminlog('07', 'File: ' . e_UPLOAD . $files[0]['name'] . '<br />' . $message);
         }
     }
     $text = "\n\t\t\t<form method='post' action='" . e_ADMIN_ABS . "banlist_export.php' id='core-banlist-transfer-form' >\n\t\t\t\t<fieldset id='core-banlist-transfer-export'>\n\t\t\t\t\t<legend>" . BANLAN_40 . "</legend>\n\t\t\t\t\t<table class='table adminlist'>\n\t\t\t\t\t\t<colgroup>\n\t\t\t\t\t\t\t<col style='width:30%' />\n\t\t\t\t\t\t\t<col style='width:30%' />\n\t\t\t\t\t\t\t<col style='width:40%' />\n\t\t\t\t\t\t</colgroup>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th colspan='2'>" . BANLAN_36 . "</th>\n\t\t\t\t\t\t\t\t<th>&nbsp;</th>\n\t\t\t\t\t\t\t</tr>\n\t\t\t";
     foreach ($ipAdministrator->getValidReasonList() as $i) {
         $text .= "\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan='3'>\n\t\t\t\t\t\t\t\t" . $frm->checkbox("ban_types[{$i}]", $i) . $frm->label($ipAdministrator->getBanTypeString($i, FALSE), "ban_types[{$i}]", $i) . "\n\t\t\t\t\t\t\t\t<span class='field-help'>(" . $ipAdministrator->getBanTypeString($i, TRUE) . ")</span>\n\t\t\t\t\t\t\t</td></tr>\n\t\t\t";
     }
     $text .= "<tr>\n\t\t\t<td>" . BANLAN_79 . "</td>\n\t\t\t<td>" . select_box('ban_separator', $separator_char) . ' ' . BANLAN_37 . "</td>\n\t\t<td>" . select_box('ban_quote', $quote_char) . ' ' . BANLAN_38 . "</td></tr>";
     $text .= "\n\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t\t<div class='buttons-bar center'>" . $frm->admin_button('ban_export', BANLAN_39, 'export', BANLAN_39) . "</div>\n\t\t\t\t\t\t<input type='hidden' name='e-token' value='" . e_TOKEN . "' />\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t";
     // Now do the import options
     $text .= "\n\t\t\t<form enctype='multipart/form-data' method='post' action='" . e_SELF . "?transfer' id='ban_import_form' >\n\t\t\t\t<fieldset id='core-banlist-transfer-import'>\n\t\t\t\t\t<legend>" . BANLAN_41 . "</legend>\n\t\t\t\t\t<table class='table adminlist'>\n\t\t\t\t\t\t<colgroup>\n\t\t\t\t\t\t\t<col style='width:30%' />\n\t\t\t\t\t\t\t<col style='width:30%' />\n\t\t\t\t\t\t\t<col style='width:40%' />\n\t\t\t\t\t\t</colgroup>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th colspan='2'>" . BANLAN_42 . "</th>\n\t\t\t\t\t\t\t\t<th>&nbsp;</th>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td colspan='3'>" . $frm->checkbox('ban_over_import', 1) . $frm->label(BANLAN_43, 'ban_over_import', 1) . "</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td colspan='3'>" . $frm->checkbox('ban_over_expiry', 1) . $frm->label(BANLAN_44, 'ban_over_expiry', 1) . "</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>" . BANLAN_46 . "</td>\n\t\t\t\t\t\t\t\t<td colspan='2'>\n\t\t\t\t\t\t\t\t\t" . $frm->file('file_userfile[]', array('size' => '40')) . "\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t<td>" . BANLAN_80 . "</td>\n\t\t\t<td>" . select_box('ban_separator', $separator_char) . ' ' . BANLAN_37 . "</td>\n\t\t<td>" . select_box('ban_quote', $quote_char) . ' ' . BANLAN_38 . "</td></tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t<div class='buttons-bar center'>\n\t\t\t\t\t\t\t\t" . $frm->admin_button('ban_import', BANLAN_45, 'import') . "\n\t\t\t\t\t\t\t\t<input type='hidden' name='e-token' value='" . e_TOKEN . "' />\n\t\t\t\t\t\t\t\t</div>\n\n\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t";
     e107::getRender()->tablerender(BANLAN_35, $emessage->render() . $text);
     break;
     // End case 'transfer'
 // End case 'transfer'
 case 'list':
 case 'white':
 default:
     if ($action != 'list' && $action != 'white') {
         $action = 'list';
     }
     $edit_action = $action == 'list' ? 'edit' : 'whedit';
     $del_action = $action == 'list' ? 'remove' : 'whremove';
     $col_widths = array('list' => array(10, 5, 35, 30, 10, 10), 'white' => array(15, 40, 35, 10));
     $col_titles = array('list' => array(BANLAN_17, BANLAN_20, BANLAN_10, BANLAN_19, BANLAN_18, LAN_OPTIONS), 'white' => array(BANLAN_55, BANLAN_56, BANLAN_19, LAN_OPTIONS));
     $no_values = array('list' => BANLAN_2, 'white' => BANLAN_54);
Example #2
0
    } else {
        $pathup = "<a class='action' href='" . e_SELF . "?" . substr($path, 0, strrpos(substr($path, 0, -1), "/")) . "/'><img class='icon S24' src='" . $imagedir . "updir.png' alt='" . FMLAN_30 . "' /></a>";
    }
}
$text .= "\n\t<form enctype='multipart/form-data' action='" . e_SELF . (e_QUERY ? "?" . e_QUERY : "") . "' method='post'>\n\t\t<fieldset id='core-filemanager'>\n\t\t\t<legend class='e-hideme'>XX</legend>\n\t\t\t<table class='table adminlist'>\n\t\t\t\t<colgroup>\n\t\t\t\t\t<col style='width:  5%' />\n\t\t\t\t\t<col style='width: 40%' />\n\t\t\t\t\t<col style='width: 20%' />\n\t\t\t\t\t<col style='width: 15%' />\n\t\t\t\t</colgroup>\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th class='center'>\n\t\t\t\t\t\t\t" . $pathup . "\n\t\t\t\t\t\t<!-- <a href='filemanager.php'><img src='" . $imagedir . "home.png' alt='" . FMLAN_16 . "' /></a> -->\n\t\t\t\t\t\t\t<input type='hidden' name='MAX_FILE_SIZE' value='{$max_file_size}' />\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th class='center'>" . FMLAN_17 . "</th>\n\t\t\t\t\t\t<th class='center'>" . FMLAN_18 . "</th>\n\t\t\t\t\t\t<th class='center'>" . FMLAN_19 . "</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n";
$c = 0;
while ($dirs[$c]) {
    $dirsize = dirsize($path . $dirs[$c]);
    $el_id = str_replace(array('/', '_', ' ', '\\'), '-', $path . $dirs[$c]);
    if (FILE_UPLOADS && is_writable(e_BASE . $path . $dirs[$c])) {
        $up_button = $frm->admin_button('erquest', FMLAN_21, 'action', '', array('id' => false, 'other' => "onclick='e107Helper.toggle(\"{$el_id}\")'"));
    } else {
        $up_button = "&nbsp;leave_32.png";
    }
    //FIXME - upload link not working, raplace with image
    $text .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='center middle'><a href='#{$el_id}' class='e-expandit'>upload</a></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<a class='action' href='" . e_SELF . "?" . $path . $dirs[$c] . "/'><img class='icon action S16' src='" . $imagedir . "folder.png' alt='" . $dirs[$c] . " " . FMLAN_31 . "' /></a>\n\t\t\t\t\t\t\t<a href='" . e_SELF . "?" . $path . $dirs[$c] . "/'>" . $dirs[$c] . "</a>\n\t\t\t\t\t\t\t<div class='e-hideme' id='{$el_id}'>\n\t\t\t\t\t\t\t\t<div class='field-spacer'>" . $frm->file('file_userfile[]', array('id' => false, 'size' => '20')) . $frm->admin_button('upload', FMLAN_22, '', '', array('id' => false)) . "</div>\n\t\t\t\t\t\t\t\t<input type='hidden' name='upload_dir[]' value='" . $path . $dirs[$c] . "' />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td class='right'>" . $dirsize . "</td>\n\t\t\t\t\t\t<td class='right'>&nbsp;</td>\n\t\t\t\t\t</tr>\n\t";
    $c++;
}
$c = 0;
while ($files[$c]) {
    $img = strtolower(substr(strrchr($files[$c], "."), 1, 3));
    if (!$img || !preg_match("/css|exe|gif|htm|jpg|js|php|png|txt|xml|zip/i", $img)) {
        $img = "def";
    }
    $size = $e107->parseMemorySize(filesize(e_BASE . $path . "/" . $files[$c]));
    $gen = new convert();
    $filedate = $gen->convert_date(filemtime(e_BASE . $path . "/" . $files[$c]), "forum");
    $text .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='center middle autocheck'>\n\t\t\t\t\t\t\t" . $frm->checkbox("selectedfile[{$c}]", 1, false, array('id' => false)) . "\n\t\t\t\t\t\t\t<input type='hidden' name='deleteconfirm[{$c}]' value='" . $path . $files[$c] . "' />\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<img class='icon' src='" . $imagedir . $img . ".png' alt='" . $files[$c] . "' />\n\t\t\t\t\t\t\t<a href='" . e_SELF . "?" . $path . $files[$c] . "'>" . $files[$c] . "</a>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td class='right'>" . $size . "</td>\n\t\t\t\t\t\t<td class='right'>" . $filedate . "</td>\n\t\t\t\t\t</tr>\n\t";
    $c++;
}
$text .= "\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t<div class='buttons-bar left'>\n\t\t\t\t" . $frm->admin_button('check_all', 'jstarget:selectedfile', 'action', LAN_CHECKALL, array('id' => false)) . "\n\t\t\t\t" . $frm->admin_button('uncheck_all', 'jstarget:selectedfile', 'action', LAN_UNCHECKALL, array('id' => false)) . "\n\t";