Changeset 22 for trunk/services/lock.php


Ignore:
Timestamp:
Nov 23, 2005 9:29:33 PM (19 years ago)
Author:
scdev
Message:

More bugs and shifting things about.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/services/lock.php

    r21 r22  
    1111App::sslOn();
    1212
    13 if (getFormData('boomerang', false) && isset($_SERVER['HTTP_REFERER'])) {
     13if (getFormData('boomerang', false)) {
    1414    // We remember which page we came from so we can go back there.
    1515    $boom_url = strpos(getFormData('boomerang'), '/') !== false ? getFormData('boomerang') : $_SERVER['HTTP_REFERER'];
    1616    App::setBoomerangURL($boom_url, 'lock');
     17    App::setBoomerangURL($_SERVER['HTTP_REFERER'], 'cancel-lock');
    1718}
    1819
    19 $lock =& RecordLock::getInstance($GLOBALS['auth']);
     20if (!isset($lock) || !is_a($lock, 'RecordLock')) {
     21    $lock =& RecordLock::getInstance($auth);
     22}
    2023$lock->select(getFormData('lock_id'));
    2124
     
    3134    App::dieBoomerangURL('lock');
    3235} else if (getFormData('cancel', false)) {
    33     App::dieBoomerangURL('lock');
     36    // Since the boomerang URL will go back to the locked record, and the record was not unlocked, we must delete the boomerang URL otherwise we'll come back here.
     37    App::deleteBoomerangURL('lock');
     38    App::dieBoomerangURL('cancel-lock');
    3439}
    3540
Note: See TracChangeset for help on using the changeset viewer.