►
Description
Stressed about patron credentials? You can rest easy with this week's hack. Christopher shows how to add a couple of quick reset buttons for patron credentials using Koha REST API. This video shows off a tool which allows you to grab information that isn't normally available on the page you are modifying, without relying on public reports. This is definitely a video worth checking out.
Referenced code: https://wiki.koha-community.org/wiki/JQuery_Library#Quick_Credential_Reset
Other Resources:
https://demo.bibkat.no/api/v1/.html
https://wiki.koha-community.org/wiki/JQuery_Library#Quick_Credential_Reset
Music: https://www.bensound.com
A
Today,
we're
going
to
be
talking
about
some
quick
reset
buttons
for
user
credentials
before
we
get
into
that.
Let
me
go
ahead
and
share
my
screen
and
remind
everybody
that
we
are
hosted
by
kohai
us
and
we
are
now
officially
passed
our
2021
conference,
but
the
link
is
still
available
on
the
website.
You
can
access
all
the
great
information
that
was
presented
this
last
week
on
that
page.
We
have
links
to
the
videos
and
many
notes.
A
A
A
B
Yes,
we
have,
we
don't
have
a
default
for
the
whole
system,
each
library
kind
of
creates
a
password
and
username
based
on
the
rules
or
the
you
know
what
they
do:
the
procedures
at
each
individual
library.
So
we
don't
have
we.
I
can't
put
a
button
in
there
that
really
resets
credentials
to
default,
because
there
is
no
system
wide
default.
I
could
easily
do
a
button
that
clears
those
boxes,
but
a
reset
to
default
can't
be
done
because
the
default
doesn't
exist.
A
So
this
this
works
well
for,
in
this
case,
for
a
library
or
libraries
that
are
consistent
across
the
libraries
with
their
credentials
for
you,
what
we
can
do
after
we
go
through
this,
is
we
can
you?
Maybe
you
can
show
us
what
you.
B
I'll
show
you
what
I
do
do,
which
is
on
the
add
and
edit
page
for
patrons
for
borrowers.
So
all
right.
A
A
B
A
A
B
A
Grabbing
the
value
and
storing
it
in
a
variable,
and
then
we
have
another
variable
here.
This
is
actually
we
were
talking
about
this
a
little
bit.
I
forgot
that
we
are
actually
using
rest
api.
I've
talked
about
this
a
little
bit
at
the
conference,
but
we're
actually
using
rest
api
to
grab
some
patron
information.
A
You
can
do
this
on
the
staff
side,
it's
very
very
limited
on
the
opac
side,
but
you
can
do
this
on
the
staff
side.
You
can
grab
information
without
having
to
depend
on
a
report,
usually
anything
that
I
that
I
grab
information
for
in
my
in
my
modifications
was
based
off
of
get
jason
to
to
grab
information
off
a
report.
It
relies
on
a
report
that
has
to
exist.
So
if
that
report
gets
deleted,
then
the
the
modification
doesn't
work.
A
I
will
provide
a
link
to
the
rest,
api
documentation,
the
documentation's,
a
little
sparse
as
far
as
explanation,
but
hopefully
between
this
example,
which
will
be
posted
in
the
wiki
and
that
documentation
you'll
be
able
to
figure
some
things
out.
I
learned
how
to
do
my
initial
setup
on
this
by
talking
with
a
member
of
the
bywater
staff,
so
we're
we're
we're
supported
by
bywater,
and
so
luke
actually
gave
me
some
assistance
in
doing
this
for
the
first
time,
but
essentially
how
this
works
is.
A
You've
got
a
variable
set
up
with
it
you're
setting
up
a
url,
that's
pointing
to
the
rest
api
and
you,
you
are
grabbing
the
patron
id
and
plugging
in
that
id
from
the
variable
that
we
just
created
the
user
borrower
number
right,
plugging
that
in
so
it's
it's
combining
that
with
this
url
and
then
so.
A
Basically,
it's
just
saying:
go
to
this
url
and
grab
this
information
from
the
patreon
with
the
patreon
id
of
this
borrower
number
and
it
is
putting
that
into
an
array
called
patron
info
array
and
our
editor
always
complains
about
the
select
command
it
works.
But
I
don't
know,
I
don't
know
why
it's
it's,
it's
just
a
warning
about
the
the
let
command,
but
the
lat
command
does
work
against
using
ajax
to
grab
that
information.
It's
making
sure
that
it's
not
doing
asynchronous
grabbing.
A
So
it's
not
like
getting
ahead
of
itself
and
it's
plugging
it's
here's.
Where,
in
the
array,
I
tell
it
what
pieces
of
information
that
I
want.
So
I
want
the
first
name
and
I
want
this.
The
surname
and
I
want
the
the
card
number
you
can
find
out
all
the
fields.
Basically,
you
can
get
everything
you
want
from
the
borrowers
table,
but
you
want
to
refer
to
the
the
rest
api
documentation.
A
It'll
tell
you
when
you're
going
for
this,
this
patron
table
and
you're
looking
up
the
patron
by
patron
id,
what
information
you
can
grab
from
that,
but
basically
it
is
the
borrower's
table.
A
A
When
you
click
it,
it
is
going
to
input
on
the
new
user
id
it's
inputting,
the
second
or
the
number
two
spot.
So
I
think
the
the
array
is.
B
A
B
A
The
first
name
would
be
zero
surname
one
and
card
number,
two
and
so
card
number
two
is
what
or
the
array
number
two
is
what
I'm
using
here
to
plug
in
a
value
for
that
field:
the
new
user
id
field
so.
A
This
new
user
id
is
what
we're
giving
value
to
and
then
the
password
so
yeah,
so
our
library
we're
using
the
user.
The
username
is
by
default,
the
the
card
number.
There
are
a
few
cases,
especially
with
staff,
where
we
don't
do
that.
We
were
a
little
bit
more
specific
on
usernames
and
passwords
in
general.
A
B
A
B
A
A
A
They
forget
what
their
their
password
is,
or
we
have
a
staff
member
that
that
didn't
set
the
the
password
correctly
the
first
time,
so
we
can
easily
go
in
there
and
set
those
if
we
have
a
staff
account
that
was
set
up.
They
don't
use
the
the
defaults,
and
so
if
they
ever
leave
the
library
they
stop
working
for
the
library
we
go
into
their
account
and
we
hit
the
reset
credentials.
So
they're
set
up
like
any
other
patron
right.
B
B
B
I've
got
two
buttons
on
the
create
page
that
say,
use
the
library
card
number
for
the
username
or
use
firstname.lastname,
which
is
another
option,
that's
popular
at
our
different
libraries
and
then
for
password.
I've
got
a
button
that
clears
the
password,
but
then
we've
got
use
last
name
or
use
the
last
four
digits
of
the
phone
or
use
birth
date
without
the
slash
marks
or
use
the
name
of
the
town
they're
in
that
the
library
is
in,
in
lower
case
letters
with
the
patrons
hometown
on
all
lowercase
letters.
That's
another
one!
B
That's
really
popular
and
I've
never
put
them
over
into
the
change
password
area,
because
just
using
simple
jquery,
where
I'm
getting
all
that
information
from
when
I
created
those
buttons
isn't
from
the
rest
api,
it's
just
values
in
those
other
fields
on
the
table
and
since
those
values
don't
appear
on
this
page,
I've
never
thought
of
putting
them
there.
But
with
the
rest
api.
I
would
be
able
to
do
that
because
the
borrower
number
is
embedded
in
the
the
page.
B
It's
right
up
here,
and
so
I
would
be
able
to
use
rest
api
to
create
a
button
that
says
you
know,
use
new
username,
make
it
the
first
name,
dot
last
name
or
make
it
the
card
number,
and
I
would
be
able
to
do
another
one.
That
says
you
know
I
would
be
able
to
recreate
those
same
four,
because
using
the
rest,
api
would
be
able
to
grab
the
phone
number
or
the
hometown
or
the
birthdate
or
any
of
those
things
that
are
in
the
patreon
record.
B
So
I
think
what
we
should
do
is.
I
should
go.
B
A
A
And
I
I
think
that
if
we
can,
you
know
we'll,
of
course
you
know,
have
the
resources
linked
to
this
video,
but
I
I
think
that
it
would
be
a
great
idea
to
follow
up
with
more
rest
api
information
so
that
we
can
show
off
more
of
how
we
accomplish
these
things.
So
we
can
get
more
exposure
to
rest
api.
It's
a
great
tool.
A
A
Why
not
sure
all
right?
Well,
thanks
george
for
sharing,
and
we
look
forward
to
seeing
what
you
accomplish
with
the
rest,
api.
B
Yeah,
cool
I'll,
let
you
know
when
I've
got
it
done,
so
we
can
record
part
two
of
this
all
right
until
then,
bye
everybody,
bye.