Bugzilla – Attachment 56630 Details for
Bug 17459
Add a script to create a superlibrarian user
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17459: Add a script to create a superlibrarian user
Bug-17459-Add-a-script-to-create-a-superlibrarian-.patch (text/plain), 2.52 KB, created by
Chris Cormack
on 2016-10-18 19:58:31 UTC
(
hide
)
Description:
Bug 17459: Add a script to create a superlibrarian user
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2016-10-18 19:58:31 UTC
Size:
2.52 KB
patch
obsolete
>From be75afa180d8c8c6d7eb06a67d6c68282bb06e3c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 17 Oct 2016 18:01:07 +0100 >Subject: [PATCH] Bug 17459: Add a script to create a superlibrarian user > >This is for developers: it's quite long (many clics) to create a new >superlibrarian user. >This new script creates a new user with superlibrarian permissions with >the easy to remember credential koha/koha > >Test plan: > perl misc/devel/create_superlibrarian.pl >Log in to Koha using koha/koha > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >--- > misc/devel/create_superlibrarian.pl | 49 +++++++++++++++++++++++++++++++++++++ > 1 file changed, 49 insertions(+) > create mode 100644 misc/devel/create_superlibrarian.pl > >diff --git a/misc/devel/create_superlibrarian.pl b/misc/devel/create_superlibrarian.pl >new file mode 100644 >index 0000000..3c8dc5d >--- /dev/null >+++ b/misc/devel/create_superlibrarian.pl >@@ -0,0 +1,49 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Copyright 2016 Koha Development Team >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+ >+use Modern::Perl; >+ >+use C4::Installer; >+use C4::Context; >+use C4::Members; >+ >+use Koha::DateUtils; >+use Koha::Libraries; >+use Koha::Patrons; >+use Koha::Patron::Categories; >+ >+my $library = Koha::Libraries->search->next; >+my $patron_category = Koha::Patron::Categories->search->next; >+ >+die "Not enough data in the database, library and/or patron category does not exist" >+ unless $library and $patron_category; >+ >+die "A patron with userid 'koha' already exists" if Koha::Patrons->find( { userid => 'koha' } ); >+die "A patron with cardnumber '42' already exists" if Koha::Patrons->find( { cardnumber => 'koha' } ); >+ >+AddMember( >+ surname => 'koha', >+ userid => 'koha', >+ cardnumber => 42, >+ branchcode => $library->branchcode, >+ categorycode => $patron_category->categorycode, >+ password => 'koha', >+ flags => 1, >+); >-- >2.9.3
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17459
:
56608
|
56630
|
56631
|
56632
|
56670
|
56671
|
56814
|
56815