From 23460302f5e6b97a5e7b9d6038e77dc4c2d13033 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 5 Mar 2012 18:51:21 -0800 Subject: some admin page fixes and cleanup --- mod/admin.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'mod') diff --git a/mod/admin.php b/mod/admin.php index 94bf44503..2115f9241 100755 --- a/mod/admin.php +++ b/mod/admin.php @@ -145,9 +145,10 @@ function admin_page_summary(&$a) { Array( t('Automatic Friend Account'), 0) ); $users=0; - foreach ($r as $u){ $accounts[$u['page-flags']][1] = $u['count']; $users+=$u['count']; } + foreach ($r as $u){ $accounts[$u['page-flags']][1] = $u['count']; $users+= $u['count']; } + + logger('accounts: ' . print_r($accounts,true)); - $r = q("SELECT COUNT(id) as `count` FROM `register`"); $pending = $r[0]['count']; @@ -574,6 +575,8 @@ function admin_page_plugins(&$a){ '$status' => $status, '$action' => $action, '$info' => get_plugin_info($plugin), + '$str_author' => t('Author: '), + '$str_maintainer' => t('Maintainer: '), '$admin_form' => $admin_form, '$function' => 'plugins', @@ -747,7 +750,8 @@ function admin_page_themes(&$a){ '$info' => get_theme_info($theme), '$function' => 'themes', '$admin_form' => $admin_form, - + '$str_author' => t('Author: '), + '$str_maintainer' => t('Maintainer: '), '$readme' => $readme )); } -- cgit v1.2.3 From 8fb0ea4048745c09ece6c84f23bffdccfc59d67d Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 6 Mar 2012 14:27:53 -0800 Subject: bugs #312, #313 --- mod/admin.php | 38 +++++++++++++++++++------------------- mod/network.php | 30 ++++++++++++++---------------- 2 files changed, 33 insertions(+), 35 deletions(-) (limited to 'mod') diff --git a/mod/admin.php b/mod/admin.php index 2115f9241..93714bb5f 100755 --- a/mod/admin.php +++ b/mod/admin.php @@ -321,32 +321,32 @@ function admin_page_site(&$a) { '$sitename' => array('sitename', t("Site name"), htmlentities($a->config['sitename'], ENT_QUOTES), ""), '$banner' => array('banner', t("Banner/Logo"), $banner, ""), '$language' => array('language', t("System language"), get_config('system','language'), "", $lang_choices), - '$theme' => array('theme', t("System theme"), get_config('system','theme'), "Default system theme (which may be over-ridden by user profiles)", $theme_choices), + '$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles"), $theme_choices), - '$maximagesize' => array('maximagesize', t("Maximum image size"), get_config('system','maximagesize'), "Maximum size in bytes of uploaded images. Default is 0, which means no limits."), + '$maximagesize' => array('maximagesize', t("Maximum image size"), get_config('system','maximagesize'), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")), '$register_policy' => array('register_policy', t("Register policy"), $a->config['register_policy'], "", $register_choices), - '$register_text' => array('register_text', t("Register text"), htmlentities($a->config['register_text'], ENT_QUOTES), "Will be displayed prominently on the registration page."), + '$register_text' => array('register_text', t("Register text"), htmlentities($a->config['register_text'], ENT_QUOTES), t("Will be displayed prominently on the registration page.")), '$abandon_days' => array('abandon_days', t('Accounts abandoned after x days'), get_config('system','account_abandon_days'), t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')), - '$allowed_sites' => array('allowed_sites', t("Allowed friend domains"), get_config('system','allowed_sites'), "Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains"), - '$allowed_email' => array('allowed_email', t("Allowed email domains"), get_config('system','allowed_email'), "Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains"), - '$block_public' => array('block_public', t("Block public"), get_config('system','block_public'), "Check to block public access to all otherwise public personal pages on this site unless you are currently logged in."), - '$force_publish' => array('publish_all', t("Force publish"), get_config('system','publish_all'), "Check to force all profiles on this site to be listed in the site directory."), - '$global_directory' => array('directory_submit_url', t("Global directory update URL"), get_config('system','directory_submit_url'), "URL to update the global directory. If this is not set, the global directory is completely unavailable to the application."), + '$allowed_sites' => array('allowed_sites', t("Allowed friend domains"), get_config('system','allowed_sites'), t("Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains")), + '$allowed_email' => array('allowed_email', t("Allowed email domains"), get_config('system','allowed_email'), t("Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains")), + '$block_public' => array('block_public', t("Block public"), get_config('system','block_public'), t("Check to block public access to all otherwise public personal pages on this site unless you are currently logged in.")), + '$force_publish' => array('publish_all', t("Force publish"), get_config('system','publish_all'), t("Check to force all profiles on this site to be listed in the site directory.")), + '$global_directory' => array('directory_submit_url', t("Global directory update URL"), get_config('system','directory_submit_url'), t("URL to update the global directory. If this is not set, the global directory is completely unavailable to the application.")), - '$no_multi_reg' => array('no_multi_reg', t("Block multiple registrations"), get_config('system','block_extended_register'), "Disallow users to register additional accounts for use as pages."), - '$no_openid' => array('no_openid', t("OpenID support"), !get_config('system','no_openid'), "OpenID support for registration and logins."), - '$no_gravatar' => array('no_gravatar', t("Gravatar support"), !get_config('system','no_gravatar'), "Search new user's photo on Gravatar."), - '$no_regfullname' => array('no_regfullname', t("Fullname check"), !get_config('system','no_regfullname'), "Force users to register with a space between firstname and lastname in Full name, as an antispam measure"), - '$no_utf' => array('no_utf', t("UTF-8 Regular expressions"), !get_config('system','no_utf'), "Use PHP UTF8 regular expressions"), - '$no_community_page' => array('no_community_page', t("Show Community Page"), !get_config('system','no_community_page'), "Display a Community page showing all recent public postings on this site."), - '$ostatus_disabled' => array('ostatus_disabled', t("Enable OStatus support"), !get_config('system','ostatus_disable'), "Provide built-in OStatus \x28identi.ca, status.net, etc.\x29 compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed."), - '$diaspora_enabled' => array('diaspora_enabled', t("Enable Diaspora support"), get_config('system','diaspora_enabled'), "Provide built-in Diaspora network compatibility."), - '$dfrn_only' => array('dfrn_only', t('Only allow Friendica contacts'), get_config('system','dfrn_only'), "All contacts must use Friendica protocols. All other built-in communication protocols disabled."), - '$verifyssl' => array('verifyssl', t("Verify SSL"), get_config('system','verifyssl'), "If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites."), + '$no_multi_reg' => array('no_multi_reg', t("Block multiple registrations"), get_config('system','block_extended_register'), t("Disallow users to register additional accounts for use as pages.")), + '$no_openid' => array('no_openid', t("OpenID support"), !get_config('system','no_openid'), t("OpenID support for registration and logins.")), + '$no_gravatar' => array('no_gravatar', t("Gravatar support"), !get_config('system','no_gravatar'), t("Search new user's photo on Gravatar.")), + '$no_regfullname' => array('no_regfullname', t("Fullname check"), !get_config('system','no_regfullname'), t("Force users to register with a space between firstname and lastname in Full name, as an antispam measure")), + '$no_utf' => array('no_utf', t("UTF-8 Regular expressions"), !get_config('system','no_utf'), t("Use PHP UTF8 regular expressions")), + '$no_community_page' => array('no_community_page', t("Show Community Page"), !get_config('system','no_community_page'), t("Display a Community page showing all recent public postings on this site.")), + '$ostatus_disabled' => array('ostatus_disabled', t("Enable OStatus support"), !get_config('system','ostatus_disable'), t("Provide built-in OStatus \x28identi.ca, status.net, etc.\x29 compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed.")), + '$diaspora_enabled' => array('diaspora_enabled', t("Enable Diaspora support"), get_config('system','diaspora_enabled'), t("Provide built-in Diaspora network compatibility.")), + '$dfrn_only' => array('dfrn_only', t('Only allow Friendica contacts'), get_config('system','dfrn_only'), t("All contacts must use Friendica protocols. All other built-in communication protocols disabled.")), + '$verifyssl' => array('verifyssl', t("Verify SSL"), get_config('system','verifyssl'), t("If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites.")), '$proxyuser' => array('proxyuser', t("Proxy user"), get_config('system','proxyuser'), ""), '$proxy' => array('proxy', t("Proxy URL"), get_config('system','proxy'), ""), - '$timeout' => array('timeout', t("Network timeout"), (x(get_config('system','curl_timeout'))?get_config('system','curl_timeout'):60), "Value is in seconds. Set to 0 for unlimited (not recommended)."), + '$timeout' => array('timeout', t("Network timeout"), (x(get_config('system','curl_timeout'))?get_config('system','curl_timeout'):60), t("Value is in seconds. Set to 0 for unlimited (not recommended).")), )); diff --git a/mod/network.php b/mod/network.php index 894ac48ed..8da1561a0 100755 --- a/mod/network.php +++ b/mod/network.php @@ -51,14 +51,14 @@ function network_init(&$a) { function saved_searches($search) { - $srchurl = '/network' - . ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : '') - . ((x($_GET,'star')) ? '?star=' . $_GET['star'] : '') - . ((x($_GET,'bmark')) ? '?bmark=' . $_GET['bmark'] : '') - . ((x($_GET,'conv')) ? '?conv=' . $_GET['conv'] : '') - . ((x($_GET,'nets')) ? '?nets=' . $_GET['nets'] : '') - . ((x($_GET,'cmin')) ? '?cmin=' . $_GET['cmin'] : '') - . ((x($_GET,'cmax')) ? '?cmax=' . $_GET['cmax'] : ''); + $srchurl = '/network?f=' + . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') + . ((x($_GET,'star')) ? '&star=' . $_GET['star'] : '') + . ((x($_GET,'bmark')) ? '&bmark=' . $_GET['bmark'] : '') + . ((x($_GET,'conv')) ? '&conv=' . $_GET['conv'] : '') + . ((x($_GET,'nets')) ? '&nets=' . $_GET['nets'] : '') + . ((x($_GET,'cmin')) ? '&cmin=' . $_GET['cmin'] : '') + . ((x($_GET,'cmax')) ? '&cmax=' . $_GET['cmax'] : ''); $o = ''; @@ -164,33 +164,33 @@ function network_content(&$a, $update = 0) { $tabs = array( array( 'label' => t('Commented Order'), - 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : ''), + 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '?f=&cid=' . $_GET['cid'] : ''), 'sel'=>$all_active, ), array( 'label' => t('Posted Order'), - 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . '?order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''), + 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''), 'sel'=>$postord_active, ), array( 'label' => t('Personal'), - 'url' => $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '&conv=1', + 'url' => $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&conv=1', 'sel' => $conv_active, ), array( 'label' => t('New'), - 'url' => $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . '/new' . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : ''), + 'url' => $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . '/new' . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : ''), 'sel' => $new_active, ), array( 'label' => t('Starred'), - 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '&star=1', + 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&star=1', 'sel'=>$starred_active, ), array( 'label' => t('Bookmarks'), - 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '&bmark=1', + 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&bmark=1', 'sel'=>$bookmarked_active, ), // array( @@ -256,8 +256,6 @@ function network_content(&$a, $update = 0) { nav_set_selected('network'); - $_SESSION['return_url'] = $a->query_string; - $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false); $x = array( -- cgit v1.2.3 From 21887a36fde1f287c73c7cc3a57ac9ba2ec2135b Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 6 Mar 2012 14:53:14 -0800 Subject: [PRIVACY] privacy issue bug #314 --- mod/display.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/display.php b/mod/display.php index f510f793d..4f2e5ff9a 100755 --- a/mod/display.php +++ b/mod/display.php @@ -34,7 +34,7 @@ function display_content(&$a) { $contact = null; $remote_contact = false; - +dbg(1); if(remote_user()) { $contact_id = $_SESSION['visitor_id']; $groups = init_groups_visitor($contact_id); @@ -87,6 +87,9 @@ function display_content(&$a) { $sql_extra = permissions_sql($a->profile['uid'],$remote_contact,$groups); + if(! local_user() && ! remote_user()) + $sql_extra .= " and `item`.`private` = 0 "; + $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, @@ -135,7 +138,7 @@ function display_content(&$a) { } } - +dbg(0); return $o; } -- cgit v1.2.3 From a464e4d33fbca9c02cd99abab092d43b631aa780 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 6 Mar 2012 15:15:59 -0800 Subject: search should be ok, but a little extra security won't hurt --- mod/search.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/search.php b/mod/search.php index fe09b671f..386592ea1 100755 --- a/mod/search.php +++ b/mod/search.php @@ -127,7 +127,7 @@ function search_content(&$a) { FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` LEFT JOIN `user` ON `user`.`uid` = `item`.`uid` WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0 - AND (( `wall` = 1 AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `user`.`hidewall` = 0 ) + AND (( `wall` = 1 AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `item`.`private` = 0 AND `user`.`hidewall` = 0 ) OR `item`.`uid` = %d ) AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 $search_alg -- cgit v1.2.3 From 7431bd950937929a21b7d158564a8f9a80d07c5f Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 6 Mar 2012 15:28:27 -0800 Subject: fix html reshares when editplain in use --- mod/share.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'mod') diff --git a/mod/share.php b/mod/share.php index bba527342..f6c025e3c 100755 --- a/mod/share.php +++ b/mod/share.php @@ -16,10 +16,18 @@ function share_init(&$a) { $o = ''; - $o .= '♲ ' . $r[0]['author-name'] . '
'; - if($r[0]['title']) - $o .= '' . $r[0]['title'] . '
'; - $o .= bbcode($r[0]['body'], true); - echo $o . '
'; + if(local_user() && intval(get_pconfig(local_user(),'system','plaintext'))) { + $o .= '♲ [url=' . $r[0]['author-link'] . ']' . $r[0]['author-name'] . '[/url]'; + if($r[0]['title']) + $o .= '[b]' . $r[0]['title'] . '[/b]' . "\n"; + $o .= $r[0]['body'] . "\n"; + } + else { + $o .= '♲ ' . $r[0]['author-name'] . '
'; + if($r[0]['title']) + $o .= '' . $r[0]['title'] . '
'; + $o .= bbcode($r[0]['body'], true) . '
'; + } + echo $o; killme(); } -- cgit v1.2.3 From 39a49d51e370f6421a065cd78594e849ef92ff73 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 6 Mar 2012 16:28:52 -0800 Subject: remove stray debugging --- mod/display.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/display.php b/mod/display.php index 4f2e5ff9a..00f8b503a 100755 --- a/mod/display.php +++ b/mod/display.php @@ -34,7 +34,7 @@ function display_content(&$a) { $contact = null; $remote_contact = false; -dbg(1); + if(remote_user()) { $contact_id = $_SESSION['visitor_id']; $groups = init_groups_visitor($contact_id); @@ -138,7 +138,7 @@ dbg(1); } } -dbg(0); + return $o; } -- cgit v1.2.3 From 88cd5800cf2e22f365bc38f567fcc1627e9278a7 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 6 Mar 2012 17:21:14 -0800 Subject: [privacy] rework latest fix --- mod/display.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'mod') diff --git a/mod/display.php b/mod/display.php index 00f8b503a..f510f793d 100755 --- a/mod/display.php +++ b/mod/display.php @@ -87,9 +87,6 @@ function display_content(&$a) { $sql_extra = permissions_sql($a->profile['uid'],$remote_contact,$groups); - if(! local_user() && ! remote_user()) - $sql_extra .= " and `item`.`private` = 0 "; - $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, -- cgit v1.2.3 From 7ad2dd65654f6b1cb17ae98e65c3e95528d29e30 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 6 Mar 2012 17:52:00 -0800 Subject: fix photos after permissions_sql change --- mod/display.php | 2 +- mod/profile.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/display.php b/mod/display.php index f510f793d..f428149e8 100755 --- a/mod/display.php +++ b/mod/display.php @@ -85,7 +85,7 @@ function display_content(&$a) { $o .= status_editor($a,$x,0,true); - $sql_extra = permissions_sql($a->profile['uid'],$remote_contact,$groups); + $sql_extra = item_permissions_sql($a->profile['uid'],$remote_contact,$groups); $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, diff --git a/mod/profile.php b/mod/profile.php index 74e1a2302..1a701f407 100755 --- a/mod/profile.php +++ b/mod/profile.php @@ -159,7 +159,7 @@ function profile_content(&$a, $update = 0) { * Get permissions SQL - if $remote_contact is true, our remote user has been pre-verified and we already have fetched his/her groups */ - $sql_extra = permissions_sql($a->profile['profile_uid'],$remote_contact,$groups); + $sql_extra = item_permissions_sql($a->profile['profile_uid'],$remote_contact,$groups); if($update) { -- cgit v1.2.3