aboutsummaryrefslogtreecommitdiff
path: root/mod/profile/actions
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-16 12:32:40 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-16 12:32:40 +0000
commit554e8f7fedab096467b2d08e8a6f67910267c69d (patch)
tree2194a6a71217a717530dae3be9a574ca222567d2 /mod/profile/actions
parent1e0a90d6488275b50dce0696c7761b0979a8bc69 (diff)
downloadelgg-554e8f7fedab096467b2d08e8a6f67910267c69d.tar.gz
elgg-554e8f7fedab096467b2d08e8a6f67910267c69d.tar.bz2
Individual profile items can now have access restrictions; also made the profile JS more cache friendly
git-svn-id: https://code.elgg.org/elgg/trunk@1968 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/profile/actions')
-rw-r--r--mod/profile/actions/edit.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/mod/profile/actions/edit.php b/mod/profile/actions/edit.php
index 46b7897df..c3673e4e6 100644
--- a/mod/profile/actions/edit.php
+++ b/mod/profile/actions/edit.php
@@ -15,8 +15,12 @@
// Get profile fields
$input = array();
+ $accesslevel = get_input('accesslevel');
+ if (!is_array($accesslevel)) $accesslevel = array();
+
foreach($CONFIG->profile as $shortname => $valuetype) {
$input[$shortname] = get_input($shortname);
+
if ($valuetype == 'tags')
$input[$shortname] = string_to_tag_array($input[$shortname]);
}
@@ -34,7 +38,22 @@
// Save stuff
if (sizeof($input) > 0)
foreach($input as $shortname => $value) {
- $user->$shortname = $value;
+
+ //$user->$shortname = $value;
+ remove_metadata($user->guid, $shortname);
+ if (isset($accesslevel[$shortname])) {
+ $access_id = (int) $accesslevel[$shortname];
+ } else {
+ $access_id = 0;
+ }
+ if (is_array($value)) {
+ foreach($value as $interval) {
+ create_metadata($user->guid, $shortname, $interval, 'text', $user->guid, $access_id, true);
+ }
+ } else {
+ create_metadata($user->guid, $shortname, $value, 'text', $user->guid, $access_id);
+ }
+
}
$user->save();