Файловый менеджер - Редактировать - /usr/lib64/python3.6/site-packages/samba/netcmd/__pycache__/contact.cpython-36.pyc
Ðазад
3 �I�d�y � @ s& d dl jZd dlZd dlZd dlZd dlmZmZ d dl m Z d dlmZ d dl mZ d dlmZmZ d dlmZ d dlmZmZmZmZ d d lmZ d dlmZ G dd � d e�ZG dd� de�ZG dd� de�ZG dd� de�Z G dd� de�Z!G dd� de�Z"G dd� de�Z#G dd� de�Z$dS )� N)� check_call�CalledProcessError)� attrgetter)�system_session)�SamDB)�credentials�dsdb)�Net)�Command�CommandError�SuperCommand�Option)� get_bytes� )�commonc @ s� e Zd ZdZdZedddeddd�ed d ed�edd ed�edded�edded�edded�edded�edded�edded�edded�edded�edded�ed d!ed�ed"d#ed�ed$d%ed�gZd&gZe j e je jd'�Z d+d)d*�Zd(S ),�cmd_adda� Add a new contact. This command adds a new contact to the Active Directory domain. The name of the new contact can be specified by the first argument 'contactname' or the --given-name, --initial and --surname arguments. If no 'contactname' is given, contact's name will be made up of the given arguments by combining the given-name, initials and surname. Each argument is optional. A dot ('.') will be appended to the initials automatically. Example1: samba-tool contact add "James T. Kirk" --job-title=Captain \ -H ldap://samba.samdom.example.com -UAdministrator%Passw1rd The example shows how to add a new contact to the domain against a remote LDAP server. Example2: samba-tool contact add --given-name=James --initials=T --surname=Kirk The example shows how to add a new contact to the domain against a local server. The resulting name is "James T. Kirk". z%prog [contactname] [options]z-Hz--URLz%LDB URL for database or target server�URL�H)�help�type�metavar�destz--ouz�DN of alternative location (with or without domainDN counterpart) in which the new contact will be created. E.g. 'OU=<OU name>'. Default is the domain base.)r r z --surnamezContact's surnamez--given-namezContact's given namez --initialszContact's initialsz--display-namezContact's display namez--job-titlezContact's job titlez--departmentzContact's departmentz --companyzContact's companyz --descriptionzContact's descriptionz--mail-addresszContact's email addressz--internet-addresszContact's home pagez--telephone-numberzContact's phone numberz--mobile-numberzContact's mobile phone numberz--physical-delivery-officezContact's office locationzfullcontactname?)� sambaopts�credopts�versionoptsNc C s� |j � }|j|�}y>t|t� ||d�}|j||||| | ||| ||||||d�}W n, tk r| } ztd|��W Y d d }~X nX | jjd| � d S )N)�url�session_infor �lp)�fullcontactname�ou�surnameZ givenname�initialsZdisplaynameZjobtitle� department�company�descriptionZmailaddressZinternetaddressZtelephonenumberZmobilenumberZphysicaldeliveryofficezFailed to add contactz Contact '%s' added successfully ) �get_loadparm�get_credentialsr r Z newcontact� Exceptionr �outf�write)�selfr r r r r r r � given_namer! �display_nameZ job_titler"