From b263f11d77db347122bce22de23587fbb2b0edff Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Fri, 7 Jun 2013 20:40:36 +0100 Subject: Another missing include --- mod/import.php | 1 + 1 file changed, 1 insertion(+) (limited to 'mod') diff --git a/mod/import.php b/mod/import.php index d1b3216d0..b7e48ed7a 100644 --- a/mod/import.php +++ b/mod/import.php @@ -5,6 +5,7 @@ require_once('include/Contact.php'); require_once('include/zot.php'); +require_once('include/identity.php'); function import_post(&$a) { -- cgit v1.2.3 From 4132cab862608f05c7a5b1467e5a66df9070b01b Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Fri, 7 Jun 2013 22:53:43 +0100 Subject: Rename newmessage widget (since we'll need to put more stuff in it as we make zotmail look like email), and add a "check mail" button. --- mod/message.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/message.php b/mod/message.php index 93b5c2494..54615f081 100644 --- a/mod/message.php +++ b/mod/message.php @@ -9,13 +9,20 @@ require_once('include/Contact.php'); function message_aside(&$a) { - $a->set_widget('newmessage',replace_macros(get_markup_template('message_side.tpl'), array( + $a->set_widget('msgaside',replace_macros(get_markup_template('message_side.tpl'), array( '$tabs'=> array(), + + '$check'=>array( + 'label' => t('Check Mail'), + 'url' => $a->get_baseurl(true) . '/message', + 'sel' => (argv(1) == ''), + ), '$new'=>array( 'label' => t('New Message'), 'url' => $a->get_baseurl(true) . '/message/new', 'sel'=> (argv(1) == 'new'), ) + ))); } -- cgit v1.2.3 From ee1ecd8ea29e41f70f8ee233ff6859e2e45e28b7 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 8 Jun 2013 16:29:56 -0700 Subject: remove uploaded import file once we're done with it. --- mod/import.php | 1 + 1 file changed, 1 insertion(+) (limited to 'mod') diff --git a/mod/import.php b/mod/import.php index d1b3216d0..a36519a0c 100644 --- a/mod/import.php +++ b/mod/import.php @@ -22,6 +22,7 @@ function import_post(&$a) { if($filesize) { $data = @file_get_contents($src); } + unlink($src); } if(! $src) { -- cgit v1.2.3 From d76ec28f7900c0c5fcf2d52bda3476de59b8fb1d Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 8 Jun 2013 16:41:57 -0700 Subject: import requires a valid account --- mod/import.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mod') diff --git a/mod/import.php b/mod/import.php index bf55b3104..1bc61da43 100644 --- a/mod/import.php +++ b/mod/import.php @@ -9,6 +9,9 @@ require_once('include/identity.php'); function import_post(&$a) { + if(! $a->get_account()) { + return; + } $data = null; $seize = ((x($_REQUEST,'make_primary')) ? intval($_REQUEST['make_primary']) : 0); @@ -328,6 +331,10 @@ function import_post(&$a) { function import_content(&$a) { + if(! $a->get_account()) { + notice( t('You must be logged in to use this feature.')); + return ''; + } $o = replace_macros(get_markup_template('channel_import.tpl'),array( '$title' => t('Import Channel'), -- cgit v1.2.3 From 8090177efb6aef9799932158b102f51131530443 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Sun, 9 Jun 2013 18:16:02 +0100 Subject: Another missing include --- mod/acl.php | 1 + 1 file changed, 1 insertion(+) (limited to 'mod') diff --git a/mod/acl.php b/mod/acl.php index 2f1866f85..dea0047f2 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -251,6 +251,7 @@ function navbar_complete(&$a) { } if(! $url) { + require_once("include/dir_fns.php"); $directory = find_upstream_directory($dirmode); if($directory) { -- cgit v1.2.3 From 2d3a0a65258be35f4c046b6b3e416bf93baa4940 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 12 Jun 2013 21:12:27 -0700 Subject: feeds are bit more standards compliant and a bit less broken now --- mod/feed.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'mod') diff --git a/mod/feed.php b/mod/feed.php index a6adc620e..104208875 100644 --- a/mod/feed.php +++ b/mod/feed.php @@ -13,7 +13,7 @@ function feed_init(&$a) { $channel = ''; if(argc() > 1) { - $r = q("select * from channel where channel_address = '%s' limit 1", + $r = q("select * from channel left join xchan on channel_hash = xchan_hash where channel_address = '%s' limit 1", dbesc(argv(1)) ); if(!($r && count($r))) @@ -21,11 +21,6 @@ function feed_init(&$a) { $channel = $r[0]; - // check site and channel permissions - - if(!($channel['channel_r_stream'] & PERMS_PUBLIC)) - killme(); - if((intval(get_config('system','block_public'))) && (! get_account_id())) killme(); -- cgit v1.2.3 From 87e4f50edab4e32a6191cd1fa5c1ee9f5dba791e Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 15 Jun 2013 02:31:34 -0700 Subject: hijack the #getzot tag --- mod/item.php | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'mod') diff --git a/mod/item.php b/mod/item.php index b09ee06f3..ed5941d2a 100644 --- a/mod/item.php +++ b/mod/item.php @@ -799,15 +799,23 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag) { if(strpos($tag,'[zrl=')) //...do nothing return $replaced; - //base tag has the tags name only - $basetag = str_replace('_',' ',substr($tag,1)); - //create text for link - $url = $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag); - $newtag = '#[zrl=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/zrl]'; - //replace tag by the link - $body = str_replace($tag, $newtag, $body); - $replaced = true; - + if($tag == '#getzot') { + $basetag = 'getzot'; + $url = 'http://getzot.com'; + $newtag = '#[zrl=' . $url . ']' . $basetag . '[/zrl]'; + $body = str_replace($tag,$newtag,$body); + $replace = true; + } + else { + //base tag has the tags name only + $basetag = str_replace('_',' ',substr($tag,1)); + //create text for link + $url = $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag); + $newtag = '#[zrl=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/zrl]'; + //replace tag by the link + $body = str_replace($tag, $newtag, $body); + $replaced = true; + } //is the link already in str_tags? if(! stristr($str_tags,$newtag)) { //append or set str_tags -- cgit v1.2.3 From a37ac8f2f36353bba26ccd2631bf1c85ae6e02da Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 16 Jun 2013 00:03:22 -0700 Subject: flag taggable connections in acl selector --- mod/acl.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'mod') diff --git a/mod/acl.php b/mod/acl.php index dea0047f2..df6de13b2 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -123,7 +123,7 @@ function acl_init(&$a){ } if ($type=='' || $type=='c') { - $r = q("SELECT abook_id as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick + $r = q("SELECT abook_id as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, abook_their_perms FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d AND not ( abook_flags & %d ) $sql_extra2 order by xchan_name asc" , intval(local_user()), @@ -142,7 +142,7 @@ function acl_init(&$a){ ); } elseif($type == 'a') { - $r = q("SELECT abook_id as id, xchan_name as name, xchan_addr as nick, xchan_photo_s as micro, xchan_network as network, xchan_url as url, xchan_addr as attag FROM abook left join xchan on abook_xchan = xchan_hash + $r = q("SELECT abook_id as id, xchan_name as name, xchan_hash as hash, xchan_addr as nick, xchan_photo_s as micro, xchan_network as network, xchan_url as url, xchan_addr as attag , abook_their_perms FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d $sql_extra3 ORDER BY xchan_name ASC ", @@ -196,13 +196,15 @@ function acl_init(&$a){ if(count($r)) { foreach($r as $g){ $contacts[] = array( - "type" => "c", - "photo" => $g['micro'], - "name" => $g['name'], - "id" => $g['id'], - "xid" => $g['hash'], - "link" => $g['nick'], - "nick" => substr($g['nick'],0,strpos($g['nick'],'@')) + "type" => "c", + "photo" => $g['micro'], + "name" => $g['name'], + "id" => $g['id'], + "xid" => $g['hash'], + "link" => $g['nick'], + "nick" => substr($g['nick'],0,strpos($g['nick'],'@')), + "network" => '', + "taggable" => (($g['abook_their_perms'] & PERMS_W_TAGWALL) ? 'taggable' : '') ); } } -- cgit v1.2.3 From c4c80a2e472173dfed9b982c6705ccfbb6e6cdab Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 16 Jun 2013 05:28:49 -0700 Subject: directory search by hub --- mod/dirsearch.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/dirsearch.php b/mod/dirsearch.php index c7fa8a9d8..5465e11ff 100644 --- a/mod/dirsearch.php +++ b/mod/dirsearch.php @@ -23,6 +23,7 @@ function dirsearch_content(&$a) { } $name = ((x($_REQUEST,'name')) ? $_REQUEST['name'] : ''); + $hub = ((x($_REQUEST,'hub')) ? $_REQUEST['hub'] : ''); $address = ((x($_REQUEST,'address')) ? $_REQUEST['address'] : ''); $locale = ((x($_REQUEST,'locale')) ? $_REQUEST['locale'] : ''); $region = ((x($_REQUEST,'region')) ? $_REQUEST['region'] : ''); @@ -38,6 +39,8 @@ function dirsearch_content(&$a) { if($name) $sql_extra .= " OR xchan_name like '" . protect_sprintf( '%' . dbesc($name) . '%' ) . "' "; + if($hub) + $sql_extra .= " OR xchan_hash in (select hubloc_hash from hubloc where hubloc_host = '" . protect_sprintf(dbesc($hub)) . "') "; if($address) $sql_extra .= " OR xchan_addr like '" . protect_sprintf( '%' . dbesc($address) . '%' ) . "' "; if($city) @@ -96,7 +99,6 @@ function dirsearch_content(&$a) { $order = " ORDER BY `xchan_name` ASC "; - $r = q("SELECT xchan.*, xprof.* from xchan left join xprof on xchan_hash = xprof_hash where $logic $sql_extra and not ( xchan_flags & %d ) $order $qlimit ", intval(XCHAN_FLAGS_HIDDEN) ); -- cgit v1.2.3