www/url_handlers.c: Do POST then GET in prefs_fmap()

When updating the field mappings @ /prefs/fmap/ do a GET after the
POST, this avoids problems with double form submissions and makes
the browsers back button do the right thing.

See: http://en.wikipedia.org/wiki/Post/Redirect/Get

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>
www/url_handlers.c: Do POST then GET in admin_edit_user()

When upating a users details @ /admin/edit_user/ do a GET after the
POST, this avoids problems with double form submissions and makes the
browsers back button do the right thing.

See: http://en.wikipedia.org/wiki/Post/Redirect/Get

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>
www/url_handlers.c: Re-org some code in admin_edit_user()

We only want to generate a web page with template variables if we get a
GET request. So move any variable setting to after the IS_POST() check,
this also allows us to replace a goto with a return.

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>
www/common.h: Add an ADD_HDR() macro

This macro adds the Approver/Admin/user_hdr parts to the web page
depending on the users capabilities.

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>
www/url_handlers.c: Convert receipts() to ADD_HDR()

This makes use of the new ADD_HDR() macro to add the
Approver/Admin/user_hdr parts to the page.

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>
www/url_handlers.c: Convert stats() to ADD_HDR()

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>
www/url_handlers.c: Convert tagged_receipts() to ADD_HDR()

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>
www/url_handlers.c: Convert receipt_info() to ADD_HDR()

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>
www/url_handlers.c: Convert reviewed_receipts() to ADD_HDR()

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>
www/url_handlers.c: Convert approve_receipts() to ADD_HDR()

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>
www/url_handlers.c: Convert extract_data() to ADD_HDR()

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>
www/url_handlers.c: Convert prefs_edit_user() to ADD_HDR()

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>
www/url_handlers.c: Convert prefs_fmap() to ADD_HDR()

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>
www/url_handlers.c: Convert prefs() to ADD_HDR()

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>
www/url_handlers.c: Convert admin_pending_activations() to ADD_HDR()

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>
www/url_handlers.c: Convert admin_user_stats() to ADD_HDR()

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>
www/url_handlers.c: Convert admin_stats() to ADD_HDR()

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>
www/url_handlers.c: Convert admin_edit_user() to ADD_HDR()

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>
www/url_handlers.c: Convert admin_add_user() to ADD_HDR()

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>
www/url_handlers.c: Convert admin_list_users() to ADD_HDR()

Signed-off-by: Andrew Clayton <andrew@opentechlabs.co.uk>