3 # koha-reset-passwd -- reset password for a user in a Koha instance
4 # Copyright 2010 Catalyst IT, Ltd
5 # Copyright 2019 Theke Solutions
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
23 # include helper functions
24 if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then
25 .
"/usr/share/koha/bin/koha-functions.sh"
27 echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2
35 Resets the password for the specified user on the Koha instance.
37 Usage: $scriptname instancename userid
39 Note: The generated password will be printed.
48 # Optionally use alternative paths for a dev install
49 adjust_paths_dev_install
$1
51 if [ "$DEV_INSTALL" = "" ]; then
52 KOHA_BINDIR
=$KOHA_HOME/bin
54 KOHA_BINDIR
=$KOHA_HOME/misc
57 if sudo
-u "$instancename-koha" -H \
58 env PERL5LIB
=$PERL5LIB \
59 KOHA_CONF
="/etc/koha/sites/$instancename/koha-conf.xml" \
60 $KOHA_BINDIR/admin
/set_password.pl
--userid $userid ; then
70 die
"Wrong parameters"
78 set_password
$instance $userid