aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-09-25 17:57:20 -0700
committerfriendica <info@friendica.com>2012-09-25 17:57:20 -0700
commitfbafd92f7f7b96b215b98f30de9a1ccbdb3479be (patch)
treef1f6739d513ac297fbd14162b8377cc4cf84c784 /mod
parentdd5725c2725b742473ce285dce8573da37fb8053 (diff)
downloadvolse-hubzilla-fbafd92f7f7b96b215b98f30de9a1ccbdb3479be.tar.gz
volse-hubzilla-fbafd92f7f7b96b215b98f30de9a1ccbdb3479be.tar.bz2
volse-hubzilla-fbafd92f7f7b96b215b98f30de9a1ccbdb3479be.zip
moving a lot of structure around. 'entity' is now 'channel'
Diffstat (limited to 'mod')
-rw-r--r--mod/feed.php6
-rw-r--r--mod/home.php6
-rw-r--r--mod/item.php38
-rw-r--r--mod/manage.php22
-rw-r--r--mod/profile.php4
-rw-r--r--mod/profile_photo.php3
-rw-r--r--mod/settings.php33
-rw-r--r--mod/zchannel.php (renamed from mod/zentity.php)10
-rw-r--r--mod/zfinger.php22
-rw-r--r--mod/zperms.php22
-rw-r--r--mod/zregister.php2
11 files changed, 79 insertions, 89 deletions
diff --git a/mod/feed.php b/mod/feed.php
index 69d8fdb05..a6adc620e 100644
--- a/mod/feed.php
+++ b/mod/feed.php
@@ -13,7 +13,7 @@ function feed_init(&$a) {
$channel = '';
if(argc() > 1) {
- $r = q("select * from entity where entity_address = '%s' limit 1",
+ $r = q("select * from channel where channel_address = '%s' limit 1",
dbesc(argv(1))
);
if(!($r && count($r)))
@@ -23,13 +23,13 @@ function feed_init(&$a) {
// check site and channel permissions
- if(!($channel['entity_r_stream'] & PERMS_PUBLIC))
+ if(!($channel['channel_r_stream'] & PERMS_PUBLIC))
killme();
if((intval(get_config('system','block_public'))) && (! get_account_id()))
killme();
- logger('mod_feed: public feed request from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $channel['entity_address']);
+ logger('mod_feed: public feed request from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $channel['channel_address']);
echo get_public_feed($channel,$params);
killme();
}
diff --git a/mod/home.php b/mod/home.php
index b96e3f29f..a49ce567e 100644
--- a/mod/home.php
+++ b/mod/home.php
@@ -6,8 +6,10 @@ function home_init(&$a) {
$ret = array();
call_hooks('home_init',$ret);
- if(local_user() && ($a->identity['entity_address']))
- goaway( $a->get_baseurl() . '/profile/' . $a->identity['entity_address']);
+ $channel = $a->get_channel();
+
+ if(local_user() && $channel && $channel['channel_address']))
+ goaway( $a->get_baseurl() . '/profile/' . $channel['channel_address']);
}}
diff --git a/mod/item.php b/mod/item.php
index 12765cba3..1db18cc85 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -175,12 +175,12 @@ function item_post(&$a) {
$user = null;
- $r = q("SELECT entity.*, account.* FROM entity left join account on entity.entity_account_id = account.account_id
- where entity.entity_id = %d LIMIT 1",
+ $r = q("SELECT channel.*, account.* FROM channel left join account on channel.channel_account_id = account.account_id
+ where channel.channel_id = %d LIMIT 1",
intval($profile_uid)
);
if(count($r))
- $entity = $r[0];
+ $channel = $r[0];
if($orig_post) {
$str_group_allow = $orig_post['allow_gid'];
@@ -208,10 +208,10 @@ function item_post(&$a) {
&& (! array_key_exists('group_allow',$_REQUEST))
&& (! array_key_exists('contact_deny',$_REQUEST))
&& (! array_key_exists('group_deny',$_REQUEST))) {
- $str_group_allow = $entity['entity_allow_gid'];
- $str_contact_allow = $entity['entity_allow_cid'];
- $str_group_deny = $entity['entity_deny_gid'];
- $str_contact_deny = $entity['entity_deny_cid'];
+ $str_group_allow = $channel['channel_allow_gid'];
+ $str_contact_allow = $channel['channel_allow_cid'];
+ $str_group_deny = $channel['channel_deny_gid'];
+ $str_contact_deny = $channel['channel_deny_cid'];
}
else {
@@ -756,11 +756,11 @@ function item_post(&$a) {
if($contact_record != $author) {
notification(array(
'type' => NOTIFY_COMMENT,
- 'notify_flags' => $entity['entity_notifyflags'],
- 'language' => $entity['account_language'],
- 'to_name' => $entity['entity_name'],
- 'to_email' => $entity['account_email'],
- 'uid' => $entity['entity_id'],
+ 'notify_flags' => $channel['channel_notifyflags'],
+ 'language' => $channel['account_language'],
+ 'to_name' => $channel['channel_name'],
+ 'to_email' => $channel['account_email'],
+ 'uid' => $channel['channel_id'],
'item' => $datarray,
'link' => $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id,
'source_name' => $datarray['author-name'],
@@ -781,11 +781,11 @@ function item_post(&$a) {
if($contact_record != $author) {
notification(array(
'type' => NOTIFY_WALL,
- 'notify_flags' => $entity['entity_notifyflags'],
- 'language' => $entity['account_language'],
- 'to_name' => $entity['entity_name'],
- 'to_email' => $entity['account_email'],
- 'uid' => $entity['entity_id'],
+ 'notify_flags' => $channel['channel_notifyflags'],
+ 'language' => $channel['account_language'],
+ 'to_name' => $channel['channel_name'],
+ 'to_email' => $channel['account_email'],
+ 'uid' => $channel['channel_id'],
'item' => $datarray,
'link' => $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id,
'source_name' => $datarray['author-name'],
@@ -806,7 +806,7 @@ function item_post(&$a) {
WHERE `id` = %d LIMIT 1",
intval($parent),
dbesc(($parent == $post_id) ? $uri : $parent_item['uri']),
- dbesc($a->get_baseurl() . '/display/' . $entity['entity_address'] . '/' . $post_id),
+ dbesc($a->get_baseurl() . '/display/' . $channel['channel_address'] . '/' . $post_id),
dbesc(datetime_convert()),
intval($post_id)
);
@@ -837,7 +837,7 @@ function item_post(&$a) {
);
$datarray['id'] = $post_id;
- $datarray['plink'] = $a->get_baseurl() . '/display/' . $entity['entity_address'] . '/' . $post_id;
+ $datarray['plink'] = $a->get_baseurl() . '/display/' . $channel['channel_address'] . '/' . $post_id;
call_hooks('post_local_end', $datarray);
diff --git a/mod/manage.php b/mod/manage.php
index 4bf161a39..b9237822b 100644
--- a/mod/manage.php
+++ b/mod/manage.php
@@ -9,18 +9,18 @@ function manage_content(&$a) {
$change_channel = ((argc() > 1) ? intval(argv(1)) : 0);
if($change_channel) {
- $r = q("select * from entity where entity_id = %d and entity_account_id = %d limit 1",
+ $r = q("select * from channel where channel_id = %d and channel_account_id = %d limit 1",
intval($change_channel),
intval(get_account_id())
);
if($r && count($r)) {
- $_SESSION['uid'] = intval($r[0]['entity_id']);
- get_app()->identity = $r[0];
- $_SESSION['theme'] = $r[0]['entity_theme'];
- date_default_timezone_set($r[0]['entity_timezone']);
+ $_SESSION['uid'] = intval($r[0]['channel_id']);
+ get_app()->set_channel($r[0]);
+ $_SESSION['theme'] = $r[0]['channel_theme'];
+ date_default_timezone_set($r[0]['channel_timezone']);
}
- if($r[0]['entity_startpage'])
- goaway(z_root() . '/' . $r[0]['entity_startpage']);
+ if($r[0]['channel_startpage'])
+ goaway(z_root() . '/' . $r[0]['channel_startpage']);
goaway(z_root());
}
@@ -28,20 +28,20 @@ function manage_content(&$a) {
$channels = null;
if(local_user()) {
- $r = q("select entity.*, contact.* from entity left join contact on entity.entity_id = contact.uid
- where entity.entity_account_id = %d and contact.self = 1",
+ $r = q("select channel.*, contact.* from channel left join contact on channel.channel_id = contact.uid
+ where channel.channel_account_id = %d and contact.self = 1",
intval(get_account_id())
);
if($r && count($r)) {
$channels = $r;
for($x = 0; $x < count($channels); $x ++)
- $channels[$x]['link'] = 'manage/' . intval($channels[$x]['entity_id']);
+ $channels[$x]['link'] = 'manage/' . intval($channels[$x]['channel_id']);
}
}
$links = array(
- array( 'zentity', t('Create a new channel'), t('New Channel'))
+ array( 'zchannel', t('Create a new channel'), t('New Channel'))
);
diff --git a/mod/profile.php b/mod/profile.php
index ee457c8b6..aaa324078 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -20,8 +20,10 @@ function profile_init(&$a) {
$profile = 0;
+ $channel = $a->get_channel();
+
if((local_user()) && (argc() > 2) && (argv(2) === 'view')) {
- $which = $a->identity['entity_address'];
+ $which = $channel['channel_address'];
$profile = argv(1);
}
diff --git a/mod/profile_photo.php b/mod/profile_photo.php
index 445045cb9..3bde6a99d 100644
--- a/mod/profile_photo.php
+++ b/mod/profile_photo.php
@@ -8,7 +8,8 @@ function profile_photo_init(&$a) {
return;
}
- profile_load($a,$a->identity['entity_address']);
+ $channel = $a->get_channel();
+ profile_load($a,$channel['channel_address']);
}
diff --git a/mod/settings.php b/mod/settings.php
index 922a90467..7cbe278a3 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -320,24 +320,6 @@ function settings_post(&$a) {
$str_group_deny = perms2str($_POST['group_deny']);
$str_contact_deny = perms2str($_POST['contact_deny']);
- $openidserver = $a->user['openidserver'];
- $openid = normalise_openid($openid);
-
- // If openid has changed or if there's an openid but no openidserver, try and discover it.
-
- if($openid != $a->user['openid'] || (strlen($openid) && (! strlen($openidserver)))) {
- $tmp_str = $openid;
- if(strlen($tmp_str) && validate_url($tmp_str)) {
- logger('updating openidserver');
- require_once('library/openid.php');
- $open_id_obj = new LightOpenID;
- $open_id_obj->identity = $openid;
- $openidserver = $open_id_obj->discover($open_id_obj->identity);
- }
- else
- $openidserver = '';
- }
-
set_pconfig(local_user(),'expire','items', $expire_items);
set_pconfig(local_user(),'expire','notes', $expire_notes);
set_pconfig(local_user(),'expire','starred', $expire_starred);
@@ -660,15 +642,18 @@ function settings_content(&$a) {
load_pconfig(local_user(),'expire');
- $username = $a->identity['entity_name'];
+ $channel = $a->get_channel();
+
+ $username = $channel['channel_name'];
$email = $a->account['account_email'];
- $nickname = $a->identity['entity_address'];
- $timezone = $a->identity['entity_timezone'];
- $notify = $a->identity['entity_notifyflags'];
- $defloc = $a->identity['entity_location'];
+ $nickname = $channel['channel_address'];
+ $timezone = $channel['channel_timezone'];
+ $notify = $channel['channel_notifyflags'];
+ $defloc = $channel['channel_location'];
- $maxreq = $a->identity['entity_max_friend_req'];
+ $maxreq = $channel['channel_max_friend_req'];
$expire = get_pconfig(local_user(),'expire','content_expire_days');
+
$blockwall = $a->user['blockwall'];
$blocktags = $a->user['blocktags'];
$unkmail = $a->user['unkmail'];
diff --git a/mod/zentity.php b/mod/zchannel.php
index a0f49b47c..f401d91c6 100644
--- a/mod/zentity.php
+++ b/mod/zchannel.php
@@ -2,7 +2,7 @@
require_once('include/identity.php');
-function zentity_init(&$a) {
+function zchannel_init(&$a) {
$cmd = ((argc() > 1) ? argv(1) : '');
@@ -57,7 +57,7 @@ function zentity_init(&$a) {
}
-function zentity_post(&$a) {
+function zchannel_post(&$a) {
$arr = $_POST;
@@ -73,7 +73,7 @@ function zentity_post(&$a) {
return;
}
- if(! strlen($next_page = get_config('system','workflow_identity_next')))
+ if(! strlen($next_page = get_config('system','workflow_channel_next')))
$next_page = 'settings';
goaway(z_root() . '/' . $next_page);
@@ -86,7 +86,7 @@ function zentity_post(&$a) {
-function zentity_content(&$a) {
+function zchannel_content(&$a) {
if(! get_account_id()) {
notice( t('Permission denied.') . EOL);
@@ -97,7 +97,7 @@ function zentity_content(&$a) {
$nickname = ((x($_REQUEST,'nickname')) ? $_REQUEST['nickname'] : "" );
- $o = replace_macros(get_markup_template('zentity.tpl'), array(
+ $o = replace_macros(get_markup_template('zchannel.tpl'), array(
'$title' => t('Add a Channel'),
'$desc' => t('A channel is your own collection of related web pages. A channel can be used to hold social network profiles, blogs, conversation groups and forums, celebrity pages, and much more. You may create as many channels as your service provider allows.'),
diff --git a/mod/zfinger.php b/mod/zfinger.php
index 66dcb16f6..95c17ecd8 100644
--- a/mod/zfinger.php
+++ b/mod/zfinger.php
@@ -13,12 +13,12 @@ function zfinger_init(&$a) {
$r = null;
if(strlen($zguid)) {
- $r = q("select * from entity where entity_global_id = '%s' limit 1",
+ $r = q("select * from channel where channel_global_id = '%s' limit 1",
dbesc($zguid)
);
}
elseif(strlen($zaddr)) {
- $r = q("select * from entity where entity_address = '%s' limit 1",
+ $r = q("select * from channel where channel_address = '%s' limit 1",
dbesc($zaddr)
);
}
@@ -34,7 +34,7 @@ function zfinger_init(&$a) {
$e = $r[0];
- $id = $e['entity_id'];
+ $id = $e['channel_id'];
$r = q("select contact.*, profile.*
from contact left join profile on contact.uid = profile.uid
where contact.uid = %d && contact.self = 1 and profile.is_default = 1 limit 1",
@@ -49,18 +49,18 @@ function zfinger_init(&$a) {
// Communication details
- $ret['guid'] = $e['entity_global_id'];
- $ret['guid_sig'] = base64url_encode(rsa_sign($e['entity_global_id'],$e['entity_prvkey']));
- $ret['key'] = $e['entity_pubkey'];
- $ret['name'] = $e['entity_name'];
- $ret['address'] = $e['entity_address'];
+ $ret['guid'] = $e['channel_global_id'];
+ $ret['guid_sig'] = base64url_encode(rsa_sign($e['channel_global_id'],$e['channel_prvkey']));
+ $ret['key'] = $e['channel_pubkey'];
+ $ret['name'] = $e['channel_name'];
+ $ret['address'] = $e['channel_address'];
$ret['profile'] = $profile;
- // array of (verified) hubs this entity uses
+ // array of (verified) hubs this channel uses
$ret['hubs'] = array();
- $x = zot_get_hubloc(array($e['entity_global_id']));
+ $x = zot_get_hubloc(array($e['channel_global_id']));
if($x && count($x)) {
foreach($x as $hub) {
if(! ($hub['hubloc_flags'] & HUBLOC_FLAGS_UNVERIFIED)) {
@@ -68,7 +68,7 @@ function zfinger_init(&$a) {
'primary' => (($hub['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY) ? true : false),
'url' => $hub['hubloc_url'],
/// hmmm we probably shouldn't sign somebody else's hub. FIXME
- 'url_sig' => base64url_encode(rsa_sign($hub['hubloc_url'],$e['entity_prvkey'])),
+ 'url_sig' => base64url_encode(rsa_sign($hub['hubloc_url'],$e['channel_prvkey'])),
'callback' => $hub['hubloc_callback'],
'sitekey' => $hub['hubloc_sitekey']
);
diff --git a/mod/zperms.php b/mod/zperms.php
index b2c18c7d0..de1d4dd6d 100644
--- a/mod/zperms.php
+++ b/mod/zperms.php
@@ -16,12 +16,12 @@ function zperms_init(&$a) {
$r = null;
if(strlen($zguid)) {
- $r = q("select * from entity where entity_global_id = '%s' limit 1",
+ $r = q("select * from channel where channel_global_id = '%s' limit 1",
dbesc($zguid)
);
}
elseif(strlen($zaddr)) {
- $r = q("select * from entity where entity_address = '%s' limit 1",
+ $r = q("select * from channel where channel_address = '%s' limit 1",
dbesc($zaddr)
);
}
@@ -36,7 +36,7 @@ function zperms_init(&$a) {
}
$e = $r[0];
- $id = $e['entity_id'];
+ $id = $e['channel_id'];
$r = q("select contact.*, profile.*
from contact left join profile on contact.uid = profile.uid
where contact.uid = %d && contact.self = 1 and profile.is_default = 1 limit 1",
@@ -49,21 +49,21 @@ function zperms_init(&$a) {
$ret['success'] = true;
- $ret['guid'] = $e['entity_global_id'];
- $ret['guid_sig'] = base64url_encode(rsa_sign($e['entity_global_id'],$e['entity_prvkey']));
- $ret['key'] = $e['entity_pubkey'];
- $ret['name'] = $e['entity_name'];
- $ret['address'] = $e['entity_address'];
+ $ret['guid'] = $e['channel_global_id'];
+ $ret['guid_sig'] = base64url_encode(rsa_sign($e['channel_global_id'],$e['channel_prvkey']));
+ $ret['key'] = $e['channel_pubkey'];
+ $ret['name'] = $e['channel_name'];
+ $ret['address'] = $e['channel_address'];
$ret['target'] = $ztarget;
$ret['target_sig'] = $zsig;
$ret['permissions'] = map_perms($r[0],$ztarget,$zsig);
$ret['profile'] = $profile;
- // array of (verified) hubs this entity uses
+ // array of (verified) hubs this channel uses
$ret['hubs'] = array();
- $x = zot_get_hubloc(array($e['entity_global_id']));
+ $x = zot_get_hubloc(array($e['channel_global_id']));
if($x && count($x)) {
foreach($x as $hub) {
if(! ($hub['hubloc_flags'] & HUBLOC_FLAGS_UNVERIFIED)) {
@@ -71,7 +71,7 @@ function zperms_init(&$a) {
'primary' => (($hub['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY) ? true : false),
'url' => $hub['hubloc_url'],
/// hmmm we probably shouldn't sign somebody else's hub. FIXME
- 'url_sig' => base64url_encode(rsa_sign($hub['hubloc_url'],$e['entity_prvkey'])),
+ 'url_sig' => base64url_encode(rsa_sign($hub['hubloc_url'],$e['channel_prvkey'])),
'callback' => $hub['hubloc_callback'],
'sitekey' => $hub['hubloc_sitekey']
);
diff --git a/mod/zregister.php b/mod/zregister.php
index 478921c3f..a83f42bd0 100644
--- a/mod/zregister.php
+++ b/mod/zregister.php
@@ -105,7 +105,7 @@ function zregister_post(&$a) {
authenticate_success($result['account'],true,false,true);
if(! strlen($next_page = get_config('system','workflow_register_next')))
- $next_page = 'zentity';
+ $next_page = 'zchannel';
$_SESSION['workflow'] = true;