3 require_once('common.php');
4 require_once('functions_tool_preferences.php');
6 if (!tool_admin_applications_check('tool_preferences')) nt_common_redirect('index.php');
8 $tpl->assign("tool_title", "My Preferences");
9 $tpl->assign("tool_v_login", $nel_user['user_name']);
10 $tpl->assign("tool_v_user_id", $nel_user['user_id']);
11 $tpl->assign("tool_v_menu", $nel_user['user_menu_style']);
12 $tpl->assign("tool_v_application", isset($nel_user['user_default_application_id']) ?
$nel_user['user_default_application_id']:'') ;
14 if (isset($NELTOOL['POST_VARS']['tool_form_user_id']))
16 $post_user_id = $NELTOOL['POST_VARS']['tool_form_user_id'];
17 $tool_action = $NELTOOL['POST_VARS']['toolaction'];
22 * update main preferences
26 $post_old_pwd = $NELTOOL['POST_VARS']['tool_form_password_old'];
27 $post_new_pwd = $NELTOOL['POST_VARS']['tool_form_password_new'];
28 $post_menu = $NELTOOL['POST_VARS']['tool_form_menu_style'];
31 if ($nel_user['user_menu_style'] != $post_menu)
33 tool_pref_update_menu_style($nel_user, $post_menu);
34 $tpl->assign("tool_v_menu", $post_menu);
38 if (($post_old_pwd != '') && ($post_new_pwd != ''))
40 if (tool_pref_check_old_password($nel_user, $post_old_pwd))
42 if (tool_pref_update_user_password($nel_user, $post_new_pwd))
44 $tpl->assign("tool_error", "Password has been updated!");
48 $tpl->assign("tool_error", "Invalid new password!");
53 $tpl->assign("tool_error", "Old password does not match!");
56 elseif (($post_old_pwd != '') ||
($post_new_pwd != ''))
58 $tpl->assign("tool_error", "You need to type your current and new passwords!");
64 * update default application
66 case 'update default application':
68 $post_new_application = $NELTOOL['POST_VARS']['tool_form_application_default'];
70 if ($nel_user['user_default_application_id'] != $post_new_application)
72 tool_pref_update_default_application($nel_user, $post_new_application);
73 $tpl->assign("tool_v_application", $post_new_application);
81 $tpl->display('tool_preferences.tpl');