• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

yast / yast-users / 16077287403

04 Jul 2025 03:49PM UTC coverage: 70.346% (+10.0%) from 60.368%
16077287403

Pull #402

github

imobachgs
Bump version and update changes file
Pull Request #402: Disable auto client unit tests

3212 of 4566 relevant lines covered (70.35%)

40.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

29.11
/src/include/users/helps.rb
1
# encoding: utf-8
2

3
# ------------------------------------------------------------------------------
4
# Copyright (c) 2006-2012 Novell, Inc. All Rights Reserved.
5
#
6
#
7
# This program is free software; you can redistribute it and/or modify it under
8
# the terms of version 2 of the GNU General Public License as published by the
9
# Free Software Foundation.
10
#
11
# This program is distributed in the hope that it will be useful, but WITHOUT
12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License along with
16
# this program; if not, contact Novell, Inc.
17
#
18
# To contact Novell about this file by physical or electronic mail, you may find
19
# current contact information at www.novell.com.
20
# ------------------------------------------------------------------------------
21

22
#
23
# File:        include/users/helps.ycp
24
# Package:        Configuration of users and groups
25
# Summary:        Helptext for the users module
26
# Authors:        Johannes Buchhold <jbuch@suse.de>,
27
#                Jiri Suchomel <jsuchome@suse.cz>
28
#
29
# $Id$
30
#
31
module Yast
1✔
32
  module UsersHelpsInclude
1✔
33
    def initialize_users_helps(include_target)
1✔
34
      textdomain "users"
24✔
35

36
      Yast.import "Label"
24✔
37
      Yast.import "Ldap"
24✔
38
      Yast.import "Stage"
24✔
39
      Yast.import "Users"
24✔
40
      Yast.import "UsersCache"
24✔
41
      Yast.import "UsersLDAP"
24✔
42
      Yast.import "UsersRoutines"
24✔
43
    end
44

45
    # Password help text.
46
    # @param [String] type user type
47
    # @return [String] help text
48
    def help_password(type)
1✔
49
      password_length = ""
×
50
      enc_to_string = {
51
        # encryption type
52
        "des"   => _("DES"),
×
53
        # encryption type
54
        "crypt" => _("DES"),
55
        # encryption type
56
        "md5"   => _("MD5")
57
      }
58
      method = Users.EncryptionMethod
×
59
      method = UsersLDAP.GetEncryption if type == "ldap"
×
60

61
      # help text 1/4
62
      help_text = _(
×
63
        "<p>\n" +
64
          "When entering a password, distinguish between uppercase and\n" +
65
          "lowercase. Passwords should not contain any accented characters or umlauts. \n" +
66
          "</p>\n"
67
      )
68

69
      # help text 2/4 %1 is encryption type, %2,%3 numbers
70
      help_text = Ops.add(
×
71
        help_text,
72
        Builtins.sformat(
73
          _(
74
            "<p>\n" +
75
              "With the current password encryption (%1), the password length should be between\n" +
76
              " %2 and %3 characters.\n" +
77
              "</p>"
78
          ),
79
          Ops.get_string(enc_to_string, method, method),
80
          Users.GetMinPasswordLength(type),
81
          Users.GetMaxPasswordLength(type)
82
        )
83
      )
84

85
      help_text = Ops.add(help_text, Users.ValidPasswordHelptext)
×
86

87
      #help text 4/4
88
      help_text = Ops.add(
×
89
        help_text,
90
        _(
91
          "<p>\n" +
92
            "To ensure that the password was entered correctly,\n" +
93
            "repeat it exactly in a second field. Do not forget your password.\n" +
94
            "</p>\n"
95
        )
96
      )
97
      help_text
×
98
    end
99

100
    # @return [String] The help text.
101
    def DefaultsDialogHelp
1✔
102
      # Help text 0/6
103
      _(
×
104
        "<p>\n" +
105
          "Here, set default values to use when creating new local or system users.\n" +
106
          "</p>\n"
107
      ) +
108
        # Help text 1/6
109
        _(
110
          "<p>\n" +
111
            "<b>Default Group</b><br>\n" +
112
            "The group name of a new user's primary group.\n" +
113
            "</p>\n"
114
        ) +
115
        # Help text 2/6
116
        _(
117
          "<p><b>Default Login Shell</b><br>\nThe name of the new user's login shell. Select one from the list or enter your own path to the shell.</P>\n"
118
        ) +
119
        #Help text 3/6
120
        _(
121
          "<p><b>Default Home</b><br>\n" +
122
            "The initial path prefix for a new user's home directory. The username is added\n" +
123
            "to the end of this value to create the default name of the home directory.\n" +
124
            "</P>\n"
125
        ) +
126
        # Help text 4.5/6
127
        _(
128
          "<p><b>Umask for Home Directory</b><br>\nUmask to use for creating new home directories.</p>\n"
129
        ) +
130
        # Help text 5/6:
131
        # Don't reorder letters YYYY-MM-DD, date must be set in this format
132
        _(
133
          "<p><b>Expiration Date</b><br>\n" +
134
            "The date on which the user account is disabled. The date must be in the format\n" +
135
            "YYYY-MM-DD. Leave it empty if this account never expires.</P>\n"
136
        ) +
137
        # Help text 6/6
138
        _(
139
          "<P><B>Days after Password Expiration Login Is Usable</B><BR>\n" +
140
            "Users can log in after expiration of passwords. Set how many days \n" +
141
            "after expiration login is allowed. Use -1 for unlimited access.\n" +
142
            "</P>\n"
143
        )
144
    end
145

146

147
    # Help for the ReadDialog () dialog.
148
    # @return [String] The help text.
149
    def ReadDialogHelp
1✔
150
      # For translators: read dialog help, part 1 of 2
151
      _(
×
152
        "<P><B><BIG>Initializing User Management</BIG></B><BR>\n" +
153
          "Please wait...\n" +
154
          "<BR></P>\n"
155
      ) +
156
        # For translators: read dialog help, part 2 of 2
157
        _(
158
          "<P><B><BIG>Aborting the Initialization</BIG></B><BR>\n" +
159
            "You can safely abort the configuration utility by pressing <B>Abort</B>\n" +
160
            "now.\n" +
161
            "</P>"
162
        )
163
    end
164

165
    # Help for the WriteDialog () dialog.
166
    # @return [String] The help text.
167
    def WriteDialogHelp
1✔
168
      # For translators: read dialog help, part 1 of 2
169
      _(
×
170
        "<P><B><BIG>Saving User Configuration</BIG></B><BR>\n" +
171
          "Please wait...\n" +
172
          "<BR></P>\n"
173
      ) +
174
        # For translators: read dialog help, part 2 of 2
175
        _(
176
          "<P><B><BIG>Aborting the Save Process:</BIG></B><BR>\n" +
177
            "Abort the save process by pressing <B>Abort</B>.\n" +
178
            "An additional dialog will inform you whether it is safe to do so.\n" +
179
            "</P>\n"
180
        )
181
    end
182

183

184
    # Help for EditUserDialog.
185
    # @param [Boolean] mail if checkbox for mail forwarding should be included
186
    # @param [String] type type of user created
187
    # @return [String] help text
188
    def EditUserDialogHelp(mail, type, what)
1✔
189
      help = ""
×
190
      if type == "ldap"
×
191
        # help text 1/7
192
        help = _(
×
193
          "<p>\n" +
194
            "Enter the <b>First Name</b>, <b>Last Name</b>, \n" +
195
            "<b>Username</b>, and\n" +
196
            "<b>Password</b> to assign to this user.\n" +
197
            "</p>\n"
198
        )
199
      else
200
        # alternative help text 1/7
201
        help = _(
×
202
          "<p>\n" +
203
            "Enter the <b>User's Full Name</b>, <b>Username</b>, and <b>Password</b> to\n" +
204
            "assign to this user account.\n" +
205
            "</p>\n"
206
        )
207
      end
208

209
      help = Ops.add(help, help_password(type))
×
210

211
      if what == "add_user"
×
212
        help = Ops.add(
×
213
          help,
214
          # help text 2/7
215
          _(
216
            "<p>\n" +
217
              "Create the <b>Username</b> from components of the full name by\n" +
218
              "clicking <b>Suggestion</b>. It may be modified, but use only\n" +
219
              "letters (no accented characters), digits, and <tt>._-</tt>.\n" +
220
              "Do not use uppercase letters in this entry unless you know what you are doing.\n" +
221
              "Usernames have stricter restrictions than passwords. You can redefine the\n" +
222
              "restrictions in the /etc/login.defs file. Read its man page for information.\n" +
223
              "</p>\n"
224
          )
225
        )
226
      else
227
        help = Ops.add(
×
228
          help,
229
          # alternative help text 2/7
230
          _(
231
            "<p>\n" +
232
              "For the <b>Username</b>, use only\n" +
233
              "letters (no accented characters), digits, and <tt>._-</tt>.\n" +
234
              "Do not use uppercase letters in this entry unless you know what you are doing.\n" +
235
              "Usernames have stricter restrictions than passwords. You can redefine the\n" +
236
              "restrictions in the /etc/login.defs file.  Read its man page for information.\n" +
237
              "</p>\n"
238
          )
239
        )
240
      end
241

242
      if mail # these are used only during installation time
×
243
        # help text 4/7 (only during installation)
244
        help = Ops.add(
×
245
          Ops.add(
246
            Ops.add(
247
              help,
248
              _(
249
                "<p>\nThe username and password created here are needed to log in and work with your Linux system. With <b>Automatic Login</b> enabled, the login procedure is skipped. This user is logged in automatically.</p>\n"
250
              )
251
            ),
252
            # help text 5/7 (only during installation)
253
            _(
254
              "<p>\nHave mail for root forwarded to this user by checking <b>Receive System Mail</b>.</p>\n"
255
            )
256
          ),
257
          # help text 6/7 (only during installation)
258
          _(
259
            "<p>Press <b>User Management</b> to add more users or groups to your system.</p>"
260
          )
261
        )
262
      else
263
        # alternative help text 4/7
264
        help = Ops.add(
×
265
          Ops.add(
266
            help,
267
            _(
268
              "<p>\n" +
269
                "To see more details, such as the home directory or the user ID, click\n" +
270
                "<b>Details</b>.\n" +
271
                "</p>\n"
272
            )
273
          ),
274
          # alternative help text 5/7
275
          _(
276
            "<p>\nTo edit various password settings of this user, such as expiration date, click <b>Password Settings</b>.</p>\n"
277
          )
278
        )
279
      end
280

281
      if !mail && type != "nis"
×
282
        # help text 7/7
283
        help = Ops.add(
×
284
          help,
285
          _(
286
            "<p>To forbid this user to\nlog in, check <b>Disable User Login</b>.</p>"
287
          )
288
        )
289
      end
290
      help
×
291
    end
292

293

294

295

296
    # Help for EditGroupDialog.
297
    # @param [Boolean] more if the widget with more_users will be shown
298
    # @return [String] help text
299
    def EditGroupDialogHelp(more)
1✔
300
      # help text 1/6
301
      helptext = Ops.add(
×
302
        Ops.add(
303
          _("<p>\nEnter the group data here.   \n</p>\n") +
304
            # help text 2/6
305
            _(
306
              "<p>\n" +
307
                "<b>Group Name:</b>\n" +
308
                "Avoid long names for groups. Normal lengths are between \n" +
309
                "two and eight characters.  \n" +
310
                "You can redefine the list of characters allowed for group names in\n" +
311
                "the /etc/login.defs file. Read its man page for information.\n" +
312
                "</p>\n"
313
            ),
314
          # help text 3/6, %1 is number
315
          Builtins.sformat(
316
            _(
317
              "<p>\n" +
318
                "<b>Group ID (gid):</b>\n" +
319
                "In addition to its name, a group must be assigned a numerical ID for its\n" +
320
                "internal representation. These values are between 0 and\n" +
321
                "%1. Some of the IDs are already assigned during installation. You will be\n" +
322
                "warned if you try to use an already set one.\n" +
323
                "</p>\n"
324
            ),
325
            UsersCache.GetMaxGID("local")
326
          )
327
        ),
328
        # help text 6/6
329
        _(
330
          "<p>\n" +
331
            "<b>Group Members:</b>\n" +
332
            "Here, select which users should be members of this group.\n" +
333
            "</p>\n"
334
        )
335
      )
336

337
      if more
×
338
        helptext = Ops.add(
×
339
          helptext,
340
          # additional helptext for EditFroup dialog
341
          _(
342
            "The second list shows users for which this group is the default\n        group. The default group can only be changed by editing the user."
343
          )
344
        )
345
      end
346

347
      helptext
×
348
    end
349

350

351
    # Help for EditUserDetailsDialog.
352
    #
353
    # @param [String] user_type type of added/edited user (local/system/ldap/nis)
354
    # @param [String] what what to do with a user (add_user/edit_user)
355
    #
356
    # @return [String] help text
357
    def EditUserDetailsDialogHelp(user_type, what)
1✔
358
      helptext = ""
×
359

360
      helptext << _("<p>\nAdditional user data includes:\n</p>")
×
361
      # TRANSLATORS: %1 is a number
362
      helptext << Builtins.sformat(
×
363
        _(
364
          "<p>\n" \
365
          "<b>User ID (uid):</b>\n" \
366
          "Each user is known to the system by a unique number,\n" \
367
          "the user ID. For normal users, you should use\n" \
368
          "a UID larger than %1 because the smaller UIDs are used\n" \
369
          "by the system for special purposes and pseudo logins.\n" \
370
          "</p>\n"
371
        ),
372
        UsersCache.GetMaxUID("system")
373
      )
374
      helptext << _(
×
375
        "<p>\n" \
376
        "If you change the UID of an existing user, the rights of the files\n" \
377
        "this user owns must be changed. This is done automatically\n" \
378
        "for the files in the user's home directory, but not for files \n" \
379
        "located elsewhere.</p>\n"
380
      )
381
      helptext << _(
×
382
        "<p>\n" \
383
        "<b>Home Directory:</b>\n" \
384
        "The home directory of the user. Normally this is\n" \
385
        "/home/username. \n" \
386
        "To select an existing directory, click <b>Browse</b>.\n" \
387
        "</p>\n"
388
      )
389

390
      if what == "add_user"
×
391
        # help text for user's home directory mode
392
        helptext << _(
×
393
          "<p>Optionally, set the <b>Home Directory Permission Mode</b> " \
394
          "for this user's home directory different from the default.</p>"
395
        )
396

397
        # help text for an empty home option
398
        # TRANSLATORS: %1 is a path to directory (e.g. '/etc/skel')
399
        helptext << Builtins.sformat(
×
400
          _(
401
            "<p>To create only an empty home directory,\n" \
402
            "check <b>Empty Home</b>. Otherwise, the new home directory\n" \
403
            "is created from the default skeleton (%1).</p>\n"
404
          ),
405
          (Users.GetLoginDefaults ? Users.GetLoginDefaults.fetch("skel", "") : "/home")
×
406
        )
407

408
        btrfs_option_label = _("Create as Btrfs Subvolume")
×
409
        # TRANSLATORS: help text for the Btrfs subvolume checkbox
410
        helptext << _(
×
411
          "<p><b>%s</b> option allows to create the user home " \
412
          "as a subvolume instead of a plain directory whenever " \
413
          "there is a Btrfs filesystem available.</p>"
414
        ) % btrfs_option_label
415
      else
416
        # help text for Move to new location checkbox
417
        helptext << _(
×
418
          "<p>If changing the location of a user's home directory, move the contents " \
419
          "of the current directory with <b>Move to New Location</b>, activated by default. " \
420
          "Otherwise a new home directory is created without any of the existing data.</p>"
421
        )
422
      end
423

424
      if user_type == "ldap"
×
425
        helptext << _(
×
426
          "<p>\n" \
427
          "The home directory of an LDAP user can be changed only on the\n" \
428
          "file server.</p>"
429
        )
430
      elsif user_type == "system" || user_type == "local"
×
431
        helptext << _(
×
432
          "<p><b>Additional Information:</b>\n" \
433
          "Some additional user data could be set here. This field may contain up to\n" \
434
          "three parts, separated by commas. The standard usage is to write\n" \
435
          "<i>office</i>,<i>work phone</i>,<i>home phone</i>. This information is \n" \
436
          "shown when you use the <i>finger</i> command on this user.</p>\n"
437
        )
438
      end
439

440
      helptext << _(
×
441
        "<p>\n" \
442
        "<b>Login Shell:</b>\n" \
443
        "The login shell (command interpreter) for the user.\n" \
444
        "Select a shell from the list of all shells installed\n" \
445
        "on your system.\n" \
446
        "</p>"
447
      )
448

449
      helptext << _(
×
450
        "<p>\n" \
451
        "<b>Default Group:</b>\n" \
452
        "The primary group to which the user belongs. Select one group\n" \
453
        "from the list of all groups existing on your system.\n" \
454
        "</p>"
455
      )
456
      helptext << _(
×
457
        "<p>\n" \
458
        "<b>Additional Groups:</b>\n" \
459
        "Select additional groups in which the user should be a member.\n" \
460
        "</p>\n"
461
      )
462

463
      helptext
×
464
    end
465

466
    # help text for dualogs with plugins
467
    def PluginDialogHelp
1✔
468
      # helptxt for plugin dialog 1/2
469
      _(
×
470
        "<p>Here, see the list of plug-ins, the\nextensions of user and group configuration.</p>\n"
471
      ) +
472
        # helptext for plugin dialog 2/3
473
        _(
474
          "The check mark in the left part of the table indicates that the plug-in\nis currently in use."
475
        ) +
476
        # helptext for plugin dialog 3/3
477
        _(
478
          "<p>Start the detailed configuration of a particular plug-in by selecting <b>Launch</b>.</p>"
479
        )
480
    end
481

482

483
    # Help for usersSave.
484
    # @return [String] help text
485
    def usersSaveDialogHelp
1✔
486
      # help texts 1/1
487
      _(
×
488
        "<p>\n" +
489
          "Save the current user and group settings to the system.\n" +
490
          "</p>"
491
      )
492
    end
493

494
    # Help for editing password settings
495
    # @return [String] help text
496
    def EditUserPasswordDialogHelp
1✔
497
      # Help text 1/6
498
      _(
×
499
        "<p>Activate <b>Force Password Change</b> to force the user to change the\n" +
500
          "password at the next login. If <b>Last Password Change</b> is set to\n" +
501
          "<i>Never</i>, the user will be forced to change the password.</p>"
502
      ) +
503
        # Help text 2/6
504
        _(
505
          "<p>\n" +
506
            "<b>Days before Password Expiration to Issue Warning</B><BR>\n" +
507
            "Users can be warned before their passwords expire. Set \n" +
508
            "how long before expiration the warning should be issued. Set -1 to disable\n" +
509
            "the warning. \n" +
510
            "</p>\n"
511
        ) +
512
        # Help text 3/6
513
        _(
514
          "<P><B>Days after Password Expires with Usable Login</B><BR>\n" +
515
            "Users can log in after their passwords have expired. Set how many days to\n" +
516
            "allow login. Use -1 for unlimited access.\n" +
517
            "</P>\n"
518
        ) +
519
        #Help text 4/6
520
        _(
521
          "<P><B>Maximum Number of Days for the Same Password</B><BR>Set how many days a user \ncan use the same password before it expires.</P>\n"
522
        ) +
523
        # Help text 5/6
524
        _(
525
          "<P><B>Minimum Number of Days for the Same Password</B><BR>Set the minimum age of \na password before a user is allowed to change it.</P>\n"
526
        ) +
527
        # Help text 6/6 : Don't reorder letters YYYY-MM-DD, date must be set in this format
528
        _(
529
          "<P><B>Expiration Date</B><BR>Set the date when this account expires. \n" +
530
            "The date must be in the format YYYY-MM-DD. \n" +
531
            "Leave it empty if this account never expires.</P>\n"
532
        )
533
    end
534

535
    def AuthentizationDialogHelp
1✔
536
      help_text =
537
        # help text 1/2
538
        _(
×
539
          "<p>\n" +
540
            "<b>Configuration Overview</b><br>\n" +
541
            "Here, see a summary of modules that could affect sources\n" +
542
            "of user accounts or authentication type.\n" +
543
            "</p>\n"
544
        ) +
545
          # help text 2/2
546
          _(
547
            "<p>\n" +
548
              "<b>Changing the Values</b><br>\n" +
549
              "You can configure these settings by running appropriate modules. Select the module with <b>Configure</b>.\n" +
550
              "</p>\n"
551
          )
552

553
      help_text
×
554
    end
555

556
    # @return [String] Help text for the authorized keys dialog
557
    def EditAuthorizedKeysDialogHelp
1✔
558
      _(
×
559
        "<p>\n" \
560
        "List of public keys that the user can use to authenticate when logging in via SSH.\n" \
561
        "You can select any public key from your computer through the <b>Add...</b> button.\n" \
562
        "</p>\n"
563
      )
564
    end
565
  end
566
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc