aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2018-03-05 20:06:47 -0500
committerAndrew Manning <tamanning@zoho.com>2018-03-05 20:06:47 -0500
commit9b13db1c4896e6a8b0a55195530f5449999e811d (patch)
tree0588de154eec12481cd56e448a0a682bb94341aa /Zotlabs/Module
parent058f7277b52bdcdb80dc3e28bf0ec93a573195a7 (diff)
parentc462d2f15eb2d463706403676b00bbd7bd111443 (diff)
downloadvolse-hubzilla-9b13db1c4896e6a8b0a55195530f5449999e811d.tar.gz
volse-hubzilla-9b13db1c4896e6a8b0a55195530f5449999e811d.tar.bz2
volse-hubzilla-9b13db1c4896e6a8b0a55195530f5449999e811d.zip
Merge branch 'dev' into oauth2
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Admin/Profs.php39
-rw-r--r--Zotlabs/Module/Directory.php5
-rw-r--r--Zotlabs/Module/Sitelist.php4
3 files changed, 37 insertions, 11 deletions
diff --git a/Zotlabs/Module/Admin/Profs.php b/Zotlabs/Module/Admin/Profs.php
index b3da09cb7..eb2501d43 100644
--- a/Zotlabs/Module/Admin/Profs.php
+++ b/Zotlabs/Module/Admin/Profs.php
@@ -9,17 +9,37 @@ class Profs {
if(array_key_exists('basic',$_REQUEST)) {
$arr = explode(',',$_REQUEST['basic']);
- for($x = 0; $x < count($arr); $x ++)
- if(trim($arr[$x]))
- $arr[$x] = trim($arr[$x]);
- set_config('system','profile_fields_basic',$arr);
-
+ array_walk($arr,'array_trim');
+ $narr = [];
+ if(count($arr)) {
+ foreach($arr as $a) {
+ if(strlen($a)) {
+ $narr[] = $a;
+ }
+ }
+ }
+ if(! $narr)
+ del_config('system','profile_fields_basic');
+ else
+ set_config('system','profile_fields_basic',$narr);
+
+
if(array_key_exists('advanced',$_REQUEST)) {
$arr = explode(',',$_REQUEST['advanced']);
- for($x = 0; $x < count($arr); $x ++)
- if(trim($arr[$x]))
- $arr[$x] = trim($arr[$x]);
- set_config('system','profile_fields_advanced',$arr);
+ array_walk($arr,'array_trim');
+ $narr = [];
+ if(count($arr)) {
+ foreach($arr as $a) {
+ if(strlen($a)) {
+ $narr[] = $a;
+ }
+ }
+ }
+ if(! $narr)
+ del_config('system','profile_fields_advanced');
+ else
+ set_config('system','profile_fields_advanced',$narr);
+
}
goaway(z_root() . '/admin/profs');
}
@@ -98,6 +118,7 @@ class Profs {
$basic = '';
$barr = array();
$fields = get_profile_fields_basic();
+
if(! $fields)
$fields = get_profile_fields_basic(1);
if($fields) {
diff --git a/Zotlabs/Module/Directory.php b/Zotlabs/Module/Directory.php
index 85c0be6b6..62a1670f9 100644
--- a/Zotlabs/Module/Directory.php
+++ b/Zotlabs/Module/Directory.php
@@ -101,6 +101,11 @@ class Directory extends \Zotlabs\Web\Controller {
if($suggest) {
$r = suggestion_query(local_channel(),get_observer_hash());
+
+ if(! $r) {
+ notice( t('No default suggestions were found.') . EOL);
+ return;
+ }
// Remember in which order the suggestions were
$addresses = array();
diff --git a/Zotlabs/Module/Sitelist.php b/Zotlabs/Module/Sitelist.php
index e7d4187b7..2ac5ed1b8 100644
--- a/Zotlabs/Module/Sitelist.php
+++ b/Zotlabs/Module/Sitelist.php
@@ -32,7 +32,7 @@ class Sitelist extends \Zotlabs\Web\Controller {
$result = array('success' => false);
- $r = q("select count(site_url) as total from site where site_type = %d $sql_extra ",
+ $r = q("select count(site_url) as total from site where site_type = %d and site_dead = 0 $sql_extra ",
intval(SITE_TYPE_ZOT)
);
@@ -42,7 +42,7 @@ class Sitelist extends \Zotlabs\Web\Controller {
$result['start'] = $start;
$result['limit'] = $limit;
- $r = q("select * from site where site_type = %d $sql_extra $sql_order $sql_limit",
+ $r = q("select * from site where site_type = %d and site_dead = 0 $sql_extra $sql_order $sql_limit",
intval(SITE_TYPE_ZOT)
);