X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fnetwork.php;h=3e6c5dc4a5821148f84260aed9488d40e25ea3e3;hb=3787e1e500b72db49958c15ebe8991caaf06ec4d;hp=1b5ea5d651d8ffd326ccf2f7565f65258010ad94;hpb=85f709320b588f3231875d097217bd9abd223c9f;p=friendica.git diff --git a/mod/network.php b/mod/network.php index 1b5ea5d651..3e6c5dc4a5 100644 --- a/mod/network.php +++ b/mod/network.php @@ -15,18 +15,20 @@ function network_init(&$a) { $a->page['aside'] .= ''; - $a->page['aside'] .= group_side('network','network'); + $a->page['aside'] .= group_side('network','network',true); } function network_content(&$a, $update = 0) { + require_once('include/conversation.php'); + if(! local_user()) return login(false); @@ -39,6 +41,8 @@ function network_content(&$a, $update = 0) { $nouveau = false; require_once('include/acl_selectors.php'); + $cid = ((x($_GET['cid'])) ? intval($_GET['cid']) : 0); + if(($a->argc > 2) && $a->argv[2] === 'new') $nouveau = true; @@ -47,10 +51,13 @@ function network_content(&$a, $update = 0) { $nouveau = true; else { $group = intval($a->argv[1]); - $group_acl = array('allow_gid' => '<' . $group . '>'); + $def_acl = array('allow_gid' => '<' . $group . '>'); } } + if($cid) + $def_acl = array('allow_cid' => '<' . intval($cid) . '>'); + if(! $update) { if(group) { if(($t = group_public_members($group)) && (! get_pconfig(local_user(),'system','nowarn_insecure'))) { @@ -92,6 +99,30 @@ function network_content(&$a, $update = 0) { $jotplugins = ''; $jotnets = ''; + + $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1); + + $mail_enabled = false; + $pubmail_enabled = false; + + if(! $mail_disabled) { + $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1", + intval(local_user()) + ); + if(count($r)) { + $mail_enabled = true; + if(intval($r[0]['pubmail'])) + $pubmail_enabled = true; + } + } + + if($mail_enabled) { + $selected = (($pubmail_enabled) ? ' checked="checked" ' : ''); + $jotnets .= '
' + . t("Post to Email") . '
'; + } + + call_hooks('jot_tool', $jotplugins); call_hooks('jot_networks', $jotnets); @@ -120,8 +151,8 @@ function network_content(&$a, $update = 0) { '$jotnets' => $jotnets, '$emtitle' => t('Example: bob@example.com, mary@example.com'), '$lockstate' => $lockstate, - '$acl' => populate_acl((($group) ? $group_acl : $a->user), $celeb), - '$bang' => (($group) ? '!' : ''), + '$acl' => populate_acl((($group || $cid) ? $def_acl : $a->user), $celeb), + '$bang' => (($group || $cid) ? '!' : ''), '$profile_uid' => local_user() )); @@ -134,6 +165,7 @@ function network_content(&$a, $update = 0) { $o .= '
' . "\r\n"; $o .= "\r\n"; } @@ -163,7 +195,7 @@ function network_content(&$a, $update = 0) { killme(); notice( t('No such group') . EOL ); goaway($a->get_baseurl() . '/network'); - return; // NOTREACHED + // NOTREACHED } $contacts = expand_groups(array($group)); @@ -178,8 +210,28 @@ function network_content(&$a, $update = 0) { $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` AND `contact-id` IN ( $contact_str )) "; $o = '

' . t('Group: ') . $r[0]['name'] . '

' . $o; } + elseif($cid) { - if((! $group) && (! $update)) + $r = q("SELECT `id`,`name`,`network`,`writable` FROM `contact` WHERE `id` = %d + AND `blocked` = 0 AND `pending` = 0 LIMIT 1", + intval($cid) + ); + if(count($r)) { + $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` AND `contact-id` IN ( " . intval($cid) . " )) "; + $o = '

' . t('Contact: ') . $r[0]['name'] . '

' . $o; + if($r[0]['network'] !== NETWORK_MAIL && $r[0]['network'] !== NETWORK_DFRN && $r[0]['writable'] && (! get_pconfig(local_user(),'system','nowarn_insecure'))) { + notice( t('Private messages to this person are at risk of public disclosure.') . EOL); + } + + } + else { + notice( t('Invalid contact.') . EOL); + goaway($a->get_baseurl() . '/network'); + // NOTREACHED + } + } + + if((! $group) && (! $cid) && (! $update)) $o .= get_birthdays(); @@ -267,8 +319,6 @@ function network_content(&$a, $update = 0) { $mode = (($nouveau) ? 'network-new' : 'network'); - require_once('include/conversation.php'); - $o .= conversation($a,$r,$mode,$update); if(! $update) {