Passed
Push — master ( ddbf8b...086098 )
by Robbie
11:17
created

DevConfirmationController::index()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 0
dl 0
loc 13
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace SilverStripe\Dev;
4
5
use SilverStripe\Control\Director;
6
use SilverStripe\ORM\DatabaseAdmin;
7
use SilverStripe\Security\Confirmation;
8
9
/**
10
 * A simple controller using DebugView to wrap up the confirmation form
11
 * with a template similar to other DevelopmentAdmin endpoints and UIs
12
 *
13
 * This is done particularly for the confirmation of URL special parameters
14
 * and /dev/build, so that people opening the confirmation form wouldn't
15
 * mix it up with some non-dev functionality
16
 */
17
class DevConfirmationController extends Confirmation\Handler
18
{
19
    public function index()
20
    {
21
        $response = parent::index();
22
23
        $renderer = DebugView::create();
24
        echo $renderer->renderHeader();
25
        echo $renderer->renderInfo(
26
            _t(__CLASS__.".INFO_TITLE", "Security Confirmation"),
27
            Director::absoluteBaseURL(),
28
            _t(__CLASS__.".INFO_DESCRIPTION", "Confirm potentially dangerous operation")
29
        );
30
31
        return $response;
32
    }
33
}
34