| @@ 982-1001 (lines=20) @@ | ||
| 979 | * @return boolean |
|
| 980 | * true if the timestamp is valid |
|
| 981 | */ |
|
| 982 | protected function validateTimestamp($section_id, $checkMissing = false) |
|
| 983 | { |
|
| 984 | if (!isset($_POST['action']['ignore-timestamp'])) { |
|
| 985 | if ($checkMissing && !isset($_POST['action']['timestamp'])) { |
|
| 986 | if (isset($this->_errors) && is_array($this->_errors)) { |
|
| 987 | $this->_errors['timestamp'] = __('The section could not be saved due to conflicting changes'); |
|
| 988 | } |
|
| 989 | return false; |
|
| 990 | } elseif (isset($_POST['action']['timestamp'])) { |
|
| 991 | $tv = new TimestampValidator('sections'); |
|
| 992 | if (!$tv->check($section_id, $_POST['action']['timestamp'])) { |
|
| 993 | if (isset($this->_errors) && is_array($this->_errors)) { |
|
| 994 | $this->_errors['timestamp'] = __('The section could not be saved due to conflicting changes'); |
|
| 995 | } |
|
| 996 | return false; |
|
| 997 | } |
|
| 998 | } |
|
| 999 | } |
|
| 1000 | return true; |
|
| 1001 | } |
|
| 1002 | } |
|
| 1003 | ||
| @@ 1943-1962 (lines=20) @@ | ||
| 1940 | * @return boolean |
|
| 1941 | * true if the timestamp is valid |
|
| 1942 | */ |
|
| 1943 | protected function validateTimestamp($entry_id, $checkMissing = false) |
|
| 1944 | { |
|
| 1945 | if (!isset($_POST['action']['ignore-timestamp'])) { |
|
| 1946 | if ($checkMissing && !isset($_POST['action']['timestamp'])) { |
|
| 1947 | if (isset($this->_errors) && is_array($this->_errors)) { |
|
| 1948 | $this->_errors['timestamp'] = __('The entry could not be saved due to conflicting changes'); |
|
| 1949 | } |
|
| 1950 | return false; |
|
| 1951 | } elseif (isset($_POST['action']['timestamp'])) { |
|
| 1952 | $tv = new TimestampValidator('entries'); |
|
| 1953 | if (!$tv->check($entry_id, $_POST['action']['timestamp'])) { |
|
| 1954 | if (isset($this->_errors) && is_array($this->_errors)) { |
|
| 1955 | $this->_errors['timestamp'] = __('The entry could not be saved due to conflicting changes'); |
|
| 1956 | } |
|
| 1957 | return false; |
|
| 1958 | } |
|
| 1959 | } |
|
| 1960 | } |
|
| 1961 | return true; |
|
| 1962 | } |
|
| 1963 | } |
|
| 1964 | ||