diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-09-02 20:12:40 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-09-02 20:12:40 -0700 |
commit | c22da3da1c5d3c5418cb9f142883adb838db9f76 (patch) | |
tree | 61c8575d5959826918c9b4fcd42666048ce246fc /include/AccessList.php | |
parent | 69fc10d5adfa0640792376ad4f417bd7f28fc7f7 (diff) | |
download | volse-hubzilla-c22da3da1c5d3c5418cb9f142883adb838db9f76.tar.gz volse-hubzilla-c22da3da1c5d3c5418cb9f142883adb838db9f76.tar.bz2 volse-hubzilla-c22da3da1c5d3c5418cb9f142883adb838db9f76.zip |
start to modularise the clone import and sync functions
Diffstat (limited to 'include/AccessList.php')
-rw-r--r-- | include/AccessList.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/AccessList.php b/include/AccessList.php index 46e66d33d..43f1de111 100644 --- a/include/AccessList.php +++ b/include/AccessList.php @@ -34,6 +34,11 @@ class AccessList { return $this->explicit; } + /** + * Set AccessList from strings such as those in already + * existing stored data items + */ + function set($arr,$explicit = true) { $this->allow_cid = $arr['allow_cid']; $this->allow_gid = $arr['allow_gid']; @@ -43,6 +48,12 @@ class AccessList { $this->explicit = $explicit; } + /** + * return an array consisting of the current + * access list components where the elements + * are directly storable. + */ + function get() { return array( 'allow_cid' => $this->allow_cid, @@ -52,6 +63,12 @@ class AccessList { ); } + /** + * Set AccessList from arrays, such as those provided by + * acl_selector(). For convenience, a string (or non-array) input is + * assumed to be a comma-separated list and auto-converted into an array. + */ + function set_from_array($arr,$explicit = true) { $this->allow_cid = perms2str((is_array($arr['contact_allow'])) ? $arr['contact_allow'] : explode(',',$arr['contact_allow'])); |