'Handle various actions available on page'

def post(self, request):

    if (not request.user.is_staff):
        raise Http404
    self.make_common_context()
    action = request.POST.get('action', '')
    track.views.server_track(request, action, {}, page='user_sysdashboard')
    if (action == 'download_users'):
        header = [_('username'), _('email')]
        data = ([u.username, u.email] for u in User.objects.all().iterator())
        return self.return_csv('users_{0}.csv'.format(request.META['SERVER_NAME']), header, data)
    elif (action == 'repair_eamap'):
        self.msg = u'<h4>{0}</h4><pre>{1}</pre>{2}'.format(_('Repair    Results'), self.fix_external_auth_map_passwords(), self.msg)
        self.datatable = {}
    elif (action == 'create_user'):
        uname = request.POST.get('student_uname', '').strip()
        name = request.POST.get('student_fullname', '').strip()
        password = request.POST.get('student_password', '').strip()
        self.msg = u'<h4>{0}</h4><p>{1}</p><hr    />{2}'.format(_('Create    User    Results'), self.create_user(uname, name, password), self.msg)
    elif (action == 'del_user'):
        uname = request.POST.get('student_uname', '').strip()
        self.msg = u'<h4>{0}</h4><p>{1}</p><hr    />{2}'.format(_('Delete    User    Results'), self.delete_user(uname), self.msg)
    context = {'datatable': self.datatable, 'msg': self.msg, 'djangopid': os.getpid(), 'modeflag': {'users': 'active-section'}, 'edx_platform_version': getattr(settings, 'EDX_PLATFORM_VERSION_STRING', '')}
    return render_to_response(self.template_name, context)
