Ejemplo n.º 1
0
<?php

if (!defined('INTERFACE_ACCESS')) {
    die('Direct access not premitted');
}
$session_id = $_REQUEST["session_id"];
$session = session::get_session($session_id);
if ($session->is_valid()) {
    ormlib::remove_from_instance(new user_settings(), "user_id = '" . $session->user_id . "'");
    $user_settings = $_REQUEST["user_settings"];
    for ($i = 0; $i < count($user_settings); $i++) {
        $users = new user_settings();
        $users->user_id = $session->user_id;
        $users->key_value = $user_settings[$i]["key"];
        $users->value = $user_settings[$i]["value"];
        $users->insert();
    }
    echo true;
}
Ejemplo n.º 2
0
        }
        $this->jquery->Tab_header('usersettings_tabs', true);
        $this->jquery->spinner('#user_alimit, #user_climit, #user_ilimit, #user_rlimit, #user_elimit', array('step' => 10, 'multiselector' => true));
        $this->jquery->spinner('user_nlimit');
        $this->jquery->Dialog('template_preview', $this->user->lang('template_preview'), array('url' => $this->root_path . "viewnews.php" . $this->SID . "&style='+ \$(\"select[name='user_style'] option:selected\").val()+'", 'width' => '750', 'height' => '520', 'modal' => true));
        $this->tpl->assign_vars(array('S_CURRENT_PASSWORD' => true, 'S_NEW_PASSWORD' => true, 'S_SETTING_ADMIN' => false, 'S_MU_TABLE' => false, 'USERNAME' => $this->user->data['username'], 'AJAXEXTENSION_USER' => '&olduser='******'username'], 'AJAXEXTENSION_MAIL' => '&oldmail=' . urlencode($this->user->data['user_email'])));
        //Generate Plugin-Tabs
        if (is_array($this->pm->get_menus('settings'))) {
            foreach ($this->pm->get_menus('settings') as $plugin => $values) {
                $name = $values['name'] ? $values['name'] : $this->user->lang($plugin);
                $icon = $values['icon'] ? $values['icon'] : $this->root_path . 'images/admin/plugin.png';
                unset($values['name'], $values['icon']);
                $this->tpl->assign_block_vars('plugin_settings_row', array('KEY' => $plugin, 'PLUGIN' => $name, 'ICON' => $icon));
                $this->tpl->assign_block_vars('plugin_usersettings_div', array('KEY' => $plugin, 'PLUGIN' => $name));
                foreach ($values as $key => $setting) {
                    $helpstring = $this->user->lang(@$setting['help']) ? $this->user->lang(@$setting['help']) : @$setting['help'];
                    $help = isset($setting['help']) ? " " . $helpstring : '';
                    $setting['value'] = $setting['selected'] = @$this->user->data['plugin_settings'][$plugin][$setting['name']];
                    $setting['name'] = $plugin . '[' . (isset($setting['name']) ? $setting['name'] : '') . ']';
                    $setting['plugin'] = $plugin;
                    $this->tpl->assign_block_vars('plugin_usersettings_div.plugin_usersettings', array('NAME' => $this->user->lang($setting['language']), 'FIELD' => $this->html->widget($setting), 'HELP' => $help, 'S_TH' => $setting['type'] == 'tablehead' ? true : false));
                }
            }
        }
        $this->core->set_vars(array('page_title' => $this->user->lang('settings_title'), 'template_file' => 'settings.html', 'display' => true));
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_user_settings', user_settings::__shortcuts());
}
registry::register('user_settings');