TZM / tzm-blade

ZMGC Application empowers members with on-line tools, by providing a free infrastructure to easily exchange, analyse and disseminate information in a scalable, non-blocking manner using only Open Source software build by the community for the community. It is about building lasting and deep solidarity versus cheap and fast Facebook or Twitter campaigns
www.zmgc.net
GNU General Public License v3.0
4 stars 8 forks source link

import users into application #57

Open nkhine opened 10 years ago

nkhine commented 10 years ago

from the admin interface, i would like an additional button to allow to upload a .csv file where you get an overlay with a form, where the user can choose and upload a file.

when the user clicks the upload button, they are told how many records are being uploaded and once it is done, they get a message telling them how many records have been imported, how many are duplicates (exist in the database) and how many have been rejected.

user_admin_interface_import_users

we should be able to view the rejected records, within the form.

don't forget to localize the interface.

when each record is processed and added to the database, send an email to the user with the following template:

Dear member,
As part of the Zeitgeist Movement system upgrade, we have moved your record to the new ZMGC application.

Please confirm your email by clicking VERIFICATION TOKEN LINK

ZMGC Team
ofShard commented 10 years ago

What is the expected format for this CSV file? Is it the result of something like mongoexport --csv? How do I know which fields apply to the CSV on an upload?

Do you also want to support JSON? Or perhaps exclusively support JSON?

nkhine commented 10 years ago

There should only be 3 fields, Email, FirstName, LastName in the csv file, if there is other fields disregard these as it maybe too much an effort to create an interface where the user to match the field/column names, what do you think?

Not sure about supporting JSON, do you think it will be useful?

nkhine commented 10 years ago

get this in the logs

27e-86aa-e62adc5cec9a fwd="50.161.7.5" dyno=web.1 connect=4ms service=3ms status=400 bytes=196
2014-02-18T18:52:13.572460+00:00 app[web.1]: nothing to to update
2014-02-18T18:52:13.441525+00:00 app[web.1]: Getting chapter cards...
2014-02-18T18:52:16.233310+00:00 app[web.1]: success
2014-02-18T18:52:16.243631+00:00 app[web.1]: Error: Forbidden
2014-02-18T18:52:16.226977+00:00 app[web.1]: deserialize
2014-02-18T18:52:16.243631+00:00 app[web.1]:   at /app/node_modules/i18next/lib/i18next.js:105:13
2014-02-18T18:52:16.243877+00:00 app[web.1]:   at Object.i18n.functions.extend.load (/app/node_modules/i18next/lib/i18nextWrapper.js:271:17)
2014-02-18T18:52:16.243631+00:00 app[web.1]:   at /app/node_modules/i18next/lib/dep/i18next-1.7.1.js:665:21
2014-02-18T18:52:16.243631+00:00 app[web.1]:   at Object.exports.error (/app/node_modules/express/node_modules/connect/lib/utils.js:63:13)
2014-02-18T18:52:16.243631+00:00 app[web.1]:   at createToken (/app/node_modules/express/node_modules/connect/lib/middleware/csrf.js:82:55)
2014-02-18T18:52:16.243631+00:00 app[web.1]:   at next (/app/node_modules/express/node_modules/connect/lib/proto.js:193:15)
2014-02-18T18:52:16.243631+00:00 app[web.1]:   at Object.handle (/app/node_modules/express/node_modules/connect/lib/middleware/csrf.js:48:24)
2014-02-18T18:52:16.243631+00:00 app[web.1]:   at next (/app/node_modules/express/node_modules/connect/lib/proto.js:193:15)
2014-02-18T18:52:16.243877+00:00 app[web.1]:   at Object.i18n.handle (/app/node_modules/i18next/lib/i18next.js:103:14)
2014-02-18T18:52:16.243877+00:00 app[web.1]:   at Context.next (/app/node_modules/express/node_modules/connect/lib/proto.js:193:15)
2014-02-18T18:52:16.243631+00:00 app[web.1]:   at Object.handle (/app/node_modules/blade/lib/blade.js:200:8)
2014-02-18T18:52:16.243877+00:00 app[web.1]:   at /app/node_modules/passport/lib/passport/index.js:332:35
2014-02-18T18:52:16.243877+00:00 app[web.1]:   at init (/app/node_modules/i18next/lib/dep/i18next-1.7.1.js:661:19)
2014-02-18T18:52:16.243877+00:00 app[web.1]:   at /app/node_modules/passport/lib/passport/strategies/session.js:61:12
2014-02-18T18:52:16.243877+00:00 app[web.1]:   at Promise.<anonymous> (/app/app/config/passport.coffee:49:17)
2014-02-18T18:52:16.244065+00:00 app[web.1]:   at /app/node_modules/mongoose/lib/query.js:1386:13
2014-02-18T18:52:16.243877+00:00 app[web.1]:   at Object.setLng (/app/node_modules/i18next/lib/dep/i18next-1.7.1.js:775:16)
2014-02-18T18:52:16.243877+00:00 app[web.1]:   at Context.actions.pass (/app/node_modules/passport/lib/passport/context/http/actions.js:77:8)
2014-02-18T18:52:16.244065+00:00 app[web.1]:   at Promise.EventEmitter.emit (events.js:95:17)
2014-02-18T18:52:16.244065+00:00 app[web.1]:   at Promise.<anonymous> (/app/node_modules/mongoose/node_modules/mpromise/lib/promise.js:177:8)
2014-02-18T18:52:16.243877+00:00 app[web.1]:   at pass (/app/node_modules/passport/lib/passport/index.js:321:31)
2014-02-18T18:52:16.244065+00:00 app[web.1]:
  at Promise.emit (/app/node_modules/mongoose/node_modules/mpromise/lib/promise.js:84:38)
2014-02-18T18:52:16.244065+00:00 app[web.1]:   at Object.cb (/app/node_modules/mongoose/lib/query.js:1143:11)
2014-02-18T18:52:16.244065+00:00 app[web.1]:   at processImmediate [as _immediateCallback] (timers.js:330:15)
2014-02-18T18:52:16.244065+00:00 app[web.1]:   at model.Document.init (/app/node_modules/mongoose/lib/document.js:250:11)
2014-02-18T18:52:16.244065+00:00 app[web.1]:   at Promise.fulfill (/app/node_modules/mongoose/node_modules/mpromise/lib/promise.js:97:20)
2014-02-18T18:52:16.244065+00:00 app[web.1]:   at completeOne (/app/node_modules/mongoose/lib/query.js:1384:10)
2014-02-18T18:52:16.244065+00:00 app[web.1]:   at Object._onImmediate (/app/node_modules/mongoose/node_modules/mquery/lib/utils.js:126:16)
2014-02-18T18:52:16.245109+00:00 heroku[router]: at=info method=POST path=/user/list?action=upload host=www.zmgc.net request_id=7d731147-8733-4736-9023-e798575549e0 fwd="94.196.122.32" dyno=web.1 connect=2ms service=58ms status=403 bytes=439
2014-02-18T18:52:16.244642+00:00 app[web.1]:
2014-02-18T18:52:16.245184+00:00 app[web.1]: POST /user/list?action=upload 403 55ms - 9b
2014-02-18T18:52:18.004503+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path=/engine.io/?EIO=2&transport=polling&sid=MRwonf6McfCISPEMAAAK host=www.zmgc.net request_id=493ae4f8-23bf-4e2e-8014-80d325caf1b9 fwd="50.161.7.5" dyno=web.1 connect=2ms service=30003ms status=503 bytes=0
2014-02-18T18:50:55.901616+00:00 heroku[router]: at=info method=GET path=/blade/plugins/liveui.js host=www.zmgc.net request_id=261bddd1-4de0-476a-aa9e-2f93dfa508a0 fwd="94.196.122.32" dyno=web.1 connect=1ms service=253ms status=304 bytes=387
2014-02-18T18:52:18.429159+00:00 app[web.1]: session EkDtnZwRtWDnu1HWSOFLMHpJ
2014-02-18T18:52:18.429282+00:00 app[web.1]: join EkDtnZwRtWDnu1HWSOFLMHpJ
2014-02-18T18:52:18.395453+00:00 heroku[router]: at=info method=GET path=/engine.io/?EIO=2&transport=polling host=www.zmgc.net request_id=891a7ba2-9c41-4bea-bc43-f67b95ebad02 fwd="50.161.7.5" dyno=web.1 connect=13ms service=26ms status=200 bytes=321
2014-02-18T18:50:22.105421+00:00 heroku[router]: at=info method=POST path=/user/list?action=upload host=www.zmgc.net request_id=b77ec417-66ca-485e-8f39-5399d2df491a fwd="94.196.122.32" dyno=web.1 connect=15ms service=1119ms status=403 bytes=439
2014-02-18T18:52:33.460570+00:00 app[web.1]: Getting chapter cards...
2014-02-18T18:52:33.898343+00:00 app[web.1]: nothing to to update
2014-02-18T18:52:43.799889+00:00 heroku[router]: at=info method=POST path=/engine.io/?EIO=2&transport=polling&sid=qDVkHnfxGw7K0jYEAAAL host=www.zmgc.net request_id=1b0ce0bd-3fef-4c22-be4f-65dea9d9b14b fwd="50.161.7.5" dyno=web.1 connect=13ms service=17ms status=400 bytes=196
nkhine commented 10 years ago

when i import users, they are all in a disabled state - when changing the status, i get this message:

That user has no login method. Resend confirmation email so they can set a password.

ofShard commented 10 years ago

Yes. It's not sending an email yet. That will be added once I get the upload bugs ironed out. That message in particular shows up because you cannot "activate" an account with no login method. A recently imported account has no password (or other provider), so you can't log in.

nkhine commented 10 years ago

when you load more users, the bottom buttons are half hidden behind the footer.

screen shot 2014-02-24 at 11 32 28

also there is no way to reset to show the first 10 entries or a 'Load Less' button. now if you click 'Load More', this then becomes the default and next time you load the page, you get this list.