The MU forums have moved to WordPress.org

1 2 3

Default Roles at Signup (67 posts)

  1. scotm
    Member
    Posted 15 years ago #

    I'd like to find a way to set site-wide default user roles. Currently, blogs are created with admin capabilites, but I only need my blog owners to have the most basic rights (read and write). I have no problem managing roles and capabilities, but how can I change the defualt "administrator" setting?

    Thx

  2. boonika
    Member
    Posted 15 years ago #

    wpmu-functions.php - I think...

  3. donncha
    Key Master
    Posted 15 years ago #

    Instead of changing that file, look at the "wpmu_new_blog" or "wpmu_new_user" actions. The first action takes blog_id and user_id as parameters so it should be easy to change the permissions through that. It makes upgrading *much* easier later.

  4. scotm
    Member
    Posted 15 years ago #

    Donncha

    Thanks so much for the reply. Here's what I'm trying to do.

    I've been using a single install of WP and the Prologue theme for some time and have successfully implemented the "Role Manager" and "Hide Dashboard" plugins to limit the author's role to simply "Read" and "Write" capabilities. As you're no doubt aware, a new author under this scenario will enter their profile page with no access to dashboard, admin settings, etc. With some minor editing at that point, I direct the user to go right to the blog where they can begin posting using Prologue's built-in post editor at the top of the page. Easy peasy....

    I'd like to replicate this in WPMU, (ideally with authors having the ability to post to their own blog and these posts appearing on the main blog). In order for it to work seamlessly, though, I need all new signups having these limited capabilities at default (versus the existing admin capabilites). I think that if I use WPMUPluginCommander I can enable the Role Manager/HideDashboard scenario across all new blogs and with the reduced capabilities for authors it should do the trick.

    Now I simply (in jest) need a way to implement the adjusted author role at default for new blog owners. To your earlier post, I've looked for "wpmu_new_blog" and "wpmu_new_user" but am finding "wp-user" and "wp-blog" in WPMU 1.5. Am I missing something?

    Appreciate any further feedback...

    Thx

  5. scotm
    Member
    Posted 15 years ago #

    I may have complicated the issue here. Tried this and it works fine:

    1) Changed default in "wp-functions" from 'administrator' to 'author'
    2) Installed Role Manager plugin.
    3) Adjusted capabilities for 'author' to simply 'read' and write'.
    4) Now new blog owners only see profile page and can go right to editor on site's main page.

    Cheers

  6. boonika
    Member
    Posted 15 years ago #

    I use exactly the same solution but I also want to remove 'Advanced Options' (pings, comments...).

  7. andrea_r
    Moderator
    Posted 15 years ago #

    So, in a nutshell, what you're ultimately aiming for is for all user's posts to wind up on the main blog page?

    If so, pull the sitewide feed, or use one fo the most_recent_posts variations to display content on a home.php assigned to the main blog's theme and have it show full post content.

    Voila.

  8. scotm
    Member
    Posted 15 years ago #

    andrea_r

    Yes, I'm not so concerned with pulling content to the home page. I see your solution as a way of doing this. My bigger issue was having new authors with their own blog (WPMU) versus just being authors (WP). I can now, for example, allow each individual member to use a plugin like "twitter tools" so that their posts go to Twitter (the plugin in WP only allows for one author).

    I'm now having trouble assigning the prologue theme to all blogs. I've activated it and de-activated all other themes but no go. Is there a similar way to hard-code in one theme for all new blogs? Perhaps "wp-functions" or maybe "wp-blogs" somewhere?

    Thx

  9. boonika
    Member
    Posted 15 years ago #

    WP-Autoblog also works fine (that's what I use) but the solution Andrea provided is better if you are fetching posts only from your MU.

    @Andrea
    Can you help with my problem (two posts above)?

  10. boonika
    Member
    Posted 15 years ago #

    Looks like cafespain wrote something about it already:

    http://mu.wordpress.org/forums/topic.php?id=8207

  11. scotm
    Member
    Posted 15 years ago #

    boonika

    Cam I ask why you'd want to remove those advanced options? To prevent duplicate content?

  12. scotm
    Member
    Posted 15 years ago #

    May have spoken to soon on my Role Manager solution. The RM plugin keeps de-activating after logging out which might not be a problem if I can do this 1) adjust 'administrator' to 'author' in "wp-functions" as discussed above, and 2) adjust capabilities for author within "update_schema" down to just 'read' and 'write'.

    It appears "update_schema" no longer exists in wpmu 1.5. Can anyone tell me where to adjust this in 1.5? Perhaps admin/includes/schema?

    Cheers

  13. andrea_r
    Moderator
    Posted 15 years ago #

    "Is there a similar way to hard-code in one theme for all new blogs? "

    Easiest way is to get rid of the current default theme and rename the prologue FOLDER to default. No need to rename anything else but the folder it resides in. MU will look for it by default.

    As per Donncha's post above, he sugggested those hooks so you could write a plugin to use that to asign those roles on signup.

  14. scotm
    Member
    Posted 15 years ago #

    andrea_r

    Thanks for the input. I'd already figured out the default issue and renamed prologue to default. Works fine.

    As for the default role, changing 'admin' to 'author' in wp-functions works, but I need to adjust the author capabilities down to simply read and write. I'm not capable of writing a plugin I'm afraid, so I thought adjusting the 'upgrade_schema" file would do it...but I can't find it in 1.5.

    Thx

  15. scotm
    Member
    Posted 15 years ago #

    Thought I'd pick up this post again. Looking for a little WPMU advice to make sure I get this right. I want to have all new blogs created with the "author" role versus "admin" role. I'm pretty sure I can edit wpmu-functions to do this, perhaps:

    $site_admins = get_site_option( 'site_admins', array('admin') );

    If this is not the correct location I'd appreciate some guidance. Also and perhaps more importantly, I want to know if this will affect my main blog (blog1) if I change this file. I don't see this happening but just trying to make sure.

    Cheers

  16. lunabyte
    Member
    Posted 15 years ago #

    No, that's not right at all.

    That's "Site Admin", not a blog admin.

    See this post from Donncha above:
    http://mu.wordpress.org/forums/topic.php?id=8217#post-48717

    "Instead of changing that file, look at the "wpmu_new_blog" or "wpmu_new_user" actions. The first action takes blog_id and user_id as parameters so it should be easy to change the permissions through that. It makes upgrading *much* easier later."

  17. scotm
    Member
    Posted 15 years ago #

    lunabyte

    thanks for the heads up. i've read that post from donncha several times and have looked for the files (he speaks of instances) but wasn't sure if it was wp-admin/wpmu-blogs and/or wpmu-users or not. i've looked in both those files but still not sure.

    you could really help me out here with a bit more guidance. thanks

  18. lunabyte
    Member
    Posted 15 years ago #

    wp-includes/wpmu-functions.php is where the functions being referenced are.

    That doesn't matter, though, as what he is saying is that you should write a plugin file (made for mu-plugins), which hooks into these function(s) and changes the users permissions for their blog.

  19. boonika
    Member
    Posted 15 years ago #

    My suggestion is that you don't change any wpmu file. Instead, use dsader's solutions to hide admin items by using small plugins. That way you want have to change default role and you can decide which user will have certain capabilities. That means that you can have different type of users. No need for changing default role. Believe me, I tried every possible solution out there. I'm also a big fan of Role Manager, but with the solution dsader provided I don't have to use that amazing plugin any more.

    Read these threads carefully:
    http://mu.wordpress.org/forums/topic.php?id=8482
    http://mu.wordpress.org/forums/topic.php?id=8540

    Also, don't forget to use it (those small plugins I've mentioned) in combination with Plugin Comander.

  20. andrea_r
    Moderator
    Posted 15 years ago #

    Donncha and luna were both talking about writing a plugin and specifically stated the functions you hook into with that plugin. :)

  21. scotm
    Member
    Posted 15 years ago #

    @lunabyte @andrea_r thanks for the clarity. knew i was missing something on donncha's advice. i appreciate the work you guys do around here.

    @boonika i'll follow your lead. i already have plugin commander installed so we'll see how it goes. just to be clear, though, i'm wanting to change default roles of new blog owners, not users, which i'm currently handling with role manager.

    thanks

  22. boonika
    Member
    Posted 15 years ago #

    @andrea_r - I didn' see that, sorry. just started reading thread from the start. Anyway, scotm has all needed informations in those two threads.

    @scotm - I understand you, but with this solution you won't have to change default blog owner role to achieve same results, which I think is even better. So, create a plugin which fits needs of new blog owner and 'tell' Plugin Comander to activate it every time new blog is created. That's all folks.

  23. scotm
    Member
    Posted 15 years ago #

    @boonika - I hear you. I read the threads you pointed me to earlier but as I suggested farther up in this thread I'm not sure I can write the plugin as suggested. All I want to do is have my new blog owners with "read" and "write" capabilities with access to the dashboard and profile only. I currently have this with a single install of WP by using role manager to "dial down" the author capabilities. This is largely because I have Prologue as the default theme planned for all blogs and with Prologue all writing takes place outside of the admin area and on the actual site page.

    After looking at the WP Lite plugin (unfortunately not for WPMU), I could use this in combination with Plugin Commander to achieve similar results now that it has an "Admin sees all feature" but once again I need to get new blog owners changed from "Admin" to just about anything else.

    Sorry for the extended post and thanks again for the advice.

    Cheers

  24. boonika
    Member
    Posted 15 years ago #

    @scotm - drop me an email at pinkforrest(at)gmail(dot)com and I'll send you two plugins with an explanation. No need for Role Manager, which is still not 100% WPMU compatible. Same goes for WP Lite. After that, write here what happened so others know if it helped you or not. I still believe that this is solution for you.

  25. andrea_r
    Moderator
    Posted 15 years ago #

    Guys, you're making it too complicated. :) Write the plugin & drop it into mu-plugins. No need for plugin commander, wplite or any other plugin.

    The hooks & filters are already there to do exactly what scotm wants.

  26. boonika
    Member
    Posted 15 years ago #

    @andrea_r

    Andrea, I understand what you are saying but I have more than one type of blog owners. Some have capabilities that others don't. Some of my users have default admin options, others can only write and edit pages and so on...

  27. scotm
    Member
    Posted 15 years ago #

    @boonika - Kudos for your offer of assistance. Well I'm halfway there. I started with your "hide menu" plugin and it worked like a charm. Now I'm down to simply "My blogs" (aside - I want to get rid of it as well), "Dashboard", "Write - Page", "Manage - Page" and "Users - Your profile" (I'd also like to have this simply "Profile".

    I then installed the "hide post page" plugin and tried it several times, but there does not seem to be any effect. Does this plugin further remove some of what I have left (ie. Write - Page and Manage - Page)? If so, that would be great but it doesn't seem to be working.

    I did not install the dashboard plugin because I want users to have that feature.

    @andrea_r - happy canada day from a fellow canuck! ...and thanks for the heads up. Since I want all of my blog owners to have the same roles I'll probably drop boonika's plugins into mu-plugins as you suggest.

    Any ideas what might be left unsolved here?

    Cheers

  28. scotm
    Member
    Posted 15 years ago #

    @boonika follow-up...I guess the "hide post page" plugin hides the options on the post page. duuhhh. ok, that's great but i guess i'm not in need of that one either since my folks are using prologue and posting off the main page.

    perhaps what i'm looking for now is a mod to your "hide menu" to replace the "write and manage page" features along with some tweaking of the "my blogs" and "users" tabs. i'll see if i can figure it out.

    thx

  29. boonika
    Member
    Posted 15 years ago #

    If you mean hide_postpage_options_plugin than no. It removes Advanced options bellow the textbox on write-page/write-post pages.

    hide_menu_plugin hides Write - Post and Manage - Post menus and some other menues (as long as I can remember). If you want to hide Write - Page and Manage - Page than simply edit that plugin. All you have to do is to ad some more lines and apropriate values. Use that solution to hide/show all other menus. Open that plugin file and read this post to understand it better:
    http://mu.wordpress.org/forums/topic.php?id=8482#post-50495

  30. scotm
    Member
    Posted 15 years ago #

    re: "hide_postpage_options_plugin" yes that's what I meant actually, advanced options below the textbox. gotcha

    re: "hide_menu_plugin" i have to think it can hide those menus as well. thanks for the link.

    btw...what does the redirect plugin accomplish?

1 2 3

About this Topic