bibdocfile: fix parsing of complex subformats

* In case of files with complex subformats, e.g.
  foo.jpg;180x30;1, correctly parses the subformat.
BibSched: fix guess_apache_process_user_from_ps

* guess_apache_process_user_from_ps was mistakenly returning
  process names instead of user names. This is now fixed.

* Improves the corresponding regular expression to ignore
  strings such as "<defunct>" that might appear on "ps"
  output.

Co-authored-by: Ludmila Marian <ludmila.marian@gmail.com>
WebAccess: fix Access policy page

* When CFG_ACCESS_CONTROL_LEVEL_SITE was set to the valid value
  of 3 or CFG_ACCESS_CONTROL_LEVEL_ACCOUNTS was set to the valid
  value of 5, accessing the Access policy page of WebAccess Admin
  interface would have caused an unhandled exception. This is now
  fixed.  Thanks to Alexander Wagner for reporting the problem.
  (closes #656)
WebSubmit: fix handling of uploaded files

* Uploading a file when switching between two submission form pages,
  no longer triggers an endless loop.

* Uploading a huge file in the last submission page no longer
  fills up all the memory.
BibEdit: fix crash in Ajax request
bibdocfile: fix documentation WRT --with-version

* --hard-delete CLI option was not handling correctly
  the --with-version option, in particular when
  multiple versions were specified or when 'all' is
  specified. Now only one version is explicitly
  accepted and the documentation has been improved.
WebStyle: fix implementation of req.get_hostname

* In the SimulatedModPythonRequest class used to simulate
  a mod_python request object, the implementation of
  the get_hostname method was wrong and causing an
  un handled exception. This is now fixed.

Co-authored-by: Joe Blaylock <jrbl@slac.stanford.edu>
BibCirculation: security check before eval

* Creates looks_like_dictionary helper function with regular
  expression and uses it before every eval to make sure about
  goodness of eval arguments.
BibCirculation: fix regexp for dictionary checking

* Amends DICC_REGEXP to also match strings like
  "l'entreprise" and not only 'foo bar'.
BibUpload: FFT regression tests not to use CDS

* FFT regression tests are now no longer referring to physical
  files on the CERN Document Server, as this server can be
  changed independently of Invenio releases. (closes #504)

* Merge note: cherry-picked from 16cb428df9e6d57c9c1f67a2fe0fdc7cd2161631
  and amended in several places to fit v1.0 release series.
Merge branch 'maint-1.0'

* maint-1.0:
  BibUpload: FFT regression tests not to use CDS
  BibCirculation: fix regexp for dictionary checking
  BibCirculation: security check before eval
  WebStyle: fix implementation of req.get_hostname
  bibdocfile: fix documentation WRT --with-version
  BibEdit: fix crash in Ajax request
  WebSubmit: fix handling of uploaded files
  WebAccess: fix Access policy page
  BibSched: fix guess_apache_process_user_from_ps
  bibdocfile: fix parsing of complex subformats
  bibdocfile: add missing normalize_format() calls
  bibdocfile: fix cli_set_batch function
  WebAccess: fix FireRole handling integer uid
  bibdocfile: fix append WRT description/restriction
  intbitset: fix several memory leaks
  intbitset: fix never ending loop in __repr__
  bibdocfile: fix handling of embargo firerole rule
bibdocfile: check_bibdoc_authorization caseless

* check_bibdoc_authorization will now retrieve the type of
  restriction in a caseless way, so that "Role: ", "role: ", "ROLE:"
  are all "role" types of restriction. (closes #452)
Merge branch 'maint-1.0'

* maint-1.0:
  bibdocfile: check_bibdoc_authorization caseless
WebSession: improve session handling

* Do not save the session in case it does not have a session
  id (e.g. during regression tests).

* Do not create a session if not within a real HTTP request.
BibRank: make numpy optional

* If numpy is not installed, the execution of citerank methods
  will not crash, but only print a message informing the admin
  about the missing import. (closes #478)

* Also, the citerank tests will not run if numpy is not installed.
WebAccess: fix retrieving emails from firerole

* Fix acc_get_authorize_emails() to return the email list instead of
  an empty set.

* Fix acc_firerole_extract_emails() to return the egroup email address
  also.
BatchUploader: fix retrieval of recs from extoaiid

* Does necessary corrections in order to treat the result of
  find_records_from_extoaiid() as an intbitset and not a recid.
  (closes #621)
WebSubmit: fix record_search_pattern in DEMOJRN

* The check on the report number format introduced as an example in
  DEMOJRN was using a variable stored locally, that was not available
  when calling the MBI submission via a direct link; this is why
  it is changed to a check that does not require this variable.
  (closes #599)
WebAlert: fix the display of records in alerts

* In order to display the records in alerts, the CFG_SITE_NAME will
  be used as collection name, in case no better guessing of the
  collection of a record was possible.
WebSearch: fix get_fieldvalues() when recid is str

* recid might be string, so try to convert it to int in the get_fieldvalues
  function (needed for WebSubmit, major user of this function, which calls it
  in many different places with a string argument instead of int).

* Add test case to be sure that we do not remove this conversion
  in the future.