From cf46aefd9d8be57722514ab0b6047fa573f46a36 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Sat, 28 Sep 2013 06:04:35 -0400
Subject: [PATCH] Make password plugin use the new 'settings_actions' hook to register its link in the settings navigation
---
program/steps/utils/save_pref.inc | 28 ++++++++++++++++++++++------
1 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/program/steps/utils/save_pref.inc b/program/steps/utils/save_pref.inc
index d7cb8bf..7def873 100644
--- a/program/steps/utils/save_pref.inc
+++ b/program/steps/utils/save_pref.inc
@@ -1,12 +1,15 @@
<?php
-/*
+/*
+-----------------------------------------------------------------------+
| program/steps/utils/save_pref.inc |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2005-2010, Roundcube Dev. - Switzerland |
- | Licensed under the GNU GPL |
+ | Copyright (C) 2005-2010, The Roundcube Dev Team |
+ | |
+ | Licensed under the GNU General Public License version 3 or |
+ | any later version with exceptions for skins & plugins. |
+ | See the README file for a full license statement. |
| |
| PURPOSE: |
| Save preferences setting in database |
@@ -14,13 +17,26 @@
+-----------------------------------------------------------------------+
| Author: Aleksander Machniak <alec@alec.pl> |
+-----------------------------------------------------------------------+
-
- $Id$
-
*/
$name = get_input_value('_name', RCUBE_INPUT_POST);
$value = get_input_value('_value', RCUBE_INPUT_POST);
+$whitelist = array(
+ 'preview_pane',
+ 'list_cols',
+ 'collapsed_folders',
+ 'collapsed_abooks',
+);
+
+if (!in_array($name, array_merge($whitelist, $RCMAIL->plugins->allowed_prefs))) {
+ raise_error(array('code' => 500, 'type' => 'php',
+ 'file' => __FILE__, 'line' => __LINE__,
+ 'message' => sprintf("Hack attempt detected (user: %s)", $RCMAIL->get_user_name())),
+ true, false);
+
+ $OUTPUT->reset();
+ $OUTPUT->send();
+}
// save preference value
$RCMAIL->user->save_prefs(array($name => $value));
--
Gitblit v1.9.1