ACC SHELL

Path : /usr/share/YaST2/clients/
File Upload :
Current File : //usr/share/YaST2/clients/users.ycp

/**
 * File:	clients/users.ycp
 * Package:	Configuration of users and groups
 * Summary:	Main file
 * Authors:	Jiri Suchomel <jsuchome@suse.cz>
 *
 * $Id: users.ycp 55355 2009-02-09 13:41:14Z jsuchome $
 *
 * Main file for users and groups configuration. Uses all other files.
 */
{

textdomain "users";

y2milestone ("----------------------------------------");
y2milestone ("Users module started");
y2useritem ("User and Group Management module started");

import "CommandLine";
import "Ldap";
import "Mode";
import "Users";
import "UsersCache";

include "users/wizards.ycp";
include "users/cmdline.ycp";

string  start_dialog	= "summary";

any	ret		= nil;
integer arg		= 0;
list    possible_start_dialogs = ["user_add", "group_add", "summary", "user_inst_start", "users", "groups" ];
// do not pass arguments to cmd-line interpreter
boolean no_cmdline	= false;

while ( arg < size( WFM::Args() ) )
{
    any a = WFM::Args( arg );
    if ( is (a, string) && contains( possible_start_dialogs, a))
    {
	start_dialog = (string) WFM::Args( arg );
	no_cmdline		= true;
    }
    arg = arg + 1;
}

// default for this client
UsersCache::SetCurrentSummary ("users");

if (start_dialog == "users" || start_dialog == "groups")
{
    UsersCache::SetCurrentSummary (start_dialog);
    start_dialog	= "summary";
}

if (no_cmdline)
{
    y2milestone( "Starting with %1 - test mode: %2", start_dialog, Mode::test () );
    Users::SetStartDialog (start_dialog);
    ret = UsersSequence (start_dialog);
    y2milestone("Users module finished with %1", ret);
    y2milestone("----------------------------------------");
    return ret;
}

// else parse arguments in cmdline
y2milestone( "Starting with arguments: %1", WFM::Args() );

/* the command line description map */
map cmdline = $[
    "id"		: "users",
    // translators: command line help text for Users module
    "help"		: _("User configuration module"),
    "guihandler"	: UsersGUI,
    "initialize"	: UsersRead,
    "finish"		: UsersWrite,
    "actions"		: $[
	"list" :$[
	    "handler"	: UsersListHandler,
	    // translators: command line help text for list action
	    "help"	: _("List of available users"),
	    "options"   : ["non_strict"],
	    // help text for unknown parameter name
	    "non_strict_help":	_("User parameters that should be listed"),
	],
	"show" :$[
	    "handler"	: UserShowHandler,
	    // translators: command line help text for show action
	    "help"	: _("Show information of selected user")
	],
	"add" :$[
	    "handler"	: UserAddHandler,
	    // translators: command line help text for ad action
	    "help"	: _("Add new user"),
	    "options"   : ["non_strict"],
	    // help text for unknown parameter name
	    "non_strict_help":	_("Additional (LDAP) user parameters"),
	],
	"edit" :$[
	    "handler"	: UserEditHandler,
	    // translators: command line help text for ad action
	    "help"	: _("Edit an existing user"),
	    "options"   : ["non_strict"],
	    // help text for unknown parameter name
	    "non_strict_help":	_("Additional (LDAP) user parameters"),
	],
	"delete" :$[
	    "handler"	: UserDeleteHandler,
	    // translators: command line help text for delete action
	    "help"	: _("Delete an existing user (home directory is not removed)")
	],
    ],
    "options"		: $[
	"local"	:$[
	    // translators: command line help text for list local option
	    "help"	: _("List of local users"),
	],
	"system"	:$[
	    // translators: command line help text for list system option
	    "help"	: _("List of system users"),
	],
	"ldap"		:$[
	    // translators: command line help text for list ldap option
	    "help"	: _("List of LDAP users"),
	],
	"nis"		:$[
	    // translators: command line help text for list nis option
	    "help"	: _("List of NIS users"),
	],
	"uid"		:$[
	    // translators: command line help text for uid option
	    "help"	: _("UID of the user"),
	    "type"	: "string"
	],
	"gid"		:$[
	    // translators: command line help text for add/gid option
	    "help"	: _("GID of user's default group"),
	    "type"	: "string"
	],
	"username"	:$[
	    // translators: command line help text for username option
	    "help"	: _("Login name of the user"),
	    "type"	: "string"
	],
	"cn"		:$[
	    // translators: command line help text for add option
	    "help"	: _("Full name of the user"),
	    "type"	: "string"
	],
	"shell"	:$[
	    // translators: command line help text for shell option
	    "help"	: _("Login shell of the user"),
	    "type"	: "string"
	],
	"home"	:$[
	    // translators: command line help text for home option
	    "help"	: _("Home directory of the user"),
	    "type"	: "string"
	],
	"no_home"	:$[
	    // translators: command line help text for add + create_home option
	    "help"	: _("Do not create home directory for new user"),
	],
	"delete_home"	:$[
	    // translators: command line help text for delete_home option
	    "help"	: _("Also delete user's home directory"),
	],
	"password"		:$[
	    // translators: command line help text for add option
	    "help"	: _("Password of the user"),
	    "type"	: "string"
	],
	"grouplist"	:$[
	    // translators: command line help text for home option
	    "help"	: _("List of groups of which the user is a member (separated by commas)"),
	    "type"	: "string"
	],
	"type"	:$[
	    // translators: command line help text for show option
	    "help"	: _("Type of the user (local, system, nis, ldap)"),
	    "type"	: "string"
	],
	"ldap_password"	:$[
	    // translators: command line help text for ldap_password option
	    "help"	: _("Password for LDAP server"),
	    "type"	: "string"
	],
	"new_username"	:$[
	    // translators: command line help text for new_username option
	    "help"	: _("New login name of the user"),
	    "type"	: "string"
	],
	"new_uid"		:$[
	    // translators: command line help text for new_uid option
	    "help"	: _("New UID of the user"),
	    "type"	: "string"
	],
	"batchmode"	:$[
	    // translators: command line help text for batchmode option
	    "help"	: _("Don't ask for missing data; return error instead.")
	],
    ],
    "mappings"		: $[
	"list"	: [ "local", "system", "ldap", "nis", ],// + "custom"
	"show"  : [ "uid", "username", "type" ],
	"add"	: [ "username", "uid", "cn", "password", "home", "no_home",
		    "shell", "gid", "grouplist", "type", "ldap_password",
		    "batchmode"
	],
	"edit"	: [ "username", "uid", "cn", "password", "home", "shell", "gid",
		    "grouplist", "new_username", "new_uid", "type",
		    "ldap_password", "batchmode"
	],
	"delete": [ "username", "uid", "delete_home", "type", "ldap_password",
		    "batchmode"
	],
    ]
];

ret = CommandLine::Run (cmdline);

y2useritem ("User and Group Management module finished");
y2milestone("Users module finished with %1", ret);
y2milestone("----------------------------------------");
return ret;

} //EOF

ACC SHELL 2018