WebSession: fix mail cookie expiration

* Fixes an issue with mail cookie activation link expiring in
  1 day instead of using the value defined by
  CFG_WEBSESSION_ADDRESS_ACTIVATION_EXPIRE_IN_DAYS.
  (closes #1596)

Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>
Reviewed-by: Tibor Simko <tibor.simko@cern.ch>
Merge branch 'maint-1.0' into maint-1.1

* maint-1.0:
  WebSession: fix mail cookie expiration
Merge branch 'maint-1.1'

* maint-1.1:
  WebSession: fix mail cookie expiration
installation: fix for rnkDOWNLOADS upgrade recipe

* Adds upgrade recipe `invenio_2013_06_11_rnkDOWNLOADS_file_format`
  to tabcreate.

Signed-off-by: Tibor Simko <tibor.simko@cern.ch>
BibIndex: centralisation of synonym treatment

* Removes CFG_BIBINDEX_SYNONYM_KBRS variable and moves the per-index
  synonym definitions to the database.  Adapts BibIndex Admin
  interface accordingly.  (addresses #852)

Co-authored-by: Grzegorz Szpura <grzegorz.szpura@cern.ch>
Signed-off-by: Grzegorz Szpura <grzegorz.szpura@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
BibIndex: centralisation of stopword treatment

* Moves CFG_BIBINDEX_REMOVE_STOPWORDS to database to idxINDEX table.
  Adapts admin interface accordingly.  (addresses #852)

* Additionally, fixes a small bug for modifysynonymkb function
  in the BibIndex Admin interface.

Signed-off-by: Grzegorz Szpura <grzegorz.szpura@cern.ch>
Co-authored-by: Patrick Glauner <patrick.oliver.glauner@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
BibIndex: centralisation of LaTeX/HTML treatment

* Moves CFG_BIBINDEX_LATEX_MARKUP, CFG_BIBINXED_HTML_MARKUP
  to the database to the idxINDEX table.  Adapts admin interface.
  (addresses #852)

Signed-off-by: Grzegorz Szpura <grzegorz.szpura@cern.ch>
Co-authored-by: Patrick Glauner <patrick.oliver.glauner@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
BibIndex: new regression tests

* Adds tests for remove_stopwords, remove_html_markup, remove_latex_markup.

* Refactors other tests in bibindexadmin_regression_tests.py.

Signed-off-by: Grzegorz Szpura <grzegorz.szpura@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
BibIndex: centralisation of tokenizers

* Introduces tokenizers for journal, year, fulltext and authorcount indexes.
  Merges old tokenizing functions for pairs, phrases and words into
  one 'BibIndexDefaultTokenizer'.  Introduces empty tokenizer.
  Extends admin interface to support tokenizers.  (closes #852)

Signed-off-by: Grzegorz Szpura <grzegorz.szpura@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
BibIndex: pluginutils for tokenizers

* CFG_BIBINDEX_PATH_TO_STOPWORDS_FILE now is a
  CFG_BIBRANK_PATH_TO_STOPWORDS_FILE.
* Indexes have their own path to stopwords file.
* Tokenizers are loaded with pluginutils.
  (references #852)

Signed-off-by: Grzegorz Szpura <grzegorz.szpura@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
BibIndex: support for CJK languages

* Introduces new tokenizer: BibIndexCJKTokenizer.
* Adds CJK search support in search_unit in search_engine.
  (closes #285)

Signed-off-by: Grzegorz Szpura <grzegorz.szpura@cern.ch>
Reviewed-by: Tibor Simko <tibor.simko@cern.ch>
BibAuthority: initial release

* BibAuthority: New module containing utility functions,
  configuration and tests.  Adds demo records and new
  index tables.  Adds HowTo guides for admin and hacking pages.
  (closes #1602)

* BibIndex: When indexing authority-controlled subfields
  of bibliographic records, enrich the index with terms
  from a configurable list of subfield values from the
  referenced authority record.

* BibIndex: When looking for recently changed bibliographic
  records to re-index for a given authority-controlled subfield,
  reindex all bibliographic records that contain references
  towards recently updated authority records, even if the
  bibliographic records in questions have not been recently updated.

* BibFormat: Simple HTML for authority record.  Links for
  browsing between dependent authority and bibliographic
  records.

* Other modules: some modifications in other modules as well.

Co-authored-by: Grzegorz Szpura <grzegorz.szpura@cern.ch>
Signed-off-by: Grzegorz Szpura <grzegorz.szpura@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
installation: fix for BibAuthority upgrade recipe

* Adds upgrade recipe `invenio_2013_08_20_bibauthority_updates`
  to tabcreate.

Signed-off-by: Tibor Simko <tibor.simko@cern.ch>
WebSearch: support for intbitset output format

* Adds support for a new output format in
  perform_request_search() function: the intbitset format.
  This format returns an intbitset representation of the
  result.  This means that the result is neither sorted nor
  ranked.  (closes #1460)

* Adds regression tests for of=intbitset.

* Also, fixes the fact that sorting no longer takes into
  account jrec and rg arguments, introduced in
  commit 0e6556031992aeb9229b722f4732b9550e8a28cb.

* Fixes typo in `get_tags_form_sort_fields` function name.

Reviewed-by: Tibor Simko <tibor.simko@cern.ch>
BibUpload: fix for inserts with 005

* In case 005 is present when inserting a new record use that to
  timestamp a record history.
  (fixes #1595)

Signed-off-by: Samuele Kaplun <samuele.kaplun@cern.ch>
Reviewed-by: Tibor Simko <tibor.simko@cern.ch>
WebSearch: fix for hidden-field admin access test

Signed-off-by: Tibor Simko <tibor.simko@cern.ch>
BibIndex: fix syntax error in bibstat

Reviewed-by: Tibor Simko <tibor.simko@cern.ch>
WebStyle: debug-toolbar display condition fix

* The Flask debug-toolbar is shown iff it is added in CFG_DEVEL_TOOLS and
  CFG_DEVEL_SITE == 9 (shown to ALL users), or the current user is super
  admin (regardless of CFG_DEVEL_SITE).

Signed-off-by: Adrian Tudor Panescu <adrian.tudor.panescu@cern.ch>
Reviewed-by: Jiri Kuncar <jiri.kuncar@cern.ch>
BibFormat: better BibTeX title and collaboration

* Adds braces around title.

* Adds collaboration.

Signed-off-by: Patrick Glauner <patrick.oliver.glauner@cern.ch>
Reviewed-by: Tibor Simko <tibor.simko@cern.ch>
BibSword: author MARC tag definition fix

Signed-off-by: Tibor Simko <tibor.simko@cern.ch>