Bug 6516 - Make borrowernumber of staff user configurable in koha-create
Sets the default borrowernumber of staff user to 1 and makes it possible to override this with ADMINUSER in /etc/koha/koha-sites.conf or with the --adminuser and -a command line options. Remember to update the wiki if this gets pushed! Signed-off-by: Robin Sheat <robin@catalyst.net.nz> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
parent
a57b692a60
commit
8d8d2e6b44
|
|
@ -23,7 +23,7 @@ usage="Usage: $0 [--create-db|--request-db|--populate-db] \
|
|||
[--marcflavor marc21|normarc|unimarc] \
|
||||
[--zebralang en|nb|fr] \
|
||||
[--defaultsql /path/to/some.sql] \
|
||||
[--configfile /path/to/config] instancename"
|
||||
[--configfile /path/to/config] [--adminuser n] instancename"
|
||||
|
||||
die() {
|
||||
echo "$@" 1>&2
|
||||
|
|
@ -79,14 +79,15 @@ INTRASUFFIX=""
|
|||
DEFAULTSQL=""
|
||||
ZEBRA_MARC_FORMAT="marc21"
|
||||
ZEBRA_LANGUAGE="en"
|
||||
ADMINUSER="1"
|
||||
if [ -e /etc/koha/koha-sites.conf ]
|
||||
then
|
||||
. /etc/koha/koha-sites.conf
|
||||
fi
|
||||
|
||||
[ $# -ge 2 ] && [ $# -le 10 ] || die $usage
|
||||
[ $# -ge 2 ] && [ $# -le 12 ] || die $usage
|
||||
|
||||
TEMP=`getopt -o crpm:l:d:f: -l create-db,request-db,populate-db,marcflavor:,zebralang:,defaultsql:,configfile: \
|
||||
TEMP=`getopt -o crpm:l:d:f:a: -l create-db,request-db,populate-db,marcflavor:,zebralang:,defaultsql:,configfile:,adminuser: \
|
||||
-n "$0" -- "$@"`
|
||||
|
||||
# Note the quotes around `$TEMP': they are essential!
|
||||
|
|
@ -96,6 +97,7 @@ eval set -- "$TEMP"
|
|||
CLO_ZEBRA_MARC_FORMAT=""
|
||||
CLO_ZEBRA_LANGUAGE=""
|
||||
CLO_DEFAULTSQL=""
|
||||
CLO_ADMINUSER=""
|
||||
|
||||
while true ; do
|
||||
case "$1" in
|
||||
|
|
@ -106,6 +108,7 @@ while true ; do
|
|||
-l|--zebralang) CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;;
|
||||
-d|--defaultsql) CLO_DEFAULTSQL="$2" ; shift 2 ;;
|
||||
-f|--configfile) configfile="$2" ; shift 2 ;;
|
||||
-a|--adminuser) CLO_ADMINUSER="$2" ; shift 2 ;;
|
||||
--) shift ; break ;;
|
||||
*) die "Internal error processing command line arguments" ;;
|
||||
esac
|
||||
|
|
@ -135,6 +138,10 @@ if [ "$CLO_DEFAULTSQL" != "" ]
|
|||
then
|
||||
DEFAULTSQL="$CLO_DEFAULTSQL"
|
||||
fi
|
||||
if [ "$CLO_ADMINUSER" != "" ]
|
||||
then
|
||||
ADMINUSER="$CLO_ADMINUSER"
|
||||
fi
|
||||
|
||||
name="$1"
|
||||
|
||||
|
|
@ -264,7 +271,7 @@ then
|
|||
USE \`$mysqldb\`;
|
||||
UPDATE borrowers
|
||||
SET password = '$staffdigest'
|
||||
WHERE borrowernumber = 3;
|
||||
WHERE borrowernumber = $ADMINUSER;
|
||||
eof
|
||||
#`
|
||||
echo "staff user password is '$staffpass' but keep that secret"
|
||||
|
|
|
|||
Loading…
Reference in New Issue