aboutsummaryrefslogtreecommitdiffstats
path: root/mod/profiles.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/profiles.php')
-rw-r--r--mod/profiles.php56
1 files changed, 34 insertions, 22 deletions
diff --git a/mod/profiles.php b/mod/profiles.php
index 3ae1390df..57d3561b1 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -272,9 +272,17 @@ function profiles_post(&$a) {
$name = escape_tags(trim($_POST['name']));
- if($orig[0]['name'] != $name)
+ if($orig[0]['name'] != $name) {
$namechanged = true;
+ $v = validate_channelname($name);
+ if($v) {
+ $notice($v);
+ $namechanged = false;
+ $name = $orig[0]['name'];
+ }
+ }
+
$pdesc = escape_tags(trim($_POST['pdesc']));
$gender = escape_tags(trim($_POST['gender']));
$address = escape_tags(trim($_POST['address']));
@@ -563,6 +571,10 @@ function profiles_post(&$a) {
dbesc(datetime_convert()),
dbesc($channel['xchan_hash'])
);
+ $r = q("UPDATE channel SET channel_name = '%s' WHERE channel_hash = '%s'",
+ dbesc($name),
+ dbesc($channel['xchan_hash'])
+ );
}
if($is_default) {
@@ -683,28 +695,28 @@ function profiles_content(&$a) {
'$exportable' => feature_enabled(local_channel(),'profile_export'),
'$lbl_import' => t('Import profile from file'),
'$lbl_export' => t('Export profile to file'),
- '$lbl_profname' => t('Profile Name:'),
- '$lbl_fullname' => t('Your Full Name:'),
- '$lbl_title' => t('Title/Description:'),
- '$lbl_gender' => t('Your Gender:'),
- '$lbl_bd' => t("Birthday :"),
- '$lbl_address' => t('Street Address:'),
- '$lbl_city' => t('Locality/City:'),
- '$lbl_zip' => t('Postal/Zip Code:'),
- '$lbl_country' => t('Country:'),
- '$lbl_region' => t('Region/State:'),
- '$lbl_marital' => t('<span class="heart">&hearts;</span> Marital Status:'),
- '$lbl_with' => t("Who: \x28if applicable\x29"),
+ '$lbl_profname' => t('Profile Name'),
+ '$lbl_fullname' => t('Your Full Name'),
+ '$lbl_title' => t('Title/Description'),
+ '$lbl_gender' => t('Your Gender'),
+ '$lbl_bd' => t("Birthday"),
+ '$lbl_address' => t('Street Address'),
+ '$lbl_city' => t('Locality/City'),
+ '$lbl_zip' => t('Postal/Zip Code'),
+ '$lbl_country' => t('Country'),
+ '$lbl_region' => t('Region/State'),
+ '$lbl_marital' => t('<span class="heart">&hearts;</span> Marital Status'),
+ '$lbl_with' => t("Who (if applicable)"),
'$lbl_ex1' => t('Examples: cathy123, Cathy Williams, cathy@example.com'),
- '$lbl_howlong' => t('Since [date]:'),
- '$lbl_sexual' => t('Sexual Preference:'),
- '$lbl_homepage' => t('Homepage URL:'),
- '$lbl_hometown' => t('Hometown:'),
- '$lbl_politic' => t('Political Views:'),
- '$lbl_religion' => t('Religious Views:'),
- '$lbl_pubkey' => t('Keywords:'),
- '$lbl_likes' => t('Likes:'),
- '$lbl_dislikes' => t('Dislikes:'),
+ '$lbl_howlong' => t('Since [date]'),
+ '$lbl_sexual' => t('Sexual Preference'),
+ '$lbl_homepage' => t('Homepage URL'),
+ '$lbl_hometown' => t('Hometown'),
+ '$lbl_politic' => t('Political Views'),
+ '$lbl_religion' => t('Religious Views'),
+ '$lbl_pubkey' => t('Keywords'),
+ '$lbl_likes' => t('Likes'),
+ '$lbl_dislikes' => t('Dislikes'),
'$lbl_ex2' => t('Example: fishing photography software'),
'$lbl_pubdsc' => t("Used in directory listings"),
'$lbl_about' => t('Tell us about yourself...'),