diff options
Diffstat (limited to 'mod')
-rwxr-xr-x | mod/acl.php | 4 | ||||
-rwxr-xr-x | mod/admin.php | 6 | ||||
-rwxr-xr-x | mod/contacts.php | 3 | ||||
-rw-r--r-- | mod/dfrn_confirm.php | 12 | ||||
-rwxr-xr-x | mod/display.php | 8 | ||||
-rwxr-xr-x | mod/item.php | 5 | ||||
-rwxr-xr-x | mod/network.php | 2 | ||||
-rw-r--r-- | mod/notify.php | 6 | ||||
-rwxr-xr-x | mod/photo.php | 2 | ||||
-rw-r--r-- | mod/ping.php | 28 | ||||
-rwxr-xr-x | mod/profile.php | 8 | ||||
-rwxr-xr-x | mod/settings.php | 57 | ||||
-rwxr-xr-x | mod/tagger.php | 1 | ||||
-rwxr-xr-x | mod/viewcontacts.php | 3 |
14 files changed, 100 insertions, 45 deletions
diff --git a/mod/acl.php b/mod/acl.php index 98ca90ded..375c618c8 100755 --- a/mod/acl.php +++ b/mod/acl.php @@ -16,6 +16,8 @@ function acl_init(&$a){ if ($search!=""){ $sql_extra = "AND `name` LIKE '%%".dbesc($search)."%%'"; $sql_extra2 = "AND (`attag` LIKE '%%".dbesc($search)."%%' OR `name` LIKE '%%".dbesc($search)."%%' OR `nick` LIKE '%%".dbesc($search)."%%')"; + } else { + $sql_extra = $sql_extra2 = ""; } // count groups and contacts @@ -75,7 +77,7 @@ function acl_init(&$a){ if ($type=='' || $type=='c'){ - $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url` FROM `contact` + $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `notify` != '' $sql_extra2 ORDER BY `name` ASC ", diff --git a/mod/admin.php b/mod/admin.php index bcbf3e28f..0f600e312 100755 --- a/mod/admin.php +++ b/mod/admin.php @@ -711,7 +711,7 @@ function admin_page_themes(&$a){ return; // NOTREACHED } - // display plugin details + // display theme details require_once('library/markdown.php'); if (theme_status($themes,$theme)) { @@ -769,7 +769,9 @@ function admin_page_themes(&$a){ '$submit' => t('Submit'), '$baseurl' => $a->get_baseurl(), '$function' => 'themes', - '$plugins' => $xthemes + '$plugins' => $xthemes, + '$experimental' => t('[Experimental]'), + '$unsupported' => t('[Unsupported]') )); } diff --git a/mod/contacts.php b/mod/contacts.php index c8edea151..c99ac1452 100755 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -504,8 +504,9 @@ function contacts_content(&$a) { 'name' => $rr['name'], 'username' => $rr['name'], 'sparkle' => $sparkle, + 'itemurl' => $rr['url'], 'url' => $url, - 'item' => $rr, + 'network' => network_to_name($rr['network']), ); } diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 5a24f0089..0bc3ea7df 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -107,7 +107,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { * */ - $r = q("SELECT * FROM `contact` WHERE ( ( `issued-id` != '' AND `issued-id` = '%s' ) OR ( `id` = %d AND `id` != 0 ) ) AND `uid` = %d LIMIT 1", + $r = q("SELECT * FROM `contact` WHERE ( ( `issued-id` != '' AND `issued-id` = '%s' ) OR ( `id` = %d AND `id` != 0 ) ) AND `uid` = %d AND `duplex` = 0 LIMIT 1", dbesc($dfrn_id), intval($cid), intval($uid) @@ -116,6 +116,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { if(! count($r)) { logger('dfrn_confirm: Contact not found in DB.'); notice( t('Contact not found.') . EOL ); + notice( t('This may occasionally happen if contact was requested by both persons and it has already been approved.') . EOL ); return; } @@ -631,6 +632,15 @@ function dfrn_confirm_post(&$a,$handsfree = null) { xml_status(3,$message); } + // It's possible that the other person also requested friendship. + // If it is a duplex relationship, ditch the issued-id if one exists. + + if($duplex) { + $r = q("UPDATE `contact` SET `issued-id` = '' WHERE `id` = %d LIMIT 1", + intval($dfrn_record) + ); + } + // We're good but now we have to scrape the profile photo and send notifications. diff --git a/mod/display.php b/mod/display.php index d96be4333..f510f793d 100755 --- a/mod/display.php +++ b/mod/display.php @@ -74,11 +74,11 @@ function display_content(&$a) { $x = array( 'is_owner' => true, 'allow_location' => $a->user['allow_location'], - 'default_location' => $a->user['default_location'], + 'default_location' => $a->user['default-location'], 'nickname' => $a->user['nickname'], - 'lockstate' => ((($group) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'), - 'acl' => populate_acl((($group || $cid) ? $def_acl : $a->user), $celeb), - 'bang' => (($group || $cid) ? '!' : ''), + 'lockstate' => ( (is_array($a->user)) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))) ? 'lock' : 'unlock'), + 'acl' => populate_acl($a->user, $celeb), + 'bang' => '', 'visitor' => 'block', 'profile_uid' => local_user() ); diff --git a/mod/item.php b/mod/item.php index 3035989f3..81d7c753b 100755 --- a/mod/item.php +++ b/mod/item.php @@ -400,6 +400,8 @@ function item_post(&$a) { $body = preg_replace('/\[\/code\]\s*\[code\]/ism',"\n",$body); + $body = scale_external_images($body,false); + /** * Look for any tags and linkify them */ @@ -753,7 +755,8 @@ function item_post(&$a) { 'source_link' => $datarray['author-link'], 'source_photo' => $datarray['author-avatar'], 'verb' => ACTIVITY_POST, - 'otype' => 'item' + 'otype' => 'item', + 'parent' => $parent, )); } diff --git a/mod/network.php b/mod/network.php index 03a671b61..894ac48ed 100755 --- a/mod/network.php +++ b/mod/network.php @@ -263,7 +263,7 @@ function network_content(&$a, $update = 0) { $x = array( 'is_owner' => true, 'allow_location' => $a->user['allow_location'], - 'default_location' => $a->user['default_location'], + 'default_location' => $a->user['default-location'], 'nickname' => $a->user['nickname'], 'lockstate' => ((($group) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'), 'acl' => populate_acl((($group || $cid) ? $def_acl : $a->user), $celeb), diff --git a/mod/notify.php b/mod/notify.php index e6a7a8859..a572b1534 100644 --- a/mod/notify.php +++ b/mod/notify.php @@ -11,8 +11,10 @@ function notify_init(&$a) { intval(local_user()) ); if(count($r)) { - q("update notify set seen = 1 where id = %d and uid = %d limit 1", - intval($a->argv[2]), + q("update notify set seen = 1 where ( link = '%s' or ( parent != 0 and parent = %d and otype = '%s' )) and uid = %d", + dbesc($r[0]['link']), + intval($r[0]['parent']), + dbesc($r[0]['otype']), intval(local_user()) ); goaway($r[0]['link']); diff --git a/mod/photo.php b/mod/photo.php index a5a5a1dc1..c4a93769a 100755 --- a/mod/photo.php +++ b/mod/photo.php @@ -119,7 +119,7 @@ function photo_init(&$a) { // NOTREACHED } - if(intval($customres) && $customres > 0 && $customres < 500) { + if(isset($customres) && $customres > 0 && $customres < 500) { require_once('include/Photo.php'); $ph = new Photo($data); if($ph->is_valid()) { diff --git a/mod/ping.php b/mod/ping.php index 0f6f0a9d6..1562254b1 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -14,10 +14,29 @@ function ping_init(&$a) { $firehose = intval(get_pconfig(local_user(),'system','notify_full')); - $z = q("select * from notify where uid = %d - order by seen asc, date desc limit 0, 50", + $t = q("select count(*) as total from notify where uid = %d and seen = 0", intval(local_user()) ); + if($t && intval($t[0]['total']) > 49) { + $z = q("select * from notify where uid = %d + and seen = 0 order by date desc limit 0, 50", + intval(local_user()) + ); + } + else { + $z1 = q("select * from notify where uid = %d + and seen = 0 order by date desc limit 0, 50", + intval(local_user()) + ); + + $z2 = q("select * from notify where uid = %d + and seen = 1 order by date desc limit 0, %d", + intval(local_user()), + intval(50 - intval($t[0]['total'])) + ); + $z = array_merge($z1,$z2); + } + $tags = array(); @@ -26,9 +45,10 @@ function ping_init(&$a) { $dislikes = array(); $friends = array(); $posts = array(); - + $home = 0; + $network = 0; - $r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`, + $r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`wall`, `item`.`author-name`, `item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object`, `pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink` FROM `item` INNER JOIN `item` as `pitem` ON `pitem`.`id`=`item`.`parent` diff --git a/mod/profile.php b/mod/profile.php index eba9874a8..74e1a2302 100755 --- a/mod/profile.php +++ b/mod/profile.php @@ -107,7 +107,7 @@ function profile_content(&$a, $update = 0) { $is_owner = ((local_user()) && (local_user() == $a->profile['profile_uid']) ? true : false); - if($a->profile['hidewall'] && (! $is_owner) && (! $remote_contact)) { + if($a->user['hidewall'] && (! $is_owner) && (! $remote_contact)) { notice( t('Access to this profile has been restricted.') . EOL); return; } @@ -228,10 +228,12 @@ function profile_content(&$a, $update = 0) { intval($a->profile['profile_uid']), dbesc($parents_str) ); + + $items = conv_sort($items,'created'); + } else { + $items = array(); } - $items = conv_sort($items,'created'); - if($is_owner && ! $update) { $o .= get_birthdays(); $o .= get_events(); diff --git a/mod/settings.php b/mod/settings.php index 91f4325da..a9d00bc98 100755 --- a/mod/settings.php +++ b/mod/settings.php @@ -50,6 +50,8 @@ function settings_post(&$a) { return; } + $old_page_flags = $a->user['page-flags']; + if(($a->argc > 1) && ($a->argv[1] === 'oauth') && x($_POST,'remove')){ $key = $_POST['remove']; q("DELETE FROM tokens WHERE id='%s' AND uid=%d", @@ -110,13 +112,15 @@ function settings_post(&$a) { if(($a->argc > 1) && ($a->argv[1] == 'connectors')) { if(x($_POST['imap-submit'])) { - $mail_server = ((x($_POST,'mail_server')) ? $_POST['mail_server'] : ''); - $mail_port = ((x($_POST,'mail_port')) ? $_POST['mail_port'] : ''); - $mail_ssl = ((x($_POST,'mail_ssl')) ? strtolower(trim($_POST['mail_ssl'])) : ''); - $mail_user = ((x($_POST,'mail_user')) ? $_POST['mail_user'] : ''); - $mail_pass = ((x($_POST,'mail_pass')) ? trim($_POST['mail_pass']) : ''); - $mail_replyto = ((x($_POST,'mail_replyto')) ? $_POST['mail_replyto'] : ''); - $mail_pubmail = ((x($_POST,'mail_pubmail')) ? $_POST['mail_pubmail'] : ''); + $mail_server = ((x($_POST,'mail_server')) ? $_POST['mail_server'] : ''); + $mail_port = ((x($_POST,'mail_port')) ? $_POST['mail_port'] : ''); + $mail_ssl = ((x($_POST,'mail_ssl')) ? strtolower(trim($_POST['mail_ssl'])) : ''); + $mail_user = ((x($_POST,'mail_user')) ? $_POST['mail_user'] : ''); + $mail_pass = ((x($_POST,'mail_pass')) ? trim($_POST['mail_pass']) : ''); + $mail_action = ((x($_POST,'mail_action')) ? trim($_POST['mail_action']) : ''); + $mail_movetofolder = ((x($_POST,'mail_movetofolder')) ? trim($_POST['mail_movetofolder']) : ''); + $mail_replyto = ((x($_POST,'mail_replyto')) ? $_POST['mail_replyto'] : ''); + $mail_pubmail = ((x($_POST,'mail_pubmail')) ? $_POST['mail_pubmail'] : ''); $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1); @@ -142,11 +146,14 @@ function settings_post(&$a) { ); } $r = q("UPDATE `mailacct` SET `server` = '%s', `port` = %d, `ssltype` = '%s', `user` = '%s', + `action` = %d, `movetofolder` = '%s', `mailbox` = 'INBOX', `reply_to` = '%s', `pubmail` = %d WHERE `uid` = %d LIMIT 1", dbesc($mail_server), intval($mail_port), dbesc($mail_ssl), dbesc($mail_user), + intval($mail_action), + dbesc($mail_movetofolder), dbesc($mail_replyto), intval($mail_pubmail), intval(local_user()) @@ -218,8 +225,8 @@ function settings_post(&$a) { $openid = ((x($_POST,'openid_url')) ? notags(trim($_POST['openid_url'])) : ''); $maxreq = ((x($_POST,'maxreq')) ? intval($_POST['maxreq']) : 0); $expire = ((x($_POST,'expire')) ? intval($_POST['expire']) : 0); - - + + $expire_items = ((x($_POST,'expire_items')) ? intval($_POST['expire_items']) : 0); $expire_notes = ((x($_POST,'expire_notes')) ? intval($_POST['expire_notes']) : 0); $expire_starred = ((x($_POST,'expire_starred')) ? intval($_POST['expire_starred']) : 0); @@ -370,7 +377,7 @@ function settings_post(&$a) { ); } - if($old_visibility != $net_publish) { + if(($old_visibility != $net_publish) || ($page_flags != $old_page_flags)) { // Update global directory in background $url = $_SESSION['my_url']; if($url && strlen(get_config('system','directory_submit_url'))) @@ -561,23 +568,25 @@ function settings_content(&$a) { $r = null; } - $mail_server = ((count($r)) ? $r[0]['server'] : ''); - $mail_port = ((count($r) && intval($r[0]['port'])) ? intval($r[0]['port']) : ''); - $mail_ssl = ((count($r)) ? $r[0]['ssltype'] : ''); - $mail_user = ((count($r)) ? $r[0]['user'] : ''); - $mail_replyto = ((count($r)) ? $r[0]['reply_to'] : ''); - $mail_pubmail = ((count($r)) ? $r[0]['pubmail'] : 0); - $mail_chk = ((count($r)) ? $r[0]['last_check'] : '0000-00-00 00:00:00'); + $mail_server = ((count($r)) ? $r[0]['server'] : ''); + $mail_port = ((count($r) && intval($r[0]['port'])) ? intval($r[0]['port']) : ''); + $mail_ssl = ((count($r)) ? $r[0]['ssltype'] : ''); + $mail_user = ((count($r)) ? $r[0]['user'] : ''); + $mail_replyto = ((count($r)) ? $r[0]['reply_to'] : ''); + $mail_pubmail = ((count($r)) ? $r[0]['pubmail'] : 0); + $mail_action = ((count($r)) ? $r[0]['action'] : 0); + $mail_movetofolder = ((count($r)) ? $r[0]['movetofolder'] : ''); + $mail_chk = ((count($r)) ? $r[0]['last_check'] : '0000-00-00 00:00:00'); + - $tpl = get_markup_template("settings_connectors.tpl"); $o .= replace_macros($tpl, array( '$title' => t('Connector Settings'), '$tabs' => $tabs, - + '$diasp_enabled' => $diasp_enabled, '$ostat_enabled' => $ostat_enabled, - + '$h_imap' => t('Email/Mailbox Setup'), '$imap_desc' => t("If you wish to communicate with email contacts using this service \x28optional\x29, please specify how to connect to your mailbox."), '$imap_lastcheck' => array('imap_lastcheck', t('Last successful email check:'), $mail_chk,''), @@ -589,8 +598,10 @@ function settings_content(&$a) { '$mail_pass' => array('mail_pass', t('Email password:'), '', ''), '$mail_replyto' => array('mail_replyto', t('Reply-to address:'), '', 'Optional'), '$mail_pubmail' => array('mail_pubmail', t('Send public posts to all email contacts:'), $mail_pubmail, ''), - '$submit' => t('Submit'), - + '$mail_action' => array('mail_action', t('Action after import:'), $mail_action, '', array(0=>t('None'), 1=>t('Delete'), 2=>t('Mark as seen'), 3=>t('Move to folder'))), + '$mail_movetofolder' => array('mail_movetofolder', t('Move to folder:'), $mail_movetofolder, ''), + '$submit' => t('Submit'), + '$settings_connectors' => $settings_connectors @@ -598,7 +609,7 @@ function settings_content(&$a) { return $o; } - + require_once('include/acl_selectors.php'); $p = q("SELECT * FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1", diff --git a/mod/tagger.php b/mod/tagger.php index 76ec3366c..3ff5d57aa 100755 --- a/mod/tagger.php +++ b/mod/tagger.php @@ -134,6 +134,7 @@ EOT; $arr['target'] = $target; $arr['object-type'] = $objtype; $arr['object'] = $obj; + $arr['private'] = $item['private']; $arr['allow_cid'] = $item['allow_cid']; $arr['allow_gid'] = $item['allow_gid']; $arr['deny_cid'] = $item['deny_cid']; diff --git a/mod/viewcontacts.php b/mod/viewcontacts.php index 10c980d93..6b66f60d7 100755 --- a/mod/viewcontacts.php +++ b/mod/viewcontacts.php @@ -63,7 +63,8 @@ function viewcontacts_content(&$a) { 'username' => $rr['name'], 'url' => $url, 'sparkle' => '', - 'item' => $rr, + 'itemurl' => $rr['url'], + 'network' => network_to_name($rr['network']), ); } |