assign("ID",vtlib_purify($_REQUEST['record'])); $mode='edit'; if (!is_admin($current_user) && $_REQUEST['record'] != $current_user->id) die ("Unauthorized access to user administration."); $focus->retrieve_entity_info($_REQUEST['record'],'Users'); $smarty->assign("USERNAME", getFullNameFromArray('Users', $focus->column_fields)); }else { $mode='create'; } if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') { $focus->id = ""; $focus->user_name = ""; $mode='create'; //When duplicating the user the password fields should be empty $focus->column_fields['user_password']=''; $focus->column_fields['confirm_password']=''; } if(empty($focus->column_fields['time_zone'])) { $focus->column_fields['time_zone'] = DateTimeField::getDBTimeZone(); } global $theme; $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; $log->info("User edit view"); $smarty->assign("JAVASCRIPT", get_validate_record_js()); $smarty->assign("UMOD", $mod_strings); global $current_language; $smod_strings = return_module_language($current_language,'Settings'); $smarty->assign("MOD", $smod_strings); $smarty->assign("CURRENT_USERID", $current_user->id); $smarty->assign("APP", $app_strings); if (isset($_REQUEST['error_string'])) $smarty->assign("ERROR_STRING", "Error: ".vtlib_purify($_REQUEST['error_string']).""); if (isset($_REQUEST['return_module'])) { $smarty->assign("RETURN_MODULE", vtlib_purify($_REQUEST['return_module'])); $RETURN_MODULE=vtlib_purify($_REQUEST['return_module']); } if (isset($_REQUEST['return_action'])) { $smarty->assign("RETURN_ACTION", vtlib_purify($_REQUEST['return_action'])); $RETURN_ACTION = vtlib_purify($_REQUEST['return_action']); } if ($_REQUEST['isDuplicate'] != 'true' && isset($_REQUEST['return_id'])) { $smarty->assign("RETURN_ID", vtlib_purify($_REQUEST['return_id'])); $RETURN_ID = vtlib_purify($_REQUEST['return_id']); } $smarty->assign("THEME", $theme); $smarty->assign("IMAGE_PATH", $image_path);$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']); $focus->mode = $mode; $disp_view = getView($focus->mode); $smarty->assign("IMAGENAME",$focus->imagename); $smarty->assign("BLOCKS",getBlocks($currentModule,$disp_view,$mode,$focus->column_fields)); $smarty->assign("MODULE", 'Settings'); $smarty->assign("MODE",$focus->mode); $smarty->assign("HOUR_FORMAT",$focus->hour_format); $smarty->assign("START_HOUR",$focus->start_hour); if ($_REQUEST['Edit'] == ' Edit ') { $smarty->assign("READONLY", "readonly"); $smarty->assign("USERNAME_READONLY", "readonly"); } if(isset($_REQUEST['record']) && $_REQUEST['isDuplicate'] != 'true') { $smarty->assign("USERNAME_READONLY", "readonly"); } $smarty->assign("HOMEORDER",$focus->getHomeStuffOrder($focus->id)); //Added to provide User based Tagcloud if($mode == 'create') $smarty->assign("TAGCLOUDVIEW","true"); // While creating user select tag cloud by default else $smarty->assign("TAGCLOUDVIEW",getTagCloudView($focus->id)); $smarty->assign("DUPLICATE",vtlib_purify($_REQUEST['isDuplicate'])); $smarty->assign("USER_MODE",$mode); $smarty->assign('PARENTTAB', getParentTab()); $_SESSION['Users_FORM_TOKEN'] = rand(5, 2000) * rand(2, 7); $smarty->assign('FORM_TOKEN', $_SESSION['Users_FORM_TOKEN']); // Gather the help information associated with fields $smarty->assign('FIELDHELPINFO', vtlib_getFieldHelpInfo($currentModule)); // END $smarty->display('UserEditView.tpl'); ?>