[% SET CPANEL.CPVAR.dprefix = "../"; SET app_name = "password-protect"; SET pwd_protect_nvdata = execute( 'NVData', 'get', { 'names' => 'optionselect_password-protect' } ); SET directory = RAW_FORM.dir; SET default_dir = ""; Api2.pre_exec("Email", "listmaildomains"); SET domains_list = Api2.exec("Email", "listmaildomains", {} ); Api2.post_exec("Email", "listmaildomains"); IF pwd_protect_nvdata.status; SET nvdata_value = pwd_protect_nvdata.data.0.value, value = nvdata_value.split(':'), selected_option = value.0, domain = value.1, always_open_dir = value.2; IF always_open_dir == 1; IF selected_option == 'webroot'; default_dir = CPANEL.homedir _ '/public_html'; ELSIF selected_option == 'domainrootselect'; default_dir = Api2.exec("DomainLookup" , "getdocroot" , {"domain" => domain}).0.docroot; ELSE; default_dir = CPANEL.homedir _ '/public_html' selected_option = 'webroot'; END; END; END; directory = directory || default_dir || CPANEL.homedir; SET directories = execute("DirectoryPrivacy", "list_directories", { dir => directory, }); %] [% WRAPPER '_assets/master.html.tt' app_key = 'directory_privacy' page_styles = css_code use_master_bootstrap = 0 page_stylesheets = [ 'cpanelpro/imagemanager.css', 'htaccess/index.css', ] -%] [% PROCESS '_assets/cjt2_header_include.tt' %]
[% locale.maketext("Set a password to protect certain directories of your account. When you enable this feature, a user that tries to open a protected folder will be prompted to enter a username and password before they can access your content.") %] [% locale.maketext("For more information, read our [output,url,_1,documentation,target,_2].", "//go.cpanel.net/DirectoryPrivacy", "_blank") %]
[% locale.maketext("Click a folder’s icon or name to navigate the file system. To select a folder, click “[output,em,_1]”.", locale.maketext('Edit')) %]
| [% locale.maketext('Current Directory') %] | [% locale.maketext('Private') %] | [% locale.maketext('Actions') %] |
|---|---|---|
|
[% IF directories.data.current.state.protected %]
[%locale.maketext('Yes')%]
[% ELSE %]
[%locale.maketext('No')%]
[% END %]
|
[% locale.maketext('Edit') %] | |
|
[% IF directory.state.protected %]
[% ELSE %]
[% END %]
[% directory.path.split("/").pop().html().replace('[.]', '. |
[% IF directory.state.protected %] [% locale.maketext('Yes') %] [% ELSE %] [% locale.maketext('No') %] [% END %] | [% locale.maketext('Edit') %] |
|
|
||