bug in get_all_perms

This commit is contained in:
friendica 2012-11-01 20:47:32 -07:00
parent f3ade4b8cf
commit 5c9a68488a

View File

@ -1,7 +1,6 @@
<?php <?php
$global_perms = array( $global_perms = array(
// Read only permissions // Read only permissions
'view_stream' => array('channel_r_stream', PERMS_R_STREAM, true), 'view_stream' => array('channel_r_stream', PERMS_R_STREAM, true),
@ -20,6 +19,9 @@
); );
// Since these include the translation function - they couldn't be included
// in $global_perms without causing an include dependency, so we provide a parallel
// array which isn't global.
function perms_text() { function perms_text() {
$perms_text = array( $perms_text = array(
@ -48,7 +50,7 @@ function perms_text() {
* @param $uid : The channel_id associated with the resource owner * @param $uid : The channel_id associated with the resource owner
* @param $observer: The xchan_hash representing the observer * @param $observer: The xchan_hash representing the observer
* *
* @returns: array of all permissions, key is permission name, value is integer 0 or 1 * @returns: array of all permissions, key is permission name, value is true or false
*/ */
function get_all_perms($uid,$observer,$internal_use = true) { function get_all_perms($uid,$observer,$internal_use = true) {
@ -74,11 +76,9 @@ function get_all_perms($uid,$observer,$internal_use = true) {
$channel_perm = $permission[0]; $channel_perm = $permission[0];
if(! $channel_checked) { if(! $channel_checked) {
$r = q("select %s, channel_hash from channel where channel_id = %d limit 1", $r = q("select * from channel where channel_id = %d limit 1",
dbesc($channel_perm),
intval($uid) intval($uid)
); );
$channel_checked = true; $channel_checked = true;
} }