Details

    • Rank:
      17453

      Description

      The CSV file user upload has the following issues:

      1. An '"emailstop" is not a valid field name' error.
      2. It doesn't update the user "auth" column when auth=nologin.

      I tried the exercise with IE8 and FireFox, but neither worked.

      Replication instructions:

      1. I created an UTF-8, tab delimited CSV file:

      username--firstname-lastname--emailstop
      xxx--aaa-bbb--1

      (where the three dashes represent a tab) in order to update some user registers. I got an '"emailstop" is not a valid field name' error.

      2. I created an UTF-8, tab delimited CSV file to set the auth field of some users to "nologin":

      username--firstname-lastname--auth
      xxx--aaa-bbb--nologin

      And the "Upload users results" page reported:

      User up-to-date | ## | ## | xxx | aaa | bbb | manual / manual-->nologin
      Users updated: 0
      Users having a weak password: 0
      Errors: 0

      1. temp.utx
        0.1 kB
        Guillermo M.
      2. temp2.csv
        0.1 kB
        Anthony Borrow
      1. MDL-27804.png
        120 kB

        Activity

        Hide
        Michael de Raadt added a comment -

        Thanks for reporting this.

        I've put it on our backlog and we'll try to get to it as soon as we can.

        Can you please attach a dummy CSV file with this issue. That will make it a lot easier to replicate and test.

        Show
        Michael de Raadt added a comment - Thanks for reporting this. I've put it on our backlog and we'll try to get to it as soon as we can. Can you please attach a dummy CSV file with this issue. That will make it a lot easier to replicate and test.
        Hide
        Guillermo M. added a comment -

        Here is a csv file, tab delimited.

        Show
        Guillermo M. added a comment - Here is a csv file, tab delimited.
        Hide
        Guillermo M. added a comment -

        I tried to use this file was meant to lock out some users.

        Show
        Guillermo M. added a comment - I tried to use this file was meant to lock out some users.
        Hide
        Anthony Borrow added a comment -

        As I understand it, emailstop is no longer available since email configuration is really handled through messaging events. The option for emailstop was removed eventhough the field remains in the database. I'll do some testing and see what might be happening with the nologin bit. Peace - Anthony

        Show
        Anthony Borrow added a comment - As I understand it, emailstop is no longer available since email configuration is really handled through messaging events. The option for emailstop was removed eventhough the field remains in the database. I'll do some testing and see what might be happening with the nologin bit. Peace - Anthony
        Hide
        Anthony Borrow added a comment -

        I've looked at the code in admin/uploaduser.php and it appears that when Petr was working on the code he added:

        if ($column === 'username' or $column === 'password' or $column === 'auth')

        { // these can not be changed here continue; }

        which means that it is no longer possible to update those columns. I think we could probably do with a little clearer message about what is happening as it appears that the change is happening. I am attaching the csv file that I was using for testing (removing the emailstop column and the double quotes) and a screen shot of the page which indicates to me that it has updated the auth field (by the green highlighted area); however, that is contradicted by the report that 0 accounts have been updated.

        Peace - Anthony

        Show
        Anthony Borrow added a comment - I've looked at the code in admin/uploaduser.php and it appears that when Petr was working on the code he added: if ($column === 'username' or $column === 'password' or $column === 'auth') { // these can not be changed here continue; } which means that it is no longer possible to update those columns. I think we could probably do with a little clearer message about what is happening as it appears that the change is happening. I am attaching the csv file that I was using for testing (removing the emailstop column and the double quotes) and a screen shot of the page which indicates to me that it has updated the auth field (by the green highlighted area); however, that is contradicted by the report that 0 accounts have been updated. Peace - Anthony
        Hide
        Anthony Borrow added a comment -

        linking to the the issue in which the code preventing updating the user's authentication was changed

        Show
        Anthony Borrow added a comment - linking to the the issue in which the code preventing updating the user's authentication was changed
        Hide
        Anthony Borrow added a comment -

        Attaching previously mentioned csv file and screen shot. Peace - Anthony

        Show
        Anthony Borrow added a comment - Attaching previously mentioned csv file and screen shot. Peace - Anthony
        Hide
        Petr Škoda added a comment -

        Hello,
        1/ the emailstop was removed completely, it is now part of the messaging preferences
        2/ the auth can not be modified any more
        3/ the password can be modified (it is in a code block bellow that if)
        4/ the 'nologin' plugin was replaced by new suspended user flag, I am going to add more options soon MDL-28351 (it should be easy to use bulk operations for the migration)

        Petr

        Show
        Petr Škoda added a comment - Hello, 1/ the emailstop was removed completely, it is now part of the messaging preferences 2/ the auth can not be modified any more 3/ the password can be modified (it is in a code block bellow that if) 4/ the 'nologin' plugin was replaced by new suspended user flag, I am going to add more options soon MDL-28351 (it should be easy to use bulk operations for the migration) Petr
        Hide
        Petr Škoda added a comment -

        oh, the auth modification is supported too, it is above the mentioned if. I am going to test it now.

        Show
        Petr Škoda added a comment - oh, the auth modification is supported too, it is above the mentioned if. I am going to test it now.
        Hide
        Petr Škoda added a comment -

        Thanks a lot for the report, fix for the auth problem will be fixed in the next weekly build.
        The email stop was removed, the csv upload is not supporting it any more.

        Petr

        Show
        Petr Škoda added a comment - Thanks a lot for the report, fix for the auth problem will be fixed in the next weekly build. The email stop was removed, the csv upload is not supporting it any more. Petr
        Hide
        Sam Hemelryk added a comment -

        Thanks Petr - nice simple fix, integrated now

        Show
        Sam Hemelryk added a comment - Thanks Petr - nice simple fix, integrated now
        Hide
        David Mudrak added a comment -

        Passed. I was able to change the auth method to nologin. The option "Existing user details" must allow overriding from the fie, otherwise the auth field is not changes.

        I fixed the http://docs.moodle.org/20/en/admin/uploaduser docs page and removed the "emailstop" from the list of supported fields.

        Show
        David Mudrak added a comment - Passed. I was able to change the auth method to nologin. The option "Existing user details" must allow overriding from the fie, otherwise the auth field is not changes. I fixed the http://docs.moodle.org/20/en/admin/uploaduser docs page and removed the "emailstop" from the list of supported fields.
        Hide
        Sam Stegers added a comment -

        Working with Moodle 2.1, it seems this problem has reared it's ugly head again. When uploading a csv file with 2 columns

        username auth
        testuser nologin

        When checking the file Moodle states that the authentication method will be changed from manual-->nologin but this does not happen. 0 user updated is the message at the end.

        I checked with other auth methods (ie CAS) and this works like a charm.

        Show
        Sam Stegers added a comment - Working with Moodle 2.1, it seems this problem has reared it's ugly head again. When uploading a csv file with 2 columns username auth testuser nologin When checking the file Moodle states that the authentication method will be changed from manual-->nologin but this does not happen. 0 user updated is the message at the end. I checked with other auth methods (ie CAS) and this works like a charm.
        Hide
        Helen Foster added a comment -

        Hi Sam,

        As this issue has been closed, please could you create a new issue for the the problem reoccurring in Moodle 2.1 then link the two issues.

        Show
        Helen Foster added a comment - Hi Sam, As this issue has been closed, please could you create a new issue for the the problem reoccurring in Moodle 2.1 then link the two issues.
        Hide
        Luis de Vasconcelos added a comment -

        I've just tried to upload some new users onto my test instance of Moodle 2.2.1+ (Build: 20120112) using this .csv file method. When I include the "emailstop" column in the .csv file I still get the '"emailstop" is not a valid field name' error.

        Stack trace:
        line 435 of \lib\setuplib.php: moodle_exception thrown
        line 208 of \admin\tool\uploaduser\locallib.php: call to print_error()
        line 126 of \admin\tool\uploaduser\index.php: call to uu_validate_user_upload_columns()

        My test.csv file contains:

        username,password,firstname,lastname,email,emailstop,idnumber,auth,lang,city,country
        abc1234,b!g$ecRet,Humpty,Dumpty,humpty.dumpty@gmail.com,1,244423432,ldap,en,-,ZA

        I also tried without the email column and still get the error:

        username,password,firstname,lastname,emailstop,idnumber,auth,lang,city,country
        abc1234,b!g$ecRet,Humpty,Dumpty,1,244423432,ldap,en,-,ZA

        I then tried it on the demo.moodle.net site and, as on my pc, I get the 'emailstop is not a valid field name' error. So it looks like the emailstop option is still not working.

        Can we reopen this issue?

        My test pc:
        Windows XP SP3
        IIS 5.1
        MS SQL Server 2005
        PHP 5.3.9 NTS VC9
        PHP date.timezone = "Africa/Johannesburg"
        Microsoft FastCGI Handler
        Microsoft SQL Server Driver for PHP
        Microsoft Windows Cache Extension for PHP

        Moodle config:
        $CFG->dbtype = 'sqlsrv';
        $CFG->dblibrary = 'native';

        Show
        Luis de Vasconcelos added a comment - I've just tried to upload some new users onto my test instance of Moodle 2.2.1+ (Build: 20120112) using this .csv file method. When I include the "emailstop" column in the .csv file I still get the '"emailstop" is not a valid field name' error. Stack trace: line 435 of \lib\setuplib.php: moodle_exception thrown line 208 of \admin\tool\uploaduser\locallib.php: call to print_error() line 126 of \admin\tool\uploaduser\index.php: call to uu_validate_user_upload_columns() My test.csv file contains: username,password,firstname,lastname,email,emailstop,idnumber,auth,lang,city,country abc1234,b!g$ecRet,Humpty,Dumpty,humpty.dumpty@gmail.com,1,244423432,ldap,en,-,ZA I also tried without the email column and still get the error: username,password,firstname,lastname,emailstop,idnumber,auth,lang,city,country abc1234,b!g$ecRet,Humpty,Dumpty,1,244423432,ldap,en,-,ZA I then tried it on the demo.moodle.net site and, as on my pc, I get the 'emailstop is not a valid field name' error. So it looks like the emailstop option is still not working. Can we reopen this issue? My test pc: Windows XP SP3 IIS 5.1 MS SQL Server 2005 PHP 5.3.9 NTS VC9 PHP date.timezone = "Africa/Johannesburg" Microsoft FastCGI Handler Microsoft SQL Server Driver for PHP Microsoft Windows Cache Extension for PHP Moodle config: $CFG->dbtype = 'sqlsrv'; $CFG->dblibrary = 'native';
        Hide
        Anthony Borrow added a comment -

        Luis - As I understand it, the emailstop field is no longer being used in Moodle 2.x - I believe that this issue stopped processing it if I recall. Could you say more about what you are trying to do as I believe most of the things that previously were done by emailstop are now being handled by the individual message processors. Peace - Anthony

        Show
        Anthony Borrow added a comment - Luis - As I understand it, the emailstop field is no longer being used in Moodle 2.x - I believe that this issue stopped processing it if I recall. Could you say more about what you are trying to do as I believe most of the things that previously were done by emailstop are now being handled by the individual message processors. Peace - Anthony
        Hide
        Luis de Vasconcelos added a comment -

        My main problem is that I have some users who don't have e-mail addresses so I have to use fake e-mails in my new_user.csv files when I register them via the Upload Users function in Moodle. But now my admin mailbox is getting flooded with a whole lot of bunced e-mails that are created when the users enrol themselves in their courses ("An error occurred while trying to deliver this message to the recipient's e-mail address").

        I tried using the solution that Randy Orwin described in http://moodle.org/mod/forum/discuss.php?d=58215#p281973, but that requires the emailstop option.

        Show
        Luis de Vasconcelos added a comment - My main problem is that I have some users who don't have e-mail addresses so I have to use fake e-mails in my new_user.csv files when I register them via the Upload Users function in Moodle. But now my admin mailbox is getting flooded with a whole lot of bunced e-mails that are created when the users enrol themselves in their courses ("An error occurred while trying to deliver this message to the recipient's e-mail address"). I tried using the solution that Randy Orwin described in http://moodle.org/mod/forum/discuss.php?d=58215#p281973 , but that requires the emailstop option.
        Hide
        David Mudrak added a comment -

        IMHO this is a clear regression caused by the removal of the emailstop flag. We need a way to declare the messaging is disabled during the users upload.

        Luis, please report it as a new issue. Thanks.

        Show
        David Mudrak added a comment - IMHO this is a clear regression caused by the removal of the emailstop flag. We need a way to declare the messaging is disabled during the users upload. Luis, please report it as a new issue. Thanks.
        Hide
        Michaela Blomberg added a comment -

        emailstop is necessary: we've the same problem: many user haven't got any emailadresses.

        Show
        Michaela Blomberg added a comment - emailstop is necessary: we've the same problem: many user haven't got any emailadresses.

          People

          • Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: