| | |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('admin'); |
| | | $app->auth->check_security_permissions('admin_allow_langedit'); |
| | | |
| | | //* This is only allowed for administrators |
| | | if(!$app->auth->is_admin()) die('only allowed for administrators.'); |
| | |
| | | $app->tpl->setVar('error', $error); |
| | | |
| | | if(isset($_POST['lng_new']) && strlen($_POST['lng_new']) == 2 && $error == '') { |
| | | |
| | | //* CSRF Check |
| | | $app->auth->csrf_token_check(); |
| | | |
| | | $lng_new = $_POST['lng_new']; |
| | | if(!preg_match("/^[a-z]{2}$/i", $lng_new)) die('unallowed characters in language name.'); |
| | | |
| | |
| | | |
| | | $app->tpl->setVar('msg', $msg); |
| | | |
| | | //* SET csrf token |
| | | $csrf_token = $app->auth->csrf_token_get('language_add'); |
| | | $app->tpl->setVar('_csrf_id',$csrf_token['csrf_id']); |
| | | $app->tpl->setVar('_csrf_key',$csrf_token['csrf_key']); |
| | | |
| | | //* load language file |
| | | $lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_language_add.lng'; |
| | | include $lng_file; |