aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/acl.php2
-rw-r--r--mod/admin.php12
-rw-r--r--mod/attach.php5
-rw-r--r--mod/channel.php2
-rw-r--r--mod/connedit.php25
-rw-r--r--mod/directory.php2
-rw-r--r--mod/dirsearch.php12
-rw-r--r--mod/dreport.php5
-rw-r--r--mod/editpost.php16
-rwxr-xr-xmod/events.php362
-rw-r--r--mod/ffsapi.php8
-rw-r--r--mod/import.php24
-rw-r--r--mod/invite.php2
-rw-r--r--mod/item.php47
-rw-r--r--mod/network.php4
-rw-r--r--mod/page.php4
-rw-r--r--mod/profile_photo.php3
-rw-r--r--mod/profiles.php16
-rw-r--r--mod/search.php3
-rw-r--r--mod/search_ac.php5
-rw-r--r--mod/settings.php5
-rw-r--r--mod/siteinfo.php4
-rwxr-xr-xmod/subthread.php12
-rw-r--r--mod/tagger.php2
24 files changed, 339 insertions, 243 deletions
diff --git a/mod/acl.php b/mod/acl.php
index dc29e3eff..aaf056b60 100644
--- a/mod/acl.php
+++ b/mod/acl.php
@@ -1,6 +1,6 @@
<?php
-/* ACL selector json backend */
+/* ACL selector json backend */
require_once("include/acl_selectors.php");
function acl_init(&$a){
diff --git a/mod/admin.php b/mod/admin.php
index a884b7658..4b7cb3cd9 100644
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -395,9 +395,10 @@ function admin_page_site(&$a) {
}
/* Banner */
+
$banner = get_config('system', 'banner');
- if($banner == false)
- $banner = 'red';
+ if($banner === false)
+ $banner = get_config('system','sitename');
$banner = htmlspecialchars($banner);
@@ -1042,7 +1043,12 @@ function admin_page_plugins(&$a){
}
$admin_form = '';
- if (is_array($a->plugins_admin) && in_array($plugin, $a->plugins_admin)){
+
+ $r = q("select * from addon where plugin_admin = 1 and name = '%s' limit 1",
+ dbesc($plugin)
+ );
+
+ if($r) {
@require_once("addon/$plugin/$plugin.php");
if(function_exists($plugin.'_plugin_admin')) {
$func = $plugin.'_plugin_admin';
diff --git a/mod/attach.php b/mod/attach.php
index ad5dead07..306e39519 100644
--- a/mod/attach.php
+++ b/mod/attach.php
@@ -37,7 +37,10 @@ function attach_init(&$a) {
header('Content-disposition: attachment; filename="' . $r['data']['filename'] . '"');
if(intval($r['data']['os_storage'])) {
$fname = dbunescbin($r['data']['data']);
- $istream = fopen('store/' . $c[0]['channel_address'] . '/' . $fname,'rb');
+ if(strpos($fname,'store') !== false)
+ $istream = fopen($fname,'rb');
+ else
+ $istream = fopen('store/' . $c[0]['channel_address'] . '/' . $fname,'rb');
$ostream = fopen('php://output','wb');
if($istream && $ostream) {
pipe_streams($istream,$ostream);
diff --git a/mod/channel.php b/mod/channel.php
index 0af2666cc..2b9d0ed89 100644
--- a/mod/channel.php
+++ b/mod/channel.php
@@ -189,7 +189,7 @@ function channel_content(&$a, $update = 0, $load = false) {
$sql_extra .= protect_sprintf(term_query('item', $category, TERM_CATEGORY));
}
if(x($hashtags)) {
- $sql_extra .= protect_sprintf(term_query('item', $hashtags, TERM_HASHTAG));
+ $sql_extra .= protect_sprintf(term_query('item', $hashtags, TERM_HASHTAG, TERM_COMMUNITYTAG));
}
if($datequery) {
diff --git a/mod/connedit.php b/mod/connedit.php
index 877c12dc7..9c46fa999 100644
--- a/mod/connedit.php
+++ b/mod/connedit.php
@@ -177,16 +177,21 @@ function connedit_post(&$a) {
if(($_REQUEST['pending']) && intval($orig_record[0]['abook_pending'])) {
$new_friend = true;
- if(! $abook_my_perms) {
- $abook_my_perms = get_channel_default_perms(local_channel());
+ // @fixme it won't be common, but when you accept a new connection request
+ // the permissions will now be that of your permissions role and ignore
+ // any you may have set manually on the form. We'll probably see a bug if somebody
+ // tries to set the permissions *and* approve the connection in the same
+ // request. The workaround is to approve the connection, then go back and
+ // adjust permissions as desired.
- $role = get_pconfig(local_channel(),'system','permissions_role');
- if($role) {
- $x = get_role_perms($role);
- if($x['perms_accept'])
- $abook_my_perms = $x['perms_accept'];
- }
+ $abook_my_perms = get_channel_default_perms(local_channel());
+
+ $role = get_pconfig(local_channel(),'system','permissions_role');
+ if($role) {
+ $x = get_role_perms($role);
+ if($x['perms_accept'])
+ $abook_my_perms = $x['perms_accept'];
}
}
@@ -661,6 +666,10 @@ function connedit_content(&$a) {
if($locs) {
foreach($locs as $l) {
+ if(!($l['location']))
+ continue;
+ if(strpos($locstr,$l['location']) !== false)
+ continue;
if(strlen($locstr))
$locstr .= ', ';
$locstr .= $l['location'];
diff --git a/mod/directory.php b/mod/directory.php
index 3c230e173..4ab118b17 100644
--- a/mod/directory.php
+++ b/mod/directory.php
@@ -121,6 +121,8 @@ function directory_content(&$a) {
}
if(! $url) {
$directory = find_upstream_directory($dirmode);
+ if((! $directory) || (! array_key_exists('url',$directory)) || (! $directory['url']))
+ logger('CRITICAL: No directory server URL');
$url = $directory['url'] . '/dirsearch';
}
diff --git a/mod/dirsearch.php b/mod/dirsearch.php
index 937564a79..548acbd08 100644
--- a/mod/dirsearch.php
+++ b/mod/dirsearch.php
@@ -124,8 +124,6 @@ function dirsearch_content(&$a) {
if($keywords)
$sql_extra .= dir_query_build($joiner,'xprof_keywords',$keywords);
- if($forums)
- $safesql .= dir_flag_build(' AND ','xchan_flags',XCHAN_FLAGS_PUBFORUM, $forums);
// we only support an age range currently. You must set both agege
// (greater than or equal) and agele (less than or equal)
@@ -173,6 +171,9 @@ function dirsearch_content(&$a) {
if($safe < 0)
$safesql = " and ( xchan_censored = 1 OR xchan_selfcensored = 1 ) ";
+ if($forums)
+ $safesql .= " and xchan_pubforum = " . ((intval($forums)) ? '1 ' : '0 ');
+
if($limit)
$qlimit = " LIMIT $limit ";
else {
@@ -185,7 +186,6 @@ function dirsearch_content(&$a) {
}
}
-
if($sort_order == 'normal') {
$order = " order by xchan_name asc ";
@@ -202,6 +202,7 @@ function dirsearch_content(&$a) {
else
$order = " order by xchan_name_date desc ";
+
if($sync) {
$spkt = array('transactions' => array());
$r = q("select * from updates where ud_date >= '%s' and ud_guid != '' order by ud_date desc",
@@ -245,15 +246,20 @@ function dirsearch_content(&$a) {
json_return_and_die($spkt);
}
else {
+
$r = q("SELECT xchan.*, xprof.* from xchan left join xprof on xchan_hash = xprof_hash
where ( $logic $sql_extra ) $hub_query and xchan_network = 'zot' and xchan_hidden = 0 and xchan_orphan = 0 and xchan_deleted = 0
$safesql $order $qlimit "
);
+
+
+
$ret['page'] = $page + 1;
$ret['records'] = count($r);
}
+
if($r) {
$entries = array();
diff --git a/mod/dreport.php b/mod/dreport.php
index c320bf0e6..1ad1eca7c 100644
--- a/mod/dreport.php
+++ b/mod/dreport.php
@@ -56,7 +56,7 @@ function dreport_content(&$a) {
return;
}
-
+ $o .= '<div class="generic-content-wrapper-styled">';
$o .= '<h2>' . sprintf( t('Delivery report for %1$s'),substr($mid,0,32)) . '...' . '</h2>';
$o .= '<table>';
@@ -121,6 +121,7 @@ function dreport_content(&$a) {
$o .= '<tr><td width="40%">' . $rr['name'] . '</td><td width="20%">' . escape_tags($rr['dreport_result']) . '</td><td width="20%">' . escape_tags($rr['dreport_time']) . '</td></tr>';
}
$o .= '</table>';
+ $o .= '</div>';
return $o;
@@ -135,4 +136,4 @@ function dreport_gravity_sort($a,$b) {
return strcmp($a['name'],$b['name']);
}
return (($a['gravity'] > $b['gravity']) ? 1 : (-1));
-} \ No newline at end of file
+}
diff --git a/mod/editpost.php b/mod/editpost.php
index 2f999858f..030d8d671 100644
--- a/mod/editpost.php
+++ b/mod/editpost.php
@@ -21,9 +21,9 @@ function editpost_content(&$a) {
return;
}
- $itm = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d and author_xchan = '%s' LIMIT 1",
+ $itm = q("SELECT * FROM `item` WHERE `id` = %d AND ( owner_xchan = '%s' OR author_xchan = '%s' ) LIMIT 1",
intval($post_id),
- intval(local_channel()),
+ dbesc(get_observer_hash()),
dbesc(get_observer_hash())
);
@@ -33,10 +33,12 @@ function editpost_content(&$a) {
}
if($itm[0]['resource_type'] === 'event' && $itm[0]['resource_id']) {
- goaway(z_root() . '/events/event/' . $itm[0]['resource_id']);
+ goaway(z_root() . '/events/' . $itm[0]['resource_id'] . '?expandform=1');
}
+ $owner_uid = $itm[0]['uid'];
+
$plaintext = true;
// if(feature_enabled(local_channel(),'richtext'))
@@ -71,14 +73,12 @@ function editpost_content(&$a) {
call_hooks('jot_tool', $jotplugins);
call_hooks('jot_networks', $jotnets);
- $channel = $a->get_channel();
-
//$tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
- $voting = feature_enabled(local_channel(),'consensus_tools');
+ $voting = feature_enabled($owner_uid,'consensus_tools');
$category = '';
- $catsenabled = ((feature_enabled(local_channel(),'categories')) ? 'categories' : '');
+ $catsenabled = ((feature_enabled($owner_uid,'categories')) ? 'categories' : '');
if ($catsenabled){
$itm = fetch_post_tags($itm);
@@ -145,7 +145,7 @@ function editpost_content(&$a) {
'$lockstate' => $lockstate,
'$acl' => '',
'$bang' => '',
- '$profile_uid' => local_channel(),
+ '$profile_uid' => $owner_uid,
'$preview' => t('Preview'),
'$jotplugins' => $jotplugins,
'$sourceapp' => t($a->sourcename),
diff --git a/mod/events.php b/mod/events.php
index d76602a33..d55d22f44 100755
--- a/mod/events.php
+++ b/mod/events.php
@@ -166,7 +166,7 @@ function events_post(&$a) {
'otype' => TERM_OBJ_POST,
'term' => trim($cat),
'url' => $channel['xchan_url'] . '?f=&cat=' . urlencode(trim($cat))
- );
+ );
}
}
@@ -273,39 +273,26 @@ function events_content(&$a) {
);
}
-
- $plaintext = true;
-
-// if(feature_enabled(local_channel(),'richtext'))
-// $plaintext = false;
-
-
+ $first_day = get_pconfig(local_channel(),'system','cal_first_day');
+ $first_day = (($first_day) ? $first_day : 0);
$htpl = get_markup_template('event_head.tpl');
$a->page['htmlhead'] .= replace_macros($htpl,array(
'$baseurl' => $a->get_baseurl(),
- '$editselect' => (($plaintext) ? 'none' : 'textareas')
+ '$lang' => $a->language,
+ '$first_day' => $first_day
));
- $o ="";
- // tabs
+ $o = '';
$channel = $a->get_channel();
- $tabs = profile_tabs($a, True, $channel['channel_address']);
-
-
-
$mode = 'view';
$y = 0;
$m = 0;
$ignored = ((x($_REQUEST,'ignored')) ? " and ignored = " . intval($_REQUEST['ignored']) . " " : '');
if(argc() > 1) {
- if(argc() > 2 && argv(1) == 'event') {
- $mode = 'edit';
- $event_id = argv(2);
- }
if(argc() > 2 && argv(1) === 'add') {
$mode = 'add';
$item_id = intval(argv(2));
@@ -314,15 +301,15 @@ function events_content(&$a) {
$mode = 'drop';
$event_id = argv(2);
}
- if(argv(1) === 'new') {
- $mode = 'new';
- $event_id = '';
- }
if(argc() > 2 && intval(argv(1)) && intval(argv(2))) {
$mode = 'view';
$y = intval(argv(1));
$m = intval(argv(2));
}
+ if(argc() <= 2) {
+ $mode = 'view';
+ $event_id = argv(1);
+ }
}
if($mode === 'add') {
@@ -330,13 +317,156 @@ function events_content(&$a) {
killme();
}
+ if($mode == 'view') {
+ /* edit/create form */
+ if($event_id) {
+ $r = q("SELECT * FROM `event` WHERE event_hash = '%s' AND `uid` = %d LIMIT 1",
+ dbesc($event_id),
+ intval(local_channel())
+ );
+ if(count($r))
+ $orig_event = $r[0];
+ }
+ $channel = $a->get_channel();
+ // Passed parameters overrides anything found in the DB
+ if(!x($orig_event))
+ $orig_event = array();
+
+ // In case of an error the browser is redirected back here, with these parameters filled in with the previous values
+ /*
+ if(x($_REQUEST,'nofinish')) $orig_event['nofinish'] = $_REQUEST['nofinish'];
+ if(x($_REQUEST,'adjust')) $orig_event['adjust'] = $_REQUEST['adjust'];
+ if(x($_REQUEST,'summary')) $orig_event['summary'] = $_REQUEST['summary'];
+ if(x($_REQUEST,'description')) $orig_event['description'] = $_REQUEST['description'];
+ if(x($_REQUEST,'location')) $orig_event['location'] = $_REQUEST['location'];
+ if(x($_REQUEST,'start')) $orig_event['start'] = $_REQUEST['start'];
+ if(x($_REQUEST,'finish')) $orig_event['finish'] = $_REQUEST['finish'];
+ if(x($_REQUEST,'type')) $orig_event['type'] = $_REQUEST['type'];
+ */
+
+ $n_checked = ((x($orig_event) && $orig_event['nofinish']) ? ' checked="checked" ' : '');
+ $a_checked = ((x($orig_event) && $orig_event['adjust']) ? ' checked="checked" ' : '');
+ $t_orig = ((x($orig_event)) ? $orig_event['summary'] : '');
+ $d_orig = ((x($orig_event)) ? $orig_event['description'] : '');
+ $l_orig = ((x($orig_event)) ? $orig_event['location'] : '');
+ $eid = ((x($orig_event)) ? $orig_event['id'] : 0);
+ $event_xchan = ((x($orig_event)) ? $orig_event['event_xchan'] : $channel['channel_hash']);
+ $mid = ((x($orig_event)) ? $orig_event['mid'] : '');
+
+ if(! x($orig_event))
+ $sh_checked = '';
+ else
+ $sh_checked = ((($orig_event['allow_cid'] === '<' . $channel['channel_hash'] . '>' || (! $orig_event['allow_cid'])) && (! $orig_event['allow_gid']) && (! $orig_event['deny_cid']) && (! $orig_event['deny_gid'])) ? '' : ' checked="checked" ' );
+
+ if($orig_event['event_xchan'])
+ $sh_checked .= ' disabled="disabled" ';
+
+ $sdt = ((x($orig_event)) ? $orig_event['start'] : 'now');
+
+ $fdt = ((x($orig_event)) ? $orig_event['finish'] : 'now');
+
+ $tz = date_default_timezone_get();
+ if(x($orig_event))
+ $tz = (($orig_event['adjust']) ? date_default_timezone_get() : 'UTC');
+
+// $syear = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'Y') : '0000');
+// $smonth = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'm') : '00');
+// $sday = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'd') : '00');
+
+ $syear = datetime_convert('UTC', $tz, $sdt, 'Y');
+ $smonth = datetime_convert('UTC', $tz, $sdt, 'm');
+ $sday = datetime_convert('UTC', $tz, $sdt, 'd');
+
+ $shour = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'H') : '00');
+ $sminute = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'i') : '00');
+ $stext = datetime_convert('UTC',$tz,$sdt);
+ $stext = substr($stext,0,14) . "00:00";
+
+// $fyear = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'Y') : '0000');
+// $fmonth = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'm') : '00');
+// $fday = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'd') : '00');
+
+ $fyear = datetime_convert('UTC', $tz, $fdt, 'Y');
+ $fmonth = datetime_convert('UTC', $tz, $fdt, 'm');
+ $fday = datetime_convert('UTC', $tz, $fdt, 'd');
+
+ $fhour = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'H') : '00');
+ $fminute = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'i') : '00');
+ $ftext = datetime_convert('UTC',$tz,$fdt);
+ $ftext = substr($ftext,0,14) . "00:00";
+ $type = ((x($orig_event)) ? $orig_event['type'] : 'event');
+
+ $f = get_config('system','event_input_format');
+ if(! $f)
+ $f = 'ymd';
+
+ $catsenabled = feature_enabled(local_channel(),'categories');
+
+ $category = '';
+
+ if($catsenabled && x($orig_event)){
+ $itm = q("select * from item where resource_type = 'event' and resource_id = '%s' and uid = %d limit 1",
+ dbesc($orig_event['event_hash']),
+ intval(local_channel())
+ );
+ $itm = fetch_post_tags($itm);
+ if($itm) {
+ $cats = get_terms_oftype($itm[0]['term'], TERM_CATEGORY);
+ foreach ($cats as $cat) {
+ if(strlen($category))
+ $category .= ', ';
+ $category .= $cat['term'];
+ }
+ }
+ }
+
+ require_once('include/acl_selectors.php');
+
+ $acl = new AccessList($channel);
+ $perm_defaults = $acl->get();
+
+ $tpl = get_markup_template('event_form.tpl');
+
+ $form = replace_macros($tpl,array(
+ '$post' => $a->get_baseurl() . '/events',
+ '$eid' => $eid,
+ '$type' => $type,
+ '$xchan' => $event_xchan,
+ '$mid' => $mid,
+ '$event_hash' => $event_id,
+ '$summary' => array('summary', t('Event Title'), $t_orig, t('Required'), '*'),
+ '$catsenabled' => $catsenabled,
+ '$placeholdercategory' => t('Categories (comma-separated list)'),
+ '$c_text' => t('Category'),
+ '$category' => $category,
+ '$required' => '<span class="required" title="' . t('Required') . '">*</span>',
+ '$s_dsel' => datetimesel($f,new DateTime(),DateTime::createFromFormat('Y',$syear+5),DateTime::createFromFormat('Y-m-d H:i',"$syear-$smonth-$sday $shour:$sminute"), t('Start date and time'), 'start_text',true,true,'','',true,$first_day),
+ '$n_text' => t('Finish date and time are not known or not relevant'),
+ '$n_checked' => $n_checked,
+ '$f_dsel' => datetimesel($f,new DateTime(),DateTime::createFromFormat('Y',$fyear+5),DateTime::createFromFormat('Y-m-d H:i',"$fyear-$fmonth-$fday $fhour:$fminute"), t('Finish date and time'),'finish_text',true,true,'start_text','',false,$first_day),
+ '$nofinish' => array('nofinish', t('Finish date and time are not known or not relevant'), $n_checked, '', array(t('No'),t('Yes')), 'onclick="enableDisableFinishDate();"'),
+ '$adjust' => array('adjust', t('Adjust for viewer timezone'), $a_checked, t('Important for events that happen in a particular place. Not practical for global holidays.'), array(t('No'),t('Yes'))),
+ '$a_text' => t('Adjust for viewer timezone'),
+ '$d_text' => t('Description'),
+ '$d_orig' => $d_orig,
+ '$l_text' => t('Location'),
+ '$l_orig' => $l_orig,
+ '$t_orig' => $t_orig,
+ '$sh_text' => t('Share this event'),
+ '$sh_checked' => $sh_checked,
+ '$share' => array('share', t('Share this event'), $sh_checked, '', array(t('No'),t('Yes'))),
+ '$preview' => t('Preview'),
+ '$permissions' => t('Permission settings'),
+ '$acl' => (($orig_event['event_xchan']) ? '' : populate_acl(((x($orig_event)) ? $orig_event : $perm_defaults),false)),
+ '$submit' => t('Submit'),
+ '$advanced' => t('Advanced Options')
+
+ ));
+ /* end edit/create form */
- if($mode == 'view') {
-
-
$thisyear = datetime_convert('UTC',date_default_timezone_get(),'now','Y');
$thismonth = datetime_convert('UTC',date_default_timezone_get(),'now','m');
if(! $y)
@@ -348,7 +478,6 @@ function events_content(&$a) {
if(argc() === 4 && argv(3) === 'export')
$export = true;
-
// Put some limits on dates. The PHP date functions don't seem to do so well before 1900.
// An upper limit was chosen to keep search engines from exploring links millions of years in the future.
@@ -378,10 +507,10 @@ function events_content(&$a) {
if (argv(1) === 'json'){
- if (x($_GET,'start')) $start = date("Y-m-d h:i:s", $_GET['start']);
- if (x($_GET,'end')) $finish = date("Y-m-d h:i:s", $_GET['end']);
+ if (x($_GET,'start')) $start = $_GET['start'];
+ if (x($_GET,'end')) $finish = $_GET['end'];
}
-
+
$start = datetime_convert('UTC','UTC',$start);
$finish = datetime_convert('UTC','UTC',$finish);
@@ -413,17 +542,17 @@ function events_content(&$a) {
$r = q("SELECT event.*, item.plink, item.item_flags, item.author_xchan, item.owner_xchan
from event left join item on event_hash = resource_id
- where resource_type = 'event' and event.uid = %d $ignored
- AND (( `adjust` = 0 AND ( `finish` >= '%s' or nofinish = 1 ) AND `start` <= '%s' )
- OR ( `adjust` = 1 AND ( `finish` >= '%s' or nofinish = 1 ) AND `start` <= '%s' )) ",
+ where resource_type = 'event' and event.uid = %d $ignored
+ AND (( adjust = 0 AND ( finish >= '%s' or nofinish = 1 ) AND start <= '%s' )
+ OR ( adjust = 1 AND ( finish >= '%s' or nofinish = 1 ) AND start <= '%s' )) ",
intval(local_channel()),
dbesc($start),
dbesc($finish),
dbesc($adjust_start),
dbesc($adjust_finish)
);
- }
+ }
$links = array();
@@ -467,7 +596,7 @@ function events_content(&$a) {
$last_date = $d;
- $edit = (intval($rr['item_wall']) ? array($a->get_baseurl().'/events/event/'.$rr['event_hash'],t('Edit event'),'','') : null);
+ $edit = array($a->get_baseurl().'/events/'.$rr['event_hash'].'?expandform=1',t('Edit event'),'','');
$drop = array($a->get_baseurl().'/events/drop/'.$rr['event_hash'],t('Delete event'),'','');
@@ -500,7 +629,7 @@ function events_content(&$a) {
}
}
-
+
if($export) {
header('Content-type: text/calendar');
header('content-disposition: attachment; filename="' . t('calendar') . '-' . $channel['channel_address'] . '.ics"' );
@@ -522,22 +651,24 @@ function events_content(&$a) {
$o = replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(),
- '$tabs' => $tabs,
- '$title' => t('Events'),
- '$new_event'=> array($a->get_baseurl().'/events/new',t('Create New Event'),'',''),
+ '$new_event' => array($a->get_baseurl().'/events/new',t('New Event'),'',''),
'$previus' => array($a->get_baseurl()."/events/$prevyear/$prevmonth",t('Previous'),'',''),
'$next' => array($a->get_baseurl()."/events/$nextyear/$nextmonth",t('Next'),'',''),
- '$export' => array($a->get_baseurl()."/events/$y/$m/export",t('Export'),'',''),
- '$calendar' => cal($y,$m,$links, ' eventcal'),
+ '$export' => array($a->get_baseurl()."/events/$y/$m/export",t('Export'),'',''),
+ '$calendar' => cal($y,$m,$links, ' eventcal'),
'$events' => $events,
- '$upload' => t('Import'),
- '$submit' => t('Submit')
+ '$upload' => t('Import'),
+ '$submit' => t('Submit'),
+ '$prev' => t('Previous'),
+ '$next' => t('Next'),
+ '$today' => t('Today'),
+ '$form' => $form,
+ '$expandform' => ((x($_GET,'expandform')) ? true : false),
));
if (x($_GET,'id')){ echo $o; killme(); }
return $o;
-
}
if($mode === 'drop' && $event_id) {
@@ -570,147 +701,4 @@ function events_content(&$a) {
}
}
- if($mode === 'edit' && $event_id) {
- $r = q("SELECT * FROM `event` WHERE event_hash = '%s' AND `uid` = %d LIMIT 1",
- dbesc($event_id),
- intval(local_channel())
- );
- if(count($r))
- $orig_event = $r[0];
- }
-
- $channel = $a->get_channel();
-
- // Passed parameters overrides anything found in the DB
- if($mode === 'edit' || $mode === 'new') {
- if(!x($orig_event)) $orig_event = array();
- // In case of an error the browser is redirected back here, with these parameters filled in with the previous values
- if(x($_REQUEST,'nofinish')) $orig_event['nofinish'] = $_REQUEST['nofinish'];
- if(x($_REQUEST,'adjust')) $orig_event['adjust'] = $_REQUEST['adjust'];
- if(x($_REQUEST,'summary')) $orig_event['summary'] = $_REQUEST['summary'];
- if(x($_REQUEST,'description')) $orig_event['description'] = $_REQUEST['description'];
- if(x($_REQUEST,'location')) $orig_event['location'] = $_REQUEST['location'];
- if(x($_REQUEST,'start')) $orig_event['start'] = $_REQUEST['start'];
- if(x($_REQUEST,'finish')) $orig_event['finish'] = $_REQUEST['finish'];
- if(x($_REQUEST,'type')) $orig_event['type'] = $_REQUEST['type'];
-
- $n_checked = ((x($orig_event) && $orig_event['nofinish']) ? ' checked="checked" ' : '');
- $a_checked = ((x($orig_event) && $orig_event['adjust']) ? ' checked="checked" ' : '');
- $t_orig = ((x($orig_event)) ? $orig_event['summary'] : '');
- $d_orig = ((x($orig_event)) ? $orig_event['description'] : '');
- $l_orig = ((x($orig_event)) ? $orig_event['location'] : '');
- $eid = ((x($orig_event)) ? $orig_event['id'] : 0);
- $event_xchan = ((x($orig_event)) ? $orig_event['event_xchan'] : $channel['channel_hash']);
- $mid = ((x($orig_event)) ? $orig_event['mid'] : '');
-
- if(! x($orig_event))
- $sh_checked = '';
- else
- $sh_checked = ((($orig_event['allow_cid'] === '<' . $channel['channel_hash'] . '>' || (! $orig_event['allow_cid'])) && (! $orig_event['allow_gid']) && (! $orig_event['deny_cid']) && (! $orig_event['deny_gid'])) ? '' : ' checked="checked" ' );
-
- if($orig_event['event_xchan'])
- $sh_checked .= ' disabled="disabled" ';
-
- $sdt = ((x($orig_event)) ? $orig_event['start'] : 'now');
- $fdt = ((x($orig_event)) ? $orig_event['finish'] : 'now');
-
- $tz = date_default_timezone_get();
- if(x($orig_event))
- $tz = (($orig_event['adjust']) ? date_default_timezone_get() : 'UTC');
-
- $syear = datetime_convert('UTC', $tz, $sdt, 'Y');
- $smonth = datetime_convert('UTC', $tz, $sdt, 'm');
- $sday = datetime_convert('UTC', $tz, $sdt, 'd');
-
-
- $shour = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'H') : 0);
- $sminute = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'i') : 0);
- $stext = datetime_convert('UTC',$tz,$sdt);
- $stext = substr($stext,0,14) . "00:00";
-
- $fyear = datetime_convert('UTC', $tz, $fdt, 'Y');
- $fmonth = datetime_convert('UTC', $tz, $fdt, 'm');
- $fday = datetime_convert('UTC', $tz, $fdt, 'd');
-
- $fhour = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'H') : 0);
- $fminute = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'i') : 0);
- $ftext = datetime_convert('UTC',$tz,$fdt);
- $ftext = substr($ftext,0,14) . "00:00";
- $type = ((x($orig_event)) ? $orig_event['type'] : 'event');
-
- $f = get_config('system','event_input_format');
- if(! $f)
- $f = 'ymd';
-
- $catsenabled = feature_enabled(local_channel(),'categories');
-
- $category = '';
-
- if($catsenabled && x($orig_event)){
- $itm = q("select * from item where resource_type = 'event' and resource_id = '%s' and uid = %d limit 1",
- dbesc($orig_event['event_hash']),
- intval(local_channel())
- );
- $itm = fetch_post_tags($itm);
- if($itm) {
- $cats = get_terms_oftype($itm[0]['term'], TERM_CATEGORY);
- foreach ($cats as $cat) {
- if(strlen($category))
- $category .= ', ';
- $category .= $cat['term'];
- }
- }
- }
-
- require_once('include/acl_selectors.php');
-
- $acl = new AccessList($channel);
- $perm_defaults = $acl->get();
-
-
- $tpl = get_markup_template('event_form.tpl');
-
- $o .= replace_macros($tpl,array(
- '$post' => $a->get_baseurl() . '/events',
- '$eid' => $eid,
- '$type' => $type,
- '$xchan' => $event_xchan,
- '$mid' => $mid,
- '$event_hash' => $event_id,
-
- '$title' => t('Event details'),
- '$desc' => t('Starting date and Title are required.'),
- '$catsenabled' => $catsenabled,
- '$placeholdercategory' => t('Categories (comma-separated list)'),
- '$category' => $category,
- '$s_text' => t('Event Starts:'),
- '$stext' => $stext,
- '$ftext' => $ftext,
- '$required' => '<span class="required" title="' . t('Required') . '">*</span>',
- '$ModalCANCEL' => t('Cancel'),
- '$ModalOK' => t('OK'),
- '$s_dsel' => datetimesel($f,new DateTime(),DateTime::createFromFormat('Y',$syear+5),DateTime::createFromFormat('Y-m-d H:i',"$syear-$smonth-$sday $shour:$sminute"),'start_text',true,true,'','',true),
- '$n_text' => t('Finish date/time is not known or not relevant'),
- '$n_checked' => $n_checked,
- '$f_text' => t('Event Finishes:'),
- '$f_dsel' => datetimesel($f,new DateTime(),DateTime::createFromFormat('Y',$fyear+5),DateTime::createFromFormat('Y-m-d H:i',"$fyear-$fmonth-$fday $fhour:$fminute"),'finish_text',true,true,'start_text'),
- '$adjust' => array('adjust', t('Adjust for viewer timezone'), $a_checked, t('Important for events that happen in a particular place. Not practical for global holidays.'),),
- '$a_text' => t('Adjust for viewer timezone'),
- '$d_text' => t('Description:'),
- '$d_orig' => $d_orig,
- '$l_text' => t('Location:'),
- '$l_orig' => $l_orig,
- '$t_text' => t('Title:'),
- '$t_orig' => $t_orig,
- '$sh_text' => t('Share this event'),
- '$sh_checked' => $sh_checked,
- '$preview' => t('Preview'),
- '$permissions' => t('Permissions'),
- '$acl' => (($orig_event['event_xchan']) ? '' : populate_acl(((x($orig_event)) ? $orig_event : $perm_defaults),false)),
- '$submit' => t('Submit')
-
- ));
-
- return $o;
- }
}
diff --git a/mod/ffsapi.php b/mod/ffsapi.php
index f4033e63b..1f68a87ba 100644
--- a/mod/ffsapi.php
+++ b/mod/ffsapi.php
@@ -40,9 +40,9 @@ var data = {
"unmarkedIcon": baseurl+"/images/hz-bookmark-32.png",
// should be available for display purposes
- "description": '$description',
- "author": '$author',
- "homepageURL": '$homepage',
+ "description": "$description",
+ "author": "$author",
+ "homepageURL": "$homepage",
// optional
"version": "1.0"
@@ -56,7 +56,7 @@ function activate(node) {
}
</script>
-<button onclick="activate(this)" title="activate the demo provider" class="btn btn-primary">$activate</button>
+<button onclick="activate(this)" title="$activate" class="btn btn-primary">$activate</button>
EOT;
diff --git a/mod/import.php b/mod/import.php
index 72d8f92e9..02e71233a 100644
--- a/mod/import.php
+++ b/mod/import.php
@@ -9,11 +9,12 @@ require_once('include/identity.php');
require_once('include/import.php');
-function import_post(&$a) {
+function import_account(&$a, $account_id) {
- $account_id = get_account_id();
- if(! $account_id)
+ if(! $account_id){
+ logger("import_account: No account ID supplied");
return;
+ }
$max_identities = account_service_class_fetch($account_id,'total_identities');
$max_friends = account_service_class_fetch($account_id,'total_channels');
@@ -122,12 +123,12 @@ function import_post(&$a) {
if(array_key_exists('channel',$data)) {
if($completed < 1) {
- $channel = import_channel($data['channel']);
+ $channel = import_channel($data['channel'], $account_id);
}
else {
$r = q("select * from channel where channel_account_id = %d and channel_guid = '%s' limit 1",
- intval(get_account_id()),
+ intval($account_id),
dbesc($channel['channel_guid'])
);
if($r)
@@ -165,7 +166,7 @@ function import_post(&$a) {
if($data['photo']) {
require_once('include/photo/photo_driver.php');
- import_channel_photo(base64url_decode($data['photo']['data']),$data['photo']['type'],get_account_id(),$channel['channel_id']);
+ import_channel_photo(base64url_decode($data['photo']['data']),$data['photo']['type'],$account_id,$channel['channel_id']);
}
if(is_array($data['profile']))
@@ -334,7 +335,7 @@ function import_post(&$a) {
unset($abook['abook_id']);
unset($abook['abook_rating']);
unset($abook['abook_rating_text']);
- $abook['abook_account'] = get_account_id();
+ $abook['abook_account'] = $account_id;
$abook['abook_channel'] = $channel['channel_id'];
if(! array_key_exists('abook_blocked',$abook)) {
$abook['abook_blocked'] = (($abook['abook_flags'] & 0x0001 ) ? 1 : 0);
@@ -493,6 +494,15 @@ function import_post(&$a) {
}
+function import_post(&$a) {
+
+ $account_id = get_account_id();
+ if(! $account_id)
+ return;
+
+ import_account($a, $account_id);
+}
+
function import_content(&$a) {
if(! get_account_id()) {
diff --git a/mod/invite.php b/mod/invite.php
index 46fa7b413..bda808142 100644
--- a/mod/invite.php
+++ b/mod/invite.php
@@ -143,4 +143,4 @@ function invite_content(&$a) {
));
return $o;
-} \ No newline at end of file
+}
diff --git a/mod/item.php b/mod/item.php
index 591dc8407..f32ff8844 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -473,7 +473,9 @@ function item_post(&$a) {
require_once('include/text.php');
if($uid && $uid == $profile_uid && feature_enabled($uid,'markdown')) {
require_once('include/bb2diaspora.php');
- $body = escape_tags($body);
+ $body = escape_tags(trim($body));
+ $body = str_replace("\n",'<br />', $body);
+
$body = preg_replace_callback('/\[share(.*?)\]/ism','share_shield',$body);
$body = diaspora2bb($body,true);
$body = preg_replace_callback('/\[share(.*?)\]/ism','share_unshield',$body);
@@ -649,6 +651,29 @@ function item_post(&$a) {
}
}
+ if($orig_post) {
+ // preserve original tags
+ $t = q("select * from term where oid = %d and otype = %d and uid = %d and type in ( %d, %d, %d )",
+ intval($orig_post['id']),
+ intval(TERM_OBJ_POST),
+ intval($profile_uid),
+ intval(TERM_UNKNOWN),
+ intval(TERM_FILE),
+ intval(TERM_COMMUNITYTAG)
+ );
+ if($t) {
+ foreach($t as $t1) {
+ $post_tags[] = array(
+ 'uid' => $profile_uid,
+ 'type' => $t1['type'],
+ 'otype' => TERM_OBJ_POST,
+ 'term' => $t1['term'],
+ 'url' => $t1['url'],
+ );
+ }
+ }
+ }
+
$item_unseen = ((local_channel() != $profile_uid) ? 1 : 0);
$item_wall = (($post_type === 'wall' || $post_type === 'wall-comment') ? 1 : 0);
@@ -701,6 +726,10 @@ function item_post(&$a) {
$plink = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $mid;
}
+
+
+
+
$datarray['aid'] = $channel['channel_account_id'];
$datarray['uid'] = $profile_uid;
@@ -779,6 +808,22 @@ function item_post(&$a) {
if($orig_post)
$datarray['edit'] = true;
+
+
+ if(feature_enabled($profile_uid,'suppress_duplicates') && (! $orig_post)) {
+
+ $z = q("select created from item where uid = %d and body = '%s'",
+ intval($profile_uid),
+ dbesc($body)
+ );
+
+ if($z && $z[0]['created'] > datetime_convert('UTC','UTC', 'now - 2 minutes')) {
+ $datarray['cancel'] = 1;
+ notice( t('Duplicate post suppressed.') . EOL);
+ logger('Duplicate post. Faking plugin cancel.');
+ }
+ }
+
call_hooks('post_local',$datarray);
if(x($datarray,'cancel')) {
diff --git a/mod/network.php b/mod/network.php
index 53de975a4..9f0604296 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -248,7 +248,7 @@ function network_content(&$a, $update = 0, $load = false) {
$sql_extra .= protect_sprintf(term_query('item', $category, TERM_CATEGORY));
}
if(x($hashtags)) {
- $sql_extra .= protect_sprintf(term_query('item', $hashtags, TERM_HASHTAG));
+ $sql_extra .= protect_sprintf(term_query('item', $hashtags, TERM_HASHTAG, TERM_COMMUNITYTAG));
}
if(! $update) {
@@ -313,7 +313,7 @@ function network_content(&$a, $update = 0, $load = false) {
if(x($_GET,'search')) {
$search = escape_tags($_GET['search']);
if(strpos($search,'#') === 0) {
- $sql_extra .= term_query('item',substr($search,1),TERM_HASHTAG);
+ $sql_extra .= term_query('item',substr($search,1),TERM_HASHTAG,TERM_COMMUNITYTAG);
}
else {
$sql_extra .= sprintf(" AND item.body like '%s' ",
diff --git a/mod/page.php b/mod/page.php
index b635a60f2..ae572ca1e 100644
--- a/mod/page.php
+++ b/mod/page.php
@@ -131,6 +131,10 @@ function page_content(&$a) {
xchan_query($r);
$r = fetch_post_tags($r,true);
+
+ if($r[0]['mimetype'] === 'application/x-pdl')
+ $a->page['pdl_content'] = true;
+
$o .= prepare_page($r[0]);
return $o;
diff --git a/mod/profile_photo.php b/mod/profile_photo.php
index 7067a9f76..2884505f0 100644
--- a/mod/profile_photo.php
+++ b/mod/profile_photo.php
@@ -6,6 +6,7 @@
*/
require_once('include/photo/photo_driver.php');
+require_once('include/identity.php');
/* @brief Function for sync'ing permissions of profile-photos and their profile
*
@@ -195,6 +196,8 @@ function profile_photo_post(&$a) {
);
}
+ profiles_build_sync(local_channel());
+
// We'll set the updated profile-photo timestamp even if it isn't the default profile,
// so that browsers will do a cache update unconditionally
diff --git a/mod/profiles.php b/mod/profiles.php
index 19e5ffc50..282d741ac 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -1,5 +1,6 @@
<?php
+require_once('include/identity.php');
function profiles_init(&$a) {
@@ -37,6 +38,12 @@ function profiles_init(&$a) {
if($r)
info( t('Profile deleted.') . EOL);
+ // @fixme this is a much more complicated sync - add any changed abook entries and
+ // also add deleted flag to profile structure
+ // profiles_build_sync is just here as a placeholder - it doesn't work at all here
+
+ // profiles_build_sync(local_channel());
+
goaway($a->get_baseurl(true) . '/profiles');
return; // NOTREACHED
}
@@ -118,7 +125,10 @@ function profiles_init(&$a) {
dbesc($name)
);
info( t('New profile created.') . EOL);
- if(count($r3) == 1)
+
+ profiles_build_sync(local_channel());
+
+ if(($r3) && (count($r3) == 1))
goaway($a->get_baseurl(true) . '/profiles/' . $r3[0]['id']);
goaway($a->get_baseurl(true) . '/profiles');
@@ -193,7 +203,6 @@ function profiles_post(&$a) {
$namechanged = false;
- call_hooks('profile_post', $_POST);
// import from json export file.
// Only import fields that are allowed on this hub
@@ -220,6 +229,7 @@ function profiles_post(&$a) {
}
}
+ call_hooks('profile_post', $_POST);
if((argc() > 1) && (argv(1) !== "new") && intval(argv(1))) {
@@ -564,8 +574,6 @@ function profiles_post(&$a) {
}
-
-
function profiles_content(&$a) {
$o = '';
diff --git a/mod/search.php b/mod/search.php
index a0085fca9..555d46f6a 100644
--- a/mod/search.php
+++ b/mod/search.php
@@ -75,9 +75,10 @@ function search_content(&$a,$update = 0, $load = false) {
return $o;
if($tag) {
- $sql_extra = sprintf(" AND `item`.`id` IN (select `oid` from term where otype = %d and type = %d and term = '%s') ",
+ $sql_extra = sprintf(" AND `item`.`id` IN (select `oid` from term where otype = %d and type in ( %d , %d) and term = '%s') ",
intval(TERM_OBJ_POST),
intval(TERM_HASHTAG),
+ intval(TERM_COMMUNITYTAG),
dbesc(protect_sprintf($search))
);
}
diff --git a/mod/search_ac.php b/mod/search_ac.php
index e42945d43..19c1dc940 100644
--- a/mod/search_ac.php
+++ b/mod/search_ac.php
@@ -42,8 +42,9 @@ function search_ac_init(&$a){
}
}
- $r = q("select distinct term, tid, url from term where type = %d $tag_sql_extra group by term order by term asc",
- intval(TERM_HASHTAG)
+ $r = q("select distinct term, tid, url from term where type in ( %d, %d ) $tag_sql_extra group by term order by term asc",
+ intval(TERM_HASHTAG),
+ intval(TERM_COMMUNITYTAG)
);
if(count($r)) {
diff --git a/mod/settings.php b/mod/settings.php
index 9a18d8e48..339f83cfe 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -405,7 +405,6 @@ function settings_post(&$a) {
$allow_location = (((x($_POST,'allow_location')) && (intval($_POST['allow_location']) == 1)) ? 1: 0);
-
$blocktags = (((x($_POST,'blocktags')) && (intval($_POST['blocktags']) == 1)) ? 0: 1); // this setting is inverted!
$unkmail = (((x($_POST,'unkmail')) && (intval($_POST['unkmail']) == 1)) ? 1: 0);
$cntunkmail = ((x($_POST,'cntunkmail')) ? intval($_POST['cntunkmail']) : 0);
@@ -416,6 +415,8 @@ function settings_post(&$a) {
$post_profilechange = (($_POST['post_profilechange'] == 1) ? 1: 0);
$adult = (($_POST['adult'] == 1) ? 1 : 0);
+ $cal_first_day = (((x($_POST,'first_day')) && (intval($_POST['first_day']) == 1)) ? 1: 0);
+
$channel = $a->get_channel();
$pageflags = $channel['channel_pageflags'];
$existing_adult = (($pageflags & PAGE_ADULT) ? 1 : 0);
@@ -503,6 +504,7 @@ function settings_post(&$a) {
set_pconfig(local_channel(),'system','evdays',$evdays);
set_pconfig(local_channel(),'system','photo_path',$photo_path);
set_pconfig(local_channel(),'system','attach_path',$attach_path);
+ set_pconfig(local_channel(),'system','cal_first_day',$cal_first_day);
$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 $set_perms where channel_id = %d",
dbesc($username),
@@ -1110,6 +1112,7 @@ function settings_content(&$a) {
'$removeme' => t('Remove Channel'),
'$removechannel' => t('Remove this channel.'),
'$firefoxshare' => t('Firefox Share $Projectname provider'),
+ '$cal_first_day' => array('first_day', t('Start calendar week on monday'), ((get_pconfig(local_channel(),'system','cal_first_day')) ? 1 : ''), '', $yes_no),
));
call_hooks('settings_form',$o);
diff --git a/mod/siteinfo.php b/mod/siteinfo.php
index 2fffccc73..231427290 100644
--- a/mod/siteinfo.php
+++ b/mod/siteinfo.php
@@ -81,8 +81,8 @@ function siteinfo_init(&$a) {
'commit' => $commit,
'url' => z_root(),
'plugins' => $visible_plugins,
- 'register_policy' => $register_policy[$a->config['system']['register_policy']],
- 'directory_mode' => $directory_mode[$a->config['system']['directory_mode']],
+ 'register_policy' => $register_policy[get_config('system','register_policy')],
+ 'directory_mode' => $directory_mode[get_config('system','directory_mode')],
'language' => get_config('system','language'),
'rss_connections' => get_config('system','feed_contacts'),
'expiration' => $site_expire,
diff --git a/mod/subthread.php b/mod/subthread.php
index 162545a2f..74d742b6a 100755
--- a/mod/subthread.php
+++ b/mod/subthread.php
@@ -11,18 +11,24 @@ function subthread_content(&$a) {
return;
}
+ $item_id = ((argc() > 2) ? notags(trim(argv(2))) : 0);
+
if(argv(1) === 'sub')
$activity = ACTIVITY_FOLLOW;
elseif(argv(1) === 'unsub')
$activity = ACTIVITY_UNFOLLOW;
- $item_id = ((argc() > 2) ? notags(trim(argv(2))) : 0);
- $r = q("SELECT * FROM `item` WHERE `parent` = '%s' OR `parent_mid` = '%s' and parent = id LIMIT 1",
- dbesc($item_id),
+ $r = q("SELECT parent FROM item WHERE id = '%s'",
dbesc($item_id)
);
+ if($r) {
+ $r = q("select * from item where id = parent and id = %d limit 1",
+ dbesc($r[0]['parent'])
+ );
+ }
+
if((! $item_id) || (! $r)) {
logger('subthread: no item ' . $item_id);
return;
diff --git a/mod/tagger.php b/mod/tagger.php
index 9f9855ed8..27a8a15ea 100644
--- a/mod/tagger.php
+++ b/mod/tagger.php
@@ -123,7 +123,7 @@ function tagger_content(&$a) {
$arr['object'] = $obj;
$arr['parent_mid'] = $item['mid'];
- store_item_tag($item['uid'],$item['id'],TERM_OBJ_POST,TERM_HASHTAG,$term,$tagid);
+ store_item_tag($item['uid'],$item['id'],TERM_OBJ_POST,TERM_COMMUNITYTAG,$term,$tagid);
$ret = post_activity_item($arr);
if($ret['success'])