1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 How to mass move to new user group.

Discussion in 'XenForo Questions and Support' started by Edrondol, Oct 6, 2011.

  1. Edrondol

    Edrondol Well-Known Member

    Quick question. I would like to have new registers move to a user group that is effectively on probation. I could not see how to make them be anything other than Registered Users.

    So what I need to do is either find a way to make new registers go to the group of my choice or find out how to mass move users to a new group called "Trusted Users". I built the promotions and rebuilt caches, but it didn't seem to do the trick.

  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Here is a different idea. Enable moderation:

    Admin CP -> Home -> Options -> User Registration -> Enable Manual Approval

    That will cause new users to have a user state of "Awaiting Approval". It's not a different usergroup. But users like this who are not "Valid" take on the permissions of the "Unregistered / Unconfirmed" group.

    Otherwise you should simply modify the permissions for the "Registered" group if you want to target new registrations. This is as opposed to trying to change the destination group for new users which is not a good idea.

    You can add existing users to a new "Trusted" group by creating a promotion. Note that in 1.1 promotions are handled by a cron that runs hourly:

    Admin CP -> Tools -> Cron Entries -> User Group Promotions

    And be aware that promotions are only awarded to qualifying users who have been active on the forum in the last 24 hours. For your purposes you may wish to temporarily modify this file so that it processes all users regardless of activity:


    Remove the red code:

    		$users = $userModel->getUsers(array(
    			'user_state' => 'valid',
    			'is_banned' => 0,
    			'last_activity' => array('>', XenForo_Application::$time - 86400)
    		), array(
    			'join' => XenForo_Model_User::FETCH_USER_OPTION
    Then manually run the cron to process all users for promotion.
    Digital Doctor, bousaid and Edrondol like this.
  3. Edrondol

    Edrondol Well-Known Member

    That's what I needed! Thanks, man! I rebuilt the caches and didn't even think of running the cron jobs. Thanks again!
  4. giorgino

    giorgino Well-Known Member

    Jake you know the answer for sure ;)
    The cron run every 20 mins, not one hour.

    In my installation running di cron the server respond with error 500 :(

    Thanks :)
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Is that with the code modification I posted? It might be processing too many users. But a 500 error is not specific. Ideally the server logs will contain more information.
  6. giorgino

    giorgino Well-Known Member

    The only servers error.log line I've found after running the promotion cron is:

    Code: - - [28/Jan/2012:11:32:37 +0100] "GET /admin.php?cron/userGroupPromotions/run&_xfToken=1%2C1327746747%2C70b9ebedd2a01f6f17d993c134c89d9d375911b7 HTTP/1.1" 500 5 "http://immobilio.it/admin.php?cron/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7"

    2012/01/28 11:32:37 [error] 31578#0: *1555996 FastCGI sent in stderr: "PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 83 bytes) in /store1/www/it.immobilio.www/doc_root/library/Zend/Db/Statement/Mysqli.php on line 304" while reading response header from upstream, client:, server: www.immobilio.it, request: "GET /admin.php?cron/userGroupPromotions/run&_xfToken=1%2C1327746747%2C70b9ebedd2a01f6f17d993c134c89d9d375911b7 HTTP/1.1", upstream: "fastcgi://", host: "immobilio.it", referrer: "http://immobilio.it/admin.php?cron/"
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Yeah, memory error. Too many users at once.

    Try re-adding the "last_activity" criteria, but change the timestamp. Then you can process all users in batches by gradually increasing the timestamp between each run. It's tedious but it should work.
  8. giorgino

    giorgino Well-Known Member

    I tried Jake :)

    The max period I can run on my board/server is 98 days (8467200 secs)
  9. Digital Doctor

    Digital Doctor Well-Known Member

    Nominate for the Help Manual !
    + CORE

Share This Page