diff options
author | Thomas Willingham <beardyunixer@beardyunixer.com> | 2014-09-09 21:32:25 +0100 |
---|---|---|
committer | Thomas Willingham <beardyunixer@beardyunixer.com> | 2014-09-09 21:32:25 +0100 |
commit | ec4f30c3f672bbfc57bee8db0aaa0cf002fe8687 (patch) | |
tree | cf1aa37d881f2ce3cb844bbcd5c11c5999e96c66 /mod | |
parent | 652ec8c3fcc956c1a5fc2adb7410e4c4a2ac6f90 (diff) | |
parent | 409c89d629993b59eaafa8443ae9d0b5f0344c1f (diff) | |
download | volse-hubzilla-ec4f30c3f672bbfc57bee8db0aaa0cf002fe8687.tar.gz volse-hubzilla-ec4f30c3f672bbfc57bee8db0aaa0cf002fe8687.tar.bz2 volse-hubzilla-ec4f30c3f672bbfc57bee8db0aaa0cf002fe8687.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mod')
-rw-r--r-- | mod/acl.php | 5 | ||||
-rw-r--r-- | mod/admin.php | 2 | ||||
-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/follow.php | 3 | ||||
-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/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 |
23 files changed, 196 insertions, 69 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..48b342d4e 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -608,13 +608,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/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/follow.php b/mod/follow.php index 663fb7536..e480a0964 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -26,10 +26,9 @@ function follow_init(&$a) { // If we can view their stream, pull in some posts - if($result['abook']['abook_their_perms'] & PERMS_R_STREAM) + if(($result['abook']['abook_their_perms'] & PERMS_R_STREAM) || ($result['abook']['xchan_network'] === 'rss')) proc_run('php','include/onepoll.php',$result['abook']['abook_id']); - goaway(z_root() . '/connedit/' . $result['abook']['abook_id'] . '?f=&follow=1'); } 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/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'); |