diff --git a/profiles/wcm_base/CHANGELOG.txt b/profiles/wcm_base/CHANGELOG.txt index af0b91cc0b20f797d99b529a43f8bcb52492d0e3..ac437ddebfe9384031af2cb93f389f783ac2bd57 100644 --- a/profiles/wcm_base/CHANGELOG.txt +++ b/profiles/wcm_base/CHANGELOG.txt @@ -1,8 +1,17 @@ +WCM Base 7.x-1.x, 2015-10-07 +---------------------------- +- WCM Base Profile: Added Private and Private files download permission modules. +- OCIO User Config: Added Private Content Viewer role. +- OCIO Media: Added schema exposed filter to media browser view, allow private uploads. +- OCIO Workbench: Added schema exposed filter to files views page. +- OCIO Permissions: + - Allow Private Content Viewer users to view private nodes and files. + - Allow non-adminstrators to unpublish content. + WCM Base 7.x-1.x, 2015-10-06 ---------------------------- - OCIO Aggregator: Removed custom module from distribution. - OCIO Landing Page: Removed twitter and aggregator panes from allowed content. -- OCIO Permissions: Granted Landing Page edit permission to editors. WCM Base 7.x-1.x, 2015-10-02 ---------------------------- @@ -66,7 +75,7 @@ WCM Base 7.x-1.x, 2015-09-11 WCM Base 7.x-1.x, 2015-09-09 ---------------------------- -- WCM Base: Added telephone module as dependency. +- WCM Base Profile: Added telephone module as dependency. - WCM User Profile: Converted phone field type from text to telephone. - OCIO Omega Base: Fixed margins on unlinked tile panes. diff --git a/profiles/wcm_base/modules/contrib/private/LICENSE.txt b/profiles/wcm_base/modules/contrib/private/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..d159169d1050894d3ea3b98e1c965c4058208fe1 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/private/LICENSE.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/profiles/wcm_base/modules/contrib/private/icon_key.gif b/profiles/wcm_base/modules/contrib/private/icon_key.gif new file mode 100644 index 0000000000000000000000000000000000000000..e3853e5afd54d40a853e4cb7934917316f073e7d Binary files /dev/null and b/profiles/wcm_base/modules/contrib/private/icon_key.gif differ diff --git a/profiles/wcm_base/modules/contrib/private/private.info b/profiles/wcm_base/modules/contrib/private/private.info new file mode 100644 index 0000000000000000000000000000000000000000..9358f64e656a2a3ae135783db8ce272ddfd4ef02 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/private/private.info @@ -0,0 +1,13 @@ +name = Private +description = Allows users to mark content as private, and hide that content from visitors. +core = 7.x +package = Access control + +files[] = private_handler_filter_private.inc + +; Information added by Drupal.org packaging script on 2015-04-06 +version = "7.x-1.2" +core = "7.x" +project = "private" +datestamp = "1428334686" + diff --git a/profiles/wcm_base/modules/contrib/private/private.install b/profiles/wcm_base/modules/contrib/private/private.install new file mode 100644 index 0000000000000000000000000000000000000000..f12fc041f43c7d6d11beab572c48f805e41bf313 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/private/private.install @@ -0,0 +1,41 @@ +<?php +/** + * @file + * Install, update and uninstall functions for the private module. + */ + + +/** + * Implements hook_schema(). + */ +function private_schema() { + $schema['private'] = array( + 'fields' => array( + 'nid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'private' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + ), + 'primary key' => array('nid'), + ); + + return $schema; +} + +/** + * Implements hook_uninstall(). + */ +function private_uninstall() { + // Remove variables. + $node_types = array_keys(node_type_get_types()); + foreach ($node_types as $node_type) { + variable_del('private_' . $node_type); + } +} diff --git a/profiles/wcm_base/modules/contrib/private/private.module b/profiles/wcm_base/modules/contrib/private/private.module new file mode 100644 index 0000000000000000000000000000000000000000..4c369fb8e4c0947f69316f06063e696fa521d6e6 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/private/private.module @@ -0,0 +1,397 @@ +<?php + +/** + * @file + * A tremendously simple access control module -- it allows users to mark + * individual nodes as private; users with 'access private content' perms can + * read these nodes, while others cannot. + */ + +define('PRIVATE_DISABLED', 0); +define('PRIVATE_ALLOWED', 1); +define('PRIVATE_AUTOMATIC', 2); +define('PRIVATE_ALWAYS', 3); +define('PRIVATE_GRANT_ALL', 1); + +/** + * Implements hook_enable(). + * + * A node access module needs to force a rebuild of the node access table + * when it is enabled to ensure that things are set up. + */ +function private_enable() { + node_access_needs_rebuild(TRUE); +} + +/** + * Implements hook_disable(). + * + * A node access module needs to force a rebuild of the node access table + * when it is disabled to ensure that its entries are removed from the table. + */ +function private_disable() { + private_disabling(TRUE); + node_access_needs_rebuild(TRUE); +} + +/** + * Simple function to make sure we don't respond with grants when disabling + * ourselves. + */ +function private_disabling($set = NULL) { + static $disabling = FALSE; + if ($set !== NULL) { + $disabling = $set; + } + + return $disabling; +} + +/** + * Implements hook_permission(). + * + * In this example, we will use a simple permission to determine whether a user + * has access to "private" content. This permission is defined here. + */ +function private_permission() { + return array( + 'mark content as private' => array( + 'title' => t('Mark content as private'), + 'description' => t('Make content only viewable by people with access to view private content'), + ), + 'access private content' => array( + 'title' => t('Access private content'), + 'description' => t('Access any content marked as private'), + ), + 'edit private content' => array( + 'title' => t('Edit private content'), + 'description' => t('Edit content marked as private'), + ), + ); +} + +/** + * Implements hook_node_grants(). + * + * Tell the node access system what GIDs the user belongs to for each realm. + * In this example, we are providing two realms: the example realm, which + * has just one group id (1) and the user is either a member or not depending + * upon the operation and the access permission set. + * + * We are also setting up a realm for the node author, though, to give it + * special privileges. That has 1 GID for every UID, and each user is + * automatically a member of the group where GID == UID. + * + */ +function private_node_grants($account, $op) { + // First grant a grant to the author for own content. + $grants['private_author'] = array($account->uid); + + if ($op == 'view' && user_access('access private content', $account)) { + $grants['private_view'] = array(PRIVATE_GRANT_ALL); + } + + if (($op == 'update' || $op == 'delete') && user_access('edit private content', $account)) { + $grants['private_edit'] = array(PRIVATE_GRANT_ALL); + } + + return $grants; +} + +/** + * Implements hook_node_access_records(). + * + * All node access modules must implement this hook. If the module is + * interested in the privacy of the node passed in, return a list + * of node access values for each grant ID we offer. + */ +function private_node_access_records($node) { + if (private_disabling()) { + return; + } + + // We only care about the node if it's been marked private. If not, it is + // treated just like any other node and we completely ignore it. + if (isset($node->private) && $node->private == 1) { + $grants = array(); + $grants[] = array( + 'realm' => 'private_view', + 'gid' => PRIVATE_GRANT_ALL, + 'grant_view' => 1, + 'grant_update' => 0, + 'grant_delete' => 0, + 'priority' => 0, + ); + $grants[] = array( + 'realm' => 'private_edit', + 'gid' => PRIVATE_GRANT_ALL, + 'grant_view' => 1, + 'grant_update' => 1, + 'grant_delete' => 1, + 'priority' => 0, + ); + $grants[] = array( + 'realm' => 'private_author', + 'gid' => $node->uid, + 'grant_view' => 1, + 'grant_update' => 1, + 'grant_delete' => 1, + 'priority' => 0, + ); + + return $grants; + } +} + +/** + * Implements hook_form_alter(). + * + * This module adds a simple checkbox to the node form labeled private. If the + * checkbox is labelled, only the node author and users with 'access private content' + * privileges may see it. + */ +function private_form_alter(&$form, &$form_state, $form_id) { + if (!empty($form['#node_edit_form'])) { + $node = $form['#node']; + $default = variable_get('private_' . $node->type, PRIVATE_ALLOWED); + + if ($default != PRIVATE_DISABLED || !empty($node->private)) { + if (empty($node->nid)) { + $privacy = ($default > PRIVATE_ALLOWED); + } + else { + $privacy = isset($node->private) ? $node->private : 0; + } + + if (user_access('mark content as private') && $default != PRIVATE_ALWAYS) { + if (user_access('administer nodes')) { + $form['options']['private'] = array( + '#type' => 'checkbox', + '#title' => t('Make this post private'), + '#attributes' => array('title' => t('When checked, only users with proper access permissions will be able to see this post.')), + '#default_value' => $privacy, + ); + } + else { + $form['private'] = array( + '#type' => 'checkbox', + '#title' => t('Make this post private'), + '#attributes' => array('title' => t('When checked, only users with proper access permissions will be able to see this post.')), + '#default_value' => $privacy, + '#weight' => 99, + ); + } + } + else { + $form['private'] = array( + '#type' => 'value', + '#value' => $privacy, + ); + } + } + } +} + +/** + * Implements hook_form_FORM_ID_alter(). + */ +function private_form_node_type_form_alter(&$form, &$form_state, $form_id) { + if (isset($form['type'])) { + $form['workflow']['private'] = array( + '#type' => 'radios', + '#title' => t('Privacy'), + '#options' => array( + PRIVATE_DISABLED => t('Disabled (always public)'), + PRIVATE_ALLOWED => t('Enabled (public by default)'), + PRIVATE_AUTOMATIC => t('Enabled (private by default)'), + PRIVATE_ALWAYS => t('Hidden (always private)'), + ), + '#default_value' => variable_get('private_' . $form['#node_type']->type, PRIVATE_ALLOWED), + ); + } +} + +/** + * Implements hook_node_load(). + */ +function private_node_load($nodes, $types) { + $result = db_query('SELECT * FROM {private} WHERE nid IN(:nids)', array(':nids' => array_keys($nodes))); + foreach ($result as $record) { + $nodes[$record->nid]->private = $record->private; + } +} + +/** + * Implements hook_node_delete(). + */ +function private_node_delete($node) { + db_delete('private') + ->condition('nid', $node->nid) + ->execute(); +} + +/** + * Implements hook_node_insert(). + */ +function private_node_insert($node) { + private_node_update($node); +} + +/** + * Implements hook_node_update(). + */ +function private_node_update($node) { + if (isset($node->private)) { + db_merge('private') + ->key(array('nid' => $node->nid)) + ->fields(array( + 'nid' => $node->nid, + 'private' => (int)$node->private, + )) + ->execute(); + } +} + +/** + * Implements hook_node_view(). + */ +function private_node_view($node, $view_mode) { + if (isset($node->private) && $node->private == 1) { + $links['private_icon']['title'] = theme('private_node_link'); + $links['private_icon']['html'] = TRUE; + $node->content['links']['private'] = array( + '#theme' => 'links__node__private', + '#links' => $links, + '#attributes' => array('class' => array('links', 'inline')), + ); + } +} + +/** + * Implements hook_theme(). + */ +function private_theme() { + return array( + 'private_node_link' => array( + 'variables' => array(), + ), + ); +} + +/** + * Custom theme function + * @see private_theme() + */ +function theme_private_node_link() { + $vars = array( + 'path' => drupal_get_path('module', 'private') . '/icon_key.gif', + 'width' => '16', + 'height' => '16', + 'alt' => t('Private'), + 'title' => t('This content is private.') + ); + return theme('image', $vars); +} + +/** + * Implements hook_action_info(). + */ +function private_action_info() { + return array( + 'private_set_private_action' => array( + 'type' => 'node', + 'label' => t('Make post private'), + 'configurable' => FALSE, + 'triggers' => array( + 'node_insert', + 'node_update', + ), + ), + 'private_set_public_action' => array( + 'type' => 'node', + 'label' => t('Make post public'), + 'configurable' => FALSE, + 'triggers' => array( + 'node_insert', + 'node_update', + ), + ), + ); +} + + +/** + * Implementation of a Drupal action. + */ +function private_set_public_action(&$node, $context = array()) { + $node->private = FALSE; + $nids = array($node->nid); + private_node_mark_public($nids); +} + + +/** + * Implementation of a Drupal action. + */ +function private_set_private_action(&$node, $context = array()) { + $node->private = TRUE; + $nids = array($node->nid); + private_node_mark_private($nids); +} + +/** + * Implements hook_node_operations(). + */ +function private_node_operations() { + $operations = array( + 'private_mark_as_private' => array( + 'label' => t('Mark as private'), + 'callback' => 'private_node_mark_private', + ), + 'private_mark_as_public' => array( + 'label' => t('Mark as public'), + 'callback' => 'private_node_mark_public', + ), + ); + return $operations; +} + +/** + * Callback for 'Mark as private' node operation + */ +function private_node_mark_private($nids) { + foreach ($nids as $nid) { + db_merge('private') + ->key(array('nid' => $nid)) + ->fields(array( + 'nid' => $nid, + 'private' => 1, + )) + ->execute(); + } +} + +/** + * Callback for 'Mark as public' node operation + */ +function private_node_mark_public($nids) { + foreach ($nids as $nid) { + db_merge('private') + ->key(array('nid' => $nid)) + ->fields(array( + 'nid' => $nid, + 'private' => 0, + )) + ->execute(); + } +} + +/** + * Tell Views that we're down with it, yo. + */ +function private_views_api() { + return array( + 'api' => 2, + 'path' => drupal_get_path('module', 'private'), + ); +} diff --git a/profiles/wcm_base/modules/contrib/private/private.test b/profiles/wcm_base/modules/contrib/private/private.test new file mode 100644 index 0000000000000000000000000000000000000000..f70190a6fab26b0bba2dc66a828bb695767dac18 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/private/private.test @@ -0,0 +1,164 @@ +<?php + +/** + * @file + * Tests for private module. + */ +class PrivateTestCase extends DrupalWebTestCase { + + public static function getInfo() { + return array( + 'name' => 'Private functionality', + 'description' => 'Checks behavior of Private.', + 'group' => 'Examples', + ); + } + + /** + * Enable modules and create user with specific permissions. + */ + public function setUp() { + parent::setUp('private', 'search'); + node_access_rebuild(); + } + + /** + * Test the "private" node access. + * + * - Create 3 users with "access content" and "create article" permissions. + * - Each user creates one private and one not private article. + * - Run cron to update search index. + * - Test that each user can view the other user's non-private article. + * - Test that each user cannot view the other user's private article. + * - Test that each user finds only appropriate (non-private + own private) + * in search results. + * - Create another user with 'view private content'. + * - Test that user 4 can view all content created above. + * - Test that user 4 can search for all content created above. + * - Test that user 4 cannot edit private content above. + * - Create another user with 'edit private content' + * - Test that user 5 can edit private content. + * - Test that user 5 can delete private content. + * - Test listings of nodes with 'node_access' tag on database search. + */ + function testNodeAccessBasic() { + $num_simple_users = 3; + $simple_users = array(); + + // nodes keyed by uid and nid: $nodes[$uid][$nid] = $is_private; + $nodes_by_user = array(); + $titles = array(); // Titles keyed by nid + $private_nodes = array(); // Array of nids marked private. + for ($i = 0; $i < $num_simple_users; $i++) { + $simple_users[$i] = $this->drupalCreateUser(array('access content', 'create article content', 'search content')); + } + foreach ($simple_users as $web_user) { + $this->drupalLogin($web_user); + foreach (array(0 => 'Public', 1 => 'Private') as $is_private => $type) { + $edit = array( + 'title' => t('@private_public Article created by @user', array('@private_public' => $type, '@user' => $web_user->name)), + ); + if ($is_private) { + $edit['private'] = TRUE; + $edit['body[und][0][value]'] = 'private node'; + } + else { + $edit['body[und][0][value]'] = 'public node'; + } + $this->drupalPost('node/add/article', $edit, t('Save')); + debug(t('Created article with private=@private', array('@private' => $is_private))); + $this->assertText(t('Article @title has been created', array('@title' => $edit['title']))); + $nid = db_query('SELECT nid FROM {node} WHERE title = :title', array(':title' => $edit['title']))->fetchField(); + $this->assertText(t('New node @nid was created and private=@private', array('@nid' => $nid, '@private' => $is_private))); + $private_status = db_query('SELECT private FROM {private} where nid = :nid', array(':nid' => $nid))->fetchField(); + $this->assertTrue($is_private == $private_status, t('Node was properly set to private or not private in private table.')); + if ($is_private) { + $private_nodes[] = $nid; + } + $titles[$nid] = $edit['title']; + $nodes_by_user[$web_user->uid][$nid] = $is_private; + } + } + debug($nodes_by_user); + $this->cronRun(); // Build the search index. + foreach ($simple_users as $web_user) { + $this->drupalLogin($web_user); + // Check to see that we find the number of search results expected. + $this->checkSearchResults('Private node', 1); + // Check own nodes to see that all are readable. + foreach (array_keys($nodes_by_user) as $uid) { + // All of this user's nodes should be readable to same. + if ($uid == $web_user->uid) { + foreach ($nodes_by_user[$uid] as $nid => $is_private) { + $this->drupalGet('node/' . $nid); + $this->assertResponse(200); + $this->assertTitle($titles[$nid] . ' | Drupal', t('Correct title for node found')); + } + } + else { + // Otherwise, for other users, private nodes should get a 403, + // but we should be able to read non-private nodes. + foreach ($nodes_by_user[$uid] as $nid => $is_private) { + $this->drupalGet('node/' . $nid); + $this->assertResponse($is_private ? 403 : 200, t('Node @nid by user @uid should get a @response for this user (@web_user_uid)', array('@nid' => $nid, '@uid' => $uid, '@response' => $is_private ? 403 : 200, '@web_user_uid' => $web_user->uid))); + if (!$is_private) { + $this->assertTitle($titles[$nid] . ' | Drupal', t('Correct title for node was found')); + } + } + } + } + + // Check to see that the correct nodes are shown on examples/node_access. + $this->drupalGet('examples/node_access'); + $accessible = $this->xpath("//tr[contains(@class,'accessible')]"); + $this->assertEqual(count($accessible), 1, t('One private item accessible')); + foreach ($accessible as $row) { + $this->assertEqual($row->td[2], $web_user->uid, t('Accessible row owned by this user')); + } + } + + // Now test that a user with 'access private content' can view content. + $access_user = $this->drupalCreateUser(array('access content', 'create article content', 'access private content', 'search content')); + $this->drupalLogin($access_user); + + // Check to see that we find the number of search results expected. + $this->checkSearchResults('Private node', 3); + + foreach ($nodes_by_user as $uid => $private_status) { + foreach ($private_status as $nid => $is_private) { + $this->drupalGet('node/' . $nid); + $this->assertResponse(200); + } + } + + // Test that a privileged user can edit and delete private content. + // This test should go last, as the nodes get deleted. + $edit_user = $this->drupalCreateUser(array('access content', 'access private content', 'edit private content')); + $this->drupalLogin($edit_user); + foreach ($private_nodes as $nid) { + $body = $this->randomName(); + $edit = array('body[und][0][value]' => $body); + $this->drupalPost('node/' . $nid . '/edit', $edit, t('Save')); + $this->assertText(t('has been updated')); + $this->drupalPost('node/' . $nid . '/edit', array(), t('Delete')); + $this->drupalPost(NULL, array(), t('Delete')); + $this->assertText(t('has been deleted')); + } + + + } + + /** + * On the search page, search for a string and assert the expected number + * of results. + * @param $search_query + * String to search for + * @param $expected_result_count + * Expected result count + */ + function checkSearchResults($search_query, $expected_result_count) { + $this->drupalPost('search/node', array('keys' => $search_query), t('Search')); + $search_results = $this->xpath("//ol[contains(@class, 'search-results')]/li"); + $this->assertEqual(count($search_results), $expected_result_count, t('Found the expected number of search results')); + } +} diff --git a/profiles/wcm_base/modules/contrib/private/private.views.inc b/profiles/wcm_base/modules/contrib/private/private.views.inc new file mode 100644 index 0000000000000000000000000000000000000000..9deedf3534026ec0e54e3ceacba8564fab7ec644 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/private/private.views.inc @@ -0,0 +1,60 @@ +<?php + +/** + * @file + * Views integration functions for the private module. + */ + +/** + * Implements hook_views_data(). + */ +function private_views_data() { + $data = array(); + + $data['private']['table']['group'] = t('Content'); + + $data['private']['table']['join'] = array( + 'node' => array( + 'left_field' => 'nid', + 'field' => 'nid', + ), + 'private' => array( + 'left_field' => 'nid', + 'field' => 'nid', + ), + ); + + $data['private']['private'] = array( + 'title' => t('Private'), + 'help' => t('Whether or not the node is private.'), + 'field' => array( + 'handler' => 'views_handler_field_boolean', + 'click sortable' => TRUE, + ), + 'filter' => array( + 'handler' => 'private_handler_filter_private', + 'label' => t('Private'), + 'type' => 'yes-no', + ), + ); + + return $data; + +} + +/** + * Implements hook_views_handlers(). + */ +function private_views_handlers() { + return array( + 'info' => array( + 'path' => drupal_get_path('module', 'private'), + ), + 'handlers' => array( + 'private_handler_filter_private' => array( + 'parent' => 'views_handler_filter_boolean_operator', + 'file' => 'private_handler_filter_private.inc', + ), + ), + ); +} diff --git a/profiles/wcm_base/modules/contrib/private/private_handler_filter_private.inc b/profiles/wcm_base/modules/contrib/private/private_handler_filter_private.inc new file mode 100644 index 0000000000000000000000000000000000000000..a61818fe42e8d872384250231663538bf3b60dd1 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/private/private_handler_filter_private.inc @@ -0,0 +1,19 @@ +<?php + +/** + * @file + * Views handlers for the private module. + */ + +class private_handler_filter_private extends views_handler_filter_boolean_operator { + function construct() { + parent::construct(); + $this->value_value = t('Private'); + } + + function query() { + $this->ensure_my_table(); + $qualified_name = "$this->table_alias.$this->real_field"; + $this->query->add_where_expression($this->options['group'], $qualified_name . (empty($this->value) ? " = 0 OR $qualified_name IS NULL" : ' = 1')); + } +} diff --git a/profiles/wcm_base/modules/contrib/private_files_download_permission/LICENSE.txt b/profiles/wcm_base/modules/contrib/private_files_download_permission/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..d159169d1050894d3ea3b98e1c965c4058208fe1 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/private_files_download_permission/LICENSE.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/profiles/wcm_base/modules/contrib/private_files_download_permission/README.txt b/profiles/wcm_base/modules/contrib/private_files_download_permission/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..edca6723d9eae51d06dc1f707c681c7d0f3df2ca --- /dev/null +++ b/profiles/wcm_base/modules/contrib/private_files_download_permission/README.txt @@ -0,0 +1,44 @@ +Private files download permission +================================= + +DESCRIPTION +---------------------------- + +Version 1.x provided "two useful features which Drupal itself is missing: a +simple permission to allow downloading of private files by role, plus the +ability to combine both public and private downloads". + +Version 2.x removes the "global" permission and implements a per-directory +by-user and by-role filter instead, to let the administrator better tweak the +whole website and increment the overall security. + +Idea and code (mostly for version 1.x) were inspired by +http://www.beacon9.ca/labs/drupal-7-private-files-module. +The 2.x development was partly sponsored by Cooperativa Italiana Artisti +(http://www.cita.coop). + +INSTALLATION / CONFIGURATION +---------------------------- + +Browse to Configuration > Media > Private files download permission (url: +/admin/config/media/private-files-download-permission). Then add or edit each +directory path you want to put under control, associating users and roles which +are allowed to download from it. +All directory paths are relative to your private file system path, but must +have a leading slash ('/'), as the private file system root itself could be put +under control. + +E.g.: +Suppose your private file system path is /opt/private. +You could configure /opt/private (and all of its subdirectories) by adding a +'/' entry, while a '/test' entry would specifically refer to /opt/private/test +(and all of its subdirectories). + +Please note that per-user checks may slow your site if there are plenty of +users. You can then bypass this feature by browsing to Configuration > Media > +Private files download permission > Preferences (url: +/admin/config/media/private-files-download-permission/preferences) and change +the setting accordingly. + +Also configure which users and roles have access to the module configuration +under People > Permissions (url: /admin/people/permissions). diff --git a/profiles/wcm_base/modules/contrib/private_files_download_permission/private_files_download_permission.info b/profiles/wcm_base/modules/contrib/private_files_download_permission/private_files_download_permission.info new file mode 100644 index 0000000000000000000000000000000000000000..601fa3db4e790fa82a2526b494fd45d46974c92c --- /dev/null +++ b/profiles/wcm_base/modules/contrib/private_files_download_permission/private_files_download_permission.info @@ -0,0 +1,12 @@ +name = Private files download permission +description = Allows by-user and by-role downloads from private file system directories. +core = 7.x +package = Access control +configure = admin/config/media/private-files-download-permission + +; Information added by Drupal.org packaging script on 2015-01-01 +version = "7.x-2.3+7-dev" +core = "7.x" +project = "private_files_download_permission" +datestamp = "1420135983" + diff --git a/profiles/wcm_base/modules/contrib/private_files_download_permission/private_files_download_permission.install b/profiles/wcm_base/modules/contrib/private_files_download_permission/private_files_download_permission.install new file mode 100644 index 0000000000000000000000000000000000000000..d5b93e9c206c303283d1b196a39ec1d1c3c678a1 --- /dev/null +++ b/profiles/wcm_base/modules/contrib/private_files_download_permission/private_files_download_permission.install @@ -0,0 +1,286 @@ +<?php + +/** + * @file + * Installs, updates and uninstalls module variables and settings. + * + * Copyright (c) 2011-2015 by Marco Zanon (http://www.marcozanon.com) + * Released under GPLv2 license + * Idea and code inspired by http://www.beacon9.ca/labs/drupal-7-private-files-module + */ + +/** + * Implements hook_schema(). + */ +function private_files_download_permission_schema() { + return array( + 'private_files_download_permission_directory' => array( + 'description' => 'Directories whose permissions are set.', + 'fields' => array( + 'did' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), + 'path' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE), + 'bypass' => array('type' => 'int', 'size' => 'tiny', 'not null' => TRUE), + ), + 'primary key' => array('did'), + 'foreign keys' => array(), + 'unique keys' => array( + 'path' => array('path'), + ), + 'indexes' => array(), + ), + 'private_files_download_permission_directory_user' => array( + 'description' => 'Users having per-directory download permission.', + 'fields' => array( + 'duid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), + 'did' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE), + 'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE), + ), + 'primary key' => array('duid'), + 'foreign keys' => array( + 'private_files_download_permission_directory' => array( + 'table' => 'private_files_download_permission_directory', + 'columns' => array('did' => 'did'), + ), + 'private_files_download_permission_directory_user' => array( + 'table' => 'users', + 'columns' => array('uid' => 'uid'), + ), + ), + 'unique keys' => array(), + 'indexes' => array(), + ), + 'private_files_download_permission_directory_role' => array( + 'description' => 'Roles having per-directory download permission.', + 'fields' => array( + 'drid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), + 'did' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE), + 'rid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE), + ), + 'primary key' => array('drid'), + 'foreign keys' => array( + 'private_files_download_permission_directory' => array( + 'table' => 'private_files_download_permission_directory', + 'columns' => array('did' => 'did'), + ), + 'private_files_download_permission_directory_role' => array( + 'table' => 'role', + 'columns' => array('rid' => 'rid'), + ), + ), + 'unique keys' => array(), + 'indexes' => array(), + ), + ); +} + +/** + * Implements hook_install(). + */ +function private_files_download_permission_install() { + $transaction = db_transaction(); + try { + // Add "real" foreign keys. + db_query('ALTER TABLE {private_files_download_permission_directory_user} + ADD CONSTRAINT {private_files_download_permission_directory_2} + FOREIGN KEY (did) REFERENCES {private_files_download_permission_directory} (did) + ON DELETE CASCADE + ON UPDATE CASCADE'); + db_query('ALTER TABLE {private_files_download_permission_directory_user} + ADD CONSTRAINT {private_files_download_permission_directory_user} + FOREIGN KEY (uid) REFERENCES {users} (uid) + ON DELETE CASCADE + ON UPDATE CASCADE'); + db_query('ALTER TABLE {private_files_download_permission_directory_role} + ADD CONSTRAINT {private_files_download_permission_directory} + FOREIGN KEY (did) REFERENCES {private_files_download_permission_directory} (did) + ON DELETE CASCADE + ON UPDATE CASCADE'); + db_query('ALTER TABLE {private_files_download_permission_directory_role} + ADD CONSTRAINT {private_files_download_permission_directory_role} + FOREIGN KEY (rid) REFERENCES {role} (rid) + ON DELETE CASCADE + ON UPDATE CASCADE'); + } + catch (Exception $e) { + $transaction->rollback(); + drupal_set_message(st('An error occurred while installing the module. Please check the log for details.'), 'error'); + } + // Set preferences' default values. + variable_set('private_files_download_permission_by_user_checks', TRUE); +} + +/** + * Remove useless settings from version 1.x, implement new schema and add + * "real" foreign keys. + */ +function private_files_download_permission_update_7200() { + $transaction = db_transaction(); + try { + // Remove useless settings from version 1.x. + foreach (user_roles() as $rid => $role_name) { + user_role_revoke_permissions($rid, array( + 'download private files', + )); + } + variable_del('private_files_download_permission_unprotected_subfolder'); + // Implement new schema (rewritten from scratch, see https://drupal.org/node/150220). + $schema = array(); + $schema['private_files_download_permission_directory'] = array( + 'description' => 'Directories whose permissions are set.', + 'fields' => array( + 'did' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), + 'path' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE), + ), + 'primary key' => array('did'), + 'foreign keys' => array(), + 'unique keys' => array( + 'path' => array('path'), + ), + 'indexes' => array(), + ); + $schema['private_files_download_permission_directory_role'] = array( + 'description' => 'Roles having per-directory download permission.', + 'fields' => array( + 'drid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), + 'did' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE), + 'rid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE), + ), + 'primary key' => array('drid'), + 'foreign keys' => array( + 'private_files_download_permission_directory' => array( + 'table' => 'private_files_download_permission_directory', + 'columns' => array('did' => 'did'), + ), + 'private_files_download_permission_directory_role' => array( + 'table' => 'role', + 'columns' => array('rid' => 'rid'), + ), + ), + 'unique keys' => array(), + 'indexes' => array(), + ); + db_create_table('private_files_download_permission_directory', $schema['private_files_download_permission_directory']); + db_create_table('private_files_download_permission_directory_role', $schema['private_files_download_permission_directory_role']); + // Add "real" foreign keys. + db_query('ALTER TABLE {private_files_download_permission_directory_role} + ADD CONSTRAINT {private_files_download_permission_directory} + FOREIGN KEY (did) REFERENCES {private_files_download_permission_directory} (did) + ON DELETE CASCADE + ON UPDATE CASCADE'); + db_query('ALTER TABLE {private_files_download_permission_directory_role} + ADD CONSTRAINT {private_files_download_permission_directory_role} + FOREIGN KEY (rid) REFERENCES {role} (rid) + ON DELETE CASCADE + ON UPDATE CASCADE'); + } + catch (Exception $e) { + $transaction->rollback(); + drupal_set_message(st('An error occurred while updating the module. Please check the log for details.'), 'error'); + } +} + +/** + * Prepare the database for by-user filtering. + */ +function private_files_download_permission_update_7201() { + $transaction = db_transaction(); + try { + // Implement new table schema (rewritten from scratch, see https://drupal.org/node/150220). + $schema = array(); + $schema['private_files_download_permission_directory_user'] = array( + 'description' => 'Users having per-directory download permission.', + 'fields' => array( + 'duid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), + 'did' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE), + 'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE), + ), + 'primary key' => array('duid'), + 'foreign keys' => array( + 'private_files_download_permission_directory' => array( + 'table' => 'private_files_download_permission_directory', + 'columns' => array('did' => 'did'), + ), + 'private_files_download_permission_directory_user' => array( + 'table' => 'users', + 'columns' => array('uid' => 'uid'), + ), + ), + 'unique keys' => array(), + 'indexes' => array(), + ); + db_create_table('private_files_download_permission_directory_user', $schema['private_files_download_permission_directory_user']); + // Add "real" foreign keys. + db_query('ALTER TABLE {private_files_download_permission_directory_user} + ADD CONSTRAINT {private_files_download_permission_directory_2} + FOREIGN KEY (did) REFERENCES {private_files_download_permission_directory} (did) + ON DELETE CASCADE + ON UPDATE CASCADE'); + db_query('ALTER TABLE {private_files_download_permission_directory_user} + ADD CONSTRAINT {private_files_download_permission_directory_user} + FOREIGN KEY (uid) REFERENCES {users} (uid) + ON DELETE CASCADE + ON UPDATE CASCADE'); + } + catch (Exception $e) { + $transaction->rollback(); + drupal_set_message(st('An error occurred while updating the module. Please check the log for details.'), 'error'); + } +} + +/** + * Prepare the database to handle the "bypass" option. Set preferences' default + * values. + */ +function private_files_download_permission_update_7203() { + // Update table schema. + db_add_field('private_files_download_permission_directory', 'bypass', array('type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'initial' => 0)); + // Set preferences' default values. + variable_set('private_files_download_permission_by_user_checks', TRUE); +} + +/** + * Implements hook_enable(). + */ +function private_files_download_permission_enable() { + // Purge directory list from cache. + drupal_static_reset('private_files_download_permission_directory_list'); +} + +/** + * Implements hook_uninstall(). + */ +function private_files_download_permission_uninstall() { + $transaction = db_transaction(); + try { + if (FALSE !== stripos(db_driver(), 'mysql')) { + // Remove "real" foreign keys (MySQL database). + db_query('ALTER TABLE {private_files_download_permission_directory_user} + DROP FOREIGN KEY {private_files_download_permission_directory_2}'); + db_query('ALTER TABLE {private_files_download_permission_directory_user} + DROP FOREIGN KEY {private_files_download_permission_directory_user}'); + db_query('ALTER TABLE {private_files_download_permission_directory_role} + DROP FOREIGN KEY {private_files_download_permission_directory}'); + db_query('ALTER TABLE {private_files_download_permission_directory_role} + DROP FOREIGN KEY {private_files_download_permission_directory_role}'); + } + else { + // Remove "real" foreign keys (non-MySQL database). + db_query('ALTER TABLE {private_files_download_permission_directory_user} + DROP CONSTRAINT IF EXISTS {private_files_download_permission_directory_2}'); + db_query('ALTER TABLE {private_files_download_permission_directory_user} + DROP CONSTRAINT IF EXISTS {private_files_download_permission_directory_user}'); + db_query('ALTER TABLE {private_files_download_permission_directory_role} + DROP CONSTRAINT IF EXISTS {private_files_download_permission_directory}'); + db_query('ALTER TABLE {private_files_download_permission_directory_role} + DROP CONSTRAINT IF EXISTS {private_files_download_permission_directory_role}'); + } + } + catch (Exception $e) { + $transaction->rollback(); + drupal_set_message(st('An error occurred while removing the module. Please check the log for details.'), 'error'); + } + // Remove preferences. + variable_del('private_files_download_permission_by_user_checks'); + // Purge directory list from cache. + drupal_static_reset('private_files_download_permission_directory_list'); +} diff --git a/profiles/wcm_base/modules/contrib/private_files_download_permission/private_files_download_permission.module b/profiles/wcm_base/modules/contrib/private_files_download_permission/private_files_download_permission.module new file mode 100644 index 0000000000000000000000000000000000000000..6a91988bbc7aa580e03499eb062ab31b73458d1d --- /dev/null +++ b/profiles/wcm_base/modules/contrib/private_files_download_permission/private_files_download_permission.module @@ -0,0 +1,594 @@ +<?php + +/** + * @file + * Handles both module settings and its behaviour. + * + * Copyright (c) 2011-2015 by Marco Zanon (http://www.marcozanon.com) + * Released under GPLv2 license + * Idea and code inspired by http://www.beacon9.ca/labs/drupal-7-private-files-module + */ + +/** + * Implements hook_permission(). + */ +function private_files_download_permission_permission() { + return array( + 'bypass private files download permission' => array( + 'title' => t('Bypass Private files download permission'), + 'description' => t('Download from private directories regardless of permission restrictions.'), + ), + 'bypass private files download permission for temporary files' => array( + 'title' => t('Bypass Private files download permission for temporary files'), + 'description' => t('Download temporary files regardless of permission restrictions.'), + ), + 'administer private files download permission' => array( + 'title' => t('Administer Private files download permission'), + 'description' => t('Access module configuration.'), + ), + ); +} + +/** + * Implements hook_menu(). + */ +function private_files_download_permission_menu() { + return array( + 'admin/config/media/private-files-download-permission' => array( + 'title' => 'Private files download permission', + 'description' => 'Manage by-directory, by-role and by-user download permissions.', + 'page callback' => 'private_files_download_permission_list_directories', + 'access arguments' => array('administer private files download permission'), + 'type' => MENU_NORMAL_ITEM, + ), + 'admin/config/media/private-files-download-permission/list' => array( + 'title' => 'List directories', + 'description' => 'List directories in the control list.', + 'page callback' => 'private_files_download_permission_list_directories', + 'access arguments' => array('administer private files download permission'), + 'type' => MENU_DEFAULT_LOCAL_TASK, + ), + 'admin/config/media/private-files-download-permission/add' => array( + 'title' => 'Add directory', + 'description' => 'Add directory to the control list.', + 'page callback' => 'private_files_download_permission_add_directory', + 'access arguments' => array('administer private files download permission'), + 'type' => MENU_LOCAL_ACTION, + ), + 'admin/config/media/private-files-download-permission/%/edit' => array( + 'title' => 'Edit directory', + 'description' => 'Edit directory in the control list.', + 'page callback' => 'private_files_download_permission_edit_directory', + 'page arguments' => array(4), + 'access arguments' => array('administer private files download permission'), + 'type' => MENU_NORMAL_ITEM, + ), + 'admin/config/media/private-files-download-permission/%/remove' => array( + 'title' => 'Remove directory', + 'description' => 'Remove directory from the control list.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('private_files_download_permission_remove_directory', 4), + 'access arguments' => array('administer private files download permission'), + 'type' => MENU_CALLBACK, + ), + 'admin/config/media/private-files-download-permission/preferences' => array( + 'title' => 'Preferences', + 'description' => 'Set module preferences.', + 'page callback' => 'private_files_download_permission_set_preferences', + 'access arguments' => array('administer private files download permission'), + 'type' => MENU_LOCAL_TASK, + ), + ); +} + +/** + * Returns a standard array containing all users. + */ +function private_files_download_permission_get_users() { + // Load user list from database. + $user_list = db_select('users', 't') + ->fields('t') + ->orderBy('t.name', 'ASC') + ->execute() + ->fetchAllAssoc('uid'); + // Return a standard (uid, name) array. + $users = array(); + foreach ($user_list as $uid => $user) { + $users[$uid] = (!$user->name ? t('anonymous user') : $user->name); + } + return $users; +} + +/** + * Returns the list of all directories under control. + */ +function private_files_download_permission_get_directory_list() { + $directory_list = &drupal_static('private_files_download_permission_directory_list'); + if (!isset($directory_list)) { + // Load directory list. + $directory_list = db_select('private_files_download_permission_directory', 't') + ->fields('t') + ->orderBy('t.path', 'ASC') + ->execute() + ->fetchAllAssoc('did'); + // Add user id and role id arrays to each directory. + foreach ($directory_list as $directory) { + $directory->uid = array(); + $directory->rid = array(); + } + // Load directory user list. + $directory_users = db_select('private_files_download_permission_directory_user', 't') + ->fields('t') + ->orderBy('t.did', 'ASC') + ->execute() + ->fetchAll(); + // Load directory role list. + $directory_roles = db_select('private_files_download_permission_directory_role', 't') + ->fields('t') + ->orderBy('t.did', 'ASC') + ->execute() + ->fetchAll(); + // Merge array values. + foreach ($directory_users as $directory_user) { + $did = $directory_user->did; + $uid = $directory_user->uid; + $directory_list[$did]->uid[$uid] = array('uid' => $uid); + } + foreach ($directory_roles as $directory_role) { + $did = $directory_role->did; + $rid = $directory_role->rid; + $directory_list[$did]->rid[$rid] = array('rid' => $rid); + } + } + return $directory_list; +} + +/** + * (Page callback.) Displays the main page and lists directories under control. + */ +function private_files_download_permission_list_directories() { + $output = ''; + // Check if file system download method is set to private. + if ('private' !== file_default_scheme()) { + drupal_set_message(t('Your !default_download_method is not set as private. Please keep in mind that these settings only affect private file system downloads.', array('!default_download_method' => l(t('default download method'), 'admin/config/media/file-system'))), 'warning'); + } + // Display the private file system path. + $private_path = variable_get('file_private_path'); + if (!$private_path) { + $output .= '<p>' . t('Your private file system path is not set.') . '</p>'; + } + else { + $output .= '<p>' . t('Your private file system path is %path.', array('%path' => $private_path)) . '</p>'; + } + // Display a warning if by-user checks are not enabled. + if (!variable_get('private_files_download_permission_by_user_checks')) { + $output .= '<p>' . t('!by_user_checks are not enabled.', array('!by_user_checks' => l(t('By-user checks'), 'admin/config/media/private-files-download-permission/preferences'))) . '</p>'; + } + // Retrieve directory list and display it as a table. + $directory_list = private_files_download_permission_get_directory_list(); + if (variable_get('private_files_download_permission_by_user_checks')) { + $users = private_files_download_permission_get_users(); + } + $roles = user_roles(); + $rows = array(); + foreach ($directory_list as $directory) { + // Prepare the 'Enabled users' cell. + if (variable_get('private_files_download_permission_by_user_checks')) { + $enabled_users = array_intersect_key($users, $directory->uid); + sort($enabled_users); + } + // Prepare the 'Enabled roles' cell. + $enabled_roles = array_intersect_key($roles, $directory->rid); + sort($enabled_roles); + // Fill table row. + $rows[] = array( + $directory->path, + $directory->bypass ? t('Yes') : '', + variable_get('private_files_download_permission_by_user_checks') && !empty($enabled_users) && !$directory->bypass ? implode('<br />', $enabled_users) : '', + !empty($enabled_roles) && !$directory->bypass ? implode('<br />', $enabled_roles) : '', + l(t('Edit'), 'admin/config/media/private-files-download-permission/' . $directory->did . '/edit/'), + l(t('Remove'), 'admin/config/media/private-files-download-permission/' . $directory->did . '/remove/'), + ); + } + $output .= theme('table', array( + 'header' => array( + t('Directory path'), + t('Bypass'), + t('Enabled users'), + t('Enabled roles'), + array( + 'data' => t('Operations'), + 'colspan' => 2, + ), + ), + 'rows' => $rows, + 'attributes' => array(), + 'caption' => NULL, + 'colgroups' => array(), + 'sticky' => FALSE, + 'empty' => t('The directory list is empty.'), + )); + // Display output. + return $output; +} + +/** + * (Form callback.) Displays a form to add/edit a directory. + */ +function private_files_download_permission_get_directory_form($form, &$form_state, $did) { + $directory_list = private_files_download_permission_get_directory_list(); + $form = array(); + // Check that $did is actually a valid directory id, if not blank. + if (NULL !== $did) { + if (!in_array($did, array_keys($directory_list))) { + drupal_set_message(t('You need to provide a valid directory id.'), 'error'); + return; + } + } + // Prepare default values. + $default_path = NULL; + $default_bypass = FALSE; + if (variable_get('private_files_download_permission_by_user_checks')) { + $default_users = array(); + } + $default_roles = array(); + if (NULL !== $did) { + $default_path = $directory_list[$did]->path; + $default_bypass = $directory_list[$did]->bypass; + if (variable_get('private_files_download_permission_by_user_checks')) { + $default_users = array_keys($directory_list[$did]->uid); + } + $default_roles = array_keys($directory_list[$did]->rid); + } + // Prepare the directory id value to be eventually submitted. + $form['did'] = array( + '#type' => 'value', + '#value' => $did, + ); + // Prepare the path text field. + $form['path'] = array( + '#type' => 'textfield', + '#title' => t('Path'), + '#field_prefix' => variable_get('file_private_path'), + '#size' => 60, + '#maxlength' => 255, + '#required' => TRUE, + '#default_value' => $default_path, + ); + // Prepare the bypass checkbox. + $form['bypass'] = array( + '#type' => 'checkbox', + '#title' => t('Bypass'), + '#default_value' => $default_bypass, + '#description' => t('Enable to make this module ignore the above path.'), + ); + // Prepare the user checkbox fieldset. + if (variable_get('private_files_download_permission_by_user_checks')) { + $form['users'] = array( + '#type' => 'fieldset', + '#title' => t('Enabled users'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + } + // Prepare user checkboxes. + if (variable_get('private_files_download_permission_by_user_checks')) { + $users = array_flip(private_files_download_permission_get_users()); + ksort($users); + $users = array_flip($users); + foreach ($users as $uid => $user) { + $form['users']['user_' . $uid] = array( + '#type' => 'checkbox', + '#title' => check_plain($user), + '#default_value' => ((NULL === $did) && (1 === $uid) ? TRUE : in_array($uid, $default_users)), + ); + } + } + // Prepare the role checkbox fieldset. + $form['roles'] = array( + '#type' => 'fieldset', + '#title' => t('Enabled roles'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + // Prepare role checkboxes. + $roles = array_flip(user_roles()); + ksort($roles); + $roles = array_flip($roles); + foreach ($roles as $rid => $role) { + $form['roles']['role_' . $rid] = array( + '#type' => 'checkbox', + '#title' => check_plain($role), + '#default_value' => in_array($rid, $default_roles), + ); + } + // Prepare the submit button. + $form['submit'] = array( + '#type' => 'submit', + '#value' => t('Save directory to the control list'), + ); + // Return form. + return $form; +} + +/** + * (Form callback.) Validates the directory form. + */ +function private_files_download_permission_get_directory_form_validate($form, &$form_state) { + // Retrieve $path (which, being required, is surely not blank). + $path = $form_state['values']['path']; + // Perform slash validation: + if (0 < drupal_strlen($path)) { + $first_character = drupal_substr($path, 0, 1); + $last_character = drupal_substr($path, -1, 1); + // ...there must be a leading slash. + if (('/' !== $first_character) && ('\\' !== $first_character)) { + form_set_error('path', t('You must add a leading slash.')); + } + if (1 < drupal_strlen($path)) { + // ...there cannot be multiple consecutive slashes. + if ((FALSE !== strpos($path, '//')) || (FALSE !== strpos($path, '\\\\'))) { + form_set_error('path', t('You cannot use multiple consecutive slashes.')); + } + // ...there cannot be trailing slashes. + if (('/' === $last_character) || ('\\' === $last_character)) { + form_set_error('path', t('You cannot use trailing slashes.')); + } + } + } +} + +/** + * (Form callback.) Submits the directory form. + */ +function private_files_download_permission_get_directory_form_submit($form, &$form_state) { + $transaction = db_transaction(); + try { + // Retrieve form values. + $did = $form_state['values']['did']; + $path = $form_state['values']['path']; + $bypass = $form_state['values']['bypass']; + if (variable_get('private_files_download_permission_by_user_checks')) { + $users = array(); + } + $roles = array(); + foreach ($form_state['values'] as $key => $value) { + if (variable_get('private_files_download_permission_by_user_checks')) { + if (0 === strpos($key, 'user_')) { + $uid = drupal_substr($key, drupal_strlen('user_')); + $users[$uid] = $value; + } + } + if (0 === strpos($key, 'role_')) { + $rid = drupal_substr($key, drupal_strlen('role_')); + $roles[$rid] = $value; + } + } + // Write directory record. + $directory_record = array( + 'did' => $did, + 'path' => $path, + 'bypass' => $bypass, + ); + if (NULL === $did) { + drupal_write_record('private_files_download_permission_directory', $directory_record); + } + else { + drupal_write_record('private_files_download_permission_directory', $directory_record, array('did')); + } + // Retrieve last record id. + if (NULL === $did) { + $did = $directory_record['did']; + } + // Delete old user permissions and write new ones. + if (variable_get('private_files_download_permission_by_user_checks')) { + db_delete('private_files_download_permission_directory_user') + ->condition('did', $did) + ->execute(); + foreach ($users as $uid => $value) { + if (TRUE == $value) { + db_insert('private_files_download_permission_directory_user') + ->fields(array( + 'did' => $did, + 'uid' => $uid, + )) + ->execute(); + } + } + } + // Delete old role permissions and write new ones. + db_delete('private_files_download_permission_directory_role') + ->condition('did', $did) + ->execute(); + foreach ($roles as $rid => $value) { + if (TRUE == $value) { + db_insert('private_files_download_permission_directory_role') + ->fields(array( + 'did' => $did, + 'rid' => $rid, + )) + ->execute(); + } + } + } + catch (Exception $e) { + $transaction->rollback(); + drupal_set_message(t('An error occurred while saving directory to the control list. Please check the log for details.'), 'error'); + } + // Purge directory list from cache. + drupal_static_reset('private_files_download_permission_get_directory_list'); + // Set form redirection. + $form_state['redirect'] = 'admin/config/media/private-files-download-permission'; +} + +/** + * (Page callback.) Adds a directory to the control list. + */ +function private_files_download_permission_add_directory() { + return drupal_get_form('private_files_download_permission_get_directory_form', NULL); +} + +/** + * (Page callback.) Edits a directory in the control list. + */ +function private_files_download_permission_edit_directory($did) { + return drupal_get_form('private_files_download_permission_get_directory_form', $did); +} + +/** + * (Form callback.) Displays a confirmation dialog before removing a directory + * from the control list. + */ +function private_files_download_permission_remove_directory($form, &$form_state, $did) { + $form = array(); + // Check that $did is actually a valid directory id. + $directory_list = private_files_download_permission_get_directory_list(); + if (!in_array($did, array_keys($directory_list))) { + drupal_set_message(t('You need to provide a valid directory id.'), 'error'); + return; + } + // Prepare the directory id value to be eventually submitted. + $form['did'] = array( + '#type' => 'value', + '#value' => $did, + ); + // Display the confirmation form. + return confirm_form( + $form, + t('Are you sure you want to remove @path from the control list?', array('@path' => $directory_list[$did]->path)), + 'admin/config/media/private-files-download-permission', + t('This action cannot be undone.'), + t('Remove directory from the control list'), + t('Cancel') + ); +} + +/** + * (Form callback.) Removes a directory from the control list. + */ +function private_files_download_permission_remove_directory_submit($form, &$form_state) { + $transaction = db_transaction(); + try { + // Check that $form_state['values']['did'] is actually a valid directory id. + $directory_list = private_files_download_permission_get_directory_list(); + if (!in_array($form_state['values']['did'], array_keys($directory_list))) { + drupal_set_message(t('You need to provide a valid directory id.'), 'error'); + return; + } + // Remove users associated to the directory. + db_delete('private_files_download_permission_directory_user') + ->condition('did', $form_state['values']['did']) + ->execute(); + // Remove roles associated to the directory. + db_delete('private_files_download_permission_directory_role') + ->condition('did', $form_state['values']['did']) + ->execute(); + // Remove the directory itself. + db_delete('private_files_download_permission_directory') + ->condition('did', $form_state['values']['did']) + ->execute(); + } + catch (Exception $e) { + $transaction->rollback(); + drupal_set_message(t('An error occurred while removing directory from the control list. Please check the log for details.'), 'error'); + } + // Purge directory list from cache. + drupal_static_reset('private_files_download_permission_get_directory_list'); + // Set form redirection. + $form_state['redirect'] = 'admin/config/media/private-files-download-permission'; +} + +/** + * (Form callback.) Displays a form to set preferences. + */ +function private_files_download_permission_get_preferences_form($form, &$form_state) { + // Prepare settings. + $form['private_files_download_permission_by_user_checks'] = array( + '#type' => 'checkbox', + '#title' => t('Enable by-user checks'), + '#default_value' => variable_get('private_files_download_permission_by_user_checks'), + '#description' => t('You may wish to disable this feature if there are plenty of users, as it may slow down the entire site.'), + ); + // Prepare the submit button. + $form['submit'] = array( + '#type' => 'submit', + '#value' => t('Save preferences'), + ); + // Return form. + return $form; +} + +/** + * (Form callback.) Submits the preferences form. + */ +function private_files_download_permission_get_preferences_form_submit($form, &$form_state) { + // Save preferences. + variable_set('private_files_download_permission_by_user_checks', $form_state['values']['private_files_download_permission_by_user_checks']); + // Purge directory list from cache. + drupal_static_reset('private_files_download_permission_get_directory_list'); + // Display message. + drupal_set_message(t('Your preferences have been successfully saved.'), 'status'); +} + +/** + * (Page callback.) Sets module preferences. + */ +function private_files_download_permission_set_preferences() { + return drupal_get_form('private_files_download_permission_get_preferences_form'); +} + +/** + * Implements hook_file_download(). + */ +function private_files_download_permission_file_download($uri) { + global $user; + // Check if user may bypass permission restrictions. + if (user_access('bypass private files download permission')) { + return array('Content-Type' => file_get_mimetype($uri)); + } + else if ((user_access('bypass private files download permission for temporary files')) && ('temporary://' === substr($uri, 0, 12))) { + return array('Content-Type' => file_get_mimetype($uri)); + } + // If not, do all the specific checks. + else { + // Extract the path from $uri, removing the protocol prefix and the file name. + $uri_path = explode('/', $uri); + array_shift($uri_path); + array_shift($uri_path); + array_pop($uri_path); + // Add a leading slash to $uri_path. + $uri_path = '/' . implode('/', $uri_path); + // Find the directory which best matches $uri_path. + $best_matching_length = 0; + $best_matching_directory = NULL; + foreach (private_files_download_permission_get_directory_list() as $directory) { + // Search for the best matching substring. + $directory_path = $directory->path; + if (0 === stripos($uri_path, $directory_path)) { + if (drupal_strlen($directory_path) > $best_matching_length) { + $best_matching_length = drupal_strlen($directory_path); + $best_matching_directory = $directory; + } + } + } + if (NULL != $best_matching_directory) { + // Check if this module should ignore the call. + if ($best_matching_directory->bypass) { + return NULL; + } + // Evaluate user and role permissions and optionally allow access to $uri. + if (variable_get('private_files_download_permission_by_user_checks')) { + if (in_array($user->uid, array_keys($best_matching_directory->uid))) { + return array('Content-Type' => file_get_mimetype($uri)); + } + } + foreach ($user->roles as $rid => $role) { + if (in_array($rid, array_keys($best_matching_directory->rid))) { + return array('Content-Type' => file_get_mimetype($uri)); + } + } + } + } + // By default, deny access. + return -1; +} diff --git a/profiles/wcm_base/modules/custom/ocio_basic_page/ocio_basic_page.info b/profiles/wcm_base/modules/custom/ocio_basic_page/ocio_basic_page.info index 3c84f30517edcb3ae0539713170be342c6940b84..efc34222fbdc63f84c7d2af8ec6c3d44bb556ee2 100644 --- a/profiles/wcm_base/modules/custom/ocio_basic_page/ocio_basic_page.info +++ b/profiles/wcm_base/modules/custom/ocio_basic_page/ocio_basic_page.info @@ -31,4 +31,5 @@ features[variable][] = menu_parent_basic_page features[variable][] = node_options_basic_page features[variable][] = node_preview_basic_page features[variable][] = node_submitted_basic_page +features[variable][] = private_basic_page features[variable][] = workbench_moderation_default_state_basic_page diff --git a/profiles/wcm_base/modules/custom/ocio_basic_page/ocio_basic_page.strongarm.inc b/profiles/wcm_base/modules/custom/ocio_basic_page/ocio_basic_page.strongarm.inc index e9dd6c44d268be93c5fa285acd0f642c47522599..d8a6831cf93f0b1f97a1c57a2d881376b94ca97e 100644 --- a/profiles/wcm_base/modules/custom/ocio_basic_page/ocio_basic_page.strongarm.inc +++ b/profiles/wcm_base/modules/custom/ocio_basic_page/ocio_basic_page.strongarm.inc @@ -98,6 +98,13 @@ function ocio_basic_page_strongarm() { $strongarm->value = 0; $export['node_submitted_basic_page'] = $strongarm; + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'private_basic_page'; + $strongarm->value = '1'; + $export['private_basic_page'] = $strongarm; + $strongarm = new stdClass(); $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ $strongarm->api_version = 1; diff --git a/profiles/wcm_base/modules/custom/ocio_book/ocio_book.info b/profiles/wcm_base/modules/custom/ocio_book/ocio_book.info index 18dde79dc9fc2c531919214c771bd44cc4a75840..9e769ec74776f49d4b5de7bd28bb5f0a7959e041 100644 --- a/profiles/wcm_base/modules/custom/ocio_book/ocio_book.info +++ b/profiles/wcm_base/modules/custom/ocio_book/ocio_book.info @@ -27,6 +27,7 @@ features[variable][] = node_options_book_page features[variable][] = node_preview_book_page features[variable][] = node_submitted_book_page features[variable][] = panelizer_defaults_node_book_page +features[variable][] = private_book_page features[variable][] = simplify_nodes_book_page features[variable][] = webform_node_book_page features[variable][] = workbench_moderation_default_state_book_page diff --git a/profiles/wcm_base/modules/custom/ocio_book/ocio_book.strongarm.inc b/profiles/wcm_base/modules/custom/ocio_book/ocio_book.strongarm.inc index eacd19e5e4e2e2596e17d813cc95c708101ec922..787d3695c2a0d47600790212dd354fca7c8f3175 100644 --- a/profiles/wcm_base/modules/custom/ocio_book/ocio_book.strongarm.inc +++ b/profiles/wcm_base/modules/custom/ocio_book/ocio_book.strongarm.inc @@ -14,7 +14,7 @@ function ocio_book_strongarm() { $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ $strongarm->api_version = 1; $strongarm->name = 'additional_settings__active_tab_book_page'; - $strongarm->value = 'edit-menu'; + $strongarm->value = 'edit-submission'; $export['additional_settings__active_tab_book_page'] = $strongarm; $strongarm = new stdClass(); @@ -185,6 +185,13 @@ function ocio_book_strongarm() { ); $export['panelizer_defaults_node_book_page'] = $strongarm; + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'private_book_page'; + $strongarm->value = '1'; + $export['private_book_page'] = $strongarm; + $strongarm = new stdClass(); $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ $strongarm->api_version = 1; diff --git a/profiles/wcm_base/modules/custom/ocio_calendar/ocio_calendar.info b/profiles/wcm_base/modules/custom/ocio_calendar/ocio_calendar.info index fe4bb77065814f6e44cf0e32e8fae6400fc1d01b..51f450ac268ada6cbd92e18a9aa416adb41a26f5 100644 --- a/profiles/wcm_base/modules/custom/ocio_calendar/ocio_calendar.info +++ b/profiles/wcm_base/modules/custom/ocio_calendar/ocio_calendar.info @@ -24,8 +24,8 @@ features[variable][] = menu_parent_calendar_entry features[variable][] = node_options_calendar_entry features[variable][] = node_preview_calendar_entry features[variable][] = node_submitted_calendar_entry +features[variable][] = private_calendar_entry features[views_view][] = calendar features_exclude[dependencies][date] = date features_exclude[dependencies][features] = features features_exclude[dependencies][ctools] = ctools -mtime = 1424705231 diff --git a/profiles/wcm_base/modules/custom/ocio_calendar/ocio_calendar.strongarm.inc b/profiles/wcm_base/modules/custom/ocio_calendar/ocio_calendar.strongarm.inc index fdc16671632933a933deb0cef556ac0a9999dd25..a601292390bff1104cc66d1ad417286251cd9050 100644 --- a/profiles/wcm_base/modules/custom/ocio_calendar/ocio_calendar.strongarm.inc +++ b/profiles/wcm_base/modules/custom/ocio_calendar/ocio_calendar.strongarm.inc @@ -68,5 +68,12 @@ function ocio_calendar_strongarm() { $strongarm->value = 1; $export['node_submitted_calendar_entry'] = $strongarm; + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'private_calendar_entry'; + $strongarm->value = '1'; + $export['private_calendar_entry'] = $strongarm; + return $export; } diff --git a/profiles/wcm_base/modules/custom/ocio_faqs/ocio_faqs.info b/profiles/wcm_base/modules/custom/ocio_faqs/ocio_faqs.info index 062fd456a753ca9f4dd0ea6d2eb153da405a7108..46724d8e37ff441c7785b88862e6e681b316f0d9 100644 --- a/profiles/wcm_base/modules/custom/ocio_faqs/ocio_faqs.info +++ b/profiles/wcm_base/modules/custom/ocio_faqs/ocio_faqs.info @@ -27,6 +27,7 @@ features[variable][] = menu_parent_faq features[variable][] = node_options_faq features[variable][] = node_preview_faq features[variable][] = node_submitted_faq +features[variable][] = private_faq features[variable][] = workbench_moderation_default_state_faq features[views_view][] = faq features_exclude[variable][field_bundle_settings_node__faq] = field_bundle_settings_node__faq diff --git a/profiles/wcm_base/modules/custom/ocio_faqs/ocio_faqs.strongarm.inc b/profiles/wcm_base/modules/custom/ocio_faqs/ocio_faqs.strongarm.inc index c83e857b73a3453c115b70c1d3266d975df86166..85d4cd9060dc0fe1a2994255f00ed049c61b9300 100644 --- a/profiles/wcm_base/modules/custom/ocio_faqs/ocio_faqs.strongarm.inc +++ b/profiles/wcm_base/modules/custom/ocio_faqs/ocio_faqs.strongarm.inc @@ -55,6 +55,13 @@ function ocio_faqs_strongarm() { $strongarm->value = 0; $export['node_submitted_faq'] = $strongarm; + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'private_faq'; + $strongarm->value = '1'; + $export['private_faq'] = $strongarm; + $strongarm = new stdClass(); $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ $strongarm->api_version = 1; diff --git a/profiles/wcm_base/modules/custom/ocio_featured_slideshow/ocio_featured_slideshow.info b/profiles/wcm_base/modules/custom/ocio_featured_slideshow/ocio_featured_slideshow.info index 0ac45ba4b275050ba64988bd04100385d0e5408d..10f6190776b99d61ad89025d176de4fc9c860081 100644 --- a/profiles/wcm_base/modules/custom/ocio_featured_slideshow/ocio_featured_slideshow.info +++ b/profiles/wcm_base/modules/custom/ocio_featured_slideshow/ocio_featured_slideshow.info @@ -38,5 +38,6 @@ features[variable][] = menu_parent_featured_slide features[variable][] = node_options_featured_slide features[variable][] = node_preview_featured_slide features[variable][] = node_submitted_featured_slide +features[variable][] = private_featured_slide features[variable][] = workbench_moderation_default_state_featured_slide features[views_view][] = featured_slideshow diff --git a/profiles/wcm_base/modules/custom/ocio_featured_slideshow/ocio_featured_slideshow.strongarm.inc b/profiles/wcm_base/modules/custom/ocio_featured_slideshow/ocio_featured_slideshow.strongarm.inc index 7e56b5ac654fbd593db80ae2726f9f9639b292cb..0b4eafe1042bfc2796d646e76e05835df6a08dc9 100644 --- a/profiles/wcm_base/modules/custom/ocio_featured_slideshow/ocio_featured_slideshow.strongarm.inc +++ b/profiles/wcm_base/modules/custom/ocio_featured_slideshow/ocio_featured_slideshow.strongarm.inc @@ -100,6 +100,13 @@ function ocio_featured_slideshow_strongarm() { $strongarm->value = 0; $export['node_submitted_featured_slide'] = $strongarm; + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'private_featured_slide'; + $strongarm->value = '1'; + $export['private_featured_slide'] = $strongarm; + $strongarm = new stdClass(); $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ $strongarm->api_version = 1; diff --git a/profiles/wcm_base/modules/custom/ocio_field_bases/ocio_field_bases.module b/profiles/wcm_base/modules/custom/ocio_field_bases/ocio_field_bases.module index 13a442a701a2985916974e6e533a029d0c8190ac..665820e63f96e0b48ddade07a2d7929b7b06fa72 100644 --- a/profiles/wcm_base/modules/custom/ocio_field_bases/ocio_field_bases.module +++ b/profiles/wcm_base/modules/custom/ocio_field_bases/ocio_field_bases.module @@ -45,7 +45,7 @@ function ocio_field_bases_preprocess_page(&$vars) { // Load our JS file that implements jQuery UI Accordion. drupal_add_js(drupal_get_path('module', 'ocio_field_bases') . '/js/ocio_field_bases_accordion.js', array('scope' => 'footer')); - if (isset($vars['node']) && $vars['node']->field_disable_title['und'][0]['value']) { + if (isset($vars['node'], $vars['node']->field_disable_title) && $vars['node']->field_disable_title['und'][0]['value']) { $vars['title_attributes_array']['class'][] = 'element-invisible'; } } diff --git a/profiles/wcm_base/modules/custom/ocio_landing_page/ocio_landing_page.info b/profiles/wcm_base/modules/custom/ocio_landing_page/ocio_landing_page.info index 707cb89109cbde0ec8c1061afff6bf401c155430..edc56cc944ef5db822a6860482d0d16c76cd6aed 100644 --- a/profiles/wcm_base/modules/custom/ocio_landing_page/ocio_landing_page.info +++ b/profiles/wcm_base/modules/custom/ocio_landing_page/ocio_landing_page.info @@ -69,6 +69,7 @@ features[variable][] = panelizer_node:ocio_landing_page_allowed_layouts_default features[variable][] = panelizer_node:ocio_landing_page_allowed_types features[variable][] = panelizer_node:ocio_landing_page_allowed_types_default features[variable][] = panelizer_node:ocio_landing_page_default +features[variable][] = private_ocio_landing_page features[variable][] = simplify_nodes_ocio_landing_page features[variable][] = webform_node_ocio_landing_page features[variable][] = workbench_moderation_default_state_ocio_landing_page diff --git a/profiles/wcm_base/modules/custom/ocio_landing_page/ocio_landing_page.strongarm.inc b/profiles/wcm_base/modules/custom/ocio_landing_page/ocio_landing_page.strongarm.inc index 8971147888cf50393f5ea7792d7bf89472a90861..e8fda1e97e41f6c9005db3b21a754d8884c6d15f 100644 --- a/profiles/wcm_base/modules/custom/ocio_landing_page/ocio_landing_page.strongarm.inc +++ b/profiles/wcm_base/modules/custom/ocio_landing_page/ocio_landing_page.strongarm.inc @@ -14,7 +14,7 @@ function ocio_landing_page_strongarm() { $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ $strongarm->api_version = 1; $strongarm->name = 'additional_settings__active_tab_ocio_landing_page'; - $strongarm->value = 'edit-panelizer'; + $strongarm->value = 'edit-submission'; $export['additional_settings__active_tab_ocio_landing_page'] = $strongarm; $strongarm = new stdClass(); @@ -688,6 +688,13 @@ function ocio_landing_page_strongarm() { ); $export['panelizer_node:ocio_landing_page_default'] = $strongarm; + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'private_ocio_landing_page'; + $strongarm->value = '1'; + $export['private_ocio_landing_page'] = $strongarm; + $strongarm = new stdClass(); $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ $strongarm->api_version = 1; diff --git a/profiles/wcm_base/modules/custom/ocio_media/ocio_media.features.features_overrides.inc b/profiles/wcm_base/modules/custom/ocio_media/ocio_media.features.features_overrides.inc index 6407d677e6c24756632f8bff91c627bb0bb42d34..1ebba59ca165b75037b606550be6cda840fb0a38 100644 --- a/profiles/wcm_base/modules/custom/ocio_media/ocio_media.features.features_overrides.inc +++ b/profiles/wcm_base/modules/custom/ocio_media/ocio_media.features.features_overrides.inc @@ -63,6 +63,27 @@ function ocio_media_features_override_default_overrides() { 'type' => 'select', 'vocabulary' => 'wcm_file_tags', ); + $overrides["views_view.media_default.display|default|display_options|filters|schema_type"] = array( + 'id' => 'schema_type', + 'table' => 'file_managed', + 'field' => 'schema_type', + 'exposed' => TRUE, + 'expose' => array( + 'operator_id' => 'schema_type_op', + 'label' => 'Storage', + 'operator' => 'schema_type_op', + 'identifier' => 'schema_type', + 'remember_roles' => array( + 2 => 2, + 1 => 0, + 5 => 0, + 4 => 0, + 7 => 0, + 6 => 0, + 3 => 0, + ), + ), + ); $overrides["views_view.media_default.display|media_browser_my_files|display_options|filters|field_file_tags_tid"] = array( 'id' => 'field_file_tags_tid', 'table' => 'field_data_field_file_tags', @@ -86,6 +107,27 @@ function ocio_media_features_override_default_overrides() { 'type' => 'select', 'vocabulary' => 'wcm_file_tags', ); + $overrides["views_view.media_default.display|media_browser_my_files|display_options|filters|schema_type"] = array( + 'id' => 'schema_type', + 'table' => 'file_managed', + 'field' => 'schema_type', + 'exposed' => TRUE, + 'expose' => array( + 'operator_id' => 'schema_type_op', + 'label' => 'Storage', + 'operator' => 'schema_type_op', + 'identifier' => 'schema_type', + 'remember_roles' => array( + 2 => 2, + 1 => 0, + 5 => 0, + 4 => 0, + 7 => 0, + 6 => 0, + 3 => 0, + ), + ), + ); return $overrides; } diff --git a/profiles/wcm_base/modules/custom/ocio_media/ocio_media.features.inc b/profiles/wcm_base/modules/custom/ocio_media/ocio_media.features.inc index e192cfcbed59cf2c5729cc2509e013f8a7ee377f..6c5a3714b4605beaad7cfb7b24014da30ad3190d 100644 --- a/profiles/wcm_base/modules/custom/ocio_media/ocio_media.features.inc +++ b/profiles/wcm_base/modules/custom/ocio_media/ocio_media.features.inc @@ -119,6 +119,27 @@ function ocio_media_views_default_views_alter(&$data) { 'type' => 'select', 'vocabulary' => 'wcm_file_tags', ); /* WAS: '' */ + $data['media_default']->display['default']->display_options['filters']['schema_type'] = array( + 'id' => 'schema_type', + 'table' => 'file_managed', + 'field' => 'schema_type', + 'exposed' => TRUE, + 'expose' => array( + 'operator_id' => 'schema_type_op', + 'label' => 'Storage', + 'operator' => 'schema_type_op', + 'identifier' => 'schema_type', + 'remember_roles' => array( + 2 => 2, + 1 => 0, + 5 => 0, + 4 => 0, + 7 => 0, + 6 => 0, + 3 => 0, + ), + ), + ); /* WAS: '' */ $data['media_default']->display['media_browser_my_files']->display_options['filters']['field_file_tags_tid'] = array( 'id' => 'field_file_tags_tid', 'table' => 'field_data_field_file_tags', @@ -142,5 +163,26 @@ function ocio_media_views_default_views_alter(&$data) { 'type' => 'select', 'vocabulary' => 'wcm_file_tags', ); /* WAS: '' */ + $data['media_default']->display['media_browser_my_files']->display_options['filters']['schema_type'] = array( + 'id' => 'schema_type', + 'table' => 'file_managed', + 'field' => 'schema_type', + 'exposed' => TRUE, + 'expose' => array( + 'operator_id' => 'schema_type_op', + 'label' => 'Storage', + 'operator' => 'schema_type_op', + 'identifier' => 'schema_type', + 'remember_roles' => array( + 2 => 2, + 1 => 0, + 5 => 0, + 4 => 0, + 7 => 0, + 6 => 0, + 3 => 0, + ), + ), + ); /* WAS: '' */ } } diff --git a/profiles/wcm_base/modules/custom/ocio_media/ocio_media.info b/profiles/wcm_base/modules/custom/ocio_media/ocio_media.info index 0a4dce845928a5a35d8f81a25ce227bf71964d93..ca3d8172924d76c4a72148143cd21869042e8bde 100644 --- a/profiles/wcm_base/modules/custom/ocio_media/ocio_media.info +++ b/profiles/wcm_base/modules/custom/ocio_media/ocio_media.info @@ -72,7 +72,9 @@ features[features_overrides][] = file_type.document.disabled features[features_overrides][] = file_type.image.disabled features[features_overrides][] = file_type.video.disabled features[features_overrides][] = views_view.media_default.display|default|display_options|filters|field_file_tags_tid +features[features_overrides][] = views_view.media_default.display|default|display_options|filters|schema_type features[features_overrides][] = views_view.media_default.display|media_browser_my_files|display_options|filters|field_file_tags_tid +features[features_overrides][] = views_view.media_default.display|media_browser_my_files|display_options|filters|schema_type features[field_instance][] = file-document-field_file_description features[field_instance][] = file-image-field_basic_image_caption features[field_instance][] = file-image-field_file_description diff --git a/profiles/wcm_base/modules/custom/ocio_media/ocio_media.strongarm.inc b/profiles/wcm_base/modules/custom/ocio_media/ocio_media.strongarm.inc index d55487260047dc68bc52c494a16b7683bf6beee3..7c68da298d153df44e2e922e3bd7cb2aff9993e1 100644 --- a/profiles/wcm_base/modules/custom/ocio_media/ocio_media.strongarm.inc +++ b/profiles/wcm_base/modules/custom/ocio_media/ocio_media.strongarm.inc @@ -301,7 +301,7 @@ function ocio_media_strongarm() { $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ $strongarm->api_version = 1; $strongarm->name = 'file_entity_file_upload_wizard_skip_scheme'; - $strongarm->value = 1; + $strongarm->value = 0; $export['file_entity_file_upload_wizard_skip_scheme'] = $strongarm; $strongarm = new stdClass(); diff --git a/profiles/wcm_base/modules/custom/ocio_news/ocio_news.info b/profiles/wcm_base/modules/custom/ocio_news/ocio_news.info index fef1203aa181621ac889f961ef20fe683993f535..b1aa6822698216a6438c02543d145859b3b2dffd 100644 --- a/profiles/wcm_base/modules/custom/ocio_news/ocio_news.info +++ b/profiles/wcm_base/modules/custom/ocio_news/ocio_news.info @@ -50,6 +50,7 @@ features[variable][] = menu_parent_article features[variable][] = node_options_article features[variable][] = node_preview_article features[variable][] = node_submitted_article +features[variable][] = private_article features[variable][] = workbench_moderation_default_state_article features[views_view][] = ocio_news_archive features_exclude[field_instance][node-article-field_tags] = node-article-field_tags diff --git a/profiles/wcm_base/modules/custom/ocio_news/ocio_news.strongarm.inc b/profiles/wcm_base/modules/custom/ocio_news/ocio_news.strongarm.inc index 37adeff8d0f13fdd614313c2568895fcc7038986..d82187c1f15cf1162c2e2efde4c309999afa829d 100644 --- a/profiles/wcm_base/modules/custom/ocio_news/ocio_news.strongarm.inc +++ b/profiles/wcm_base/modules/custom/ocio_news/ocio_news.strongarm.inc @@ -104,6 +104,13 @@ function ocio_news_strongarm() { $strongarm->value = 1; $export['node_submitted_article'] = $strongarm; + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'private_article'; + $strongarm->value = '1'; + $export['private_article'] = $strongarm; + $strongarm = new stdClass(); $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ $strongarm->api_version = 1; diff --git a/profiles/wcm_base/modules/custom/ocio_panels_settings/ocio_panels_settings.module b/profiles/wcm_base/modules/custom/ocio_panels_settings/ocio_panels_settings.module index 11047bb828b1250fba0c0e94498aff72c7652327..5accef0fa9b81f8e909a395581f3ba33823267e5 100644 --- a/profiles/wcm_base/modules/custom/ocio_panels_settings/ocio_panels_settings.module +++ b/profiles/wcm_base/modules/custom/ocio_panels_settings/ocio_panels_settings.module @@ -143,3 +143,37 @@ function ocio_panels_settings_preprocess_panels_add_content_modal(&$vars) { } */ +/* + * Implements hook_form_FORM_ID_alter(). + * + * Make private node field accessible to non-administrators. + */ +function ocio_panels_settings_form_node_form_alter(&$form, &$form_state) { + if (!empty($form['private'])) { + $access = user_access('edit private content') && user_access('mark content as private'); + + if ($access) { + $form['options']['#access'] = $access; + $form['options']['private'] = $form['private']; + unset($form['options']['private']['#weight']); + unset($form['private']); + } + } + + if (!empty($form['options']['private'])) { + $form['options']['private']['#title'] = t('Make this content private'); + } +} + +/* + * Implements hook_module_implements_alter(). + * + * Force the above form alter hook to execute after the Private module's hook. + */ +function ocio_panels_settings_module_implements_alter(&$implementations, $hook) { + if ($hook == 'form_alter' && isset($implementations['ocio_panels_settings'], $implementations['private'])) { + $group = $implementations['ocio_panels_settings']; + unset($implementations['ocio_panels_settings']); + $implementations['ocio_panels_settings'] = $group; + } +} diff --git a/profiles/wcm_base/modules/custom/ocio_permissions/ocio_permissions.features.inc b/profiles/wcm_base/modules/custom/ocio_permissions/ocio_permissions.features.inc index 05a4b0467a10121aa2c87038dc553b52b951f88d..6ce9a77f98f25bd20c27e5cd52d92caec725991e 100644 --- a/profiles/wcm_base/modules/custom/ocio_permissions/ocio_permissions.features.inc +++ b/profiles/wcm_base/modules/custom/ocio_permissions/ocio_permissions.features.inc @@ -1,3 +1,14 @@ <?php +/** + * @file + * ocio_permissions.features.inc + */ -// This file is deprecated and can be removed. +/** + * Implements hook_ctools_plugin_api(). + */ +function ocio_permissions_ctools_plugin_api($module = NULL, $api = NULL) { + if ($module == "strongarm" && $api == "strongarm") { + return array("version" => "1"); + } +} diff --git a/profiles/wcm_base/modules/custom/ocio_permissions/ocio_permissions.features.user_permission.inc b/profiles/wcm_base/modules/custom/ocio_permissions/ocio_permissions.features.user_permission.inc index d8f1923878034f04fe92c6ddf1b31770bbe88c89..09a911e01dab1ee27d60f9579e9944d5e6d99c2d 100644 --- a/profiles/wcm_base/modules/custom/ocio_permissions/ocio_permissions.features.user_permission.inc +++ b/profiles/wcm_base/modules/custom/ocio_permissions/ocio_permissions.features.user_permission.inc @@ -24,8 +24,10 @@ function ocio_permissions_user_default_permissions() { 'name' => 'access administration pages', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'contributor' => 'contributor', 'editor' => 'editor', + 'site builder' => 'site builder', + 'site manager' => 'site manager', ), 'module' => 'system', ); @@ -44,7 +46,10 @@ function ocio_permissions_user_default_permissions() { 'name' => 'access all webform results', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'contributor' => 'contributor', + 'editor' => 'editor', + 'site builder' => 'site builder', + 'site manager' => 'site manager', ), 'module' => 'webform', ); @@ -105,7 +110,8 @@ function ocio_permissions_user_default_permissions() { 'name' => 'access navbar', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'contributor' => 'contributor', + 'editor' => 'editor', 'site builder' => 'site builder', 'site manager' => 'site manager', ), @@ -183,12 +189,27 @@ function ocio_permissions_user_default_permissions() { 'module' => 'book', ); + // Exported permission: 'access private content'. + $permissions['access private content'] = array( + 'name' => 'access private content', + 'roles' => array( + 'administrator' => 'administrator', + 'contributor' => 'contributor', + 'editor' => 'editor', + 'private content viewer' => 'private content viewer', + 'site builder' => 'site builder', + 'site manager' => 'site manager', + ), + 'module' => 'private', + ); + // Exported permission: 'access site in maintenance mode'. $permissions['access site in maintenance mode'] = array( 'name' => 'access site in maintenance mode', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'site builder' => 'site builder', + 'site manager' => 'site manager', ), 'module' => 'system', ); @@ -207,7 +228,10 @@ function ocio_permissions_user_default_permissions() { 'name' => 'access workbench', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'contributor' => 'contributor', + 'editor' => 'editor', + 'site builder' => 'site builder', + 'site manager' => 'site manager', ), 'module' => 'workbench', ); @@ -721,15 +745,6 @@ function ocio_permissions_user_default_permissions() { 'module' => 'panelizer', ); - // Exported permission: 'administer panelizer taxonomy_term ocio_tags defaults'. - $permissions['administer panelizer taxonomy_term ocio_tags defaults'] = array( - 'name' => 'administer panelizer taxonomy_term ocio_tags defaults', - 'roles' => array( - 'administrator' => 'administrator', - ), - 'module' => 'panelizer', - ); - // Exported permission: 'administer panelizer taxonomy_term panopoly_categories breadcrumbs'. $permissions['administer panelizer taxonomy_term panopoly_categories breadcrumbs'] = array( 'name' => 'administer panelizer taxonomy_term panopoly_categories breadcrumbs', @@ -793,33 +808,6 @@ function ocio_permissions_user_default_permissions() { 'module' => 'panelizer', ); - // Exported permission: 'administer panelizer taxonomy_term wcm_file_tags defaults'. - $permissions['administer panelizer taxonomy_term wcm_file_tags defaults'] = array( - 'name' => 'administer panelizer taxonomy_term wcm_file_tags defaults', - 'roles' => array( - 'administrator' => 'administrator', - ), - 'module' => 'panelizer', - ); - - // Exported permission: 'administer panelizer taxonomy_term wcm_user_contact_group defaults'. - $permissions['administer panelizer taxonomy_term wcm_user_contact_group defaults'] = array( - 'name' => 'administer panelizer taxonomy_term wcm_user_contact_group defaults', - 'roles' => array( - 'administrator' => 'administrator', - ), - 'module' => 'panelizer', - ); - - // Exported permission: 'administer panelizer taxonomy_term wcm_user_leadership_group defaults'. - $permissions['administer panelizer taxonomy_term wcm_user_leadership_group defaults'] = array( - 'name' => 'administer panelizer taxonomy_term wcm_user_leadership_group defaults', - 'roles' => array( - 'administrator' => 'administrator', - ), - 'module' => 'panelizer', - ); - // Exported permission: 'administer panelizer user user breadcrumbs'. $permissions['administer panelizer user user breadcrumbs'] = array( 'name' => 'administer panelizer user user breadcrumbs', @@ -910,6 +898,15 @@ function ocio_permissions_user_default_permissions() { 'module' => 'pathauto', ); + // Exported permission: 'administer private files download permission'. + $permissions['administer private files download permission'] = array( + 'name' => 'administer private files download permission', + 'roles' => array( + 'administrator' => 'administrator', + ), + 'module' => 'private_files_download_permission', + ); + // Exported permission: 'administer realname'. $permissions['administer realname'] = array( 'name' => 'administer realname', @@ -1101,6 +1098,29 @@ function ocio_permissions_user_default_permissions() { 'module' => 'node', ); + // Exported permission: 'bypass private files download permission'. + $permissions['bypass private files download permission'] = array( + 'name' => 'bypass private files download permission', + 'roles' => array( + 'administrator' => 'administrator', + 'contributor' => 'contributor', + 'editor' => 'editor', + 'private content viewer' => 'private content viewer', + 'site builder' => 'site builder', + 'site manager' => 'site manager', + ), + 'module' => 'private_files_download_permission', + ); + + // Exported permission: 'bypass private files download permission for temporary files'. + $permissions['bypass private files download permission for temporary files'] = array( + 'name' => 'bypass private files download permission for temporary files', + 'roles' => array( + 'administrator' => 'administrator', + ), + 'module' => 'private_files_download_permission', + ); + // Exported permission: 'bypass workbench moderation'. $permissions['bypass workbench moderation'] = array( 'name' => 'bypass workbench moderation', @@ -1179,7 +1199,10 @@ function ocio_permissions_user_default_permissions() { 'name' => 'create basic_page content', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'contributor' => 'contributor', + 'editor' => 'editor', + 'site builder' => 'site builder', + 'site manager' => 'site manager', ), 'module' => 'node', ); @@ -1354,7 +1377,9 @@ function ocio_permissions_user_default_permissions() { 'name' => 'create files', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'editor' => 'editor', + 'site builder' => 'site builder', + 'site manager' => 'site manager', ), 'module' => 'file_entity', ); @@ -1399,7 +1424,6 @@ function ocio_permissions_user_default_permissions() { 'name' => 'create web_form content', 'roles' => array( 'administrator' => 'administrator', - 'editor' => 'editor', 'site builder' => 'site builder', 'site manager' => 'site manager', ), @@ -1561,7 +1585,6 @@ function ocio_permissions_user_default_permissions() { 'name' => 'delete any web_form content', 'roles' => array( 'administrator' => 'administrator', - 'editor' => 'editor', 'site builder' => 'site builder', 'site manager' => 'site manager', ), @@ -1816,7 +1839,6 @@ function ocio_permissions_user_default_permissions() { 'name' => 'delete own web_form content', 'roles' => array( 'administrator' => 'administrator', - 'editor' => 'editor', 'site builder' => 'site builder', 'site manager' => 'site manager', ), @@ -2122,7 +2144,6 @@ function ocio_permissions_user_default_permissions() { 'name' => 'edit any web_form content', 'roles' => array( 'administrator' => 'administrator', - 'editor' => 'editor', 'site builder' => 'site builder', 'site manager' => 'site manager', ), @@ -2285,7 +2306,10 @@ function ocio_permissions_user_default_permissions() { 'name' => 'edit own basic_page content', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'contributor' => 'contributor', + 'editor' => 'editor', + 'site builder' => 'site builder', + 'site manager' => 'site manager', ), 'module' => 'node', ); @@ -2385,7 +2409,6 @@ function ocio_permissions_user_default_permissions() { 'name' => 'edit own web_form content', 'roles' => array( 'administrator' => 'administrator', - 'editor' => 'editor', 'site builder' => 'site builder', 'site manager' => 'site manager', ), @@ -2401,6 +2424,19 @@ function ocio_permissions_user_default_permissions() { 'module' => 'webform', ); + // Exported permission: 'edit private content'. + $permissions['edit private content'] = array( + 'name' => 'edit private content', + 'roles' => array( + 'administrator' => 'administrator', + 'contributor' => 'contributor', + 'editor' => 'editor', + 'site builder' => 'site builder', + 'site manager' => 'site manager', + ), + 'module' => 'private', + ); + // Exported permission: 'edit terms in ocio_tags'. $permissions['edit terms in ocio_tags'] = array( 'name' => 'edit terms in ocio_tags', @@ -2472,7 +2508,7 @@ function ocio_permissions_user_default_permissions() { 'name' => 'enter article revision log entry', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'contributor' => 'contributor', 'editor' => 'editor', 'site builder' => 'site builder', 'site manager' => 'site manager', @@ -2485,7 +2521,7 @@ function ocio_permissions_user_default_permissions() { 'name' => 'enter basic_page revision log entry', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'contributor' => 'contributor', 'editor' => 'editor', 'site builder' => 'site builder', 'site manager' => 'site manager', @@ -2498,7 +2534,9 @@ function ocio_permissions_user_default_permissions() { 'name' => 'enter book_page revision log entry', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'editor' => 'editor', + 'site builder' => 'site builder', + 'site manager' => 'site manager', ), 'module' => 'override_node_options', ); @@ -2508,7 +2546,9 @@ function ocio_permissions_user_default_permissions() { 'name' => 'enter calendar_entry revision log entry', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'editor' => 'editor', + 'site builder' => 'site builder', + 'site manager' => 'site manager', ), 'module' => 'override_node_options', ); @@ -2518,7 +2558,6 @@ function ocio_permissions_user_default_permissions() { 'name' => 'enter faq revision log entry', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', 'editor' => 'editor', 'site builder' => 'site builder', 'site manager' => 'site manager', @@ -2598,6 +2637,19 @@ function ocio_permissions_user_default_permissions() { 'module' => 'features', ); + // Exported permission: 'mark content as private'. + $permissions['mark content as private'] = array( + 'name' => 'mark content as private', + 'roles' => array( + 'administrator' => 'administrator', + 'contributor' => 'contributor', + 'editor' => 'editor', + 'site builder' => 'site builder', + 'site manager' => 'site manager', + ), + 'module' => 'private', + ); + // Exported permission: 'moderate content from draft to needs_review'. $permissions['moderate content from draft to needs_review'] = array( 'name' => 'moderate content from draft to needs_review', @@ -2648,6 +2700,18 @@ function ocio_permissions_user_default_permissions() { 'module' => 'workbench_moderation', ); + // Exported permission: 'moderate content from published to draft'. + $permissions['moderate content from published to draft'] = array( + 'name' => 'moderate content from published to draft', + 'roles' => array( + 'administrator' => 'administrator', + 'editor' => 'editor', + 'site builder' => 'site builder', + 'site manager' => 'site manager', + ), + 'module' => 'workbench_moderation', + ); + // Exported permission: 'modify ocio theme'. $permissions['modify ocio theme'] = array( 'name' => 'modify ocio theme', @@ -2691,7 +2755,7 @@ function ocio_permissions_user_default_permissions() { 'name' => 'override article authored by option', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'contributor' => 'contributor', 'editor' => 'editor', 'site builder' => 'site builder', 'site manager' => 'site manager', @@ -2704,7 +2768,7 @@ function ocio_permissions_user_default_permissions() { 'name' => 'override article authored on option', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'contributor' => 'contributor', 'editor' => 'editor', 'site builder' => 'site builder', 'site manager' => 'site manager', @@ -2753,7 +2817,7 @@ function ocio_permissions_user_default_permissions() { 'name' => 'override basic_page authored by option', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'contributor' => 'contributor', 'editor' => 'editor', 'site builder' => 'site builder', 'site manager' => 'site manager', @@ -2766,7 +2830,7 @@ function ocio_permissions_user_default_permissions() { 'name' => 'override basic_page authored on option', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'contributor' => 'contributor', 'editor' => 'editor', 'site builder' => 'site builder', 'site manager' => 'site manager', @@ -2815,7 +2879,9 @@ function ocio_permissions_user_default_permissions() { 'name' => 'override book_page authored by option', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'editor' => 'editor', + 'site builder' => 'site builder', + 'site manager' => 'site manager', ), 'module' => 'override_node_options', ); @@ -2825,7 +2891,9 @@ function ocio_permissions_user_default_permissions() { 'name' => 'override book_page authored on option', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'editor' => 'editor', + 'site builder' => 'site builder', + 'site manager' => 'site manager', ), 'module' => 'override_node_options', ); @@ -2871,7 +2939,9 @@ function ocio_permissions_user_default_permissions() { 'name' => 'override calendar_entry authored by option', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'editor' => 'editor', + 'site builder' => 'site builder', + 'site manager' => 'site manager', ), 'module' => 'override_node_options', ); @@ -2881,7 +2951,9 @@ function ocio_permissions_user_default_permissions() { 'name' => 'override calendar_entry authored on option', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'editor' => 'editor', + 'site builder' => 'site builder', + 'site manager' => 'site manager', ), 'module' => 'override_node_options', ); @@ -2927,7 +2999,6 @@ function ocio_permissions_user_default_permissions() { 'name' => 'override faq authored by option', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', 'editor' => 'editor', 'site builder' => 'site builder', 'site manager' => 'site manager', @@ -2940,7 +3011,6 @@ function ocio_permissions_user_default_permissions() { 'name' => 'override faq authored on option', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', 'editor' => 'editor', 'site builder' => 'site builder', 'site manager' => 'site manager', @@ -3325,7 +3395,6 @@ function ocio_permissions_user_default_permissions() { 'name' => 'use pasteformat', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', 'contributor' => 'contributor', 'editor' => 'editor', 'site builder' => 'site builder', @@ -3379,7 +3448,10 @@ function ocio_permissions_user_default_permissions() { 'name' => 'use workbench_media add form', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'contributor' => 'contributor', + 'editor' => 'editor', + 'site builder' => 'site builder', + 'site manager' => 'site manager', ), 'module' => 'workbench_media', ); @@ -3447,7 +3519,6 @@ function ocio_permissions_user_default_permissions() { 'name' => 'view moderation history', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', 'editor' => 'editor', 'site builder' => 'site builder', 'site manager' => 'site manager', @@ -3460,7 +3531,9 @@ function ocio_permissions_user_default_permissions() { 'name' => 'view moderation messages', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'editor' => 'editor', + 'site builder' => 'site builder', + 'site manager' => 'site manager', ), 'module' => 'workbench_moderation', ); @@ -3480,6 +3553,9 @@ function ocio_permissions_user_default_permissions() { 'name' => 'view own private files', 'roles' => array( 'administrator' => 'administrator', + 'editor' => 'editor', + 'site builder' => 'site builder', + 'site manager' => 'site manager', ), 'module' => 'file_entity', ); @@ -3513,6 +3589,11 @@ function ocio_permissions_user_default_permissions() { 'name' => 'view private files', 'roles' => array( 'administrator' => 'administrator', + 'contributor' => 'contributor', + 'editor' => 'editor', + 'private content viewer' => 'private content viewer', + 'site builder' => 'site builder', + 'site manager' => 'site manager', ), 'module' => 'file_entity', ); @@ -3534,7 +3615,10 @@ function ocio_permissions_user_default_permissions() { 'name' => 'view the administration theme', 'roles' => array( 'administrator' => 'administrator', - 'authenticated user' => 'authenticated user', + 'contributor' => 'contributor', + 'editor' => 'editor', + 'site builder' => 'site builder', + 'site manager' => 'site manager', ), 'module' => 'system', ); diff --git a/profiles/wcm_base/modules/custom/ocio_permissions/ocio_permissions.info b/profiles/wcm_base/modules/custom/ocio_permissions/ocio_permissions.info index 3f7d509bcea9a5da531557457218ee27263be482..f93ab808f8390b0cc624c7f6dc1420ed22fa6b8f 100644 --- a/profiles/wcm_base/modules/custom/ocio_permissions/ocio_permissions.info +++ b/profiles/wcm_base/modules/custom/ocio_permissions/ocio_permissions.info @@ -4,6 +4,7 @@ core = 7.x package = OCIO Configuration version = 7.x-1.0 project = ocio_permissions +dependencies[] = administerusersbyrole dependencies[] = aggregator dependencies[] = block dependencies[] = book @@ -49,11 +50,13 @@ dependencies[] = path dependencies[] = pathauto dependencies[] = realname dependencies[] = responsive_menus +dependencies[] = role_delegation dependencies[] = search dependencies[] = search_api dependencies[] = shortcut dependencies[] = simplesamlphp_auth dependencies[] = simplify +dependencies[] = strongarm dependencies[] = superfish dependencies[] = system dependencies[] = tablefield @@ -66,6 +69,7 @@ dependencies[] = webform dependencies[] = workbench dependencies[] = workbench_media dependencies[] = workbench_moderation +features[ctools][] = strongarm:strongarm:1 features[features_api][] = api:2 features[user_permission][] = access admin lock features[user_permission][] = access administration pages @@ -84,6 +88,7 @@ features[user_permission][] = access own consumers features[user_permission][] = access own webform results features[user_permission][] = access own webform submissions features[user_permission][] = access printer-friendly version +features[user_permission][] = access private content features[user_permission][] = access site in maintenance mode features[user_permission][] = access site reports features[user_permission][] = access workbench @@ -141,7 +146,6 @@ features[user_permission][] = administer panelizer node ocio_landing_page defaul features[user_permission][] = administer panelizer node ocio_landing_page layout features[user_permission][] = administer panelizer node ocio_landing_page overview features[user_permission][] = administer panelizer node ocio_landing_page settings -features[user_permission][] = administer panelizer taxonomy_term ocio_tags defaults features[user_permission][] = administer panelizer taxonomy_term panopoly_categories breadcrumbs features[user_permission][] = administer panelizer taxonomy_term panopoly_categories content features[user_permission][] = administer panelizer taxonomy_term panopoly_categories context @@ -149,9 +153,6 @@ features[user_permission][] = administer panelizer taxonomy_term panopoly_catego features[user_permission][] = administer panelizer taxonomy_term panopoly_categories layout features[user_permission][] = administer panelizer taxonomy_term panopoly_categories overview features[user_permission][] = administer panelizer taxonomy_term panopoly_categories settings -features[user_permission][] = administer panelizer taxonomy_term wcm_file_tags defaults -features[user_permission][] = administer panelizer taxonomy_term wcm_user_contact_group defaults -features[user_permission][] = administer panelizer taxonomy_term wcm_user_leadership_group defaults features[user_permission][] = administer panelizer user user breadcrumbs features[user_permission][] = administer panelizer user user content features[user_permission][] = administer panelizer user user context @@ -162,6 +163,7 @@ features[user_permission][] = administer panelizer user user settings features[user_permission][] = administer panels layouts features[user_permission][] = administer panels styles features[user_permission][] = administer pathauto +features[user_permission][] = administer private files download permission features[user_permission][] = administer realname features[user_permission][] = administer responsive menus features[user_permission][] = administer search @@ -183,6 +185,8 @@ features[user_permission][] = administer workbench moderation features[user_permission][] = block IP addresses features[user_permission][] = bypass file access features[user_permission][] = bypass node access +features[user_permission][] = bypass private files download permission +features[user_permission][] = bypass private files download permission for temporary files features[user_permission][] = bypass workbench moderation features[user_permission][] = change layouts in place editing features[user_permission][] = clear all caches @@ -301,6 +305,7 @@ features[user_permission][] = edit own ocio_landing_page content features[user_permission][] = edit own video files features[user_permission][] = edit own web_form content features[user_permission][] = edit own webform submissions +features[user_permission][] = edit private content features[user_permission][] = edit terms in ocio_tags features[user_permission][] = edit terms in panopoly_categories features[user_permission][] = edit terms in wcm_file_tags @@ -319,10 +324,12 @@ features[user_permission][] = execute php code features[user_permission][] = export tablefield features[user_permission][] = generate features features[user_permission][] = manage features +features[user_permission][] = mark content as private features[user_permission][] = moderate content from draft to needs_review features[user_permission][] = moderate content from draft to published features[user_permission][] = moderate content from needs_review to draft features[user_permission][] = moderate content from needs_review to published +features[user_permission][] = moderate content from published to draft features[user_permission][] = modify ocio theme features[user_permission][] = notify of path changes features[user_permission][] = oauth authorize any consumers @@ -411,5 +418,8 @@ features[user_permission][] = view pane admin links features[user_permission][] = view private files features[user_permission][] = view revisions features[user_permission][] = view the administration theme +features[variable][] = private_files_download_permission_by_user_checks features_exclude[dependencies][defaultconfig] = defaultconfig features_exclude[dependencies][defaultcontent] = defaultcontent +features_exclude[dependencies][private] = private +features_exclude[dependencies][private_files_download_permission] = private_files_download_permission diff --git a/profiles/wcm_base/modules/custom/ocio_permissions/ocio_permissions.module b/profiles/wcm_base/modules/custom/ocio_permissions/ocio_permissions.module index 44788b071e42418f461724a48cea5cd1f0b6e429..68a8ed7a7bc0245b5c3f42d592deca7445e0d7fa 100644 --- a/profiles/wcm_base/modules/custom/ocio_permissions/ocio_permissions.module +++ b/profiles/wcm_base/modules/custom/ocio_permissions/ocio_permissions.module @@ -1,5 +1,7 @@ <?php /** * @file - * Drupal needs this blank file. + * Code for the OCIO Permissions feature. */ + +include_once 'ocio_permissions.features.inc'; diff --git a/profiles/wcm_base/modules/custom/ocio_permissions/ocio_permissions.strongarm.inc b/profiles/wcm_base/modules/custom/ocio_permissions/ocio_permissions.strongarm.inc index cf8bcfdf1bd29a1f0cc66aa259e8ccb0c33ef774..8c93dc632d323a3c1f7208d1e580f6609c04f4f0 100644 --- a/profiles/wcm_base/modules/custom/ocio_permissions/ocio_permissions.strongarm.inc +++ b/profiles/wcm_base/modules/custom/ocio_permissions/ocio_permissions.strongarm.inc @@ -13,16 +13,9 @@ function ocio_permissions_strongarm() { $strongarm = new stdClass(); $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ $strongarm->api_version = 1; - $strongarm->name = 'pasteformat_cleanup_format'; - $strongarm->value = 'filtered_html'; - $export['pasteformat_cleanup_format'] = $strongarm; - - $strongarm = new stdClass(); - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ - $strongarm->api_version = 1; - $strongarm->name = 'pasteformat_message_success'; - $strongarm->value = ''; - $export['pasteformat_message_success'] = $strongarm; + $strongarm->name = 'private_files_download_permission_by_user_checks'; + $strongarm->value = 0; + $export['private_files_download_permission_by_user_checks'] = $strongarm; return $export; } diff --git a/profiles/wcm_base/modules/custom/ocio_user_config/ocio_user_config.features.user_permission.inc b/profiles/wcm_base/modules/custom/ocio_user_config/ocio_user_config.features.user_permission.inc index 8e232e7209242e1b67fab6c1574b17ebced6f581..6739f4ba0271b7eb2399f38792d50dff196916d6 100644 --- a/profiles/wcm_base/modules/custom/ocio_user_config/ocio_user_config.features.user_permission.inc +++ b/profiles/wcm_base/modules/custom/ocio_user_config/ocio_user_config.features.user_permission.inc @@ -90,6 +90,17 @@ function ocio_user_config_user_default_permissions() { 'module' => 'role_delegation', ); + // Exported permission: 'assign private content viewer role'. + $permissions['assign private content viewer role'] = array( + 'name' => 'assign private content viewer role', + 'roles' => array( + 'administrator' => 'administrator', + 'site builder' => 'site builder', + 'site manager' => 'site manager', + ), + 'module' => 'role_delegation', + ); + // Exported permission: 'assign site builder role'. $permissions['assign site builder role'] = array( 'name' => 'assign site builder role', @@ -165,6 +176,15 @@ function ocio_user_config_user_default_permissions() { 'module' => 'administerusersbyrole', ); + // Exported permission: 'cancel users with role 8'. + $permissions['cancel users with role 8'] = array( + 'name' => 'cancel users with role 8', + 'roles' => array( + 'administrator' => 'administrator', + ), + 'module' => 'administerusersbyrole', + ); + // Exported permission: 'change own username'. $permissions['change own username'] = array( 'name' => 'change own username', @@ -224,6 +244,7 @@ function ocio_user_config_user_default_permissions() { 'roles' => array( 'administrator' => 'administrator', 'site builder' => 'site builder', + 'site manager' => 'site manager', ), 'module' => 'administerusersbyrole', ); @@ -239,6 +260,17 @@ function ocio_user_config_user_default_permissions() { 'module' => 'administerusersbyrole', ); + // Exported permission: 'edit users with role 8'. + $permissions['edit users with role 8'] = array( + 'name' => 'edit users with role 8', + 'roles' => array( + 'administrator' => 'administrator', + 'site builder' => 'site builder', + 'site manager' => 'site manager', + ), + 'module' => 'administerusersbyrole', + ); + // Exported permission: 'select account cancellation method'. $permissions['select account cancellation method'] = array( 'name' => 'select account cancellation method', diff --git a/profiles/wcm_base/modules/custom/ocio_user_config/ocio_user_config.features.user_role.inc b/profiles/wcm_base/modules/custom/ocio_user_config/ocio_user_config.features.user_role.inc index ffe4dcda8616458c04f92e82a70b173c919b06d5..e26151a7d9da9866666b4b7c714b990f3e4098ef 100644 --- a/profiles/wcm_base/modules/custom/ocio_user_config/ocio_user_config.features.user_role.inc +++ b/profiles/wcm_base/modules/custom/ocio_user_config/ocio_user_config.features.user_role.inc @@ -28,6 +28,12 @@ function ocio_user_config_user_default_roles() { 'weight' => 4, ); + // Exported role: private content viewer. + $roles['private content viewer'] = array( + 'name' => 'private content viewer', + 'weight' => 2, + ); + // Exported role: site builder. $roles['site builder'] = array( 'name' => 'site builder', diff --git a/profiles/wcm_base/modules/custom/ocio_user_config/ocio_user_config.info b/profiles/wcm_base/modules/custom/ocio_user_config/ocio_user_config.info index 2620d2656ca8b12358e405931fd2a5fbf98d668f..3ff099c53e9b1cf5193a141d67902c7065d9322e 100644 --- a/profiles/wcm_base/modules/custom/ocio_user_config/ocio_user_config.info +++ b/profiles/wcm_base/modules/custom/ocio_user_config/ocio_user_config.info @@ -23,6 +23,7 @@ features[user_permission][] = administer users features[user_permission][] = assign all roles features[user_permission][] = assign contributor role features[user_permission][] = assign editor role +features[user_permission][] = assign private content viewer role features[user_permission][] = assign site builder role features[user_permission][] = assign site manager role features[user_permission][] = cancel account @@ -31,6 +32,7 @@ features[user_permission][] = cancel users with role 4 features[user_permission][] = cancel users with role 5 features[user_permission][] = cancel users with role 6 features[user_permission][] = cancel users with role 7 +features[user_permission][] = cancel users with role 8 features[user_permission][] = change own username features[user_permission][] = create users features[user_permission][] = edit users with role 2 @@ -38,10 +40,12 @@ features[user_permission][] = edit users with role 4 features[user_permission][] = edit users with role 5 features[user_permission][] = edit users with role 6 features[user_permission][] = edit users with role 7 +features[user_permission][] = edit users with role 8 features[user_permission][] = select account cancellation method features[user_role][] = administrator features[user_role][] = contributor features[user_role][] = editor +features[user_role][] = private content viewer features[user_role][] = site builder features[user_role][] = site manager features[variable][] = views_defaults diff --git a/profiles/wcm_base/modules/custom/ocio_web_form/ocio_web_form.info b/profiles/wcm_base/modules/custom/ocio_web_form/ocio_web_form.info index 39e47b948fe379b686fe97ef09f10e996228550a..185c1f1e1613a6b9f023e23ef69a1b731312c570 100644 --- a/profiles/wcm_base/modules/custom/ocio_web_form/ocio_web_form.info +++ b/profiles/wcm_base/modules/custom/ocio_web_form/ocio_web_form.info @@ -27,6 +27,7 @@ features[variable][] = menu_parent_web_form features[variable][] = node_options_web_form features[variable][] = node_preview_web_form features[variable][] = node_submitted_web_form +features[variable][] = private_web_form features[variable][] = webform_node_web_form features[variable][] = workbench_moderation_default_state_web_form features_exclude[field_base][body] = body diff --git a/profiles/wcm_base/modules/custom/ocio_web_form/ocio_web_form.strongarm.inc b/profiles/wcm_base/modules/custom/ocio_web_form/ocio_web_form.strongarm.inc index b09c2a859c1f089aa0a17f9a348fe2a71e299227..64cfb5349c870cbc7cb2961d638add0c12053630 100644 --- a/profiles/wcm_base/modules/custom/ocio_web_form/ocio_web_form.strongarm.inc +++ b/profiles/wcm_base/modules/custom/ocio_web_form/ocio_web_form.strongarm.inc @@ -119,6 +119,13 @@ function ocio_web_form_strongarm() { $strongarm->value = 0; $export['node_submitted_web_form'] = $strongarm; + $strongarm = new stdClass(); + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ + $strongarm->api_version = 1; + $strongarm->name = 'private_web_form'; + $strongarm->value = '1'; + $export['private_web_form'] = $strongarm; + $strongarm = new stdClass(); $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ $strongarm->api_version = 1; diff --git a/profiles/wcm_base/modules/custom/ocio_workbench/ocio_workbench.features.workbench_moderation_transitions.inc b/profiles/wcm_base/modules/custom/ocio_workbench/ocio_workbench.features.workbench_moderation_transitions.inc index 6b58c5d3f8b322c1cee40a4c39451c0696fa9ddd..b9ea7de4bd408a70a49c123b06c2b32eb1156a23 100644 --- a/profiles/wcm_base/modules/custom/ocio_workbench/ocio_workbench.features.workbench_moderation_transitions.inc +++ b/profiles/wcm_base/modules/custom/ocio_workbench/ocio_workbench.features.workbench_moderation_transitions.inc @@ -29,6 +29,11 @@ function ocio_workbench_workbench_moderation_export_transitions() { 'to_name' => 'published', 'name' => 'Publish', ), + 'published:draft' => array( + 'from_name' => 'published', + 'to_name' => 'draft', + 'name' => 'Unpublish', + ), ); return $items; } diff --git a/profiles/wcm_base/modules/custom/ocio_workbench/ocio_workbench.info b/profiles/wcm_base/modules/custom/ocio_workbench/ocio_workbench.info index c28dc2368f4705728fcd3131ad2499095e8cdff1..ff6f8b2e1d916c987d80076c783256410e22e080 100644 --- a/profiles/wcm_base/modules/custom/ocio_workbench/ocio_workbench.info +++ b/profiles/wcm_base/modules/custom/ocio_workbench/ocio_workbench.info @@ -10,6 +10,8 @@ dependencies[] = views dependencies[] = workbench dependencies[] = workbench_media dependencies[] = workbench_moderation +dependencies[] = workbench_moderation +dependencies[] = workbench_moderation features[ctools][] = views:views_default:3.0 features[features_api][] = api:2 features[features_override_items][] = views_view.workbench_edited @@ -41,6 +43,7 @@ features[workbench_moderation_transitions][] = draft:needs_review features[workbench_moderation_transitions][] = draft:published features[workbench_moderation_transitions][] = needs_review:draft features[workbench_moderation_transitions][] = needs_review:published +features[workbench_moderation_transitions][] = published:draft features_exclude[features_overrides][views_view.workbench_moderation.display|needs_review_page|display_options|menu|context] = views_view.workbench_moderation.display|needs_review_page|display_options|menu|context features_exclude[features_overrides][views_view.workbench_moderation.display|needs_review_page|display_options|menu|context_only_inline] = views_view.workbench_moderation.display|needs_review_page|display_options|menu|context_only_inline features_exclude[features_overrides][views_view.workbench_moderation.display|drafts_page|display_options|menu|context] = views_view.workbench_moderation.display|drafts_page|display_options|menu|context diff --git a/profiles/wcm_base/modules/custom/ocio_workbench/ocio_workbench.views_default.inc b/profiles/wcm_base/modules/custom/ocio_workbench/ocio_workbench.views_default.inc index b95a5795afa3b146f26928b3f54a2ff010722c4f..921496ddf993b25555219422ce596cf2190774d2 100644 --- a/profiles/wcm_base/modules/custom/ocio_workbench/ocio_workbench.views_default.inc +++ b/profiles/wcm_base/modules/custom/ocio_workbench/ocio_workbench.views_default.inc @@ -207,6 +207,24 @@ function ocio_workbench_views_default_views() { ); $handler->display->display_options['filters']['field_file_tags_tid']['type'] = 'select'; $handler->display->display_options['filters']['field_file_tags_tid']['vocabulary'] = 'wcm_file_tags'; + /* Filter criterion: File: Schema type */ + $handler->display->display_options['filters']['schema_type']['id'] = 'schema_type'; + $handler->display->display_options['filters']['schema_type']['table'] = 'file_managed'; + $handler->display->display_options['filters']['schema_type']['field'] = 'schema_type'; + $handler->display->display_options['filters']['schema_type']['exposed'] = TRUE; + $handler->display->display_options['filters']['schema_type']['expose']['operator_id'] = 'schema_type_op'; + $handler->display->display_options['filters']['schema_type']['expose']['label'] = 'Storage'; + $handler->display->display_options['filters']['schema_type']['expose']['operator'] = 'schema_type_op'; + $handler->display->display_options['filters']['schema_type']['expose']['identifier'] = 'schema_type'; + $handler->display->display_options['filters']['schema_type']['expose']['remember_roles'] = array( + 2 => 2, + 1 => 0, + 5 => 0, + 4 => 0, + 7 => 0, + 6 => 0, + 3 => 0, + ); /* Display: Page */ $handler = $view->new_display('page', 'Page', 'page_1'); diff --git a/profiles/wcm_base/wcm_base.info b/profiles/wcm_base/wcm_base.info index d8c5ba97d8483374c4b34eaadc1884450de92a37..7024555a67bd11f47b5d00bfd8fa3b77410cdefa 100644 --- a/profiles/wcm_base/wcm_base.info +++ b/profiles/wcm_base/wcm_base.info @@ -55,6 +55,8 @@ dependencies[] = flexslider dependencies[] = flexslider_views dependencies[] = override_node_options dependencies[] = panels_accordion +dependencies[] = private +dependencies[] = private_files_download_permission dependencies[] = telephone dependencies[] = textformatter dependencies[] = uuid_features diff --git a/profiles/wcm_base/wcm_base.install b/profiles/wcm_base/wcm_base.install index 8cd9bda90cd7126456f9dffd22e8d971bf38481b..4d183b97f0c295ea4463479ed22276c62cb1e829 100644 --- a/profiles/wcm_base/wcm_base.install +++ b/profiles/wcm_base/wcm_base.install @@ -61,6 +61,9 @@ function _wcm_base_set_up_admin() { foreach ($features as $feature) { features_revert_module($feature); } + + //Rebuild node access permissions + node_access_rebuild(); } /** diff --git a/profiles/wcm_base/wcm_base.make b/profiles/wcm_base/wcm_base.make index a4dca7ff30ef6fde6d69c52dd655b4ad251e99d9..1077c887f98014b4603dd0cb0df9682aea99bece 100644 --- a/profiles/wcm_base/wcm_base.make +++ b/profiles/wcm_base/wcm_base.make @@ -59,6 +59,12 @@ projects[override_node_options][subdir] = contrib projects[panels_accordion][version] = 1.0 projects[panels_accordion][subdir] = contrib +projects[private][version] = 1.2 +projects[private][subdir] = contrib + +projects[private_files_download_permission][version] = 2.x-dev +projects[private_files_download_permission][subdir] = contrib + projects[realname][version] = 1.2 projects[realname][subdir] = contrib