aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xboot.php2
-rw-r--r--doc/Schema-development.md14
-rw-r--r--include/enotify.php8
-rw-r--r--include/follow.php4
-rw-r--r--include/group.php6
-rw-r--r--include/notifier.php29
-rw-r--r--include/zot.php16
-rw-r--r--install/database.sql4
-rw-r--r--install/update.php11
-rw-r--r--js/crypto.js46
-rw-r--r--mod/connections.php17
-rw-r--r--mod/help.php32
-rw-r--r--mod/post.php14
-rw-r--r--mod/settings.php15
-rw-r--r--version.inc2
15 files changed, 173 insertions, 47 deletions
diff --git a/boot.php b/boot.php
index c84604dc1..3fabff55a 100755
--- a/boot.php
+++ b/boot.php
@@ -45,7 +45,7 @@ define ( 'RED_PLATFORM', 'Red Matrix' );
define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R');
define ( 'ZOT_REVISION', 1 );
-define ( 'DB_UPDATE_VERSION', 1083 );
+define ( 'DB_UPDATE_VERSION', 1084 );
define ( 'EOL', '<br />' . "\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
diff --git a/doc/Schema-development.md b/doc/Schema-development.md
index 415c68efa..481792fcc 100644
--- a/doc/Schema-development.md
+++ b/doc/Schema-development.md
@@ -6,27 +6,27 @@ A schema, in a nutshell, is a collection of settings for a bunch of variables to
certain elements of a theme. A schema is loaded as though it were part of config.php
and has access to all the same information. Importantly, this means it is identity aware,
and can be used to do some interesting things. One could, for example, restrict options
-by service class, or present different options to different users.
+by service class, or present different options to different members.
By default, we filter only by whether or not expert mode is enabled. If expert mode is
-enabled, all options are presented to the user. If it is not, only scheme, background
+enabled, all options are presented to the member. If it is not, only scheme, background
image, font face, and iconset are available as choices.
-A schema is loaded *after* the user settings. Therefore, to allow a user to overwrite a
-particular aspect of a schmea you would use the following syntax:
+A schema is loaded *after* the member's personal settings. Therefore, to allow a member
+to overwrite a particular aspect of a schema you would use the following syntax:
if (! $foo)
$foo = 'bar';
However, there are circumstances - particularly with positional elements - where it
-may be desirable (or necessary) to override a users settings. In this case, the syntax
+may be desirable (or necessary) to override a member's settings. In this case, the syntax
is even simpler:
$foo = 'bar';
-Users will not thank you for this, however, so only use it when it is required.
+Members will not thank you for this, however, so only use it when it is required.
-If no user options are set, and no schema is selected, we will first try to load a schema
+If no personal options are set, and no schema is selected, we will first try to load a schema
with the file name "default.php". This file should never be included with a theme. If it
is, merge conflicts will occur as people update their code. Rather, this should be defined
by administrators on a site by site basis.
diff --git a/include/enotify.php b/include/enotify.php
index 67fe748d1..91b37a913 100644
--- a/include/enotify.php
+++ b/include/enotify.php
@@ -322,6 +322,7 @@ function notification($params) {
$datarray['url'] = $sender['xchan_url'];
$datarray['photo'] = $sender['xchan_photo_s'];
$datarray['date'] = datetime_convert();
+ $datarray['aid'] = $recip['channel_account_id'];
$datarray['uid'] = $recip['channel_id'];
$datarray['link'] = $itemlink;
$datarray['parent'] = $parent_id;
@@ -340,13 +341,14 @@ function notification($params) {
// create notification entry in DB
- $r = q("insert into notify (hash,name,url,photo,date,uid,link,parent,type,verb,otype)
- values('%s','%s','%s','%s','%s',%d,'%s',%d,%d,'%s','%s')",
+ $r = q("insert into notify (hash,name,url,photo,date,aid,uid,link,parent,type,verb,otype)
+ values('%s','%s','%s','%s','%s',%d,%d,'%s',%d,%d,'%s','%s')",
dbesc($datarray['hash']),
dbesc($datarray['name']),
dbesc($datarray['url']),
dbesc($datarray['photo']),
dbesc($datarray['date']),
+ intval($datarray['aid']),
intval($datarray['uid']),
dbesc($datarray['link']),
intval($datarray['parent']),
@@ -559,7 +561,7 @@ class enotify {
// send the message
$res = mail(
- $params['toEmail'], // send to address
+ $params['toEmail'], // send to address
$messageSubject, // subject
$multipartMessageBody, // message body
$messageHeader // message headers
diff --git a/include/follow.php b/include/follow.php
index 5cf161304..845ce11da 100644
--- a/include/follow.php
+++ b/include/follow.php
@@ -175,6 +175,10 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
proc_run('php', 'include/notifier.php', 'permission_update', $result['abook']['abook_id']);
}
+ $arr = array('channel_id' => $uid, 'abook' => $result['abook']);
+
+ call_hooks('follow', $arr);
+
/** If there is a default group for this channel, add this member to it */
if($default_group) {
diff --git a/include/group.php b/include/group.php
index eece07983..d339301b4 100644
--- a/include/group.php
+++ b/include/group.php
@@ -202,7 +202,7 @@ function group_get_members($gid) {
return $ret;
}
-function mini_group_select($uid,$gid = 0) {
+function mini_group_select($uid,$group = '') {
$grps = array();
$o = '';
@@ -210,10 +210,10 @@ function mini_group_select($uid,$gid = 0) {
$r = q("SELECT * FROM `group` WHERE `deleted` = 0 AND `uid` = %d ORDER BY `name` ASC",
intval($uid)
);
- $grps[] = array('name' => '', 'id' => '0', 'selected' => '');
+ $grps[] = array('name' => '', 'hash' => '0', 'selected' => '');
if(count($r)) {
foreach($r as $rr) {
- $grps[] = array('name' => $rr['name'], 'id' => $rr['id'], 'selected' => (($gid == $rr['id']) ? 'true' : ''));
+ $grps[] = array('name' => $rr['name'], 'id' => $rr['hash'], 'selected' => (($group == $rr['hash']) ? 'true' : ''));
}
}
diff --git a/include/notifier.php b/include/notifier.php
index 1407be4b3..0868ac77e 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -382,12 +382,27 @@ function notifier_run($argv, $argc){
$env_recips = (($private) ? array() : null);
- $details = q("select xchan_hash, xchan_addr, xchan_guid, xchan_guid_sig from xchan where xchan_hash in (" . implode(',',$recipients) . ")");
+ $details = q("select xchan_hash, xchan_instance_url, xchan_addr, xchan_guid, xchan_guid_sig from xchan where xchan_hash in (" . implode(',',$recipients) . ")");
$recip_list = array();
if($details) {
foreach($details as $d) {
+
+ // If the recipient is federated from a traditional network they won't be able to
+ // handle nomadic identity. If we're publishing from a site that they aren't
+ // directly connected with, ignore them.
+
+ // FIXME: make sure we run through a notifier loop on the hub they're connected
+ // with if this post comes in from a different hub - so that we will deliver to them.
+
+ // On the down side, these channels will stop working if the hub they connected with
+ // goes down permanently, as they are (doh) not nomadic.
+
+ if(($d['xchan_instance_url']) && ($d['xchan_instance_url'] != z_root()))
+ continue;
+
+
$recip_list[] = $d['xchan_addr'] . ' (' . $d['xchan_hash'] . ')';
if($private)
$env_recips[] = array('guid' => $d['xchan_guid'],'guid_sig' => $d['xchan_guid_sig']);
@@ -408,9 +423,9 @@ function notifier_run($argv, $argc){
// for public posts always include our own hub
- $sql_extra = (($private) ? "" : " or hubloc_url = '" . z_root() . "' ");
+ $sql_extra = (($private) ? "" : " or hubloc_url = '" . dbesc(z_root()) . "' ");
- $r = q("select distinct hubloc_sitekey, hubloc_flags, hubloc_callback, hubloc_host from hubloc
+ $r = q("select hubloc_sitekey, hubloc_flags, hubloc_callback, hubloc_host from hubloc
where hubloc_hash in (" . implode(',',$recipients) . ") $sql_extra group by hubloc_sitekey");
if(! $r) {
logger('notifier: no hubs');
@@ -419,10 +434,14 @@ function notifier_run($argv, $argc){
$hubs = $r;
$hublist = array();
+ $keys = array();
+
foreach($hubs as $hub) {
- // don't try to deliver to deleted hublocs
- if(! ($hub['hubloc_flags'] & HUBLOC_FLAGS_DELETED)) {
+ // don't try to deliver to deleted hublocs - and inexplicably SQL "distinct" and "group by"
+ // both return records with duplicate keys in rare circumstances
+ if((! ($hub['hubloc_flags'] & HUBLOC_FLAGS_DELETED)) && (! in_array($hub['hubloc_sitekey'],$keys))) {
$hublist[] = $hub['hubloc_host'];
+ $keys[] = $hub['hubloc_sitekey'];
}
}
diff --git a/include/zot.php b/include/zot.php
index a4a27ce9c..65f3b606f 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -584,7 +584,7 @@ function import_xchan($arr,$ud_flags = 1) {
if($arr['locations']) {
- $xisting = q("select hubloc_id, hubloc_url from hubloc where hubloc_hash = '%s'",
+ $xisting = q("select hubloc_id, hubloc_url, hubloc_sitekey from hubloc where hubloc_hash = '%s'",
dbesc($xchan_hash)
);
@@ -596,14 +596,14 @@ function import_xchan($arr,$ud_flags = 1) {
}
for($x = 0; $x < count($xisting); $x ++) {
- if($xisting[$x]['hubloc_url'] == $location['url']) {
+ if(($xisting[$x]['hubloc_url'] === $location['url']) && ($xisting[$x]['hubloc_sitekey'] === $location['sitekey'])) {
$xisting[$x]['updated'] = true;
}
}
// match as many fields as possible in case anything at all changed.
- $r = q("select * from hubloc where hubloc_hash = '%s' and hubloc_guid = '%s' and hubloc_guid_sig = '%s' and hubloc_url = '%s' and hubloc_url_sig = '%s' and hubloc_host = '%s' and hubloc_addr = '%s' and hubloc_callback = '%s' and hubloc_sitekey = '%s' limit 1",
+ $r = q("select * from hubloc where hubloc_hash = '%s' and hubloc_guid = '%s' and hubloc_guid_sig = '%s' and hubloc_url = '%s' and hubloc_url_sig = '%s' and hubloc_host = '%s' and hubloc_addr = '%s' and hubloc_callback = '%s' and hubloc_sitekey = '%s' ",
dbesc($xchan_hash),
dbesc($arr['guid']),
dbesc($arr['guid_sig']),
@@ -624,6 +624,16 @@ function import_xchan($arr,$ud_flags = 1) {
intval($r[0]['hubloc_id'])
);
}
+
+ // Remove pure duplicates
+ if(count($r) > 1) {
+ for($h = 1; $h < count($r); $h ++) {
+ q("delete from hubloc where hubloc_id = %d limit 1",
+ intval($r[$h]['hubloc_id'])
+ );
+ }
+ }
+
if((($r[0]['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY) && (! $location['primary']))
|| ((! ($r[0]['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY)) && ($location['primary']))) {
$r = q("update hubloc set hubloc_flags = (hubloc_flags ^ %d), hubloc_updated = '%s' where hubloc_id = %d limit 1",
diff --git a/install/database.sql b/install/database.sql
index 5496072a9..ef79862c3 100644
--- a/install/database.sql
+++ b/install/database.sql
@@ -563,6 +563,7 @@ CREATE TABLE IF NOT EXISTS `notify` (
`photo` char(255) NOT NULL,
`date` datetime NOT NULL,
`msg` mediumtext NOT NULL,
+ `aid` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`link` char(255) NOT NULL,
`parent` int(11) NOT NULL,
@@ -578,7 +579,8 @@ CREATE TABLE IF NOT EXISTS `notify` (
KEY `hash` (`hash`),
KEY `parent` (`parent`),
KEY `link` (`link`),
- KEY `otype` (`otype`)
+ KEY `otype` (`otype`),
+ KEY `aid` (`aid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `obj` (
diff --git a/install/update.php b/install/update.php
index 31eac2963..f498ec042 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1083 );
+define( 'UPDATE_VERSION' , 1084 );
/**
*
@@ -910,3 +910,12 @@ function update_r1082() {
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
+
+function update_r1083() {
+ $r = q("ALTER TABLE `notify` ADD `aid` INT NOT NULL AFTER `msg` ,
+ADD INDEX ( `aid` )");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
diff --git a/js/crypto.js b/js/crypto.js
index a7b278537..a144e03ea 100644
--- a/js/crypto.js
+++ b/js/crypto.js
@@ -18,6 +18,11 @@ function str_rot13 (str) {
}
+// Arrays for pluggable encryptors/decryptors
+
+var red_encryptors = new Array();
+var red_decryptors = new Array();
+
// We probably just want the element where the text is and find it ourself. e.g. if
// there is highlighted text use it, otherwise use the entire text.
// So the third element may be useless. Fix also in view/tpl/jot.tpl before
@@ -86,6 +91,13 @@ function red_encrypt(alg, elem,text) {
newdiv = "[crypt alg='3des' hint='" + enc_hint + "']" + encrypted + '[/crypt]';
}
+ if((red_encryptors.length) && (! newdiv.length)) {
+ for(var i = 0; i < red_encryptors.length; i ++) {
+ newdiv = red_encryptors[i](alg,text);
+ if(newdiv.length)
+ break;
+ }
+ }
enc_key = '';
@@ -118,22 +130,30 @@ function red_encrypt(alg, elem,text) {
function red_decrypt(alg,hint,text,elem) {
- var enc_text = '';
+ var dec_text = '';
if(alg == 'rot13' || alg == 'triple-rot13')
- enc_text = str_rot13(text);
+ dec_text = str_rot13(text);
+ else {
+ var enc_key = prompt((hint.length) ? hint : aStr['passphrase']);
+ }
if(alg == 'aes256') {
- var enc_key = prompt((hint.length) ? hint : aStr['passphrase']);
- enc_text = CryptoJS.AES.decrypt(text,enc_key);
+ dec_text = CryptoJS.AES.decrypt(text,enc_key);
}
if(alg == 'rabbit') {
- var enc_key = prompt((hint.length) ? hint : aStr['passphrase']);
- enc_text = CryptoJS.Rabbit.decrypt(text,enc_key);
+ dec_text = CryptoJS.Rabbit.decrypt(text,enc_key);
}
if(alg == '3des') {
- var enc_key = prompt((hint.length) ? hint : aStr['passphrase']);
- enc_text = CryptoJS.TripleDES.decrypt(text,enc_key);
+ dec_text = CryptoJS.TripleDES.decrypt(text,enc_key);
+ }
+
+ if((red_decryptors.length) && (! dec_text.length)) {
+ for(var i = 0; i < red_decryptors.length; i ++) {
+ dec_text = red_decryptors[i](alg,text,enc_key);
+ if(dec_text.length)
+ break;
+ }
}
enc_key = '';
@@ -144,16 +164,16 @@ function red_decrypt(alg,hint,text,elem) {
// wipe out the text and make you re-enter the key if it was in the
// conversation. For now we do that so you can read it.
- var enc_result = enc_text.toString(CryptoJS.enc.Utf8);
- delete enc_text;
+ var dec_result = dec_text.toString(CryptoJS.enc.Utf8);
+ delete dec_text;
// incorrect decryptions *usually* but don't always have zero length
// If the person typo'd let them try again without reloading the page
// otherwise they'll have no "padlock" to click to try again.
- if(enc_result.length) {
- $(elem).html(b2h(enc_result));
- enc_result = '';
+ if(dec_result.length) {
+ $(elem).html(b2h(dec_result));
+ dec_result = '';
}
}
diff --git a/mod/connections.php b/mod/connections.php
index a40a8fa90..d7adf775b 100644
--- a/mod/connections.php
+++ b/mod/connections.php
@@ -129,6 +129,17 @@ function connections_post(&$a) {
}
if($new_friend) {
+ $channel = $a->get_channel();
+ $default_group = $channel['channel_default_group'];
+ if($default_group) {
+ require_once('include/group.php');
+ $g = group_rec_byhash(local_user(),$default_group);
+ if($g)
+ group_add_member(local_user(),'',$a->data['abook_xchan'],$g['id']);
+ }
+
+
+
// Check if settings permit ("post new friend activity" is allowed, and
// friends in general or this friend in particular aren't hidden)
// and send out a new friend activity
@@ -136,6 +147,7 @@ function connections_post(&$a) {
// pull in a bit of content if there is any to pull in
proc_run('php','include/onepoll.php',$contact_id);
+
}
// Refresh the structure in memory with the new data
@@ -150,6 +162,11 @@ function connections_post(&$a) {
$a->data['abook'] = $r[0];
}
+ if($new_friend) {
+ $arr = array('channel_id' => local_user(), 'abook' => $a->data['abook']);
+ call_hooks('accept_follow', $arr);
+ }
+
connections_clone($a);
return;
diff --git a/mod/help.php b/mod/help.php
index 770a0a8af..e78f9e61c 100644
--- a/mod/help.php
+++ b/mod/help.php
@@ -1,5 +1,16 @@
<?php
+/**
+ * You can create local site resources in doc/Site.md and either link to doc/Home.md for the standard resources
+ * or use our include mechanism to include it on your local page.
+ *
+ * #include doc/Home.md;
+ *
+ * The syntax is somewhat strict.
+ *
+ */
+
+
if(! function_exists('load_doc_file')) {
function load_doc_file($s) {
$lang = get_app()->language;
@@ -25,9 +36,13 @@ function help_content(&$a) {
$text = '';
- if($a->argc > 1) {
+ if(argc() > 1) {
$text = load_doc_file('doc/' . $a->argv[1] . '.md');
- $a->page['title'] = t('Help:') . ' ' . str_replace('-',' ',notags($a->argv[1]));
+ $a->page['title'] = t('Help:') . ' ' . str_replace('-',' ',notags(argv(1)));
+ }
+ if(! $text) {
+ $text = load_doc_file('doc/Site.md');
+ $a->page['title'] = t('Help');
}
if(! $text) {
$text = load_doc_file('doc/Home.md');
@@ -41,7 +56,20 @@ function help_content(&$a) {
'$message' => t('Page not found.' )
));
}
+
+ $text = preg_replace_callback("/#include (.*?)\;/ism", 'preg_callback_help_include', $text);
+
return Markdown($text);
}
+
+
+function preg_callback_help_include($matches) {
+ print_r($matches);
+
+ if($matches[1])
+ return str_replace($matches[0],load_doc_file($matches[1]),$matches[0]);
+
+}
+
diff --git a/mod/post.php b/mod/post.php
index 64e08e632..0ce58ec9f 100644
--- a/mod/post.php
+++ b/mod/post.php
@@ -265,6 +265,7 @@ function post_post(&$a) {
if((! $forgery) && (! $secret_fail))
break;
}
+
if($forgery) {
$ret['message'] = 'possible site forgery';
logger('mod_zot: pickup: ' . $ret['message']);
@@ -312,6 +313,7 @@ function post_post(&$a) {
);
}
}
+
$encrypted = crypto_encapsulate(json_encode($ret),$sitekey);
json_return_and_die($encrypted);
@@ -355,6 +357,18 @@ function post_post(&$a) {
intval($hub['hubloc_id'])
);
+ /**
+ * This hub has now been proven to be valid.
+ * Any hub with the same URL and a different sitekey cannot be valid.
+ * Get rid of them (mark them deleted). There's a good chance they were re-installs.
+ *
+ */
+
+ q("update hubloc set hubloc_flags = ( hubloc_flags | %d ) where hubloc_url = '%s' and hubloc_sitekey != '%s' ",
+ intval(HUBLOC_FLAGS_DELETED),
+ dbesc($hub['hubloc_url']),
+ dbesc($hub['hubloc_sitekey'])
+ );
// TODO: check which hub is primary and take action if mismatched
diff --git a/mod/settings.php b/mod/settings.php
index ba7540b91..af9113202 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -357,7 +357,7 @@ function settings_post(&$a) {
$openid = ((x($_POST,'openid_url')) ? notags(trim($_POST['openid_url'])) : '');
$maxreq = ((x($_POST,'maxreq')) ? intval($_POST['maxreq']) : 0);
$expire = ((x($_POST,'expire')) ? intval($_POST['expire']) : 0);
- $def_gid = ((x($_POST,'group-selection')) ? intval($_POST['group-selection']) : 0);
+ $def_group = ((x($_POST,'group-selection')) ? notags(trim($_POST['group-selection'])) : '');
$expire_items = ((x($_POST,'expire_items')) ? intval($_POST['expire_items']) : 0);
@@ -506,9 +506,9 @@ function settings_post(&$a) {
if($page_flags == PAGE_PRVGROUP) {
$hidewall = 1;
if((! $str_contact_allow) && (! $str_group_allow) && (! $str_contact_deny) && (! $str_group_deny)) {
- if($def_gid) {
+ if($def_group) {
info( t('Private forum has no privacy permissions. Using default privacy group.'). EOL);
- $str_group_allow = '<' . $def_gid . '>';
+ $str_group_allow = '<' . $def_group . '>';
}
else {
notice( t('Private forum has no privacy permissions and no default privacy group.') . EOL);
@@ -519,7 +519,7 @@ function settings_post(&$a) {
*/
/*
- $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `openid` = '%s', `timezone` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s', `allow_location` = %d, `maxreq` = %d, `expire` = %d, `openidserver` = '%s', `def_gid` = %d, `blockwall` = %d, `hidewall` = %d, `blocktags` = %d, `unkmail` = %d, `cntunkmail` = %d WHERE `uid` = %d LIMIT 1",
+ $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `openid` = '%s', `timezone` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s', `allow_location` = %d, `maxreq` = %d, `expire` = %d, `openidserver` = '%s', `def_group` = %d, `blockwall` = %d, `hidewall` = %d, `blocktags` = %d, `unkmail` = %d, `cntunkmail` = %d WHERE `uid` = %d LIMIT 1",
dbesc($username),
dbesc($email),
dbesc($openid),
@@ -535,7 +535,7 @@ function settings_post(&$a) {
intval($maxreq),
intval($expire),
dbesc($openidserver),
- intval($def_gid),
+ intval($def_group),
intval($blockwall),
intval($hidewall),
intval($blocktags),
@@ -545,7 +545,7 @@ function settings_post(&$a) {
);
*/
- $r = q("update channel set channel_name = '%s', channel_pageflags = %d, channel_timezone = '%s', channel_location = '%s', channel_notifyflags = %d, channel_max_anon_mail = %d, channel_max_friend_req = %d, channel_expire_days = %d, channel_r_stream = %d, channel_r_profile = %d, channel_r_photos = %d, channel_r_abook = %d, channel_w_stream = %d, channel_w_wall = %d, channel_w_tagwall = %d, channel_w_comment = %d, channel_w_mail = %d, channel_w_photos = %d, channel_w_chat = %d, channel_a_delegate = %d, channel_r_storage = %d, channel_w_storage = %d, channel_r_pages = %d, channel_w_pages = %d, channel_a_republish = %d where channel_id = %d limit 1",
+ $r = q("update channel set channel_name = '%s', channel_pageflags = %d, channel_timezone = '%s', channel_location = '%s', channel_notifyflags = %d, channel_max_anon_mail = %d, channel_max_friend_req = %d, channel_expire_days = %d, channel_default_group = '%s', channel_r_stream = %d, channel_r_profile = %d, channel_r_photos = %d, channel_r_abook = %d, channel_w_stream = %d, channel_w_wall = %d, channel_w_tagwall = %d, channel_w_comment = %d, channel_w_mail = %d, channel_w_photos = %d, channel_w_chat = %d, channel_a_delegate = %d, channel_r_storage = %d, channel_w_storage = %d, channel_r_pages = %d, channel_w_pages = %d, channel_a_republish = %d where channel_id = %d limit 1",
dbesc($username),
intval($pageflags),
dbesc($timezone),
@@ -554,6 +554,7 @@ function settings_post(&$a) {
intval($unkmail),
intval($maxreq),
intval($expire),
+ dbesc($def_group),
intval($arr['channel_r_stream']),
intval($arr['channel_r_profile']),
intval($arr['channel_r_photos']),
@@ -1045,7 +1046,7 @@ function settings_content(&$a) {
require_once('include/group.php');
- $group_select = mini_group_select(local_user(),$a->user['def_gid']);
+ $group_select = mini_group_select(local_user(),$channel['channel_default_group']);
$o .= replace_macros($stpl,array(
'$ptitle' => t('Channel Settings'),
diff --git a/version.inc b/version.inc
index ab46c45fd..3e026cef2 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2013-11-20.503
+2013-11-21.504