Any way to export users?
Permalink
I thought I was done with my C5 site and the client just asked for a feature that they assumed would be available. They want to be able to extract all the user data into a file (either csv or excel file). Is there any way to do this? It looks like from looking at google there used to be a way to do this in c5 but it appears to be ripped out (I couldn't find it anyway).
Any ideas on how to do this? I would greatly appreciate any help on this.
Any ideas on how to do this? I would greatly appreciate any help on this.
not sure what kind of format you need it in, but check out the UserList class. That'll make it easy to grab all the users.
What is it all data?
They would probably love it if it could be any data but they will settle for all data in a csv or excel file. I found in the documentation that there used to be a "Export" button on the user page. I wish it was still there. Do you know why it was removed? I assume I could probably get a copy of the old code and integrate it somehow?
I'm kind of panicking here because I thought I was done and I didn't expect this last minute request.
I'll look at UserList as Tony recommends but I was hoping there was a solution already (wishful thinking).
I'm kind of panicking here because I thought I was done and I didn't expect this last minute request.
I'll look at UserList as Tony recommends but I was hoping there was a solution already (wishful thinking).
hey, good news. concrete5.4, isn't officially released yet, but it has an easy way export users to an excel spreadsheet in there already! have a look at the beta version in svn.
That is fantastic! Unfortunately, I can't wait until 5.4 because my customer is going to go live soon but I will install it and see if I can leverage the code for now until 5.4 comes out officially. Thanks so much!
Ok dumb question. I can't find how to get the beta version of 5.4. I couldn't see it anywhere on this site or sourceforge. Do I have to join the beta program? Thanks.
the beta's kind of a mess right now, so just grab the code you need from here and copy it over:
http://svn.concrete5.org/svn/concrete5/...
http://svn.concrete5.org/svn/concrete5/...
hi .. i can't find the CSV export code anywhere in 5.4 .. can someone please point me in the right direction? it's pretty urgent ..
thanks in advance !
thanks in advance !
I also could not find it in 5.4. I gave up and installed 5.2 which had some code in there to export users (part of the dashboard). I ended up creating a single page with the export code and a controller which I based on the members controller. Here is part of my export code in my single page (this creates an excel file):
I hope this helps.
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?> <div id="ccm-profile-wrapper"> <?php if ($userList->getTotal() == 0) { ?> <div><?php echo t('No users found.')?></div> <?php } else { header("Content-Type: application/vnd.ms-excel"); header("Cache-control: private"); header("Pragma: public"); $date = date('Ymd'); header("Content-Disposition: inline; filename=user_report_{$date}.xls"); header("Content-Title: User Report - Run on {$date}"); echo("<table><tr>"); //echo("<td><b>".t('Username')."</b></td>"); echo("<td><b>".t('Email Address')."</b></td>");
Viewing 15 lines of 48 lines. View entire code block.
I hope this helps.