Merge remote branch 'cbarberis/master'

This commit is contained in:
Sam Minnee 2011-02-14 16:34:02 +13:00
commit 8d05811734
21 changed files with 108 additions and 14 deletions

View File

@ -123,6 +123,10 @@ class RestfulServer extends Controller {
*/
protected $member;
static $allowed_actions = array(
'index'
);
/*
function handleItem($request) {
return new RestfulServer_Item(DataObject::get_by_id($request->param("ClassName"), $request->param("ID")));

View File

@ -26,6 +26,11 @@ class SapphireSoapServer extends Controller {
'binary' => 'xsd:base64Binary',
);
static $allowed_actions = array(
'index',
'wsdl'
);
function wsdl() {
$this->getResponse()->addHeader("Content-Type", "text/xml");

View File

@ -6,6 +6,11 @@
* @subpackage integration
*/
class VersionedRestfulServer extends Controller {
static $allowed_actions = array(
'index'
);
function handleRequest($request) {
Versioned::reading_stage('Live');
$restfulserver = new RestfulServer();

View File

@ -10,6 +10,10 @@
* @subpackage cron
*/
abstract class CliController extends Controller {
static $allowed_actions = array(
'index'
);
function init() {
parent::init();

View File

@ -7,11 +7,17 @@
*/
class CodeViewer extends Controller {
public static $url_handlers = array (
public static $url_handlers = array(
'' => 'browse',
'$Class' => 'viewClass'
);
static $allowed_actions = array(
'index',
'browse',
'viewClass'
);
/**
* Define a simple finite state machine.
* Top keys are the state names. 'start' is the first state, and 'die' is the error state.

View File

@ -17,6 +17,17 @@ class DevelopmentAdmin extends Controller {
'$Action//$Action/$ID' => 'handleAction',
);
static $allowed_actions = array(
'index',
'tests',
'jstests',
'tasks',
'viewmodel',
'build',
'reset',
'viewcode'
);
function init() {
parent::init();

View File

@ -5,6 +5,10 @@
* @subpackage testing
*/
class InstallerTest extends Controller {
static $allowed_actions = array(
'testrewrite'
);
function testrewrite() {
echo "OK";

View File

@ -42,6 +42,13 @@ class JSTestRunner extends Controller {
'$TestCase' => 'only',
);
static $allowed_actions = array(
'index',
'all',
'browse',
'only'
);
/**
* Override the default reporter with a custom configured subclass.
*

View File

@ -23,6 +23,10 @@ define('30719',E_ALL);
* @subpackage dev
*/
class SapphireREPL extends Controller {
static $allowed_actions = array(
'index'
);
public function error_handler( $errno, $errstr, $errfile, $errline, $errctx ) {
// Ignore unless important error

View File

@ -10,6 +10,10 @@ class TaskRunner extends Controller {
'$TaskName' => 'runTask'
);
static $allowed_actions = array(
'index'
);
function init() {
parent::init();

View File

@ -40,6 +40,21 @@ class TestRunner extends Controller {
'$TestCase' => 'only',
);
static $allowed_actions = array(
'index',
'browse',
'coverage',
'startsession',
'endsession',
'cleanupdb',
'module',
'all',
'build',
'only'
);
/**
* @var Array Blacklist certain directories for the coverage report.
* Filepaths are relative to the webroot, without leading slash.

View File

@ -616,6 +616,10 @@ class Email extends ViewableData {
*/
class Email_BounceHandler extends Controller {
static $allowed_actions = array(
'index'
);
function init() {
BasicAuth::protect_entire_site(false);
parent::init();

View File

@ -21,6 +21,11 @@
*/
class Upload extends Controller {
static $allowed_actions = array(
'index',
'load'
);
/**
* A File object
* @var File

View File

@ -5,6 +5,18 @@
* @subpackage security
*/
class Security extends Controller {
static $allowed_actions = array(
'index',
'login',
'logout',
'basicauthlogin',
'lostpassword',
'passwordsent',
'changepassword',
'ping',
'LoginForm'
);
/**
* Default user name. Only used in dev-mode by {@link setDefaultAdmin()}

View File

@ -139,7 +139,7 @@ class ControllerTest extends FunctionalTest {
/**
* Simple controller for testing
*/
class ControllerTest_Controller extends Controller {
class ControllerTest_Controller extends Controller implements TestOnly {
public $Content = "default content";
function methodaction() {
@ -156,7 +156,7 @@ class ControllerTest_Controller extends Controller {
/**
* Controller with an $allowed_actions value
*/
class ControllerTest_SecuredController extends Controller {
class ControllerTest_SecuredController extends Controller implements TestOnly {
static $allowed_actions = array(
"methodaction",
"adminonly" => "ADMIN",
@ -179,7 +179,7 @@ class ControllerTest_SecuredController extends Controller {
}
}
class ControllerTest_FullSecuredController extends Controller {
class ControllerTest_FullSecuredController extends Controller implements TestOnly {
static $allowed_actions = array(
"*" => "ADMIN",
@ -195,7 +195,7 @@ class ControllerTest_FullSecuredController extends Controller {
}
}
class ControllerTest_UnsecuredController extends ControllerTest_SecuredController {}
class ControllerTest_UnsecuredController extends ControllerTest_SecuredController implements TestOnly {}
class ControllerTest_HasAction extends Controller {
@ -210,7 +210,7 @@ class ControllerTest_HasAction extends Controller {
}
class ControllerTest_HasAction_Unsecured extends ControllerTest_HasAction {
class ControllerTest_HasAction_Unsecured extends ControllerTest_HasAction implements TestOnly {
public function defined_action() { }

View File

@ -265,7 +265,7 @@ Director::addRules(50, array(
/**
* Controller for the test
*/
class RequestHandlingTest_Controller extends Controller {
class RequestHandlingTest_Controller extends Controller implements TestOnly {
static $url_handlers = array(
// The double-slash is need here to ensure that
'$Action//$ID/$OtherID' => "handleAction",
@ -383,7 +383,7 @@ class RequestHandlingTest_ControllerExtension extends Extension {
/**
* Controller for the test
*/
class RequestHandlingTest_AllowedController extends Controller {
class RequestHandlingTest_AllowedController extends Controller implements TestOnly {
static $url_handlers = array(
// The double-slash is need here to ensure that
'$Action//$ID/$OtherID' => "handleAction",
@ -458,7 +458,7 @@ class RequestHandlingTest_Form extends Form {
}
}
class RequestHandlingTest_ControllerFormWithAllowedActions extends Controller {
class RequestHandlingTest_ControllerFormWithAllowedActions extends Controller implements TestOnly {
function Form() {
return new RequestHandlingTest_FormWithAllowedActions(

View File

@ -37,7 +37,7 @@ class WebserverRoutingTest extends SapphireTest {
* @package sapphire
* @subpackage tests
*/
class WebserverRoutingTest_Controller extends Controller {
class WebserverRoutingTest_Controller extends Controller implements TestOnly {
function index() {
BasicAuth::protect_entire_site(false);

View File

@ -134,7 +134,7 @@ class RestfulServiceTest extends SapphireTest {
}
}
class RestfulServiceTest_Controller extends Controller {
class RestfulServiceTest_Controller extends Controller implements TestOnly {
public function init() {
$this->basicAuthEnabled = false;
parent::init();

View File

@ -368,7 +368,7 @@ class FormTest_Team extends DataObject implements TestOnly {
);
}
class FormTest_Controller extends Controller {
class FormTest_Controller extends Controller implements TestOnly {
static $url_handlers = array(
'$Action//$ID/$OtherID' => "handleAction",
);
@ -424,7 +424,7 @@ class FormTest_Controller extends Controller {
}
}
class FormTest_ControllerWithSecurityToken extends Controller {
class FormTest_ControllerWithSecurityToken extends Controller implements TestOnly {
static $url_handlers = array(
'$Action//$ID/$OtherID' => "handleAction",
);

View File

@ -288,7 +288,7 @@ class TableFieldTest extends SapphireTest {
/**
* Stub controller
*/
class TableFieldTest_Controller extends Controller {
class TableFieldTest_Controller extends Controller implements TestOnly {
function Link($action = null) {
return Controller::join_links('TableFieldTest/', $action);
}

View File

@ -150,6 +150,10 @@ class Widget_Controller extends Controller {
*/
protected $widget;
static $allowed_actions = array(
'editablesegment'
);
function __construct($widget = null) {
// TODO This shouldn't be optional, is only necessary for editablesegment()
if($widget) {