HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

System User Bot not being generated in 2.1 stable

vrijvlindervrijvlinder Papillon-Sauvage MVP

I have been updating my forums and have run into a problem. The system user is not being generated. I tried adding it manually to the database and adding the configuration for it in the config.php . I also fresh installed and moved the forum to the new install without success.

This same issue has happened on three different updated forums. One did not even have any users but the the admin.

Any ideas ?

Tagged:
«1

Comments

  • Options
    peregrineperegrine MVP
    edited June 2014

    are your new installations completing successfully? in the past you had some problems with config.php not being updated, and plugins not enabling via dashboard.

    yes, followup with what I said in pm :) you left it hanging as far as manually adding it.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    peregrineperegrine MVP
    edited June 2014

    the System user depends on a few things.

    provided the user table has a System user name and the column "Admin" in the User Table has a values of 2.

    There are other machinations - but the bottom line column "Admin" in the User Table has a values of 2. for the "System User".

    Also the UserID for the System should not be associated with any roles in the UserRole table.

    if your "System user" is UserID no. 2

    there should not be any UserID rows in the UserRole Table for UserID 2.

    If you fix the User table for System user, and make sure the UserRole Table has no userid associated with the System user, the next save of the config.php (via changing something in dashboard e.g. theme).

    a config statement will be created for the UserID for the system User (which in my case the userid for System is "2"

    produces.

    $Configuration['Garden']['SystemUserID'] = '2';

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    peregrineperegrine MVP
    edited June 2014

    or you could remove $Configuration['Garden']['SystemUserID']

    from you config.php

    and write a plugin that calls usermodel GetSystemUserID()

    which essentially put the System User back in provided there is no config statement
    with these values in the user table.

    where you see the importance of column "Admin" in the User Table has a value of 2.

    which you could do manually.

         $SystemUser = array(
                 'Name' => T('System'),
                 'Photo' => Asset('/applications/dashboard/design/images/usericon.png', TRUE),
                 'Password' => RandomString('20'),
                 'HashMethod' => 'Random',
                 'Email' => 'system@domain.com',
                 'DateInserted' => Gdn_Format::ToDateTime(),
                 'Admin' => '2'
              );
    
    
          $SystemUserID = $this->SQL->Insert($this->Name, $SystemUser);
    
              SaveToConfig('Garden.SystemUserID', $SystemUserID);
    

    also in structure  from running uttility/update and utility/structure
    
    // Make sure the system user is okay.
    $SystemUserID = C('Garden.SystemUserID');
    if ($SystemUserID) {
       $SysUser = Gdn::UserModel()->GetID($SystemUserID);
    
       if (!$SysUser || GetValue('Deleted', $SysUser) || GetValue('Admin', $SysUser) != 2) {
          $SystemUserID = FALSE;
          RemoveFromConfig('Garden.SystemUserID');
       }
    }
    
    if (!$SystemUserID) {
       // Try and find a system user.
       $SystemUserID = Gdn::SQL()->GetWhere('User', array('Name' => 'System', 'Admin' => 2))->Value('UserID');
       if ($SystemUserID)
          SaveToConfig('Garden.SystemUserID', $SystemUserID);
    }
    

    in a new installation - the System User is the author of the first discussion Bam!

    do you get an initial discussion created? when doing a fresh install!

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    are your new installations completing successfully?

    Yes the new installation is successful. All plugins can be enabled and everything works perfectly well. The only problem is there is no System User.

    in a new installation - the System User is the author of the first discussion Bam!

    That is also not happening when updating. And this recent install no new discussion Bam.

    I will make screenshot of user table.. I had to step out for a bit but I just got back.
    I will try the plugin and see if that works to create it.

  • Options

    And this recent install no new discussion Bam.

    so in essence with a new fresh install, it is not successful really, because its not completing.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    Yes I suppose that could be. The issue is that updating where there already is a User two does not matter or should not because I think the System user looks for ID2 and if it is taken is used the next available id number.

    In one of my install the System is not two in this case it is 24

    http://www.godfreezone.org/Forum/profile/24/The_System

    In this install Everything went well after failure the first time from the ftp choking but after I installed a second forum and added the config.php for the first one that seemed to make the first one work as expected . I don't know how or why but most likely has to do with the database structure.

    I tried doing the same thing to this one to see if it would also work but it did nothing. All I succeeded in doing is changing the name of the subdirectory but ended up with the same problem.

    I can't find where to change the value of the admin column. In this problem install that I am working on atm, there was already a User 2. But I don't think that is the problem. The SYstem User is simply not being called from the UserModel or something.

    so in essence with a new fresh install.it is not successful really, because its not completing.

    I used the same database, which in theory as with the previous install would have created what was missing as it did in the other one. But it did not work this time.

    The next option is a new database which I really wanted to avoid having to rebuild it.

    I tried using Swaipbot plugin to add the function to call the System User but it did not work either.

    Utility structure and update both return successful

  • Options

    I used the same database, which in theory as with the previous install would have created what was missing as it did in the other one. But it did not work this time.

    no.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    if your goal is creating a system user I can help. But I can't weave around on other philosophical ideas.

    if you want to manually create a system user. let me know. when you have access to sql or phpmyadmin.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
  • Options
    peregrineperegrine MVP
    edited June 2014

    what userid # do you want the System user created at?

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    ok run

    SELECT * FROM GDN_User WHERE UserID = 2

    do you get any results.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    ok I think I made it p. I see a User 2 and it says System User now.

  • Options

    post the results then.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    This is what I did:

    Created User System using the info for it in the usermodel as you posted above. Made it admin with value 2

    Added the $Configuration for the SystemUser to the config.php reflecting user2

  • Options
    peregrineperegrine MVP
    edited June 2014

    UPDATE GDN_User SET Password = UNHEX( '36514d52543457424a3834593642594c4e385438' ) ,
    Admin = '2' WHERE GDN_User.UserID =2;

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    you can change a few numbers in the password field but leave the same number of numbers in the password field.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    HashMethod column should be Random

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited June 2014

    yes that is what I used , I am going to do this to the others see how it goes. It should work too.

Sign In or Register to comment.