mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
bfojcapell: Added security check, only admins can use text collector
(merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@41830 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
46be50f0a2
commit
7e9623f4ac
@ -86,7 +86,7 @@ function stripslashes_recursively(&$array) {
|
|||||||
/**
|
/**
|
||||||
* This is the main translator function. Returns the string defined by $class and $entity according to the currently set locale
|
* This is the main translator function. Returns the string defined by $class and $entity according to the currently set locale
|
||||||
*/
|
*/
|
||||||
function _($class, $entity, $string="", $priority=PR_MEDIUM, $context="") {
|
function _($class, $entity, $string="", $priority=100, $context="") {
|
||||||
global $lang;
|
global $lang;
|
||||||
$locale = i18n::getLocale();
|
$locale = i18n::getLocale();
|
||||||
$class = ereg_replace('.*([/\\]+)',"",$class);
|
$class = ereg_replace('.*([/\\]+)',"",$class);
|
||||||
|
@ -1,10 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
define('PR_HIGH',100);
|
||||||
|
define('PR_MEDIUM',50);
|
||||||
|
define('PR_LOW',10);
|
||||||
|
|
||||||
class i18n extends Controller {
|
class i18n extends Controller {
|
||||||
static $currentlocale = 'en';
|
static $currentlocale = 'en';
|
||||||
|
|
||||||
static function textCollector() {
|
static function textCollector() {
|
||||||
|
|
||||||
|
if (!Permission::check("ADMIN")) die("You must be an admin to enable text collector mode");
|
||||||
echo "Collecting text...<br /><br />";
|
echo "Collecting text...<br /><br />";
|
||||||
|
|
||||||
//Calculate base directory
|
//Calculate base directory
|
||||||
|
Loading…
Reference in New Issue
Block a user