• I have a multi network and multisite setup. I want the first person that registers on a new site to be automatically created with the role of admin. Then any users that register to that site later would only be able to register as contributors or authors.

    I’d like this to happen automatically. I am the super admin for the global network and each state network. I should point out each state has a network and there are multisites within each state network that are for schools.

    So the first person to register at dsnamerica.com/idaho/skylinehighschool/ would be made as admin for skylinehighschool but would not have super admin permissions for all of idaho. Anyone to register on Skyline’s site would only be able to register as a contributor or author to only the Skyline site.

    Clear as mud?

    Thanks all

Viewing 3 replies - 1 through 3 (of 3 total)
  • Users do not register to individual sites, the signup as global users of the network(subscribers to the whole shebang) via the main site. Each site admin can send invites and manage existing network users after they signup.

    But maybe something like this might work if you know the campus ip address of the corresponding school – and all registrations originate from the local campus. in this example you know blogid (20) corresponds to the ip address(122.213.37.213) of the school the students come from.

    <?php
    if( '122.213.37.213' == $_SERVER['REMOTE_ADDR'] ) {
    function ds_new_user_meta20($user_id) {
    add_user_to_blog('20', $user_id, 'contributor');
    }
    add_action('wpmu_new_user','ds_new_user_meta20');
    }
    ?>

    Thread Starter Jacob311

    (@jacob311)

    David,

    Thank you for that code snippet. My uppers have sent me their csv files that has all of the schools that will need a site. The information I have so far doesn’t include anything about their IP addresses or their email addresses. I thought about using something like that code above if I had either.

    I do have a security plugin I found that does make it so that those that register through one site will only have access to that single site, so I’m set there.

    I think this one is going to take some creative thinking. My deadline is July 15 and even if I finished the development and design by July 1st I don’t know if I’d have enough time to take care of each of these 20,000 sites individually.

    So because I don’t have IP addresses, email addresses, or anything really besides the school name and the school’s information (address, how many students, etc) I need to think of some other way of uniquely identifying them.

    Think with me… if there was a drop down menu in the registration process that allowed them to choose between Admin or Contributor (I guess I should radio buttons for two options), then if they chose Admin I could unhide a div that held a text box that required a passcode to register as an Admin. If they select Contributor after seeing that new required text box, that text box should disappear.

    Actually that sounds right. It would be nice to do this dynamically with an if-else based on something like an IP, but I don’t have that option.

    But how would they know the passcode to use if I haven’t been able to personally contact them prior to their registration process?… They would have to click some other link that says “how do I know my passcode?” that would email me, then I’d have to verify them and email them back…yikes…maybe not.

    If you have any more ideas, please throw them my way. I don’t want to do anything manually 20,000 times! 😉

    Interestingly the csv file of the schools includes each school’s latitude and longitude location…if that strikes any brain waves for ideas.

    Thanks again.

    Have a look at the “blog types” on the edublogs signgup page. Sort of looks like what you are after. If you are building dropdowns, then build the dropdown that assigns them to a blog as well as their contributor role and you are a step closer.

    Might be an idea in this signup widget but haven’t tackled this kind of registration for a while: http://wordpress.org/plugins/add-users-sidebar-widget/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘First user to register is admin, others follow as contributors’ is closed to new replies.