Now have a solid permissions model. Create a few functions to enumerate them and then we're off to the races.

This commit is contained in:
friendica
2012-10-28 18:50:35 -07:00
parent 1a9ab12748
commit 4bcf19632b
6 changed files with 367 additions and 101 deletions

View File

@@ -210,7 +210,7 @@ function change_channel($change_channel) {
intval($change_channel),
intval(get_account_id())
);
if($r && count($r)) {
if($r) {
$hash = $r[0]['channel_hash'];
$_SESSION['uid'] = intval($r[0]['channel_id']);
get_app()->set_channel($r[0]);
@@ -221,8 +221,10 @@ function change_channel($change_channel) {
$x = q("select * from xchan where xchan_hash = '%s' limit 1",
dbesc($hash)
);
if($x && count($x))
if($x) {
get_app()->set_observer($x[0]);
get_app()->set_perms(get_all_perms(local_user(),$hash));
}
}
return $ret;