@@ -828,7 +828,6 @@ xrdp_login_wnd_create(struct xrdp_wm *self)
828828 self -> login_window -> left = primary_x_offset - self -> login_window -> width / 2 ;
829829 self -> login_window -> top = primary_y_offset - self -> login_window -> height / 2 ;
830830
831-
832831 self -> login_window -> notify = xrdp_wm_login_notify ;
833832
834833 /* if window title not specified, use hostname as default */
@@ -951,6 +950,17 @@ xrdp_login_wnd_create(struct xrdp_wm *self)
951950 but -> top = globals -> ls_scaled .input_y_pos ;
952951 set_string (& but -> caption1 , "Session" );
953952
953+ /* Acceptable Use Policy */
954+ but = xrdp_bitmap_create (globals -> ls_scaled .acceptable_use_width , globals -> ls_scaled .acceptable_use_height ,
955+ self -> screen -> bpp , WND_TYPE_LABEL , self );
956+ list_add_item (self -> login_window -> child_list , (long )but );
957+ but -> parent = self -> login_window ;
958+ but -> owner = self -> login_window ;
959+ but -> left = globals -> ls_scaled .acceptable_use_x_pos ;
960+ but -> top = globals -> ls_scaled .acceptable_use_y_pos ;
961+ //set_string(&but->caption1, globals->ls_acceptable_use_policy_filename);
962+ set_string (& but -> caption1 , "This is a test of adding an acceptable use policy to the login screen" );
963+
954964 /* combo */
955965 combo = xrdp_bitmap_create (globals -> ls_scaled .input_width , combo_height ,
956966 self -> screen -> bpp , WND_TYPE_COMBO , self );
@@ -1084,6 +1094,10 @@ load_xrdp_config(struct xrdp_config *config, const char *xrdp_ini, int bpp)
10841094 globals -> ls_unscaled .logo_y_pos = 50 ;
10851095 globals -> ls_unscaled .label_x_pos = 30 ;
10861096 globals -> ls_unscaled .label_width = 65 ;
1097+ globals -> ls_unscaled .acceptable_use_x_pos = 30 ; /* acceptable use x co-ordinate */
1098+ globals -> ls_unscaled .acceptable_use_y_pos = 240 ; /* acceptable use y co-ordinate */
1099+ globals -> ls_unscaled .acceptable_use_height = 50 ; /* height of the acceptable use policy */
1100+ globals -> ls_unscaled .acceptable_use_width = 250 ; /* width of the acceptable use policy */
10871101 globals -> ls_unscaled .input_x_pos = 110 ;
10881102 globals -> ls_unscaled .input_width = 210 ;
10891103 globals -> ls_unscaled .input_y_pos = 150 ;
@@ -1331,6 +1345,12 @@ load_xrdp_config(struct xrdp_config *config, const char *xrdp_ini, int bpp)
13311345 globals -> ls_bg_color = HCOLOR (bpp , xrdp_wm_htoi (v ));
13321346 }
13331347
1348+ else if (g_strncmp (n , "ls_acceptable_use_policy_filename" , 255 ) == 0 )
1349+ {
1350+ g_strncpy (globals -> ls_acceptable_use_policy_filename , v , 255 );
1351+ globals -> ls_acceptable_use_policy_filename [255 ] = 0 ;
1352+ }
1353+
13341354 else if (g_strncmp (n , "ls_title" , 255 ) == 0 )
13351355 {
13361356 g_strncpy (globals -> ls_title , v , 255 );
@@ -1484,6 +1504,7 @@ load_xrdp_config(struct xrdp_config *config, const char *xrdp_ini, int bpp)
14841504 LOG (LOG_LEVEL_DEBUG , "ls_width (unscaled): %d" , globals -> ls_unscaled .width );
14851505 LOG (LOG_LEVEL_DEBUG , "ls_height (unscaled): %d" , globals -> ls_unscaled .height );
14861506 LOG (LOG_LEVEL_DEBUG , "ls_bg_color: %x" , globals -> ls_bg_color );
1507+ LOG (LOG_LEVEL_DEBUG , "ls_acceptable_use_policy_filename: %s" , globals -> ls_acceptable_use_policy_filename );
14871508 LOG (LOG_LEVEL_DEBUG , "ls_title: %s" , globals -> ls_title );
14881509 LOG (LOG_LEVEL_DEBUG , "ls_logo_filename: %s" , globals -> ls_logo_filename );
14891510 LOG (LOG_LEVEL_DEBUG , "ls_logo_x_pos : %d" , globals -> ls_unscaled .logo_x_pos );
@@ -1552,6 +1573,14 @@ xrdp_login_wnd_scale_config_values(struct xrdp_wm *self)
15521573 scaled -> logo_y_pos = SCALE_AND_ROUND (unscaled -> logo_y_pos );
15531574 scaled -> label_x_pos = SCALE_AND_ROUND (unscaled -> label_x_pos );
15541575 scaled -> label_width = SCALE_AND_ROUND (unscaled -> label_width );
1576+ scaled -> acceptable_use_x_pos
1577+ = SCALE_AND_ROUND (unscaled -> acceptable_use_x_pos );
1578+ scaled -> acceptable_use_y_pos
1579+ = SCALE_AND_ROUND (unscaled -> acceptable_use_y_pos );
1580+ scaled -> acceptable_use_height
1581+ = SCALE_AND_ROUND (unscaled -> acceptable_use_height );
1582+ scaled -> acceptable_use_width
1583+ = SCALE_AND_ROUND (unscaled -> acceptable_use_width );
15551584 scaled -> input_x_pos = SCALE_AND_ROUND (unscaled -> input_x_pos );
15561585 scaled -> input_width = SCALE_AND_ROUND (unscaled -> input_width );
15571586 scaled -> input_y_pos = SCALE_AND_ROUND (unscaled -> input_y_pos );
0 commit comments