if (array_key_exists('action', $_POST)) { switch ($_POST['action']) { case 'update_base_url': saveBaseURL('../'); break; case 'update_config': updateConfig(); break; case 'update_feedback': updateFeedback(); break; case 'update_password': $passwordError = updatePassword($_POST['admin_password']); break; case 'update_translation': updateTranslation(); break; case 'update_theme': updateTheme(); break; case 'update_channels': updateChannels(); break; case 'total_reset': $total_reset = totalReset(); break; } } if (array_key_exists('delete', $_GET) && $_GET['delete'] == 'key') { removeLicenseKey(); }
<?php //check if we got a correct call if (isset($_GET['submitted'])) { include "functions.php"; $value = stripslashes($_GET['newvalue']); $key = stripslashes($_GET['key']); $language = stripslashes($_GET['language']); if ($language == 'key') { echo insertNewKey($value); } else { echo updateTranslation($language, $key, $value); } } else { echo 'wrong call'; }
<?php require_once '../functions/functions.php'; if ($user->id && in_array($user->id, $ocp_allowed_user_for_translation)) { # access allowed } else { checkMinGroup(3); } if (is_array($_POST) && count($_POST)) { foreach ($_POST as $k => $v) { if (preg_match('#translation_(\\d+)#', $k, $matches)) { $id = $matches[1]; updateTranslation($id, $v); } } addInfoMessage('Translations updated.'); } $translations = getAllTranslations($user->ui->language); $smarty->assign('translations', $translations); smarty_display('translations');