What about simply removing the options and making the group option default on the privacy settings when you post? that way all content would only be in the group that person was a member of...this is obviously provided that they're assigned to groups and can't ad other groups but I think i can get rid of that kind of stuff by commenting out the actual code, right?
Thanks!!
-Ray-
(1)
yep... if you've looked at the actual code in the views --> that will work ;-)
(2)
ever thot abt posting in my galaxy ? LOLZ ;-O
ok i'll try it and see how it goes!...now i just have to figure out how to prevent them from seeing the other groups...that's still on the table but this helps a lot!!! BTW, where's your galaxy?
Thanks!1
Hi Ray,
Here are some thoughts if you let the user select his school during registration:
I think you may have a smoother process if you let the user select his school during validation instead. Here's what I would try:
-- Patrick
WOW...i just wrote a HUGE paragraph and forgot to click submit...walked away, came back an hour later, clicked submit and the error box pops up sayin the page expired and then it wouldn't let me get my comment back...UGH!
anyways, so the gist is this...on the site now i have a field in registration where they can chose their school from a drop down menu but it's only a tag field...can i harness that power somehow and maybe do something like:
after email confirmation
get infofield_school
find the group with the same name(i'd manually create the schools(i.e. groups) in the database that I want)
Autoinvite/autoaccept
What cha think?
Thanks!
-Ray-
The "email/confirm" action triggers an 'enable' event when the confirmation is verified, so it is simpler than I thought. I don't know how you pass 'infofield_school' around, but something like the following would work:
function blah_email_confirm_hook() {
register_elgg_event_handler('enable', 'user', 'blah_user_enabled');
return true;
}function blah_user_enabled($event, $type, $user) {
// just some sanity checks
//
if ($event != 'enable' || $type != 'user' || !($user instanceof ElggUser))
return true;
// TODO: where does school group GUID come from? Is it a
// parameter encoded in the e-mail confirmation URL?
//
$grp_guid = get_input('infofield_school');
$usr_guid = $user->guid;// add user to group
// TODO: make sure $grp_guid is a valid school group
//
if (!is_group_member($grp_guid, $usr_guid)) {
if (!join_group($grp_guid, $usr_guid)) {
// TODO: error handling
}
}return true;
}// register hook for email/confirm, e.g. in a plugin's start.php
//
register_plugin_hook('action', 'email/confirm', 'blah_email_confirm_hook');
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.