Drupal: .htaccess Access Deny
August 21, 2014 – 7:59 am | No Comment

In this article I will tell how to forbid access to certain resources for some clients. The instructions will include descriptions of different directives.

Read the full story »
CSS Templates

Contain reviews and news about CSS Templates.

Freebies

Contain freebies such as icons, graphics, headers and images for your websites.

Fun Stuff

Contains other fun stuff for entertainment or interesting site showcase.

How-To

Contain technical elaborations on some specific workarounds or common tweak.

Joomla Templates

Contains reviews and news about Joomla templates.

Home » How-To

Objects Unlocking and Checkin in Joomla

Submitted by on November 27, 2009 – 9:41 amNo Comment

This article is devoted to unlocking of Joomla site obejcts; it covers such areas as editing of locked articles, ContentUnlocker module (which is for unblocking of data), unlocking of objects by Manager and Administrator.


How to edit locked article

The beginners of Joomla often have a problem that can’t edit their articles in the administrator’s pane because the articles are locked. This is not the problem at all, and I will tell you what you should do to unlock the article here.

Joomla is a multiuser system. Therefore content unit is locked at the moment of its editing. This is to prevent editing of the article by other users at the same moment.

Article is unlocked automatically when saving, or clicking Close/Cancel button in the editing dialog window. But sometimes users forget save article or click Close/Cancel and the article is left locked.

You should perform the following steps to unlock site content:

  1. Enter to the adminsitrator’s panel;
  2. Select System> Global Checkin
  3. All locked content of the site is unlocked now.

Note: you can unlock other Joomla elements: modules, menu elements, elements of some components (for example, banners) in the same way.

Content Unlocker

When editing of some data in Joomla-based site, Authors often forget to click Save (or the data is not saved because of JavaScript error). As a result – the data is locked. Meanwhile users of Administrator or Manager groups cannot unlock the data by themselves. If the data should be edited in a short time, they should ask to unlock it users from Super administrator group. ContentUnlocker module was developed to automate this process.

Module works in a very simple way: specify identifier of the data that is to be unlocked in the module form and click GO.

You can list identifiers of users who will be permitted to the module in ContentUnlocker settings through the front-end of the site. The default identifier is 62 – ID of super administrator.

How Manager and Administrator Can Unlock Site Content

By default, unlocking is available for users from Super Administrator group only. But users with Manager rights often create content of the site. So locking of some content unit becomes a problem – Manager should ask Super Administrator to unlock an article. ContentUnlocker module is one of the ways to fix this problem. But there is another one. In this section I would tell you how to access unlocking for all users of the administrative panel with the help of a little modification.

I recommend you to backup files to be changed before you start. Backup will allow you to undo your changes and repair you site in the case of some problems.

Then do:

  1. Open ../administrator/components/com_checkin/admin.checkin.php file;
  2. Find the following code there:
    if (!$acl->acl_check( ‘administration’, ‘config’, ‘users’, $my->usertype )) {  mosRedirect( ‘index2.php?’, _NOT_AUTH );

    and replace it with

    /* if (!$acl->acl_check( ‘administration’, ‘config’, ‘users’, $my->usertype )) {  mosRedirect( ‘index2.php?’, _NOT_AUTH );} */

  3. Save your changes;
  4. Open ../administrator/modules/mod_fullmenu.php file;
  5. Find the following code there: 
            }

      ?>      _cmSplit,

      <?php
        // Help Sub-Menu

  6. And change it to:
    } else {
    ?>
    _cmSplit,
    [null,’System’,null,null,’System Management’,
    [‘<img src="../includes/js/ThemeOffice/checkin.png" />’, ‘Global Checkin’, ‘index2.php?option=com_checkin’, null,’Check-in all checked-out items’],
    ],
    <?php
    }
    ?>
    _cmSplit,
    <?php
    // Help Sub-Menu
  7. Done!

How to unlock Joomla objects

Earlier I told about some of the methods to unlock Joomla objects. But there is a comprehensive solution – disable the proper objects locking. This solution can be applied only for those sites which have a small number of administrators (1-2), i.e. where probability of simultaneous editing of some object those sites which content almost is low.

To represent an object in database Joomla uses descendant of the base Joomla class mosDBTable which contains methods for locking (checkout) and unlocking (checkin) of objects. Therefore if you’ll disable logic of these functions in the mosDBTable class, locking of objects will not work (except when developers of additional extensions use their own implementation of these objects which is a very seldom thing).

Before begin your modification, I recommend backup the files to be changed. Backup will allow you to undo your changes and repair you site in the case of some problems.

Let’s start!

  1. Open ../includes/database.php file
  2. Fine the following code there
  function checkout( $user_id, $oid=null ) {

and replace it with

  function checkout( $user_id, $oid=null ) {
    return true;
  1. Fin the following code there
  function checkin( $oid=null ) {

and replace it to

  function checkin( $oid=null ) {
    return true;
  1. Save your changes.

That is all! Now you task is just to choose which unlocking method you’ll use (if you which to use it).

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.