diff options
author | friendica <info@friendica.com> | 2013-01-12 20:38:42 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-01-12 20:38:42 -0800 |
commit | c0c5252b57fdd6a7687aec02411a899a54021af6 (patch) | |
tree | 63e5b4ed9ed9af8d5059976fcaa20b4f88ef3516 | |
parent | 99ff0f51a83a553051211a186d9162669636d931 (diff) | |
download | volse-hubzilla-c0c5252b57fdd6a7687aec02411a899a54021af6.tar.gz volse-hubzilla-c0c5252b57fdd6a7687aec02411a899a54021af6.tar.bz2 volse-hubzilla-c0c5252b57fdd6a7687aec02411a899a54021af6.zip |
fresh: provide ability to change channels
-rwxr-xr-x | util/fresh | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/util/fresh b/util/fresh index 2cbba81cd..2314796bb 100755 --- a/util/fresh +++ b/util/fresh @@ -92,7 +92,23 @@ function process_command($line) { } break; - + case 'channel': + if(! local_user()) + echo 'Permission denied.'; + if(argv(1)) { + $r = q("select * from channel where channel_address = '%s' and channel_account_id = %d limit 1", + dbesc(argv(1)), + intval(get_account_id()) + ); + if($r) { + change_channel($r[0]['channel_id']); + $channel = $a->get_channel(); + echo 'Logged in as ' . $channel['channel_name']; + } + else + echo 'Channel not found.'; + } + break; default: break; |