khanat-opennel-code/code/ryzom/tools/server/admin/tool_preferences.php
StudioEtrange 91e6b23d3f ** PCH Support for NMake with VS2012
NMAKE-VS2012 Error LNK2011
while NMAKE-VS2010 does not complain
we need to link the pch.obj file
see http://msdn.microsoft.com/en-us/library/3ay26wa2(v=vs.110).aspx

** PCH Support for Ninja
Ninja need to add property
        OBJECT_DEPENDS for using PCH
        OBJECT_OUTPUTS for create PCH
see http://public.kitware.com/pipermail/cmake-developers/2012-March/003653.html
2013-09-05 17:18:01 +02:00

83 lines
No EOL
2.4 KiB
PHP

<?php
require_once('common.php');
require_once('functions_tool_preferences.php');
if (!tool_admin_applications_check('tool_preferences')) nt_common_redirect('index.php');
$tpl->assign("tool_title", "My Preferences");
$tpl->assign("tool_v_login", $nel_user['user_name']);
$tpl->assign("tool_v_user_id", $nel_user['user_id']);
$tpl->assign("tool_v_menu", $nel_user['user_menu_style']);
$tpl->assign("tool_v_application", isset($nel_user['user_default_application_id']) ? $nel_user['user_default_application_id']:'') ;
if (isset($NELTOOL['POST_VARS']['tool_form_user_id']))
{
$post_user_id = $NELTOOL['POST_VARS']['tool_form_user_id'];
$tool_action = $NELTOOL['POST_VARS']['toolaction'];
switch ($tool_action)
{
/*
* update main preferences
*/
case 'update':
$post_old_pwd = $NELTOOL['POST_VARS']['tool_form_password_old'];
$post_new_pwd = $NELTOOL['POST_VARS']['tool_form_password_new'];
$post_menu = $NELTOOL['POST_VARS']['tool_form_menu_style'];
// update menu style
if ($nel_user['user_menu_style'] != $post_menu)
{
tool_pref_update_menu_style($nel_user, $post_menu);
$tpl->assign("tool_v_menu", $post_menu);
}
// update password
if (($post_old_pwd != '') && ($post_new_pwd != ''))
{
if (tool_pref_check_old_password($nel_user, $post_old_pwd))
{
if (tool_pref_update_user_password($nel_user, $post_new_pwd))
{
$tpl->assign("tool_error", "Password has been updated!");
}
else
{
$tpl->assign("tool_error", "Invalid new password!");
}
}
else
{
$tpl->assign("tool_error", "Old password does not match!");
}
}
elseif (($post_old_pwd != '') || ($post_new_pwd != ''))
{
$tpl->assign("tool_error", "You need to type your current and new passwords!");
}
break;
/*
* update default application
*/
case 'update default application':
$post_new_application = $NELTOOL['POST_VARS']['tool_form_application_default'];
if ($nel_user['user_default_application_id'] != $post_new_application)
{
tool_pref_update_default_application($nel_user, $post_new_application);
$tpl->assign("tool_v_application", $post_new_application);
}
break;
}
}
$tpl->display('tool_preferences.tpl');
?>