/**
 *
 * File:	include/users/helps.ycp
 * Package:	Configuration of users and groups
 * Summary:	Helptext for the users module
 * Authors:	Johannes Buchhold <jbuch@suse.de>,
 *		Jiri Suchomel <jsuchome@suse.cz>
 *
 * $Id: helps.ycp 21491 2005-02-10 09:46:52Z jsuchome $
 *
 */
{
  textdomain "users";

  import "Label";
  import "Stage";
  import "Users";
  import "UsersCache";
  import "UsersLDAP";


  /**
   * Password help text.
   * @param type user type
   * @return string help text
   */
  define string help_password (string type)``{
    string password_length = "";
    map enc_to_string = $[
	// encryption type
	"des" :	_("DES"),
	// encryption type
	"crypt" :_("DES"),
	// encryption type
	"md5" :	_("MD5"),
	// encryption type
	"blowfish" : _("Blowfish")
    ];
    string method = Users::EncryptionMethod ();
    if (type == "ldap")
	method = UsersLDAP::GetEncryption ();

	// help text 1/4
    string help_text =  _("<p>
When entering a password, distinguish between uppercase and lowercase. It should not contain any special characters (e.g., accented characters).
</p>
");

    // help text 2/4 %1 is encryption type, %2,%3 numbers
    help_text = help_text + sformat(_("<p>
With the current password encryption (%1), the password length should be between
 %2 and %3 characters.
</p>"), enc_to_string[method]:method,
	Users::GetMinPasswordLength (type), Users::GetMaxPasswordLength (type));

    // help text 3/4
    help_text = help_text + _("<p>
Valid password characters are letters, digits, blanks, and
<tt>#*,.;:._-+!</tt><tt>$%&/|?{[()]}=</tt>.
</p>");

    //help text 4/4
    help_text = help_text + _("<p>
To ensure that the password was entered correctly,
repeat it exactly in a second field. Do not forget your password.
</p>
");
    return help_text;

  }

     /**
     * @return string The help text.
     */
    define string DefaultsDialogHelp () ``{
// Help text 0/6
      return _("<p>
Here, set default values to use when creating new <b>local</b> or <b>system</b> users.
</p>
") +
// Help text 1/6
      _("<p>
<b>Default Group</b><br>
The group name for a new user's initial group.
</p>
")
+
// Help text 1.5/6
      _("<p>
<b>Secondary Groups</b><br>
Names of initial additional groups of the new user.
</p>
")
+
// Help text 2/6
_("<p><b>Default Login Shell</b><br>
The name of the new user's login shell. Select one from the list or enter your own path to the shell.</P>
")
+
//Help text 3/6
_("<p><b>Default Home</b><br>
The initial path prefix for a new user's home directory. The user's name will be affixed to the end of this value to create the default name of the user's home directory.</P>
")
+
// Help text 4/6
_("<p><b>Skeleton Directory</b><br>
The contents of this directory will be copied to a user's home directory when a new user is added. </p>
")
+
// Help text 5/6:
// Don't reorder letters YYYY-MM-DD, date must be set in this format
_("<p><b>Expiration Date</b><br>
The date on which the user account is disabled. Date must be in the format YYYY-MM-DD. Leave empty if this account never expires.</P>
")
+
// Help text 6/6
_("<P><B>Logging in after expiration</B><BR>
Users can log in after expiration of passwords. Set how many days 
after expiration login is allowed. Use -1 for unlimited access.
</P>
");

}


     /**
     * Help for the ReadDialog () dialog.
     * @return string The help text.
     */
    define string ReadDialogHelp () ``{
	return
	    // For translators: read dialog help, part 1 of 2
_("<P><B><BIG>Initializing users configuration</BIG></B><BR>
Please wait...
<BR></P>
") +
	    // For translators: read dialog help, part 2 of 2
_("<P><B><BIG>Aborting the initialization:</BIG></B><BR>
You can safely abort the configuration utility by pressing the <B>Abort</B>
button now.
</P>");
    }

     /**
     * Help for the WriteDialog () dialog.
     * @return string The help text.
     */
    define string WriteDialogHelp () ``{
    return
	    // For translators: read dialog help, part 1 of 2
_("<P><B><BIG>Saving User Configuration</BIG></B><BR>
Please wait...
<BR></P>
") +
	    // For translators: read dialog help, part 2 of 2
_("<P><B><BIG>Aborting the Save Process:</BIG></B><BR>
Abort the save process by pressing <B>Abort</B>.
An additional dialog will inform you whether it is safe to do so.
</P>
");
 }


  /**
   * Help for EditUserDialog.
   * @param mail if checkbox for mail forwarding should be included
   * @param type type of user created
   * @return string help text
   */
  define string EditUserDialogHelp(boolean mail, string type, string what) ``{

    string help = "";
    if (type == "ldap")
    {
	// help text 1/7
	help = _("<p>
If you fill out the fields <b>First Name</b>, <b>Last Name</b>, and
<b>User Login</b>, a new user account is created with the
<b>Password</b> given in the corresponding field.
</p>
");
    }
    else
    {
	// alternative help text 1/7
	help = _("<p>
If you fill out the fields <b>Full User Name</b> and <b>User Login</b>, a new
user account is created with the <b>Password</b> given in
the corresponding field.
</p>
");
    }

    help = help + help_password(type);

    if (what == "add_user")
    {
	help = help +
	// help text 2/7
	_("<p>
Create the <b>User Login</b> from components of the full name by
clicking <b>Suggestion</b>. It may be modified, but use only
letters (no accented characters), digits, and <tt>._-</tt>
Do not use uppercase letters in this entry unless you really know what you are doing.
User names have stricter restrictions than passwords. You can redefine the
restrictions in the /etc/login.defs file. Read its man page for information.
</p>
");
    }
    else
    {
	help = help +
	// alternative help text 2/7
	_("<p>
When you modify the <b>User Login</b>, use only
letters (no accented characters), digits, and <tt>._-</tt>
Do not use uppercase letters in this entry unless you really know what you are doing.
User names have stricter restrictions than passwords. You can redefine the
restrictions in the /etc/login.defs file.  Read its man page for information.
</p>
");
    }

    help = help +

	// help text 3/7
	_("<p>
To work with Linux, first enter the <b>User Login</b> and
the password. This starting procedure is traditionally known as the
<b>login</b>.
</p>
");

    if (mail) // these are used only during installation time
    {
	// help text 4/7 (only during installation)
	help = help + _("<p>
The <b>login</b> procedure could be skipped if <b>Auto Login</b> is set. In such a case, this user is logged in automatically. This feature is only
available when using KDM as a login manager.</p>
") +

        // help text 5/7 (only during installation)
        _("<p>
The mail for root will be forwarded to this user if you check the option \"Receive System Mail\".</p>
") +

	// help text 6/7 (only during installation)
        _("<p>Press <b>User Management</b> to add more users or groups to your system.</p>");
    }
    else
    {
	// alternative help text 4/7
	help = help + _("<p>
To see more details, such as the home directory or the user ID, click
<b>Details</b>.
</p>
") +

	// alternative help text 5/7
	_("<p>
To edit various password settings of this user (e.g., expiration date), click <b>Password Settings</b>.</p>
");
    }

    if (!mail && type != "nis")
    {
	// help text 7/7
	help = help + _("<p>To disallow this user to
log in, check <b>Disable User Login</b> option.</p>");
    }
    return help;
  }




  /**
   * Help for EditGroupDialog.
   * @param more if the widget with more_users will be shown
   * @return string help text
   */
  define string EditGroupDialogHelp(boolean more) ``{
	// help text 1/6
      string helptext = _("<p>
YaST provides an easy means of maintaining user groups on your
system. Here is what the different entries mean:
</p>
") +

	// help text 2/6
		_("<p>
<b>Group Name:</b>
Enter the name of the group. Avoid 
long names. Normal lengths are between two and eight characters.
You can redefine the list of characters allowed for group names in
the /etc/login.defs file. Read its man page for information.
</p>
") +
	// help text 3/6, %1 is number
		sformat(_("<p>
<b>Group ID (gid):</b>
In addition to its name, a group must be assigned a numerical ID for its
internal representation. These values are between 0 and
%1. Some of the IDs are already assigned during installation. YaST2
warns you if you try to use an already set one.
</p>
"), UsersCache::GetMaxGID ("local")) +
	// help text 4/6
		_("<p>
<b>Enter a Password:</b>
To require the users who are not members of the group to identify themselves while
switching to this new group (see man page of <tt>newgrp</tt>), assign a
password to this group. For security reasons, this password is not shown
here. This entry is not required.
</p>
") +
	// help text 5/6
		_("<p>
<b>Repeat Password:</b>
Enter the password a second time to avoid typing errors.
</p>
") +
	// help text 6/6
		_("<p>
<b>Members of This Group:</b>
Here, select which users should be members of this group.
</p>
");

    if (more)
        // additional helptext for EditFroup dialog
        helptext = helptext +
        _("The second list shows users for which this group is the default group. This list cannot be edited here.");

    return helptext;
  }


  /**
   * Help for EditUserDetailsDialog.
   * @param user_type type of edited user (local/system/ldap/nis)
   * @param what what to do with a user (add_user/edit_user)
   * @return string help text
   */
  define string EditUserDetailsDialogHelp(string user_type, string what) {

	// help text 1/8
    string helptext = _("<p>
The meaning of the fields are described below:
</p>") +
	// help text 2/8, %1 is number
		sformat(_("<p>
<b>User ID (uid):</b>
Each user is known to the system by a unique number,
the \"User ID\". For normal users, you should use
a UID bigger than %1 because the smaller UIDs are used
by the system for special purposes and pseudo logins.
</p>
"), UsersCache::GetMaxUID ("system") ) +

	// help text 3/8
 _("<p>
If you change the UID of an existing user, the rights of the files
this user owns must be changed. This is done automatically
for the files in the user's home directory, but not for files 
located elsewhere.</p>
") +

	// help text 4/8
	_("<p>
<b>Home Directory:</b>
The home directory of the user. Normally this is
/home/username. 
<br>
To select an existing directory, click <b>Browse</b>.
</p>
");
    if (what == "add_user")
    {
	map defaults        = Users::GetLoginDefaults ();
        helptext = helptext +
	// alternate helptext 4.5/8; %1 is directory (e.g. '/etc/skel')
	sformat (_("<p>To create only an empty home directory,
check <b>Empty Home</b>. Otherwise, the new user home directory
is created from the default skeleton (%1).</p>
"), defaults["skel"]:"");
    }

    if (user_type == "ldap")
        helptext = helptext +
    // alternate helptext 5/8
    _("<p>
The home directory of an LDAP user can be changed only on the
file server.</p>");

    else if (user_type == "system" || user_type == "local")
        helptext = helptext +
    // alternate helptext 5/8
    _("<p><b>Additional Information</b>
Some additional user data could be set here. These field may contain up to
three parts separated by commas. The standard usage is to write
<i>office</i>,<i>work phone</i>,<i>home phone</i>. This information will
be shown when you use the <i>finger</i> command on this user.</p>
");

	// help text 6/8
	helptext = helptext + _("<p>
<b>Login shell:</b>
The login shell (\"command interpreter\") for the user.
Select one shell from the list of all shells installed
on your system.
</p>") +

	// help text 7/8
		_("<p>
<b>Default Group:</b>
The group to which the user belongs. Select one group
from the list of all groups existing on your system.
</p>") +
	// help text 8/8
		_("<p>
<b>Group Membership:</b>
All additional memberships in groups for the user.
</p>
");
    return helptext;
  }

  /**
   * help text for dualogs with plugins
   */
  define string PluginDialogHelp () {

    // helptxt for plugin dialog 1/2
    return _("<p>Here, see the list of plug-ins--the
extensions of user and group configuration.</p>
") +

    // helptext for plugin dialog 2/3
    _("The check mark in the left part of the table indicates that plug-in
is currently in use.") +

    // helptext for plugin dialog 3/3
    _("<p>Start the detailed configuration of particular plug-in by selecting <b>Launch</b>.</p>");
  }


  /**
   * Help for usersSave.
   * @return string help text
   */
  define string usersSaveDialogHelp() ``{
	// help texts 1/1
      return _("<p>
Save the current user and group settings to system
</p>");

  }

  /**
   * Help for editing password settings
   * @return string help text
   */
  define string  EditUserPasswordDialogHelp() ``{
// Help text 1/5
      return _("<p>
<b>Warning before expiration</B><BR>
Users can be warned before expiration of their passwords. Set 
how many days before expiration the warning is issued. Set -1 to disable warning.
</p>
")
+
// Help text 2/5
_("<P><B>Logging in after expiration</B><BR>
Users can log in after expiration of passwords. Set how many days 
after expiration login is allowed. Use -1 for unlimited access.
</P>
")
+
//Help text 3/5
_("<P><B>Lifetime of password</B><BR> Set how many days a user 
can use the same password before it expires.</P>
")
+
// Help text 4/5
_("<P><B>Minimum age of password</B><BR>Set the minimum age of 
a password before a user is allowed to change it.</P>
")
+
// Help text 5/5 : Don't reorder letters YYYY-MM-DD, date must be set in this format
_("<P><B>Expiration Date</B><BR>Set the date when this account expires. 
The date must be in the format YYYY-MM-DD. 
Leave empty if this account never expires.</P>
");
  }

define string AuthentizationDialogHelp() ``{

    string help_text =
    // help text 1/2
    _("<p>
<b>Configuration Overview</b><br>
Here, see a summary of modules that could affect sources
of user accounts or authentication type.
</p>
") +
    // help text 2/2
    _("<p>
<b>Changing the Values</b><br>
You can configure these settings by running appropriate modules. Select the module with the <b>Configure</b> button.
</p>
");

    return help_text;
}

}// EOF
