aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/group.php11
-rw-r--r--engine/lib/pageowner.php11
-rw-r--r--mod/groups/languages/en.php3
3 files changed, 19 insertions, 6 deletions
diff --git a/engine/lib/group.php b/engine/lib/group.php
index dee522099..40bf7a674 100644
--- a/engine/lib/group.php
+++ b/engine/lib/group.php
@@ -120,6 +120,15 @@
return can_write_to_container($user_guid, $this->getGUID());
}
+ public function get($name) {
+
+ if ($name == 'username') {
+ return 'group:' . $this->getGUID();
+ }
+ return parent::get($name);
+
+ }
+
/**
* Start friendable compatibility block:
*
@@ -227,6 +236,7 @@
return get_group_members($this->getGUID(), $limit, $offset, 0 , $count);
}
+
/**
* Returns whether the current group is public membership or not.
@@ -791,5 +801,4 @@
return get_entities_from_relationship('member', $user_guid, true);
}
-
?> \ No newline at end of file
diff --git a/engine/lib/pageowner.php b/engine/lib/pageowner.php
index 57c083f02..3f867e750 100644
--- a/engine/lib/pageowner.php
+++ b/engine/lib/pageowner.php
@@ -28,17 +28,20 @@
}
if ($username = get_input("username")) {
+ if (substr_count($username,'group:')) {
+ preg_match('/group\:([0-9]+)/i',$username,$matches);
+ $guid = $matches[1];
+ if ($entity = get_entity($guid)) {
+ return $entity->getGUID();
+ }
+ }
if ($user = get_user_by_username($username)) {
return $user->getGUID();
- } else {
- return 0;
}
}
if ($owner = get_input("owner_guid")) {
if ($user = get_entity($owner)) {
return $user->getGUID();
- } else {
- return 0;
}
}
if (!empty($CONFIG->page_owner_handlers) && is_array($CONFIG->page_owner_handlers)) {
diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php
index d13568bd4..612cac205 100644
--- a/mod/groups/languages/en.php
+++ b/mod/groups/languages/en.php
@@ -23,7 +23,8 @@
'groups:edit' => "Edit a group",
'groups:icon' => 'Group icon (leave blank to leave unchanged)',
- 'groups:name' => 'Group name',
+ 'groups:name' => 'Group name',
+ 'groups:username' => 'Group short name (displayed in URLs, alphanumeric characters only)',
'groups:description' => 'Description',
'groups:interests' => 'Interests',
'groups:website' => 'Website',