diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/acl.php | 5 | ||||
-rw-r--r-- | mod/admin.php | 6 | ||||
-rw-r--r-- | mod/connections.php | 53 | ||||
-rw-r--r-- | mod/directory.php | 9 | ||||
-rw-r--r-- | mod/dirsearch.php | 4 | ||||
-rwxr-xr-x | mod/events.php | 89 | ||||
-rw-r--r-- | mod/feed.php | 2 | ||||
-rw-r--r-- | mod/group.php | 8 | ||||
-rw-r--r-- | mod/import.php | 2 | ||||
-rw-r--r-- | mod/item.php | 13 | ||||
-rw-r--r-- | mod/mail.php | 2 | ||||
-rw-r--r-- | mod/photos.php | 72 | ||||
-rw-r--r-- | mod/poco.php | 5 | ||||
-rw-r--r-- | mod/profiles.php | 4 | ||||
-rw-r--r-- | mod/receive.php | 2 | ||||
-rw-r--r-- | mod/register.php | 1 | ||||
-rw-r--r-- | mod/regmod.php | 1 | ||||
-rw-r--r-- | mod/regver.php | 2 | ||||
-rw-r--r-- | mod/removeaccount.php | 2 | ||||
-rw-r--r-- | mod/removeme.php | 2 | ||||
-rw-r--r-- | mod/share.php | 6 | ||||
-rw-r--r-- | mod/webpages.php | 13 | ||||
-rw-r--r-- | mod/xrd.php | 17 | ||||
-rw-r--r-- | mod/zfinger.php | 1 |
24 files changed, 236 insertions, 85 deletions
diff --git a/mod/acl.php b/mod/acl.php index fa399a9b5..5658a05c5 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -225,6 +225,11 @@ function acl_init(&$a){ if(count($r)) { foreach($r as $g){ + + // remove RSS feeds from ACLs - they are inaccessible + if(strpos($g['hash'],'/')) + continue; + if(($g['abook_their_perms'] & PERMS_W_TAGWALL) && $type == 'c') { $contacts[] = array( "type" => "c", diff --git a/mod/admin.php b/mod/admin.php index 31d3873ff..5bb97d158 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -267,7 +267,7 @@ function admin_page_site_post(&$a){ $maxloadavg = ((x($_POST,'maxloadavg'))? intval(trim($_POST['maxloadavg'])) : 50); $feed_contacts = ((x($_POST,'feed_contacts')) ? intval($_POST['feed_contacts']) : 0); $diaspora_enabled = ((x($_POST,'diaspora_enabled')) ? intval($_POST['diaspora_enabled']) : 0); - + $verify_email = ((x($_POST,'verify_email')) ? 1 : 0); set_config('system','feed_contacts',$feed_contacts); set_config('system','diaspora_enabled',$diaspora_enabled); @@ -276,6 +276,7 @@ function admin_page_site_post(&$a){ set_config('system','maxloadavg',$maxloadavg); set_config('system','sitename',$sitename); set_config('system','no_login_on_homepage',$no_login_on_homepage); + set_config('system','verify_email',$verify_email); if ($banner=="") { del_config('system','banner'); @@ -436,6 +437,7 @@ function admin_page_site(&$a) { '$allowed_sites' => array('allowed_sites', t("Allowed friend domains"), get_config('system','allowed_sites'), t("Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains")), '$allowed_email' => array('allowed_email', t("Allowed email domains"), get_config('system','allowed_email'), t("Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains")), '$block_public' => array('block_public', t("Block public"), get_config('system','block_public'), t("Check to block public access to all otherwise public personal pages on this site unless you are currently logged in.")), + '$verify_email' => array('verify_email', t("Verify Email Addresses"), get_config('system','verify_email'), t("Check to verify email addresses used in account registration (recommended).")), '$force_publish' => array('publish_all', t("Force publish"), get_config('system','publish_all'), t("Check to force all profiles on this site to be listed in the site directory.")), '$disable_discover_tab' => array('disable_discover_tab', t("Disable discovery tab"), get_config('system','disable_discover_tab'), t("Remove the tab in the network view with public content pulled from sources chosen for this site.")), '$no_login_on_homepage' => array('no_login_on_homepage', t("No login on Homepage"), get_config('system','no_login_on_homepage'), t("Check to hide the login form from your sites homepage when visitors arrive who are not logged in (e.g. when you put the content of the homepage in via the site channel).")), @@ -608,13 +610,11 @@ function admin_page_users_post(&$a){ } if (x($_POST,'page_users_approve')){ - require_once('include/account.php'); foreach($pending as $hash){ user_allow($hash); } } if (x($_POST,'page_users_deny')){ - require_once('include/account.php'); foreach($pending as $hash){ user_deny($hash); } diff --git a/mod/connections.php b/mod/connections.php index 028889647..0dfcfebf1 100644 --- a/mod/connections.php +++ b/mod/connections.php @@ -369,7 +369,7 @@ function connections_content(&$a) { if($rr['xchan_url']) { $contacts[] = array( 'img_hover' => sprintf( t('%1$s [%2$s]'),$rr['xchan_name'],$rr['xchan_url']), - 'edit_hover' => t('Edit contact'), + 'edit_hover' => t('Edit connection'), 'id' => $rr['abook_id'], 'alt_text' => $alt_text, 'dir_icon' => $dir_icon, @@ -378,6 +378,7 @@ function connections_content(&$a) { 'username' => $rr['xchan_name'], 'classes' => (($rr['abook_flags'] & ABOOK_FLAG_ARCHIVED) ? 'archived' : ''), 'link' => z_root() . '/connedit/' . $rr['abook_id'], + 'edit' => t('Edit'), 'url' => chanlink_url($rr['xchan_url']), 'network' => network_to_name($rr['network']), ); @@ -385,20 +386,40 @@ function connections_content(&$a) { } } - $o .= replace_macros(get_markup_template('connections.tpl'),array( - '$header' => t('Connections') . (($head) ? ' - ' . $head : ''), - '$tabs' => $t, - '$total' => $total, - '$search' => $search_hdr, - '$desc' => t('Search your connections'), - '$finding' => (($searching) ? t('Finding: ') . "'" . $search . "'" : ""), - '$submit' => t('Find'), - '$edit' => t('Edit'), - '$cmd' => $a->cmd, - '$contacts' => $contacts, - '$paginate' => paginate($a), - - )); - + + if($_REQUEST['aj']) { + if($contacts) { + $o = replace_macros(get_markup_template('contactsajax.tpl'),array( + '$contacts' => $contacts, + '$edit' => t('Edit'), + )); + } + else { + $o = '<div id="content-complete"></div>'; + } + echo $o; + killme(); + } + else { + $o .= "<script> var page_query = '" . $_GET['q'] . "'; var extra_args = '" . extra_query_args() . "' ; </script>"; + $o .= replace_macros(get_markup_template('connections.tpl'),array( + '$header' => t('Connections') . (($head) ? ' - ' . $head : ''), + '$tabs' => $t, + '$total' => $total, + '$search' => $search_hdr, + '$desc' => t('Search your connections'), + '$finding' => (($searching) ? t('Finding: ') . "'" . $search . "'" : ""), + '$submit' => t('Find'), + '$edit' => t('Edit'), + '$cmd' => $a->cmd, + '$contacts' => $contacts, + '$paginate' => paginate($a), + + )); + } + + if(! $contacts) + $o .= '<div id="content-complete"></div>'; + return $o; } diff --git a/mod/directory.php b/mod/directory.php index 39eeb36ce..3d7632ec0 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -5,7 +5,7 @@ require_once('include/widgets.php'); function directory_init(&$a) { - $a->set_pager_itemspage(80); + $a->set_pager_itemspage(60); } @@ -216,7 +216,7 @@ function directory_content(&$a) { } else { - $o .= "<script> var page_query_args = '" . $a->query_string . "'; </script>"; + $o .= "<script> var page_query = '" . $_GET['q'] . "'; var extra_args = '" . extra_query_args() . "' ; </script>"; $o .= replace_macros($tpl, array( '$search' => $search, '$desc' => t('Find'), @@ -224,10 +224,11 @@ function directory_content(&$a) { '$safetxt' => htmlspecialchars($search,ENT_QUOTES,'UTF-8'), '$entries' => $entries, '$dirlbl' => t('Directory'), - '$submit' => t('Find') + '$submit' => t('Find'), + '$next' => alt_pager($a,$j['records'], t('next page'), t('previous page')) + )); -// $o .= alt_pager($a,$j['records'], t('next page'), t('previous page')); } diff --git a/mod/dirsearch.php b/mod/dirsearch.php index e292553ad..d8f611e6a 100644 --- a/mod/dirsearch.php +++ b/mod/dirsearch.php @@ -4,7 +4,7 @@ require_once('include/dir_fns.php'); function dirsearch_init(&$a) { - $a->set_pager_itemspage(80); + $a->set_pager_itemspage(60); } @@ -122,7 +122,7 @@ function dirsearch_content(&$a) { } - $perpage = (($_REQUEST['n']) ? $_REQUEST['n'] : 80); + $perpage = (($_REQUEST['n']) ? $_REQUEST['n'] : 60); $page = (($_REQUEST['p']) ? intval($_REQUEST['p'] - 1) : 0); $startrec = (($page+1) * $perpage) - $perpage; $limit = (($_REQUEST['limit']) ? intval($_REQUEST['limit']) : 0); diff --git a/mod/events.php b/mod/events.php index 02a9d1ed9..c80d1dd39 100755 --- a/mod/events.php +++ b/mod/events.php @@ -14,6 +14,10 @@ function events_post(&$a) { $event_id = ((x($_POST,'event_id')) ? intval($_POST['event_id']) : 0); $xchan = ((x($_POST,'xchan')) ? dbesc($_POST['xchan']) : ''); $uid = local_user(); + + $start_text = escape_tags($_REQUEST['start_text']); + $finish_text = escape_tags($_REQUEST['finish_text']); + $startyear = intval($_POST['startyear']); $startmonth = intval($_POST['startmonth']); $startday = intval($_POST['startday']); @@ -29,6 +33,10 @@ function events_post(&$a) { $adjust = intval($_POST['adjust']); $nofinish = intval($_POST['nofinish']); + $categories = escape_tags(trim($_POST['category'])); + + + // only allow editing your own events. if(($xchan) && ($xchan !== get_observer_hash())) @@ -37,12 +45,23 @@ function events_post(&$a) { // The default setting for the `private` field in event_store() is false, so mirror that $private_event = false; + if($start_text) { + $start = $start_text; + } + else { + $start = sprintf('%d-%d-%d %d:%d:0',$startyear,$startmonth,$startday,$starthour,$startminute); + } + + if($nofinish) { + $finish = NULL_DATE; + } - $start = sprintf('%d-%d-%d %d:%d:0',$startyear,$startmonth,$startday,$starthour,$startminute); - if($nofinish) - $finish = '0000-00-00 00:00:00'; - else - $finish = sprintf('%d-%d-%d %d:%d:0',$finishyear,$finishmonth,$finishday,$finishhour,$finishminute); + if($finish_text) { + $finish = $finish_text; + } + else { + $finish = sprintf('%d-%d-%d %d:%d:0',$finishyear,$finishmonth,$finishday,$finishhour,$finishminute); + } if($adjust) { $start = datetime_convert(date_default_timezone_get(),'UTC',$start); @@ -123,6 +142,22 @@ function events_post(&$a) { } } + $post_tags = array(); + $channel = $a->get_channel(); + + if(strlen($categories)) { + $cats = explode(',',$categories); + foreach($cats as $cat) { + $post_tags[] = array( + 'uid' => $profile_uid, + 'type' => TERM_CATEGORY, + 'otype' => TERM_OBJ_POST, + 'term' => trim($cat), + 'url' => $channel['xchan_url'] . '?f=&cat=' . urlencode(trim($cat)) + ); + } + } + $datarray = array(); $datarray['start'] = $start; $datarray['finish'] = $finish; @@ -145,6 +180,11 @@ function events_post(&$a) { $datarray['edited'] = $edited; $event = event_store_event($datarray); + + + if($post_tags) + $datarray['term'] = $post_tags; + $item_id = event_store_item($datarray,$event); if($share) @@ -451,8 +491,11 @@ function events_content(&$a) { $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'); @@ -460,11 +503,35 @@ function events_content(&$a) { $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"; $f = get_config('system','event_input_format'); if(! $f) $f = 'ymd'; + $catsenabled = feature_enabled(local_user(),'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_user()) + ); + $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']; + } + } + } + + + $dateformat = datesel_format($f); $timeformat = t('hour:minute'); @@ -487,9 +554,17 @@ function events_content(&$a) { '$mid' => $mid, '$title' => t('Event details'), - '$desc' => sprintf( t('Format is %s %s. Starting date and Title are required.'),$dateformat,$timeformat), - + '$format_desc' => sprintf( t('Format is %s %s.'),$dateformat,$timeformat), + '$desc' => t('Starting date and Title are required.'), + '$catsenabled' => $catsenabled, + '$placeholdercategory' => t('Categories (comma-separated list)'), + '$category' => $category, '$s_text' => t('Event Starts:') . ' <span class="required" title="' . t('Required') . '">*</span>', + '$bootstrap' => 1, + '$stext' => $stext, + '$ftext' => $ftext, + '$ModalCANCEL' => t('Cancel'), + '$ModalOK' => t('OK'), '$s_dsel' => datesel($f,'start',$syear+5,$syear,false,$syear,$smonth,$sday), '$s_tsel' => timesel('start',$shour,$sminute), '$n_text' => t('Finish date/time is not known or not relevant'), diff --git a/mod/feed.php b/mod/feed.php index fdbe4db8c..776f9787f 100644 --- a/mod/feed.php +++ b/mod/feed.php @@ -7,7 +7,7 @@ function feed_init(&$a) { $params = array(); - $params['begin'] = ((x($_REQUEST,'date_begin')) ? $_REQUEST['date_begin'] : '0000-00-00 00:00:00'); + $params['begin'] = ((x($_REQUEST,'date_begin')) ? $_REQUEST['date_begin'] : NULL_DATE); $params['end'] = ((x($_REQUEST,'date_end')) ? $_REQUEST['date_end'] : ''); $params['type'] = ((stristr(argv(0),'json')) ? 'json' : 'xml'); $params['pages'] = ((x($_REQUEST,'pages')) ? intval($_REQUEST['pages']) : 0); diff --git a/mod/group.php b/mod/group.php index 0f265f6fb..9b90b1a1a 100644 --- a/mod/group.php +++ b/mod/group.php @@ -118,14 +118,14 @@ function group_content(&$a) { check_form_security_token_ForbiddenOnErr('group_member_change', 't'); $r = q("SELECT abook_xchan from abook left join xchan on abook_xchan = xchan_hash where abook_xchan = '%s' and abook_channel = %d and not (xchan_flags & %d) and not (abook_flags & %d) and not (abook_flags & %d) limit 1", - dbesc(argv(2)), + dbesc(base64url_decode(argv(2))), intval(local_user()), intval(XCHAN_FLAGS_DELETED), intval(ABOOK_FLAG_BLOCKED), intval(ABOOK_FLAG_PENDING) ); if(count($r)) - $change = argv(2); + $change = base64url_decode(argv(2)); } @@ -204,7 +204,7 @@ function group_content(&$a) { foreach($members as $member) { if($member['xchan_url']) { $member['archived'] = (($member['abook_flags'] & ABOOK_FLAG_ARCHIVED) ? true : false); - $member['click'] = 'groupChangeMember(' . $group['id'] . ',\'' . $member['xchan_hash'] . '\',\'' . $sec_token . '\'); return false;'; + $member['click'] = 'groupChangeMember(' . $group['id'] . ',\'' . base64url_encode($member['xchan_hash']) . '\',\'' . $sec_token . '\'); return false;'; $groupeditor['members'][] = micropro($member,true,'mpgroup', $textmode); } else @@ -223,7 +223,7 @@ function group_content(&$a) { foreach($r as $member) { if(! in_array($member['xchan_hash'],$preselected)) { $member['archived'] = (($member['abook_flags'] & ABOOK_FLAG_ARCHIVED) ? true : false); - $member['click'] = 'groupChangeMember(' . $group['id'] . ',\'' . $member['xchan_hash'] . '\',\'' . $sec_token . '\'); return false;'; + $member['click'] = 'groupChangeMember(' . $group['id'] . ',\'' . base64url_encode($member['xchan_hash']) . '\',\'' . $sec_token . '\'); return false;'; $groupeditor['contacts'][] = micropro($member,true,'mpall', $textmode); } } diff --git a/mod/import.php b/mod/import.php index e732c3c06..7452bcdc9 100644 --- a/mod/import.php +++ b/mod/import.php @@ -256,7 +256,7 @@ function import_post(&$a) { require_once('include/photo/photo_driver.php'); $photos = import_profile_photo($xchan['xchan_photo_l'],$xchan['xchan_hash']); if($photos[4]) - $photodate = '0000-00-00 00:00:00'; + $photodate = NULL_DATE; else $photodate = $xchan['xchan_photo_date']; diff --git a/mod/item.php b/mod/item.php index c1dd15eb1..23d39a62c 100644 --- a/mod/item.php +++ b/mod/item.php @@ -384,13 +384,13 @@ function item_post(&$a) { } - $expires = '0000-00-00 00:00:00'; + $expires = NULL_DATE; if(feature_enabled($profile_uid,'content_expire')) { if(x($_REQUEST,'expire')) { $expires = datetime_convert(date_default_timezone_get(),'UTC', $_REQUEST['expire']); if($expires <= datetime_convert()) - $expires = '0000-00-00 00:00:00'; + $expires = NULL_DATE; } } @@ -1190,6 +1190,10 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag) { function fix_attached_photo_permissions($uid,$xchan_hash,$body, $str_contact_allow,$str_group_allow,$str_contact_deny,$str_group_deny) { + if(get_pconfig($uid,'system','force_public_uploads')) { + $str_contact_allow = $str_group_allow = $str_contact_deny = $str_group_deny = ''; + } + $match = null; // match img and zmg image links if(preg_match_all("/\[[zi]mg(.*?)\](.*?)\[\/[zi]mg\]/",$body,$match)) { @@ -1259,6 +1263,10 @@ function fix_attached_photo_permissions($uid,$xchan_hash,$body, function fix_attached_file_permissions($channel,$observer_hash,$body, $str_contact_allow,$str_group_allow,$str_contact_deny,$str_group_deny) { + if(get_pconfig($channel['channel_id'],'system','force_public_uploads')) { + $str_contact_allow = $str_group_allow = $str_contact_deny = $str_group_deny = ''; + } + $match = false; if(preg_match_all("/\[attachment\](.*?)\[\/attachment\]/",$body,$match)) { @@ -1279,6 +1287,7 @@ function fix_attached_file_permissions($channel,$observer_hash,$body, } } } + function item_check_service_class($channel_id,$iswebpage) { $ret = array('success' => false, $message => ''); if ($iswebpage) { diff --git a/mod/mail.php b/mod/mail.php index b7297443c..d6d802fe7 100644 --- a/mod/mail.php +++ b/mod/mail.php @@ -17,7 +17,7 @@ function mail_post(&$a) { $body = ((x($_REQUEST,'body')) ? escape_tags(trim($_REQUEST['body'])) : ''); $recipient = ((x($_REQUEST,'messageto')) ? notags(trim($_REQUEST['messageto'])) : ''); $rstr = ((x($_REQUEST,'messagerecip')) ? notags(trim($_REQUEST['messagerecip'])) : ''); - $expires = ((x($_REQUEST,'expires')) ? datetime_convert(date_default_timezone_get(),'UTC', $_REQUEST['expires']) : '0000-00-00 00:00:00'); + $expires = ((x($_REQUEST,'expires')) ? datetime_convert(date_default_timezone_get(),'UTC', $_REQUEST['expires']) : NULL_DATE); // If we have a raw string for a recipient which hasn't been auto-filled, // it means they probably aren't in our address book, hence we don't know diff --git a/mod/photos.php b/mod/photos.php index 428aff2a0..b1d105986 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -635,7 +635,7 @@ function photos_content(&$a) { ); if(count($r)) { $a->set_pager_total(count($r)); - $a->set_pager_itemspage(40); + $a->set_pager_itemspage(60); } if($_GET['order'] === 'posted') @@ -697,9 +697,14 @@ function photos_content(&$a) { $o .= '<div class="photos-upload-link" ><a href="' . $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/upload/' . bin2hex($album) . '" >' . t('Upload New Photos') . '</a></div>'; } + $ajaxout = ''; + $tpl = get_markup_template('photo_album.tpl'); - if(count($r)) + if(count($r)) { $twist = 'rotright'; + $o .= "<script> var page_query = '" . $_GET['q'] . "'; var extra_args = '" . extra_query_args() . "' ; </script>"; + $o .= '<div id="photo-album-contents">'; + foreach($r as $rr) { if($twist == 'rotright') @@ -728,7 +733,8 @@ function photos_content(&$a) { $rel=("photo"); // } - $o .= replace_macros($tpl,array( + + $tmp = replace_macros($tpl,array( '$id' => $rr['id'], '$twist' => ' ' . $twist . rand(2,4), '$photolink' => $imagelink, @@ -740,10 +746,25 @@ function photos_content(&$a) { '$ext' => $ext, '$hash'=> $rr['resource_id'], )); - + if($_REQUEST['aj']) + $ajaxout .= $tmp; + else + $o .= $tmp; + } } + if($_REQUEST['aj']) { + if(! $r) + $ajaxout .= '<div id="content-complete"></div>'; + echo $ajaxout; + killme(); + } + + $o .= '<div id="page-end"></div>'; + $o .= '</div>'; // photo-album-contents $o .= '<div id="photo-album-end"></div>'; - $o .= paginate($a); + $o .= '<script>$(document).ready(function() { loadingPage = false;});</script>'; + $o .= '<div id="page-spinner"></div>'; +// $o .= paginate($a); return $o; @@ -1138,7 +1159,7 @@ function photos_content(&$a) { ); if(count($r)) { $a->set_pager_total(count($r)); - $a->set_pager_itemspage(20); + $a->set_pager_itemspage(60); } $r = q("SELECT `resource_id`, `id`, `filename`, type, `album`, max(`scale`) AS `scale` FROM `photo` @@ -1192,16 +1213,37 @@ function photos_content(&$a) { } } - $tpl = get_markup_template('photos_recent.tpl'); - $o .= replace_macros($tpl, array( - '$title' => t('Recent Photos'), - '$can_post' => $can_post, - '$upload' => array(t('Upload New Photos'), $a->get_baseurl().'/photos/'.$a->data['channel']['channel_address'].'/upload'), - '$photos' => $photos, - )); + if($_REQUEST['aj']) { + if($photos) { + $o = replace_macros(get_markup_template('photosajax.tpl'),array( + '$photos' => $photos + )); + } + else { + $o = '<div id="content-complete"></div>'; + } + echo $o; + killme(); + } + else { + $o .= "<script> var page_query = '" . $_GET['q'] . "'; var extra_args = '" . extra_query_args() . "' ; </script>"; + $tpl = get_markup_template('photos_recent.tpl'); + $o .= replace_macros($tpl, array( + '$title' => t('Recent Photos'), + '$can_post' => $can_post, + '$upload' => array(t('Upload New Photos'), $a->get_baseurl().'/photos/'.$a->data['channel']['channel_address'].'/upload'), + '$photos' => $photos, + )); - - $o .= paginate($a); + } + + if((! $photos) && ($_REQUEST['aj'])) { + $o .= '<div id="content-complete"></div>'; + echo $o; + killme(); + } + +// $o .= paginate($a); return $o; } diff --git a/mod/poco.php b/mod/poco.php index 9295f13de..c1696e4cd 100644 --- a/mod/poco.php +++ b/mod/poco.php @@ -167,8 +167,11 @@ function poco_init(&$a) { $entry['displayName'] = $rr['xchan_name']; if($fields_ret['urls']) { $entry['urls'] = array(array('value' => $rr['xchan_url'], 'type' => 'profile')); + $network = $rr['xchan_network']; + if(strpos($network,'friendica') !== false) + $network = 'friendica'; if($rr['xchan_addr']) - $entry['urls'][] = array('value' => 'acct:' . $rr['xchan_addr'], 'type' => 'zot'); + $entry['urls'][] = array('value' => 'acct:' . $rr['xchan_addr'], 'type' => $network); } if($fields_ret['preferredUsername']) $entry['preferredUsername'] = substr($rr['xchan_addr'],0,strpos($rr['xchan_addr'],'@')); diff --git a/mod/profiles.php b/mod/profiles.php index 6361f56a3..063e714e7 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -304,7 +304,7 @@ function profiles_post(&$a) { $with = ((x($_POST,'with')) ? escape_tags(trim($_POST['with'])) : ''); if(! strlen($howlong)) - $howlong = '0000-00-00 00:00:00'; + $howlong = NULL_DATE; else $howlong = datetime_convert(date_default_timezone_get(),'UTC',$howlong); @@ -707,7 +707,7 @@ logger('extra_fields: ' . print_r($extra_fields,true)); '$marital' => marital_selector($r[0]['marital']), '$marital_min' => marital_selector_min($r[0]['marital']), '$with' => $r[0]['with'], - '$howlong' => ($r[0]['howlong'] === '0000-00-00 00:00:00' ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong'])), + '$howlong' => ($r[0]['howlong'] === NULL_DATE ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong'])), '$sexual' => sexpref_selector($r[0]['sexual']), '$sexual_min' => sexpref_selector_min($r[0]['sexual']), '$about' => $r[0]['about'], diff --git a/mod/receive.php b/mod/receive.php index 4071b169b..2a68019e0 100644 --- a/mod/receive.php +++ b/mod/receive.php @@ -58,7 +58,7 @@ function receive_post(&$a) { logger('mod-diaspora: decoded', LOGGER_DEBUG); - logger('mod-diaspora: decoded msg: ' . print_r($msg,true), LOGGER_DATA); + logger('mod-diaspora: decoded msg: ' . print_r($msg,true), LOGGER_DEBUG); if(! is_array($msg)) http_status_exit(500); diff --git a/mod/register.php b/mod/register.php index 954a32fbf..0e33fa358 100644 --- a/mod/register.php +++ b/mod/register.php @@ -1,6 +1,5 @@ <?php -require_once('include/account.php'); function register_init(&$a) { diff --git a/mod/regmod.php b/mod/regmod.php index c54c0d88e..d75355d5f 100644 --- a/mod/regmod.php +++ b/mod/regmod.php @@ -1,6 +1,5 @@ <?php -require_once('include/account.php'); function regmod_content(&$a) { diff --git a/mod/regver.php b/mod/regver.php index 988fa8c0d..c3ade2ee1 100644 --- a/mod/regver.php +++ b/mod/regver.php @@ -1,7 +1,5 @@ <?php -require_once('include/account.php'); - function regver_content(&$a) { global $lang; diff --git a/mod/removeaccount.php b/mod/removeaccount.php index 1f9dbcafa..70979c07d 100644 --- a/mod/removeaccount.php +++ b/mod/removeaccount.php @@ -24,7 +24,7 @@ function removeaccount_post(&$a) { if(! account_verify_password($account['account_email'],$_POST['qxz_password'])) return; - if($account['account_password_changed'] != '0000-00-00 00:00:00') { + if($account['account_password_changed'] != NULL_DATE) { $d1 = datetime_convert('UTC','UTC','now - 48 hours'); if($account['account_password_changed'] > d1) { notice( t('Account removals are not allowed within 48 hours of changing the account password.') . EOL); diff --git a/mod/removeme.php b/mod/removeme.php index 13bf6cf63..d2ff013b8 100644 --- a/mod/removeme.php +++ b/mod/removeme.php @@ -23,7 +23,7 @@ function removeme_post(&$a) { if(! account_verify_password($account['account_email'],$_POST['qxz_password'])) return; - if($account['account_password_changed'] != '0000-00-00 00:00:00') { + if($account['account_password_changed'] != NULL_DATE) { $d1 = datetime_convert('UTC','UTC','now - 48 hours'); if($account['account_password_changed'] > d1) { notice( t('Channel removals are not allowed within 48 hours of changing the account password.') . EOL); diff --git a/mod/share.php b/mod/share.php index 8b0403663..78a25ee10 100644 --- a/mod/share.php +++ b/mod/share.php @@ -14,10 +14,12 @@ function share_init(&$a) { killme(); - $r = q("SELECT * from item WHERE id = %d LIMIT 1", + $r = q("SELECT * from item left join xchan on author_xchan = xchan_hash WHERE id = %d LIMIT 1", intval($post_id) ); - if((! $r) || $r[0]['item_private']) + if(! $r) + killme(); + if(($r[0]['item_private']) && ($r[0]['xchan_network'] !== 'rss')) killme(); $sql_extra = item_permissions_sql($r[0]['uid']); diff --git a/mod/webpages.php b/mod/webpages.php index bfa2ebd7d..1b906a97f 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -46,11 +46,16 @@ function webpages_content(&$a) { // } - $mimetype = (($_REQUEST['mimetype']) ? $_REQUEST['mimetype'] : get_config('system','page_mimetype')); - if(! $mimetype) - $mimetype = 'choose'; + if(feature_enabled($owner,'expert_mode')) { + $mimetype = (($_REQUEST['mimetype']) ? $_REQUEST['mimetype'] : get_pconfig($owner,'system','page_mimetype')); + if(! $mimetype) + $mimetype = 'choose'; + } + else { + $mimetype = 'text/bbcode'; + } - $layout = (($_REQUEST['layout']) ? $_REQUEST['layout'] : get_config('system','page_layout')); + $layout = (($_REQUEST['layout']) ? $_REQUEST['layout'] : get_pconfig($owner,'system','page_layout')); if(! $layout) $layout = 'choose'; diff --git a/mod/xrd.php b/mod/xrd.php index d059bec9b..4fa81c7f3 100644 --- a/mod/xrd.php +++ b/mod/xrd.php @@ -22,18 +22,11 @@ function xrd_init(&$a) { if(! $r) killme(); - if(get_config('system','diaspora_enabled')) { - $tpl = get_markup_template('xrd_diaspora.tpl'); - $dspr = replace_macros($tpl,array( - '$baseurl' => $a->get_baseurl(), - '$dspr_guid' => $r[0]['channel_guid'], - '$dspr_key' => base64_encode(pemtorsa($r[0]['channel_pubkey'])) - )); - } - else - $dspr = ''; - - + $dspr = replace_macros(get_markup_template('xrd_diaspora.tpl'),array( + '$baseurl' => $a->get_baseurl(), + '$dspr_guid' => $r[0]['channel_guid'], + '$dspr_key' => base64_encode(pemtorsa($r[0]['channel_pubkey'])) + )); $salmon_key = salmon_key($r[0]['channel_pubkey']); diff --git a/mod/zfinger.php b/mod/zfinger.php index ef55085d6..1226f74fe 100644 --- a/mod/zfinger.php +++ b/mod/zfinger.php @@ -273,7 +273,6 @@ function zfinger_init(&$a) { if($access_policy == ACCESS_TIERED) $ret['site']['access_policy'] = 'tiered'; - require_once('include/account.php'); $ret['site']['accounts'] = account_total(); require_once('include/identity.php'); |