Spade
Mini Shell
| Directory:~$ /lib/python2.7/site-packages/clcommon/cpapi/plugins/ |
| [Home] [System Details] [Kill Me] |
�
b=0Yc@s�ddlZyddlZWnek
r5dZnXddlmZmZddlmZdZ dZ
d�Ze d�Zddd �Z
ded
�Zddd�ZdS(i����N(tNotSupportedt NoPackage(tClPwds/etc/psa/.psa.shadowtPleskcCstjjd�S(Ns/usr/local/psa/version(tostpathtisfile(((s@/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/plesk.pytdetectscCsCt�}d|d<t|�}|j�j�|d<|j�|S(Ntadmintlogintpass(tdicttopentreadtstriptclose(t
_pass_pathtaccesstf((s@/usr/lib/python2.7/site-packages/clcommon/cpapi/plugins/plesk.pyt db_accesss
tpsac
Cs�tstd��n|p!t�}|jdd�}|d}|d}tjd|d|d|d|�}|j�}d }|j|�g|j�D]} | 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
$
#
cCstd��dS(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|ttf�r�dt fd��Y}i}x*|D]\} }
|| |
�|| <q�Wnxa|D]Y}t
|�r||krq�ntjj
||j�}||kr�|j|�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
tutf8i'tpwcBseZd�ZRS(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