Ejemplo n.º 1
0
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

   Notes: Based on the Time Tracking plugin by Elmar:
   2005 by Elmar Schumacher - GAMBIT Consulting GmbH
   http://www.mantisbt.org/forums/viewtopic.php?f=4&t=589	
*/
form_security_validate('plugin_TimeTracking_config_update');
auth_reauthenticate();
access_ensure_global_level(plugin_config_get('admin_threshold'));
function maybe_set_option($name, $value)
{
    if ($value != plugin_config_get($name)) {
        plugin_config_set($name, $value);
    }
}
maybe_set_option('admin_own_threshold', gpc_get_int('admin_own_threshold'));
maybe_set_option('view_others_threshold', gpc_get_int('view_others_threshold'));
maybe_set_option('admin_threshold', gpc_get_int('admin_threshold'));
form_security_purge('plugin_TimeTracking_config_update');
print_successful_redirect(plugin_page('config_page', true));
Ejemplo n.º 2
0
} else {
    plugin_config_delete('buglink_regex_2');
}
if (!$f_bugfix_reset_1) {
    maybe_set_option('bugfix_regex_1', $f_bugfix_regex_1);
} else {
    plugin_config_delete('bugfix_regex_1');
}
if (!$f_bugfix_reset_2) {
    maybe_set_option('bugfix_regex_2', $f_bugfix_regex_2);
} else {
    plugin_config_delete('bugfix_regex_2');
}
maybe_set_option('bugfix_status', $f_bugfix_status);
maybe_set_option('bugfix_resolution', $f_bugfix_resolution);
maybe_set_option('bugfix_status_pvm', $f_bugfix_status_pvm);
maybe_set_option('bugfix_handler', $f_bugfix_handler);
maybe_set_option('bugfix_message', $f_bugfix_message);
maybe_set_option('bugfix_message_view_status', $f_bugfix_message_view_status);
maybe_set_option('remote_checkin', $f_remote_checkin);
maybe_set_option('checkin_urls', serialize($t_checkin_urls));
maybe_set_option('remote_imports', $f_remote_imports);
maybe_set_option('import_urls', serialize($t_import_urls));
maybe_set_option('api_key', $f_api_key);
foreach (SourceVCS::all() as $t_type => $t_vcs) {
    if ($t_vcs->configuration) {
        $t_vcs->update_config();
    }
}
form_security_purge('plugin_Source_manage_config');
print_successful_redirect(plugin_page('manage_config_page', true));
<?php

# Copyright (C) 2008	John Reese
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
form_security_validate('plugin_Timecard_config_update');
access_ensure_global_level(plugin_config_get('manage_threshold'));
auth_reauthenticate();
function maybe_set_option($name, $value)
{
    if ($value != plugin_config_get($name)) {
        plugin_config_set($name, $value);
    }
}
maybe_set_option('view_threshold', gpc_get_int('view_threshold'));
maybe_set_option('estimate_threshold', gpc_get_int('estimate_threshold'));
maybe_set_option('update_threshold', gpc_get_int('update_threshold'));
maybe_set_option('manage_threshold', gpc_get_int('manage_threshold'));
maybe_set_option('use_estimates', gpc_get_bool('use_estimates', OFF));
maybe_set_option('use_updates', gpc_get_bool('use_updates', OFF));
maybe_set_option('use_timecard', gpc_get_bool('use_timecard', OFF));
form_security_purge('plugin_Timecard_config_update');
print_successful_redirect(plugin_page('config_page', true));