Code Duplication    Length = 26-26 lines in 4 locations

src/controllers/GroupsController.php 1 location

@@ 283-308 (lines=26) @@
280
     *
281
     * @param mixed $confirm
282
     */
283
    public function doDrop($confirm)
284
    {
285
        $data = $this->misc->getDatabaseAccessor();
286
287
        if ($confirm) {
288
            $this->printTrail('group');
289
            $this->printTitle($this->lang['strdrop'], 'pg.group.drop');
290
291
            echo '<p>', sprintf($this->lang['strconfdropgroup'], $this->misc->printVal($_REQUEST['group'])), '</p>'.PHP_EOL;
292
293
            echo '<form action="'.\SUBFOLDER.'/src/views/groups" method="post">'.PHP_EOL;
294
            echo $this->misc->form;
295
            echo '<input type="hidden" name="action" value="drop" />'.PHP_EOL;
296
            echo '<input type="hidden" name="group" value="', htmlspecialchars($_REQUEST['group']), '" />'.PHP_EOL;
297
            echo "<input type=\"submit\" name=\"drop\" value=\"{$this->lang['strdrop']}\" />".PHP_EOL;
298
            echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />".PHP_EOL;
299
            echo '</form>'.PHP_EOL;
300
        } else {
301
            $status = $data->dropGroup($_REQUEST['group']);
302
            if (0 == $status) {
303
                $this->doDefault($this->lang['strgroupdropped']);
304
            } else {
305
                $this->doDefault($this->lang['strgroupdroppedbad']);
306
            }
307
        }
308
    }
309
310
    /**
311
     * Displays a screen where they can enter a new group.

src/controllers/RolesController.php 1 location

@@ 605-630 (lines=26) @@
602
     *
603
     * @param mixed $confirm
604
     */
605
    public function doDrop($confirm)
606
    {
607
        $data = $this->misc->getDatabaseAccessor();
608
609
        if ($confirm) {
610
            $this->printTrail('role');
611
            $this->printTitle($this->lang['strdroprole'], 'pg.role.drop');
612
613
            echo '<p>', sprintf($this->lang['strconfdroprole'], $this->misc->printVal($_REQUEST['rolename'])), '</p>'.PHP_EOL;
614
615
            echo '<form action="'.\SUBFOLDER.'/src/views/roles" method="post">'.PHP_EOL;
616
            echo '<p><input type="hidden" name="action" value="drop" />'.PHP_EOL;
617
            echo '<input type="hidden" name="rolename" value="', htmlspecialchars($_REQUEST['rolename']), '" />'.PHP_EOL;
618
            echo $this->misc->form;
619
            echo "<input type=\"submit\" name=\"drop\" value=\"{$this->lang['strdrop']}\" />".PHP_EOL;
620
            echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" /></p>".PHP_EOL;
621
            echo '</form>'.PHP_EOL;
622
        } else {
623
            $status = $data->dropRole($_REQUEST['rolename']);
624
            if (0 == $status) {
625
                $this->doDefault($this->lang['strroledropped']);
626
            } else {
627
                $this->doDefault($this->lang['strroledroppedbad']);
628
            }
629
        }
630
    }
631
632
    /**
633
     * Show the properties of a role.

src/controllers/TablespacesController.php 1 location

@@ 255-280 (lines=26) @@
252
     *
253
     * @param mixed $confirm
254
     */
255
    public function doDrop($confirm)
256
    {
257
        $data = $this->misc->getDatabaseAccessor();
258
259
        if ($confirm) {
260
            $this->printTrail('tablespace');
261
            $this->printTitle($this->lang['strdrop'], 'pg.tablespace.drop');
262
263
            echo '<p>', sprintf($this->lang['strconfdroptablespace'], $this->misc->printVal($_REQUEST['tablespace'])), '</p>'.PHP_EOL;
264
265
            echo '<form action="'.\SUBFOLDER.'/src/views/tablespaces" method="post">'.PHP_EOL;
266
            echo $this->misc->form;
267
            echo '<input type="hidden" name="action" value="drop" />'.PHP_EOL;
268
            echo '<input type="hidden" name="tablespace" value="', htmlspecialchars($_REQUEST['tablespace']), '" />'.PHP_EOL;
269
            echo "<input type=\"submit\" name=\"drop\" value=\"{$this->lang['strdrop']}\" />".PHP_EOL;
270
            echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />".PHP_EOL;
271
            echo '</form>'.PHP_EOL;
272
        } else {
273
            $status = $data->droptablespace($_REQUEST['tablespace']);
274
            if (0 == $status) {
275
                $this->doDefault($this->lang['strtablespacedropped']);
276
            } else {
277
                $this->doDefault($this->lang['strtablespacedroppedbad']);
278
            }
279
        }
280
    }
281
282
    /**
283
     * Displays a screen where they can enter a new tablespace.

src/controllers/UsersController.php 1 location

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