[ Index ]

PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008]

title

Body

[close]

/mod/wiki/ -> confirmlock.php (source)

   1  <?php
   2  /**
   3   * This script is called through AJAX. It confirms that a user is still 
   4   * trying to edit a page that they have locked (they haven't closed
   5   * their browser window or something). 
   6   *
   7   * @copyright &copy; 2006 The Open University
   8   * @author s.marshall@open.ac.uk
   9   * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
  10   * @package mod-wiki
  11   * @category mod
  12   *//** */
  13  
  14  require_once("../../config.php");
  15  
  16  header('Content-Type: text/plain');    
  17  
  18  if(empty($_POST['lockid'])) {
  19      print 'noid';
  20      exit;
  21  }
  22  
  23  $lockid=(int)$_POST['lockid'];
  24  if($lock=get_record('wiki_locks','id',$lockid)) {
  25      $lock->lockedseen=time();
  26      update_record('wiki_locks',$lock);
  27      print 'ok';   
  28  } else {
  29      print 'cancel'; // Tells user their lock has been cancelled.
  30  }
  31  
  32  ?>


Generated: Wed Jan 14 11:33:29 2009 Cross-referenced by PHPXref 0.7