diff options
author | friendica <info@friendica.com> | 2014-09-17 21:16:15 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-09-17 21:16:15 -0700 |
commit | 51d9f0d97a186e32aeacc42e3b2d2001d04b5dd2 (patch) | |
tree | 52cd6eacf0eb3b78edc815fc91be81ae24399d05 /include/identity.php | |
parent | eca420ec96912ad573354953297564c9f9ad2c32 (diff) | |
download | volse-hubzilla-51d9f0d97a186e32aeacc42e3b2d2001d04b5dd2.tar.gz volse-hubzilla-51d9f0d97a186e32aeacc42e3b2d2001d04b5dd2.tar.bz2 volse-hubzilla-51d9f0d97a186e32aeacc42e3b2d2001d04b5dd2.zip |
channel permission roles
Diffstat (limited to 'include/identity.php')
-rw-r--r-- | include/identity.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/identity.php b/include/identity.php index 38e96ab71..ead785543 100644 --- a/include/identity.php +++ b/include/identity.php @@ -219,13 +219,15 @@ function create_identity($arr) { $perms_sql = ''; $role_permissions = null; + $global_perms = get_perms(); if(array_key_exists('permissions_role',$arr) && $arr['permissions_role']) { $role_permissions = get_role_perms($arr['permissions_role']); + if($role_permissions) { foreach($role_permissions as $p => $v) { if(strpos($p,'channel_') !== false) { - $perms_keys .= ', ' . $global_perms[$p][0]; + $perms_keys .= ', ' . $p; $perms_vals .= ', ' . intval($v); } if($p === 'directory_publish') @@ -235,16 +237,16 @@ function create_identity($arr) { } else { $defperms = site_default_perms(); - $global_perms = get_perms(); foreach($defperms as $p => $v) { $perms_keys .= ', ' . $global_perms[$p][0]; $perms_vals .= ', ' . intval($v); } } + $expire = get_config('system', 'default_expire_days'); $expire = (($expire===false)? '0': $expire); - + $r = q("insert into channel ( channel_account_id, channel_primary, channel_name, channel_address, channel_guid, channel_guid_sig, channel_hash, channel_prvkey, channel_pubkey, channel_pageflags, channel_expire_days $perms_keys ) @@ -264,8 +266,6 @@ function create_identity($arr) { ); - - $r = q("select * from channel where channel_account_id = %d and channel_guid = '%s' limit 1", intval($arr['account_id']), |