• File: plesk.pyo
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/lib/python2.7/site-packages/clcommon/cpapi/plugins/plesk.pyo
  • Date Modified: 06/01/2017 4:14 PM
  • File size: 3.61 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

b=0Yc@sddlZyddlZWnek
r5dZnXddlmZmZddlmZdZ	dZ
dZe	dZddd	Z
ded
ZdddZdS(iN(tNotSupportedt	NoPackage(tClPwds/etc/psa/.psa.shadowtPleskcCstjjdS(Ns/usr/local/psa/version(tostpathtisfile(((s@/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/plesk.pytdetectscCsCt}d|d<t|}|jj|d<|j|S(Ntadmintlogintpass(tdicttopentreadtstriptclose(t
_pass_pathtaccesstf((s@/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/plesk.pyt	db_accesss	

tpsac
Cststdn|p!t}|jdd}|d}|d}tjd|d|d|d|}|j}d	}|j|g|jD]}	|	d
^q}
|j|
S(Ns@Can not connect to database; MySQL-python package not installed.thostt	localhostR	R
tusertpasswdtdbsSELECT login FROM sys_usersi(	tMySQLdbRRtgettconnecttcursortexecutetfetchallR(t_accsesst_dbnameRtdbhosttdblogintdbpassRRtsqltfetched_onetcpusers_lst((s@/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/plesk.pytcpusers!s

$
#
cCstddS(Ns|Getting binding credentials in the database to the user name in the system is not currently supported. Is under development.(R(tcplogin_lsttwith_system_users((s@/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/plesk.pytdblogin_cplogin_pairs1sc
CsWg}|dkr<y
t}WqBtk
r8d}qBXn|}g}|dk	ryg|D]}|jd^q[}ntd}|j}t|ttfrdt	fdY}i}x*|D]\}	}
||	|
||	<qWnxa|D]Y}t
|r||krqntjj
||j}||kr|j|qqW|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
    tutf8i'tpwcBseZdZRS(cSs||_||_dS(N(tpw_nametpw_dir(tselftnametdir((s@/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/plesk.pyt__init__Ss	(t__name__t
__module__R3(((s@/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/plesk.pyR-RsN(tNoneR(RtencodeRt
get_user_dictt
isinstancetlistttupletobjecttlenRRtdirnameR/tappend(
t	_sysuserst_cpusersthomedirstresultstuserstlinetclpwdt
users_dictR-R1R2t	user_namethomedir((s@/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/plesk.pyRB5s0	


%
(RRtImportErrorR6tclcommon.cpapi.cpapiexceptionsRRtclcommonRtPSA_SHADOW_PATHt
__cpname__RRR(tFalseR+RB(((s@/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/plesk.pyt<module>s