diff options
author | Friendika <info@friendika.com> | 2011-05-24 16:30:52 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-05-24 16:30:52 -0700 |
commit | e3d1ef8ef7c1be2a8588ec1709304f766b0c7607 (patch) | |
tree | 36fa06a1745df6c041b99b23a3524b7bd14bcfa7 /mod | |
parent | 21769d7390a0bcfb5c74e53c05867ab52a54448b (diff) | |
download | volse-hubzilla-e3d1ef8ef7c1be2a8588ec1709304f766b0c7607.tar.gz volse-hubzilla-e3d1ef8ef7c1be2a8588ec1709304f766b0c7607.tar.bz2 volse-hubzilla-e3d1ef8ef7c1be2a8588ec1709304f766b0c7607.zip |
ability to hide profile and wall from unknown people
Diffstat (limited to 'mod')
-rw-r--r-- | mod/profile.php | 7 | ||||
-rw-r--r-- | mod/profiles.php | 18 |
2 files changed, 21 insertions, 4 deletions
diff --git a/mod/profile.php b/mod/profile.php index 634aec460..8d46d6c5b 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -51,11 +51,14 @@ function profile_init(&$a) { function profile_content(&$a, $update = 0) { - if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) { + if(get_config('system','block_public') && (! local_user()) && (! remote_user())) { return login(); } - + if($a->profile['hidewall'] && (! local_user()) && (! remote_user())) { + notice( t('Access to this profile has been restricted.') . EOL); + return; + } require_once("include/bbcode.php"); require_once('include/security.php'); diff --git a/mod/profiles.php b/mod/profiles.php index 9c92d81ba..b64c1294e 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -129,6 +129,7 @@ function profiles_post(&$a) { $work = escape_tags(trim($_POST['work'])); $education = escape_tags(trim($_POST['education'])); $hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0); + $hidewall = (($_POST['hidewall'] == 1) ? 1: 0); $r = q("UPDATE `profile` @@ -160,7 +161,8 @@ function profiles_post(&$a) { `romance` = '%s', `work` = '%s', `education` = '%s', - `hide-friends` = %d + `hide-friends` = %d, + `hidewall` = %d WHERE `id` = %d AND `uid` = %d LIMIT 1", dbesc($profile_name), dbesc($name), @@ -191,6 +193,7 @@ function profiles_post(&$a) { dbesc($work), dbesc($education), intval($hide_friends), + intval($hidewall), intval($a->argv[1]), intval($_SESSION['uid']) ); @@ -351,13 +354,23 @@ function profiles_content(&$a) { $opt_tpl = get_markup_template("profile-hide-friends.tpl"); $hide_friends = replace_macros($opt_tpl,array( - '$desc' => t('Hide my contact/friend list from viewers of this profile?'), + '$desc' => t('Hide your contact/friend list from viewers of this profile?'), '$yes_str' => t('Yes'), '$no_str' => t('No'), '$yes_selected' => (($r[0]['hide-friends']) ? " checked=\"checked\" " : ""), '$no_selected' => (($r[0]['hide-friends'] == 0) ? " checked=\"checked\" " : "") )); + $opt_tpl = get_markup_template("profile-hide-wall.tpl"); + $hide_wall = replace_macros($opt_tpl,array( + '$desc' => t('Hide your messages from unknown viewers of this profile?'), + '$yes_str' => t('Yes'), + '$no_str' => t('No'), + '$yes_selected' => (($r[0]['hidewall']) ? " checked=\"checked\" " : ""), + '$no_selected' => (($r[0]['hidewall'] == 0) ? " checked=\"checked\" " : "") + )); + + $a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl())); $a->page['htmlhead'] .= "<script type=\"text/javascript\" src=\"include/country.js\" ></script>"; @@ -413,6 +426,7 @@ function profiles_content(&$a) { '$pdesc' => $r[0]['pdesc'], '$dob' => dob($r[0]['dob']), '$hide_friends' => $hide_friends, + '$hide_wall' => $hide_wall, '$address' => $r[0]['address'], '$locality' => $r[0]['locality'], '$region' => $r[0]['region'], |