/** * Locks the page. Takes the user DB ID and place it as locksmith data. Impossible if resource is already locked. * * @param CMS_profile_user $user The user placing the lock * @return boolean true on success, false on failure. * @access public */ function lock(&$user) { if ($this->getLock()) { return false; } $this->_lockDate = new CMS_date(); $this->_lockDate->setNow(); $sql = "\n\t\t\tinsert into\n\t\t\t\tlocks\n\t\t\tset\n\t\t\t\tresource_lok = '" . $this->_id . "',\n\t\t\t\tlocksmithData_lok = '" . $user->getUserID() . "',\n\t\t\t\tdate_lok = '" . $this->_lockDate->getDBValue() . "'\n\t\t"; $q = new CMS_query($sql); //set object lock status $this->_lockStatus = $user->getUserID(); return true; }