November 15, 2014 - How to


Groups File Access WordPress Plugin

www.itthinx.com

SEE: http://www.itthinx.com/documentation/groups-file-access/



Groups File Access WordPress plugin

Copyright (c) www.itthinx.com

LICENSE RESTRICTIONS

This plugin is provided subject to the license granted.

Unauthorized use and distribution is prohibited. See COPYRIGHT.txt and LICENSE.txt.

This plugin relies on code that is NOT licensed under the GNU General Public License. Files licensed under the GNU General Public License state so explicitly in their header. You MUST be granted a license by the copyright holder for those parts that are not provided under the

GPLv3 license. If you have not been granted a license DO NOT USE this plugin until you have BEEN GRANTED A LICENSE. Use of this plugin without a granted license constitutes an act of COPYRIGHT INFRINGEMENT and LICENSE VIOLATION and may result in legal action taken against the offending party. Being granted a license is GOOD because you will get support and contribute to the development of useful free and premium themes and plugins that you will be able to enjoy.

Thank you!

Visit www.itthinx.com for more information.

v2



Table of Contents

1. Installation ............................................................................................................................4 Backup......................................................................................................................................4 Install and activate the Groups plugin...................................................................................4 Install and activate the Groups File Access plugin..............................................................4

 2. Setup ...................................................................................................................................5

3. Update ..................................................................................................................................6 Backup......................................................................................................................................6

 Upgrade to the new release..................................................................................................6

4. Basic usage ...........................................................................................................................7 Setup & Usage Example.........................................................................................................7

Managing files..........................................................................................................................7 Filters......................................................................................................................................8 Shortcodes............................................................................................................................8 [groups_can_access_file].....................................................................................................8 [groups_can_not_access_file].............................................................................................8 [groups_file_info]......................................................................................................................8 [groups_file_url]........................................................................................................................9 [groups_file_link].......................................................................................................................9 [groups_file_visibility]...............................................................................................................9 API..............................................................................................................................................10

 5. Documentation..................................................................................................................11



1 Installation

Backup

Back up your WordPress installation files and database.

Install and activate the Groups plugin

If you have not done so already, install and activate the Groups plugin.

To install it automatically: Log in on your site with your administrator account. From your Dashboard, go to Plugins > Add New, input "Groups" (without the quotes) in the search field located besides the Search Plugins button, click the button and locate the Groups plugin by itthinx in the results.

Click the Install Now link for that plugin and confirm that you want to install the plugin. Once the plugin has been downloaded and installed, confirm that you want to activate it.

To install it manually: You can also download the Groups plugin to install it manually. Visit http://www.itthinx.com/plugins/groups and locate the download link. Once you have downloaded the plugin, go to Plugins > Add New > Upload and click the Browse... button to select the plugin's zip file and click on the Install Now button. After you have installed the Groups plugin, proceed to activate it.

Install and activate the Groups File Access plugin

Add the new plugin you have received and activate it: Go to Plugins > Add New > Upload and click the Browse... button to select the plugin's zip file, usually groups-file-access-x.y.z.zip (x, y and z are the plugin's current version numbers). After that proceed to activate the plugin.

If you see errors, please follow the advise given to remedy them and make sure to use any hints given. If you still have errors, review the plugin's page located here: http://www.itthinx.com/plugins/groups- file-access for similar problems and the proposed solutions posted in the comments. Ultimately, you can ask for support on that page as well by posting a comment.



2 Setup

1. Make sure that you have followed the installation instructions above.

2. Check the settings on the Groups > File Access page and adjust them if needed. The options are fully documented on the page.

3. If your setup is adequate, you can manage files controlled by the plugin on the Groups > Files page.

Have a look at Setup & Usage Example for a quick example on how to provide uploaded files to members of a group.

Please note that additional information and examples are available on the plugin page and the documentation pages:

Groups File Access

• Plugin page : http://www.itthinx.com/plugins/groups-file-access

• Documentation : http://www.itthinx.com/documentation/groups-file-access

• Demo : http://itthinx.org/gfademo Groups

• Plugin page : http://www.itthinx.com/plugins/groups

• Documentation : http://www.itthinx.com/documentation/groups



3 Update

If you have received or downloaded an updated version of the Groups File Access plugin, follow these instructions to update it:

Backup

Back up your WordPress installation files and database.

Upgrade to the new release

Upgrading requires to replace the plugin.

IMPORTANT! Make sure that none of the data deletion options are checked on the Groups > File Access page:

• DO NOT CHECK "Delete plugin data when the plugin is deleted?"

• DO NOT CHECK "Delete all Groups File Access plugin data when the plugin is deactivated?" To update, the plugin must be deactivated, deleted and the new release uploaded and activated. These are the steps involved:

1. Go to Plugins > Installed Plugins, click Deactivate on the Groups File Access plugin, then

click Delete to remove it. 2. Go to Plugins > Add New > Upload and click the Browse... button to select the new release's zip file, and click on the Install Now button. After it has been installed, activate the plugin. If you see errors, please follow the advise given to remedy them and make sure to use any hints given. If you still have errors, review the plugin's page located here: http://www.itthinx.com/plugins/groups- file-access for similar problems and the proposed solutions posted in the comments. Ultimately, you can ask for support on that page as well by posting a comment.



4 Basic usage

Additional information and examples are available on the plugin page and the documentation pages.

Setup & Usage Example

1. If you have not done so already, install and activate the Groups plugin. Go to Plugins > Add New, search for Groups and click Install Now. You can also download the plugin here and upload it to your site. 2. Unless you have done that already, upload the Groups File Access plugin and activate it. No

errors should be displayed. If you see errors, please follow the advise given to remedy them and make sure to use any hints given. If you still have errors, review the plugin's page located here: http://www.itthinx.com/plugins/groups-file-access for similar problems and the proposed solutions posted in the comments. Ultimately, you can ask for support on that page as well by posting a comment. 3. Check the settings on the Groups > File Access page and adjust them if needed. 4. If your setup is adequate, you can manage files controlled by the plugin on the Groups > Files

page. 5. Go to Groups > Files, click New File on top of the page and upload a sample file.

6. You will now see the uploaded file in the list on the Groups > Files page. Click the checkbox next to the file and select the Registered group on top of the files table. Click the Add button. The file is now assigned to the Registered group. Note that all registered users are automatically added to this group by default. Once they are logged in, they will be able to download the file you have added. 7. Create a new page on your site, copy and paste the following content on the page:

[groups_non_member group="Registered"] Please log in or register an account to access the files. [/groups_non_member]

[groups_member group="Registered"] You can download these files: [groups_file_link group="Registered" description="yes"] [/groups_member]

8. Visit the new page while logged in, you will see the link to the file. Click the link and you will be able to download the file. Log out and try to visit the file's URL. You will see that now you will not be able to download the file.

Managing files

Files are managed in the Groups > Files section. Here you can add, edit and delete files that you want to make accessible to group members. Access to files is restricted by group membership. To be able to download a file, a user must be a member of a group that is assigned to the file. If an access limit has been set for the file, the user must also have accessed (downloaded) the file fewer times than the file’s access limit.

If you want to restrict access to a file to registered users, add the file using the New File option at the top of the screen. Once the file is added, tick the checkbox for the desired file in the file list, select the



Registered group on top of the list and use the Add button to assign the group to the file. Now any registered user who is logged in can access the file (provided the access limit has not been exceeded by the user). If you want to restrict access to a file to users that belong to a certain group, create the group, add the desired users to the group and assign the group to the files that the group should be able to access. More than one group can be assigned to a file.

By selected one or more files, bulk operations can be executed, including adding files to a group, removing files from a group and removing files.

Filters

Use the filters to restrict the files displayed in the file list to those that match the given criteria. Note that the filter settings are persistent, i.e. if you leave the screen or log out and come back, the same settings will be in effect. Click the Apply button to use the filters and the Clear button to remove all filters.

Shortcodes

Shortcodes are used on posts or pages to render links to files, provide information about files and conditionally show content to users depending on whether they are allowed to access a file. The [groups_file_link] shortcode described below, renders the actual link to a file that authorized users can click to download the file.

[groups_can_access_file]

Content enclosed by this shortcode will only be shown if the current user can access the file. The file is identified by the required file_id attribute.

Example: [groups_can_access_file file_id="3"]This is shown if the user can access the file.[/groups_can_access_file]

Attributes

• file_id required - identifies the desired file

[groups_can_not_access_file]

Shows content enclosed by the shortcode only when the current user can not access the given file. Attributes and usage are the same as for the [groups_can_access_file] shortcode.

[groups_file_info]

This shortcode renders information about a file including the name, description, maximum number of allowed accesses per user, consumed and remaining number of accesses for the current user and the file id.

Example: [groups_file_info file_id="7" show="name"]

Attributes

• file_id required - identifies the desired file



• show optional - defaults to "name". Acceptable values are any of name, description, count, max_count, remaining and file_id

• visibility optional - defaults to can_access showing information only if the current user can access the file, always will show information unconditionally

• filter optional - defaults to wp_filter_kses determining the filter function that is applied to the information about to be shown. If none or an empty value is provided, no filter function will be applied prior to rendering the information.

[groups_file_url]

This shortcode renders the URL that serves the file. An authorized user can visit the URL to download the file. Example: [groups_file_url file_id="456"]

Attributes

• file_id required - identifies the desired file

• visibility optional - defaults to can_access showing information only if the current user can access the file, always will show information unconditionally

[groups_file_link]

This shortcode renders links to files. An authorized user can click on a link to download the related file. Example: [groups_file_link file_id="78"]

Attributes

• file_id required* - identifies the desired file

• group required* - group name or ID - will list file links for the files that are related to the given group, sorted by name

• description optional - only effective when used with the group attribute; defaults to "no", if set to "yes" will show descriptions for each file

• order optional - only effective when used with the group attribute; files are listed sorted by name which defaults to "asc" for ascending order, allows "desc" for descending order

• visibility optional - defaults to can_access showing information only if the current user can access the file, always will show information unconditionally

* Only one of file_id or group is required, both should not be provided.

Additional attributes are accepted for the link’s a tag. These are accesskey, alt, charset, coords, class, dir, hreflang, id, lang, name, rel, rev, shape, style, tabindex and target. Please refer to the HTML 4.01 Specification on the The A element for further information about these attributes.

[groups_file_visibility]

This shortcode allows to switch the default visibility setting for those shortcodes that provide a visibility attribute. The shortcode can be used multiple times on a page or post and will affect the shortcodes below it unless it is used again. Example: [groups_file_visibility visibility="always"]



Attributes

• visibility required - can_access or always

API

Please refer to the documentation pages for details on the plugin’s API. Unless you are a developer who wants to build a specialized application based on the plugin, you don't need to use the API. The plugin's features are entirely packed into the administration screens added to the Groups menu and file access and information is provided through the plugin's shortcodes.

Comments are closed.