ok

Mini Shell

Direktori : /proc/self/root/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/
Upload File :
Current File : //proc/self/root/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/directadmin.pyo

�
b=0Yc@s5dZd�ZddlZddlZddlZddlmZddlm	Z	m
Z
ddlmZddl
mZdZd	Zd
ZdZejdeje��Zid
d6dd6dd6dd6dd6dd6Zed�Zed�Zed�Zded�Zdded�Zded�ZdS(tDirectAdmincCs"tjjd�p!tjjd�S(Ns"/usr/local/directadmin/directadmins(/usr/local/directadmin/custombuild/build(tostpathtisfile(((sF/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/directadmin.pytdetectsi����N(tload(tNoDBAccessDatatCpApiTypeError(t_dblogin_cplogin_pairs(tClPwds&/usr/local/directadmin/conf/mysql.confs!/usr/local/directadmin/data/userss	user.confs//usr/local/directadmin/data/admin/reseller.lists
.+/(.+)/%stdomaintdnstpackagetemailtmailtlanguagetlocaletnametcplogintresellercCs�t�}y,t|�}|d|d<|d|d<WnLtk
r`}tdt|���n$tk
r�td|f��nX|S(Ntusertlogintpasswdtpasss0Can not open file with data to database access; s-Can not get database access data from file %s(tdictt
loadconfigtIOErrorRtstrtKeyError(t
_conf_pathtaccesst
login_dataterr((sF/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/directadmin.pyt	db_access%s	
cCsogtjtjj|dt��D]}tj|�^q"}g|D]}|rD|jd�^qD}t|�S(Nt*i(	tglobRRtjoint	USER_CONFtUSER_PATTERNtmatchtgroupttuple(t_pathRt
match_listR't
users_list((sF/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/directadmin.pytcpusers3s=(cCs8t|�}ttj|j��}|j�t|�S(N(topentmapRtstript	readlinestcloseR)(t_resellers_pathtstreamtresellers_list((sF/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/directadmin.pyt	resellers9s
cCs"t�}td|d|�}|S(Ntcplogin_lstR(R!R(R7twith_system_usersRtdata((sF/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/directadmin.pytdblogin_cplogin_pairs@s	cCst�}t|ttf�r*|g}n�t|ttf�rNt|�}n�|dkr�gtjtj	j
|dt��D]}tj
|�^q|}g|D]}|r�|jd�^q�}n$tdddddt|�j��t�}tt�}	x�|	D]x}
ttj	j
tj	j
||
j�d���}|jtg|D]}||krH||
f^qH��|j�qWx�|D]�}ttj	j
||d	��}
|j|�|
d
<tg|D]}|
jtj|��^q��}||kr�|j|�q�q�W|S(NR"itfuncnametcpinfotsupportettypessstr|unicode|list|tuplet
received_types
users.lists	user.confR(tlistt
isinstanceRtunicodeR)tNoneR#tiglobRRR$R%R&R'R(Rttypet__name__RR.tRESELLERS_LISTR0tupdateR2RtgettUSERCONF_PARAM_MAPtappend(tcpusertkeylsR*treturnedtcpusers_listRR+R'tuser_reseller_maptreseller_list_streamtreseller_logintreseller_cpuser_listt	user_nametcpuser_datatkeytcpuser_data_lst((sF/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/directadmin.pyR<Fs0	=+	
0"
1cCs�g}t�}|j�}t|ttf�rydtfd��Y}i}x*|D]\}}|||�||<qSWnxj|D]b}|d|d}	tjj|	�r�tjj	||j
�}
|
|kr�|j|
�q�q�q�W|S(s
    Detects and returns list of folders contained the home dirs of users of the DirectAdmin

    :param str|None _sysusers: for testing
    :param str|None _path: for testing
    :return: list of folders, which are parent of home dirs of users of the panel
    tpwcBseZd�ZRS(cSs||_||_dS(N(tpw_nametpw_dir(tselfRtdir((sF/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/directadmin.pyt__init__vs	(REt
__module__R\(((sF/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/directadmin.pyRWust/s
/user.conf(R	t
get_user_dictR@R?R)tobjectRRtexiststdirnameRYRJ(t	_sysusersR*thomedirstclpwdt
users_dictRWRR[RSt	conf_filethomedir((sF/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/directadmin.pyRdes		
(RRRsresellerRslocale(t
__cpname__RRR#tretclcommon.clconfparsRRtclcommon.cpapi.cpapiexceptionsRRt clcommon.cpapi.plugins.universalRtclcommonR	t
DA_DB_CONFt
DA_USERS_PATHR%RFtcompiletescapeR&RIR!R-R6RBtFalseR:R<Rd(((sF/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/directadmin.pyt<module>s6	


Zerion Mini Shell 1.0