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:
Ingo Schommer 2007-09-15 00:16:41 +00:00
parent 46be50f0a2
commit 7e9623f4ac
2 changed files with 6 additions and 1 deletions

View File

@ -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
*/
function _($class, $entity, $string="", $priority=PR_MEDIUM, $context="") {
function _($class, $entity, $string="", $priority=100, $context="") {
global $lang;
$locale = i18n::getLocale();
$class = ereg_replace('.*([/\\]+)',"",$class);

View File

@ -1,10 +1,15 @@
<?php
define('PR_HIGH',100);
define('PR_MEDIUM',50);
define('PR_LOW',10);
class i18n extends Controller {
static $currentlocale = 'en';
static function textCollector() {
if (!Permission::check("ADMIN")) die("You must be an admin to enable text collector mode");
echo "Collecting text...<br /><br />";
//Calculate base directory