allowing textcollector for non-admins in CLI-mode (needed for auto-updating)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@44574 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2007-11-11 02:54:36 +00:00
parent a95efe833f
commit dd71c53a4d

View File

@ -1268,8 +1268,11 @@ class i18n extends Controller {
* and write the resultant files in the lang folder of each module.
*/
public function textcollector() {
if (!Permission::check("ADMIN")) user_error("You must be an admin to enable text collector mode", E_USER_ERROR);
// allows textcollector to run in CLI without admin-check
if(!Permission::check("ADMIN") && !Director::is_cli()) {
user_error("You must be an admin or use CLI-mode to enable text collector", E_USER_ERROR);
}
echo "Collecting text...<br /><br />";
//Calculate base directory