source: trunk/services/lock.php @ 21

Last change on this file since 21 was 20, checked in by scdev, 19 years ago

Tons of little updates and bugfixes. CSS updates to templates and core css files. File upload ability to module_maker. Remade Upload interface to use setParam/getParam.

File size: 1.4 KB
Line 
1<?php
2/**
3 * lock.php
4 * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information
5 */
6
7// require_once dirname(__FILE__) . '/_config.inc.php';
8require_once 'codebase/lib/RecordLock.inc.php';
9
10$auth->requireLogin();
11App::sslOn();
12
13if (getFormData('boomerang', false) && isset($_SERVER['HTTP_REFERER'])) {
14    // We remember which page we came from so we can go back there.
15    $boom_url = strpos(getFormData('boomerang'), '/') !== false ? getFormData('boomerang') : $_SERVER['HTTP_REFERER'];
16    App::setBoomerangURL($boom_url, 'lock');
17}
18
19$lock =& RecordLock::getInstance($GLOBALS['auth']);
20$lock->select(getFormData('lock_id'));
21
22if (!$lock->isLocked()) {
23    App::logMsg('Lock not found with lock_id: ' . getFormData('lock_id') . ', from referrer: ' . $_SERVER['HTTP_REFERER'], LOG_WARNING, __FILE__, __LINE__);
24    App::dieBoomerangURL('lock');
25}
26
27// What action to take.
28if (getFormData('unlock', false)) {
29    $lock->remove();
30    App::raiseMsg(sprintf(_("The record <strong>%s</strong> has been unlocked, and can now be modified."), $lock->getTitle('title')), MSG_NOTICE, __FILE__, __LINE__);
31    App::dieBoomerangURL('lock');
32} else if (getFormData('cancel', false)) {
33    App::dieBoomerangURL('lock');
34}
35
36// Titles and navigation header.
37$nav->addPage(sprintf(_("Locked record: %s"), $lock->getTitle()));
38
39// Templates.
40include 'header.ihtml';
41$lock->printErrorHTML();
42include 'footer.ihtml';
43
44?>
Note: See TracBrowser for help on using the repository browser.