Code Duplication    Length = 4-7 lines in 5 locations

admin/pages.php 5 locations

@@ 489-492 (lines=4) @@
486
        showPage($page, $id);
487
        break;
488
489
    case 'restore':
490
        $success = $wikiPage->setRevision($page, $id);
491
        redirect_header('pages.php?page=' . $page . '&op=history', 2, $success ? _MD_GWIKI_DBUPDATED : _MD_GWIKI_ERRORINSERT);
492
        break;
493
494
    case 'fix':
495
        confirmAction('fix', $page, (int)$_GET['id']);
@@ 498-501 (lines=4) @@
495
        confirmAction('fix', $page, (int)$_GET['id']);
496
        break;
497
498
    case 'fixit':
499
        $success = fixRevision($page, $id);
500
        redirect_header('pages.php?page=' . $page . '&op=history', 2, $success ? _MD_GWIKI_DBUPDATED : _MD_GWIKI_ERRORINSERT);
501
        break;
502
503
    case 'tool':
504
        showPageTool($page, (int)$_GET['id']);
@@ 518-524 (lines=7) @@
515
        confirmAction('delete', $page);
516
        break;
517
518
    case 'deleteit':
519
        //  mark all versions inactive -- these will disappear as they age and the database is cleaned
520
        $sql = 'UPDATE ' . $xoopsDB->prefix('gwiki_pages') . " SET active = 0 WHERE keyword='{$page}' ";
521
522
        $success = $xoopsDB->query($sql);
523
        redirect_header('pages.php?op=manage', 2, $success ? _MD_GWIKI_DBUPDATED : _MD_GWIKI_ERRORINSERT);
524
        break;
525
526
    case 'clean':
527
        confirmAction('clean');
@@ 550-555 (lines=6) @@
547
        confirmAction('lock', $page);
548
        break;
549
550
    case 'lockit':
551
        $sql = 'UPDATE ' . $xoopsDB->prefix('gwiki_pages') . " SET admin_lock = 1 WHERE keyword='{$page}' ";
552
553
        $success = $xoopsDB->query($sql);
554
        redirect_header('pages.php?op=manage', 2, $success ? _MD_GWIKI_DBUPDATED : _MD_GWIKI_ERRORINSERT);
555
        break;
556
557
    case 'unlock':
558
        confirmAction('unlock', $page);
@@ 561-566 (lines=6) @@
558
        confirmAction('unlock', $page);
559
        break;
560
561
    case 'unlockit':
562
        $sql = 'UPDATE ' . $xoopsDB->prefix('gwiki_pages') . " SET admin_lock = 0 WHERE keyword='{$page}' ";
563
564
        $success = $xoopsDB->query($sql);
565
        redirect_header('pages.php?op=manage', 2, $success ? _MD_GWIKI_DBUPDATED : _MD_GWIKI_ERRORINSERT);
566
        break;
567
568
    case 'partition':
569
        if (checkForPartitions()) {