1: <?php
2: /**
3: * Class used to determine if access is being ignored.
4: *
5: * @package Elgg.Core
6: * @subpackage Access
7: * @access private
8: * @see elgg_get_ignore_access()
9: *
10: * @todo I don't remember why this was required beyond scope concerns.
11: */
12: class ElggAccess {
13: /**
14: * Bypass Elgg's access control if true.
15: * @var bool
16: */
17: private $ignore_access;
18:
19: // @codingStandardsIgnoreStart
20: /**
21: * Get current ignore access setting.
22: *
23: * @return bool
24: * @deprecated 1.8 Use ElggAccess::getIgnoreAccess()
25: */
26: public function get_ignore_access() {
27: elgg_deprecated_notice('ElggAccess::get_ignore_access() is deprecated by ElggAccess::getIgnoreAccess()', 1.8);
28: return $this->getIgnoreAccess();
29: }
30: // @codingStandardsIgnoreEnd
31:
32: /**
33: * Get current ignore access setting.
34: *
35: * @return bool
36: */
37: public function getIgnoreAccess() {
38: return $this->ignore_access;
39: }
40:
41: // @codingStandardsIgnoreStart
42: /**
43: * Set ignore access.
44: *
45: * @param bool $ignore Ignore access
46: *
47: * @return bool Previous setting
48: *
49: * @deprecated 1.8 Use ElggAccess:setIgnoreAccess()
50: */
51: public function set_ignore_access($ignore = true) {
52: elgg_deprecated_notice('ElggAccess::set_ignore_access() is deprecated by ElggAccess::setIgnoreAccess()', 1.8);
53: return $this->setIgnoreAccess($ignore);
54: }
55: // @codingStandardsIgnoreEnd
56:
57: /**
58: * Set ignore access.
59: *
60: * @param bool $ignore Ignore access
61: *
62: * @return bool Previous setting
63: */
64: public function setIgnoreAccess($ignore = true) {
65: $prev = $this->ignore_access;
66: $this->ignore_access = $ignore;
67:
68: return $prev;
69: }
70: }
71: