Exemplo n.º 1
0
def show_info():
    """Handle 'mruser info'."""

    user = User(client, args.user)
    user.loadInfo()

    if user.middle_name:
        realname = "%s %s %s" % (user.first_name, user.middle_name, user.last_name)
    else:
        realname = "%s %s" % (user.first_name, user.last_name)

    common.section_header( "Information about user %s" % common.emph_text(user.name) )
    common.show_fields(
        ('Login name', user.name),
        ('Real name', realname),
        ('Status', format_user_status(user)),
        ('User ID', user.uid),
        ('MIT ID', user.mit_id),
        ('Class', user.user_class),
        ('Shell (Unix)', user.shell),
        ('Shell (Windows)', user.windows_shell),
        ('Comments', user.comments) if user.comments else None,
        ('Sponsor', str(user.sponsor) if user.sponsor else 'None'),
        ('Expires', user.expiration) if user.expiration else None,
        ('Alternate email', user.alternate_email) if user.alternate_email else None,
        ('Alternate phone', user.alternate_phone) if user.alternate_phone else None,
        ('Created', "%s by %s" % (common.last_modified_date(user.created_date), user.created_by)),
        ('Last modified', "%s by %s using %s" % (common.last_modified_date(user.lastmod_datetime), user.lastmod_by, user.lastmod_with)),
    )
Exemplo n.º 2
0
def show_info():
    """Handle 'mrlist info'."""

    mlist = List(common.client, args.list)
    mlist.loadInfo()

    common.section_header("Information about list %s" % common.emph_text(mlist.name) )
    common.show_fields(
        ('Description', mlist.description),
        ('Active', mlist.active),
        ('Public', mlist.public),
        ('Visible', not mlist.hidden),
        ('Mailing list', mlist.is_mailing),
        ('AFS group', "GID #%s" % mlist.gid if mlist.is_afsgroup else mlist.is_afsgroup),
        ('Unix group', mlist.is_nfsgroup) if mlist.is_afsgroup else None,
        ('Mailman list', "On server %s" % mlist.mailman_server if mlist.is_mailman_list else mlist.is_mailman_list),
        ('Owner', str(mlist.owner) ),
        ('Membership ACL', str(mlist.memacl) if mlist.memacl else 'None' ),
        ('Last modified', "%s ago by %s using %s" % (common.last_modified_date(mlist.lastmod_datetime), mlist.lastmod_by, mlist.lastmod_with)),
    )