aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Admin
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/Admin
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/Admin')
-rw-r--r--Zotlabs/Module/Admin/Profs.php39
1 files changed, 30 insertions, 9 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) {