Code Duplication    Length = 30-30 lines in 4 locations

src/controllers/GroupsController.php 1 location

@@ 267-296 (lines=30) @@
264
    /**
265
     * Show confirmation of drop and perform actual drop
266
     */
267
    public function doDrop($confirm)
268
    {
269
        $conf = $this->conf;
270
        $misc = $this->misc;
271
        $lang = $this->lang;
272
        $data = $misc->getDatabaseAccessor();
273
274
        if ($confirm) {
275
            $this->printTrail('group');
276
            $this->printTitle($lang['strdrop'], 'pg.group.drop');
277
278
            echo '<p>', sprintf($lang['strconfdropgroup'], $misc->printVal($_REQUEST['group'])), "</p>\n";
279
280
            echo '<form action="' . SUBFOLDER . "/src/views/groups.php\" method=\"post\">\n";
281
            echo $misc->form;
282
            echo "<input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
283
            echo '<input type="hidden" name="group" value="', htmlspecialchars($_REQUEST['group']), "\" />\n";
284
            echo "<input type=\"submit\" name=\"drop\" value=\"{$lang['strdrop']}\" />\n";
285
            echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" />\n";
286
            echo "</form>\n";
287
        } else {
288
            $status = $data->dropGroup($_REQUEST['group']);
289
            if ($status == 0) {
290
                $this->doDefault($lang['strgroupdropped']);
291
            } else {
292
                $this->doDefault($lang['strgroupdroppedbad']);
293
            }
294
        }
295
    }
296
297
    /**
298
     * Displays a screen where they can enter a new group
299
     */

src/controllers/RolesController.php 1 location

@@ 592-621 (lines=30) @@
589
    /**
590
     * Show confirmation of drop a role and perform actual drop
591
     */
592
    public function doDrop($confirm)
593
    {
594
        $conf = $this->conf;
595
        $misc = $this->misc;
596
        $lang = $this->lang;
597
        $data = $misc->getDatabaseAccessor();
598
599
        if ($confirm) {
600
            $this->printTrail('role');
601
            $this->printTitle($lang['strdroprole'], 'pg.role.drop');
602
603
            echo '<p>', sprintf($lang['strconfdroprole'], $misc->printVal($_REQUEST['rolename'])), "</p>\n";
604
605
            echo '<form action="' . SUBFOLDER . "/src/views/roles.php\" method=\"post\">\n";
606
            echo "<p><input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
607
            echo '<input type="hidden" name="rolename" value="', htmlspecialchars($_REQUEST['rolename']), "\" />\n";
608
            echo $misc->form;
609
            echo "<input type=\"submit\" name=\"drop\" value=\"{$lang['strdrop']}\" />\n";
610
            echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" /></p>\n";
611
            echo "</form>\n";
612
        } else {
613
            $status = $data->dropRole($_REQUEST['rolename']);
614
            if ($status == 0) {
615
                $this->doDefault($lang['strroledropped']);
616
            } else {
617
                $this->doDefault($lang['strroledroppedbad']);
618
            }
619
        }
620
    }
621
622
    /**
623
     * Show the properties of a role
624
     */

src/controllers/UsersController.php 1 location

@@ 381-410 (lines=30) @@
378
    /**
379
     * Show confirmation of drop and perform actual drop
380
     */
381
    public function doDrop($confirm)
382
    {
383
        $conf = $this->conf;
384
        $misc = $this->misc;
385
        $lang = $this->lang;
386
        $data = $misc->getDatabaseAccessor();
387
388
        if ($confirm) {
389
            $this->printTrail('user');
390
            $this->printTitle($lang['strdrop'], 'pg.user.drop');
391
392
            echo '<p>', sprintf($lang['strconfdropuser'], $misc->printVal($_REQUEST['username'])), "</p>\n";
393
394
            echo '<form action="' . SUBFOLDER . "/src/views/users.php\" method=\"post\">\n";
395
            echo "<p><input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
396
            echo '<input type="hidden" name="username" value="', htmlspecialchars($_REQUEST['username']), "\" />\n";
397
            echo $misc->form;
398
            echo "<input type=\"submit\" name=\"drop\" value=\"{$lang['strdrop']}\" />\n";
399
            echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" /></p>\n";
400
            echo "</form>\n";
401
        } else {
402
            $status = $data->dropUser($_REQUEST['username']);
403
            if ($status == 0) {
404
                $this->doDefault($lang['struserdropped']);
405
            } else {
406
                $this->doDefault($lang['struserdroppedbad']);
407
            }
408
        }
409
    }
410
411
    /**
412
     * Displays a screen where they can enter a new user
413
     */

src/controllers/TablespacesController.php 1 location

@@ 259-288 (lines=30) @@
256
    /**
257
     * Show confirmation of drop and perform actual drop
258
     */
259
    public function doDrop($confirm)
260
    {
261
        $conf = $this->conf;
262
        $misc = $this->misc;
263
        $lang = $this->lang;
264
        $data = $misc->getDatabaseAccessor();
265
266
        if ($confirm) {
267
            $this->printTrail('tablespace');
268
            $this->printTitle($lang['strdrop'], 'pg.tablespace.drop');
269
270
            echo '<p>', sprintf($lang['strconfdroptablespace'], $misc->printVal($_REQUEST['tablespace'])), "</p>\n";
271
272
            echo '<form action="' . SUBFOLDER . "/src/views/tablespaces.php\" method=\"post\">\n";
273
            echo $misc->form;
274
            echo "<input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
275
            echo '<input type="hidden" name="tablespace" value="', htmlspecialchars($_REQUEST['tablespace']), "\" />\n";
276
            echo "<input type=\"submit\" name=\"drop\" value=\"{$lang['strdrop']}\" />\n";
277
            echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" />\n";
278
            echo "</form>\n";
279
        } else {
280
            $status = $data->droptablespace($_REQUEST['tablespace']);
281
            if ($status == 0) {
282
                $this->doDefault($lang['strtablespacedropped']);
283
            } else {
284
                $this->doDefault($lang['strtablespacedroppedbad']);
285
            }
286
        }
287
    }
288
289
    /**
290
     * Displays a screen where they can enter a new tablespace
291
     */