Merge remote branch 'upstream/master'
This commit is contained in:
commit
5cfb068c25
110 changed files with 8291 additions and 1531 deletions
|
@ -295,7 +295,11 @@ class Photo {
|
|||
if( (! function_exists('exif_read_data')) || ($this->getType() !== 'image/jpeg') )
|
||||
return;
|
||||
|
||||
$exif = exif_read_data($filename);
|
||||
$exif = @exif_read_data($filename);
|
||||
|
||||
if(! $exif)
|
||||
return;
|
||||
|
||||
$ort = $exif['Orientation'];
|
||||
|
||||
switch($ort)
|
||||
|
|
|
@ -563,9 +563,10 @@ function probe_url($url, $mode = PROBE_NORMAL) {
|
|||
else
|
||||
$poll = $tapi . '?screen_name=' . $tid;
|
||||
$profile = 'http://twitter.com/#!/' . $tid;
|
||||
$vcard['photo'] = 'https://api.twitter.com/1/users/profile_image/' . $tid;
|
||||
//$vcard['photo'] = 'https://api.twitter.com/1/users/profile_image/' . $tid;
|
||||
$vcard['photo'] = 'https://api.twitter.com/1/users/profile_image?screen_name=' . $tid . '&size=bigger';
|
||||
$vcard['nick'] = $tid;
|
||||
$vcard['fn'] = $tid . '@twitter';
|
||||
$vcard['fn'] = $tid;
|
||||
}
|
||||
|
||||
if($lastfm) {
|
||||
|
|
|
@ -10,14 +10,13 @@ function nuke_session() {
|
|||
unset($_SESSION['administrator']);
|
||||
unset($_SESSION['cid']);
|
||||
unset($_SESSION['theme']);
|
||||
unset($_SESSION['mobile-theme']);
|
||||
unset($_SESSION['page_flags']);
|
||||
unset($_SESSION['submanage']);
|
||||
unset($_SESSION['my_url']);
|
||||
unset($_SESSION['my_address']);
|
||||
unset($_SESSION['addr']);
|
||||
unset($_SESSION['return_url']);
|
||||
unset($_SESSION['theme']);
|
||||
unset($_SESSION['page_flags']);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -142,9 +142,16 @@ function common_friends_visitor_widget($profile_uid) {
|
|||
|
||||
$cid = $zcid = 0;
|
||||
|
||||
if(can_write_wall($a,$profile_uid))
|
||||
$cid = remote_user();
|
||||
else {
|
||||
if(is_array($_SESSION['remote'])) {
|
||||
foreach($_SESSION['remote'] as $visitor) {
|
||||
if($visitor['uid'] == $profile_uid) {
|
||||
$cid = $visitor['cid'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(! $cid) {
|
||||
if(get_my_url()) {
|
||||
$r = q("select id from contact where nurl = '%s' and uid = %d limit 1",
|
||||
dbesc(normalise_link(get_my_url())),
|
||||
|
|
|
@ -346,7 +346,7 @@ function count_descendants($item) {
|
|||
* Recursively prepare a thread for HTML
|
||||
*/
|
||||
|
||||
function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $profile_owner, $alike, $dlike, $thread_level=1) {
|
||||
function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $profile_owner, $alike, $dlike, $previewing, $thread_level=1) {
|
||||
$result = array();
|
||||
|
||||
$wall_template = 'wall_thread.tpl';
|
||||
|
@ -394,12 +394,34 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr
|
|||
$thumb = $item['thumb'];
|
||||
$indent = '';
|
||||
$osparkle = '';
|
||||
$visiting = false;
|
||||
$lastcollapsed = false;
|
||||
$firstcollapsed = false;
|
||||
$total_children += count_descendants($item);
|
||||
|
||||
$toplevelpost = (($item['id'] == $item['parent']) ? true : false);
|
||||
|
||||
|
||||
if($item['uid'] == local_user())
|
||||
$dropping = true;
|
||||
elseif(is_array($_SESSION['remote'])) {
|
||||
foreach($_SESSION['remote'] as $visitor) {
|
||||
if($visitor['cid'] == $item['contact-id']) {
|
||||
$dropping = true;
|
||||
$visiting = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$item_writeable = (($item['writable'] || $item['self']) ? true : false);
|
||||
|
||||
// This will allow us to comment on wall-to-wall items owned by our friends
|
||||
// and community forums even if somebody else wrote the post.
|
||||
|
||||
if($visiting && $mode == 'profile')
|
||||
$item_writeable = true;
|
||||
|
||||
$show_comment_box = ((($page_writeable) && ($item_writeable)) ? true : false);
|
||||
$lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|
||||
|| strlen($item['deny_cid']) || strlen($item['deny_gid']))))
|
||||
|
@ -411,8 +433,6 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr
|
|||
$edpost = array($a->get_baseurl($ssl_state)."/editpost/".$item['id'], t("Edit"));
|
||||
else
|
||||
$edpost = false;
|
||||
if((intval($item['contact-id']) && $item['contact-id'] == remote_user()) || ($item['uid'] == local_user()))
|
||||
$dropping = true;
|
||||
|
||||
$drop = array(
|
||||
'dropping' => $dropping,
|
||||
|
@ -651,7 +671,7 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr
|
|||
|
||||
$item_result['children'] = array();
|
||||
if(count($item['children'])) {
|
||||
$item_result['children'] = prepare_threads_body($a, $item['children'], $cmnt_tpl, $page_writeable, $mode, $profile_owner, $alike, $dlike, ($thread_level + 1));
|
||||
$item_result['children'] = prepare_threads_body($a, $item['children'], $cmnt_tpl, $page_writeable, $mode, $profile_owner, $alike, $dlike, $previewing, ($thread_level + 1));
|
||||
}
|
||||
$item_result['private'] = $item['private'];
|
||||
$item_result['toplevel'] = ($toplevelpost ? 'toplevel_item' : '');
|
||||
|
@ -901,7 +921,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
|
|||
}
|
||||
}
|
||||
|
||||
$threads = prepare_threads_body($a, $threads, $cmnt_tpl, $page_writeable, $mode, $profile_owner, $alike, $dlike);
|
||||
$threads = prepare_threads_body($a, $threads, $cmnt_tpl, $page_writeable, $mode, $profile_owner, $alike, $dlike, $previewing);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -328,8 +328,9 @@ function delivery_run($argv, $argc){
|
|||
dbesc($nickname)
|
||||
);
|
||||
|
||||
if(count($x)) {
|
||||
if($owner['page-flags'] == PAGE_COMMUNITY && ! $x[0]['writable']) {
|
||||
if($x && count($x)) {
|
||||
$write_flag = ((($x[0]['rel']) && ($x[0]['rel'] != CONTACT_IS_SHARING)) ? true : false);
|
||||
if((($owner['page-flags'] == PAGE_COMMUNITY) || ($write_flag)) && (! $x[0]['writable'])) {
|
||||
q("update contact set writable = 1 where id = %d limit 1",
|
||||
intval($x[0]['id'])
|
||||
);
|
||||
|
|
|
@ -2128,8 +2128,11 @@ function local_delivery($importer,$data) {
|
|||
|
||||
|
||||
$rawtags = $feed->get_feed_tags( NAMESPACE_DFRN, 'owner');
|
||||
if(! $rawtags)
|
||||
$rawtags = $feed->get_feed_tags( SIMPLEPIE_NAMESPACE_ATOM_10, 'author');
|
||||
|
||||
// Fallback should not be needed here. If it isn't DFRN it won't have DFRN updated tags
|
||||
// if(! $rawtags)
|
||||
// $rawtags = $feed->get_feed_tags( SIMPLEPIE_NAMESPACE_ATOM_10, 'author');
|
||||
|
||||
if($rawtags) {
|
||||
$elems = $rawtags[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10];
|
||||
if($elems['name'][0]['attribs'][NAMESPACE_DFRN]['updated']) {
|
||||
|
@ -3708,9 +3711,21 @@ function drop_item($id,$interactive = true) {
|
|||
|
||||
$owner = $item['uid'];
|
||||
|
||||
$cid = 0;
|
||||
|
||||
// check if logged in user is either the author or owner of this item
|
||||
|
||||
if((local_user() == $item['uid']) || (remote_user() == $item['contact-id']) || (! $interactive)) {
|
||||
if(is_array($_SESSION['remote'])) {
|
||||
foreach($_SESSION['remote'] as $visitor) {
|
||||
if($visitor['uid'] == $item['uid'] && $visitor['cid'] == $item['contact-id']) {
|
||||
$cid = $visitor['cid'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if((local_user() == $item['uid']) || ($cid) || (! $interactive)) {
|
||||
|
||||
logger('delete item: ' . $item['id'], LOGGER_DEBUG);
|
||||
// delete the item
|
||||
|
|
|
@ -295,7 +295,7 @@ function notifier_run($argv, $argc){
|
|||
// a delivery fork. private groups (forum_mode == 2) do not uplink
|
||||
|
||||
if((intval($parent['forum_mode']) == 1) && (! $top_level) && ($cmd !== 'uplink')) {
|
||||
proc_run('php','include/notifier','uplink',$item_id);
|
||||
proc_run('php','include/notifier.php','uplink',$item_id);
|
||||
}
|
||||
|
||||
$conversants = array();
|
||||
|
@ -580,9 +580,9 @@ function notifier_run($argv, $argc){
|
|||
dbesc($nickname)
|
||||
);
|
||||
|
||||
if(count($x)) {
|
||||
|
||||
if($owner['page-flags'] == PAGE_COMMUNITY && ! $x[0]['writable']) {
|
||||
if($x && count($x)) {
|
||||
$write_flag = ((($x[0]['rel']) && ($x[0]['rel'] != CONTACT_IS_SHARING)) ? true : false);
|
||||
if((($owner['page-flags'] == PAGE_COMMUNITY) || ($write_flag)) && (! $x[0]['writable'])) {
|
||||
q("update contact set writable = 1 where id = %d limit 1",
|
||||
intval($x[0]['id'])
|
||||
);
|
||||
|
|
|
@ -145,6 +145,7 @@ class FKOAuth1 extends OAuthServer {
|
|||
}
|
||||
$_SESSION['uid'] = $record['uid'];
|
||||
$_SESSION['theme'] = $record['theme'];
|
||||
$_SESSION['mobile-theme'] = get_pconfig($record['uid'], 'system', 'mobile_theme');
|
||||
$_SESSION['authenticated'] = 1;
|
||||
$_SESSION['page_flags'] = $record['page-flags'];
|
||||
$_SESSION['my_url'] = $a->get_baseurl() . '/profile/' . $record['nickname'];
|
||||
|
|
|
@ -6,6 +6,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive
|
|||
|
||||
$_SESSION['uid'] = $user_record['uid'];
|
||||
$_SESSION['theme'] = $user_record['theme'];
|
||||
$_SESSION['mobile-theme'] = get_pconfig($user_record['uid'], 'system', 'mobile_theme');
|
||||
$_SESSION['authenticated'] = 1;
|
||||
$_SESSION['page_flags'] = $user_record['page-flags'];
|
||||
$_SESSION['my_url'] = $a->get_baseurl() . '/profile/' . $user_record['nickname'];
|
||||
|
@ -120,12 +121,26 @@ function can_write_wall(&$a,$owner) {
|
|||
elseif($verified === 1)
|
||||
return false;
|
||||
else {
|
||||
$cid = 0;
|
||||
|
||||
if(is_array($_SESSION['remote'])) {
|
||||
foreach($_SESSION['remote'] as $visitor) {
|
||||
if($visitor['uid'] == $owner) {
|
||||
$cid = $visitor['cid'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(! $cid)
|
||||
return false;
|
||||
|
||||
|
||||
$r = q("SELECT `contact`.*, `user`.`page-flags` FROM `contact` LEFT JOIN `user` on `user`.`uid` = `contact`.`uid`
|
||||
WHERE `contact`.`uid` = %d AND `contact`.`id` = %d AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
|
||||
AND `user`.`blockwall` = 0 AND `readonly` = 0 AND ( `contact`.`rel` IN ( %d , %d ) OR `user`.`page-flags` = %d ) LIMIT 1",
|
||||
intval($owner),
|
||||
intval(remote_user()),
|
||||
intval($cid),
|
||||
intval(CONTACT_IS_SHARING),
|
||||
intval(CONTACT_IS_FRIEND),
|
||||
intval(PAGE_COMMUNITY)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue