} else { COM_accessLog("User {$_USER['username']} tried to illegally delete route {$rid} and failed CSRF checks."); $display = COM_refresh($_CONF['site_admin_url'] . '/index.php'); } echo $display; die; break; case $LANG_ADMIN['save']: if (!SEC_checkToken()) { COM_accessLog("User {$_USER['username']} tried to illegally save route {$rid} and failed CSRF checks."); echo COM_refresh($_CONF['site_admin_url'] . '/index.php'); die; } $method = \Geeklog\Input::fPost('method', ''); $rule = \Geeklog\Input::post('rule', ''); $route = \Geeklog\Input::post('route', ''); $priority = \Geeklog\Input::fPost('priority', Router::DEFAULT_PRIORITY); $display = saveRoute($rid, $method, $rule, $route, $priority); break; case 'edit': $content = getRouteEditor($rid); $display = COM_createHTMLDocument($content, array('pagetitle' => $LANG_ROUTER[2])); break; case 'move': if (SEC_checkToken()) { moveRoute($rid); } $content = listRoutes(); $display = COM_createHTMLDocument($content, array('pagetitle' => $LANG_ROUTER[2])); break; default:
} elseif (!@is_link($path)) { if (!@unlink($path)) { $failures[] = $path; } } } } if (!@rmdir($baseDir)) { $failures[] = $baseDir; } return $failures; } // Main global $_TABLES, $LANG_SUCCESS, $MESSAGE; $type = \Geeklog\Input::fGet('type', 'install'); $submit = \Geeklog\Input::post('submit', ''); $language = \Geeklog\Input::fGet('language', 'english'); $language = preg_replace('/[^a-z0-9\\-_]/', '', $language); $languagePath = dirname(__FILE__) . '/language/' . $language . '.php'; if (is_readable($languagePath)) { require_once dirname(__FILE__) . '/language/' . $language . '.php'; } else { require_once dirname(__FILE__) . '/language/english.php'; } // enable detailed error reporting $_CONF['rootdebug'] = true; // Prevent the template class from creating a cache file $_CONF['cache_templates'] = false; switch ($submit) { case $LANG_SUCCESS[24]: // Delete all the fies and directories
/** * Save language items into database */ public static function adminSave() { global $_CONF, $_TABLES; self::checkAccessRights(); self::checkSecurityToken(); $id = \Geeklog\Input::fPost('id', 0); $id = intval($id, 10); $varName = \Geeklog\Input::fPost('var_name', ''); $language = \Geeklog\Input::fPost('language', ''); $name = \Geeklog\Input::fPost('name', ''); $value = \Geeklog\Input::post('value', ''); if ($id >= 0 && !empty($varName) && !empty($language) && !empty($name)) { $varName = DB_escapeString($varName); $language = DB_escapeString($language); $name = DB_escapeString($name); $value = DB_escapeString($value); if ($id === 0) { $sql = "INSERT INTO {$_TABLES['language_items']} (var_name, language, name, value) " . "VALUES ('{$varName}', '{$language}', '{$name}', '{$value}')"; } else { $sql = "UPDATE {$_TABLES['language_items']} SET var_name = '{$varName}', " . "language = '{$language}', name = '{$name}', value = '{$value}' " . "WHERE id = {$id} "; } DB_query($sql); $redirect = $_CONF['site_admin_url'] . '/language.php?msg=131'; header('Location: ' . $redirect); exit; } else { $A = array('id' => $id, 'var_name' => $varName, 'language' => $language, 'name' => $name, 'value' => $value); self::adminShowEditor($A); exit; } }
// | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ global $_CONF, $LANG_ADMIN; // Geeklog common function library require_once './../lib-common.php'; // Security check to ensure user even belongs on this page require_once './auth.inc.php'; // Include admin library require_once $_CONF['path_system'] . 'lib-admin.php'; // Include Language class require_once $_CONF['path_system'] . 'classes/language.class.php'; // Make sure user has rights to access this page Language::checkAccessRights(); // Main $mode = \Geeklog\Input::post('mode', \Geeklog\Input::get('mode', '')); switch ($mode) { case 'list': Language::adminShowList(); break; case 'edit': Language::adminShowEditor(); break; case $LANG_ADMIN['save']: Language::adminSave(); break; case $LANG_ADMIN['delete']: Language::adminDelete(); break; default: if (isset($_POST['delitem'])) {