From 11de99d31b0f3e829aedc0b30c887acca1cd62df Mon Sep 17 00:00:00 2001 From: Frank Bergkemper Date: Tue, 25 Nov 2014 14:38:44 +0000 Subject: [PATCH] Authentication and Session Handling --- .gitignore | 3 + AUTHORS.txt => AUTHORS | 0 CONTRIBUTE.md | 38 --- LICENSE.txt => LICENSE | 237 +++++++++++++- Makefile.am | 8 +- Makefile.in | 12 +- README.md | 32 +- composer.json | 3 +- composer.json.dev | 18 -- composer.phar | Bin 1016876 -> 1054749 bytes config/application.config.php | 20 +- config/autoload/.gitignore | 2 - config/autoload/global.php | 235 +++++++++++++- config/autoload/local.php.dist | 72 ----- configure | 71 +++- configure.ac | 10 +- debian/control | 2 +- debian/copyright | 3 +- debian/docs | 5 + debian/postinst | 5 + debian/rules | 2 +- doc/INSTALL.md | 265 +++++++++++++++ doc/README.md | 1 - doc/developers/README-GIT.md | 72 ----- doc/install/INSTALL.md | 163 ---------- init_autoloader.php | 9 +- install/apache/bareos-webui.conf | 86 ++--- install/bareos/bareos-webui.conf | 24 ++ install/directors.ini | 72 +++++ module/Admin/config/module.config.php | 2 +- .../src/Admin/Controller/AdminController.php | 2 +- module/Admin/src/Admin/Model/Admin.php | 2 +- module/Admin/src/Admin/Model/AdminTable.php | 2 +- module/Admin/view/admin/admin/index.phtml | 2 +- module/Admin/view/admin/admin/roles.phtml | 2 +- module/Admin/view/admin/admin/users.phtml | 2 +- module/Application/Module.php | 102 +++++- module/Application/config/module.config.php | 192 +++++------ .../Controller/IndexController.php | 2 +- .../src/Application/View/Helper/Bytes.php | 2 +- .../src/Application/View/Helper/Date.php | 2 +- .../Application/View/Helper/Expiration.php | 2 +- .../View/Helper/HumanReadableTimeperiod.php | 2 +- .../Application/View/Helper/JobDuration.php | 2 +- .../src/Application/View/Helper/JobLevel.php | 2 +- .../src/Application/View/Helper/JobStatus.php | 2 +- .../src/Application/View/Helper/JobType.php | 2 +- .../src/Application/View/Helper/Retention.php | 2 +- .../View/Helper/StatusGlyphicons.php | 2 +- .../view/application/index/index.phtml | 5 +- module/Application/view/error/404.phtml | 2 + module/Application/view/error/index.phtml | 3 + module/Application/view/layout/error.phtml | 71 ++++ module/Application/view/layout/install.phtml | 2 +- module/Application/view/layout/layout.phtml | 29 +- module/Application/view/layout/login.phtml | 85 +++++ module/Auth/Module.php | 50 +++ module/Auth/autoload_classmap.php | 26 ++ module/Auth/config/module.config.php | 59 ++++ .../src/Auth/Controller/AuthController.php | 148 +++++++++ module/Auth/src/Auth/Form/LoginForm.php | 101 ++++++ module/Auth/src/Auth/Model/Auth.php | 82 +++++ .../Auth/view/auth/auth/index.phtml | 0 module/Auth/view/auth/auth/login.phtml | 57 ++++ module/Auth/view/auth/auth/logout.phtml | 0 module/Client/Module.php | 5 +- .../Client/Controller/ClientController.php | 75 +++-- .../Client/src/Client/Model/ClientTable.php | 6 +- module/Dashboard/config/module.config.php | 2 +- .../Controller/DashboardController.php | 31 +- .../src/Dashboard/Model/Dashboard.php | 2 +- .../src/Dashboard/Model/DashboardTable.php | 2 +- .../view/dashboard/dashboard/index.phtml | 2 +- module/Director/Module.php | 8 +- module/Director/config/module.config.php | 2 +- .../Controller/DirectorController.php | 112 ++++--- .../Director/src/Director/Model/Director.php | 2 +- .../src/Director/Model/DirectorTable.php | 2 +- .../view/director/director/index.phtml | 2 +- .../view/director/director/messages.phtml | 2 +- .../view/director/director/schedule.phtml | 2 +- .../director/director/schedulerstatus.phtml | 2 +- .../view/director/director/version.phtml | 2 +- .../src/File/Controller/FileController.php | 48 +-- module/File/src/File/Model/File.php | 2 +- module/File/src/File/Model/FileTable.php | 2 +- module/Fileset/Module.php | 5 +- module/Fileset/config/module.config.php | 2 +- .../Fileset/Controller/FilesetController.php | 75 +++-- module/Fileset/src/Fileset/Model/Fileset.php | 2 +- .../src/Fileset/Model/FilesetTable.php | 22 +- .../view/fileset/fileset/details.phtml | 2 +- .../Fileset/view/fileset/fileset/index.phtml | 2 +- module/Install/config/module.config.php | 2 +- .../Install/Controller/InstallController.php | 104 ++++-- module/Install/src/Install/Model/Install.php | 6 +- .../src/Install/Model/InstallTable.php | 8 +- .../Install/view/install/install/index.phtml | 2 +- .../Install/view/install/install/test.phtml | 33 +- module/Job/Module.php | 13 +- module/Job/config/module.config.php | 2 +- .../Job/src/Job/Controller/JobController.php | 304 ++++++++++-------- module/Job/src/Job/Model/Job.php | 12 +- module/Job/src/Job/Model/JobTable.php | 48 +-- module/Job/view/job/job/cancel.phtml | 2 +- module/Job/view/job/job/details.phtml | 50 +-- module/Job/view/job/job/index.phtml | 4 +- module/Job/view/job/job/rerun.phtml | 2 +- module/Job/view/job/job/running.phtml | 2 +- module/Job/view/job/job/successful.phtml | 2 +- module/Job/view/job/job/timeline.phtml | 2 +- module/Job/view/job/job/unsuccessful.phtml | 2 +- module/Job/view/job/job/waiting.phtml | 2 +- module/Log/Module.php | 13 +- module/Log/config/module.config.php | 2 +- .../Log/src/Log/Controller/LogController.php | 83 +++-- module/Log/src/Log/Model/LogTable.php | 8 +- module/Log/view/log/log/details.phtml | 2 +- module/Log/view/log/log/index.phtml | 2 +- module/Log/view/log/log/job.phtml | 2 +- module/Media/Module.php | 5 +- module/Media/config/module.config.php | 2 +- .../src/Media/Controller/MediaController.php | 60 ++-- module/Media/src/Media/Model/Media.php | 2 +- module/Media/src/Media/Model/MediaTable.php | 32 +- module/Media/view/media/media/details.phtml | 2 +- module/Media/view/media/media/index.phtml | 2 +- module/Pool/Module.php | 5 +- module/Pool/config/module.config.php | 2 +- .../src/Pool/Controller/PoolController.php | 75 +++-- module/Pool/src/Pool/Model/Pool.php | 2 +- module/Pool/src/Pool/Model/PoolTable.php | 14 +- module/Pool/view/pool/pool/details.phtml | 2 +- module/Pool/view/pool/pool/index.phtml | 2 +- module/Restore/config/module.config.php | 2 +- .../Restore/Controller/RestoreController.php | 2 +- module/Restore/src/Restore/Model/Restore.php | 2 +- .../src/Restore/Model/RestoreTable.php | 2 +- .../Restore/view/restore/restore/index.phtml | 2 +- module/Statistics/Module.php | 11 +- module/Statistics/config/module.config.php | 2 +- .../Controller/StatisticsController.php | 136 ++++---- .../src/Statistics/Model/Statistics.php | 2 +- .../src/Statistics/Model/StatisticsTable.php | 2 +- .../statistics/statistics/backupjob.phtml | 2 +- .../view/statistics/statistics/catalog.phtml | 2 +- .../view/statistics/statistics/client.phtml | 2 +- .../view/statistics/statistics/index.phtml | 2 +- .../view/statistics/statistics/stored.phtml | 2 +- module/Storage/Module.php | 5 +- module/Storage/config/module.config.php | 2 +- .../Storage/Controller/StorageController.php | 103 +++--- module/Storage/src/Storage/Model/Storage.php | 2 +- .../src/Storage/Model/StorageTable.php | 8 +- .../view/storage/storage/autochanger.phtml | 2 +- .../view/storage/storage/details.phtml | 2 +- .../Storage/view/storage/storage/index.phtml | 2 +- module/User/config/module.config.php | 2 +- .../src/User/Controller/UserController.php | 2 +- module/User/src/User/Model/User.php | 2 +- module/User/src/User/Model/UserTable.php | 2 +- module/User/view/user/user/index.phtml | 2 +- packaging/obs/bareos-webui.dsc | 2 +- packaging/obs/bareos-webui.spec | 33 +- public/css/style.css | 9 + .../Controller/IndexControllerTest.php | 2 +- .../Controller/IndexControllerTest.php | 2 +- tests/ClientTest/Model/ClientTableTest.php | 2 +- .../Controller/IndexControllerTest.php | 2 +- .../Controller/IndexControllerTest.php | 2 +- .../Controller/IndexControllerTest.php | 2 +- tests/FileTest/Model/FileTableTest.php | 2 +- .../Controller/IndexControllerTest.php | 2 +- tests/FilesetTest/Model/FilesetTableTest.php | 2 +- .../Controller/IndexControllerTest.php | 2 +- tests/JobTest/Model/JobTableTest.php | 2 +- .../Controller/IndexControllerTest.php | 2 +- tests/LogTest/Model/LogTableTest.php | 2 +- .../Controller/IndexControllerTest.php | 2 +- tests/MediaTest/Model/MediaTableTest.php | 2 +- .../Controller/IndexControllerTest.php | 2 +- tests/PoolTest/Model/PoolTableTest.php | 2 +- .../Controller/IndexControllerTest.php | 2 +- .../Controller/IndexControllerTest.php | 2 +- .../Controller/IndexControllerTest.php | 2 +- tests/StorageTest/Model/StorageTableTest.php | 2 +- .../Controller/IndexControllerTest.php | 2 +- .../library/Bareos/BSock/BareosBSock.php | 52 ++- .../Bareos/Db/Sql/BareosSqlCompatHelper.php | 8 +- 189 files changed, 2944 insertions(+), 1377 deletions(-) rename AUTHORS.txt => AUTHORS (100%) delete mode 100644 CONTRIBUTE.md rename LICENSE.txt => LICENSE (77%) delete mode 100644 composer.json.dev delete mode 100644 config/autoload/local.php.dist create mode 100644 debian/docs create mode 100644 debian/postinst mode change 100755 => 100644 debian/rules create mode 100644 doc/INSTALL.md delete mode 100644 doc/README.md delete mode 100644 doc/developers/README-GIT.md delete mode 100644 doc/install/INSTALL.md create mode 100644 install/bareos/bareos-webui.conf create mode 100644 install/directors.ini create mode 100644 module/Application/view/layout/error.phtml create mode 100644 module/Application/view/layout/login.phtml create mode 100644 module/Auth/Module.php create mode 100644 module/Auth/autoload_classmap.php create mode 100644 module/Auth/config/module.config.php create mode 100644 module/Auth/src/Auth/Controller/AuthController.php create mode 100644 module/Auth/src/Auth/Form/LoginForm.php create mode 100644 module/Auth/src/Auth/Model/Auth.php rename CHANGELOG.md => module/Auth/view/auth/auth/index.phtml (100%) create mode 100644 module/Auth/view/auth/auth/login.phtml create mode 100644 module/Auth/view/auth/auth/logout.phtml diff --git a/.gitignore b/.gitignore index 2659611c..288efc3e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ composer.lock +config.ini +*.swp +*.cache diff --git a/AUTHORS.txt b/AUTHORS similarity index 100% rename from AUTHORS.txt rename to AUTHORS diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md deleted file mode 100644 index b3732816..00000000 --- a/CONTRIBUTE.md +++ /dev/null @@ -1,38 +0,0 @@ -## CONTRIBUTE - -As a free software project, we are very open to your contributions. You don't need developer -skills to help, there are several ways to get involved into the project. - -### Localization - -For localization, the Bareos Web-Frontend uses Gettext; you can find po files for each translation -in the language directory https://github.com/bareos/bareos-webui/tree/master/module/Application/language. -You can translate them using the usual tools for handling Gettext translations, e.g. Poedit. - -### Testing and quality assurance - -One important thing for us is to avoid problems in the user interface. You can really help us out here -providing feedback on releases and especially by testing the pre-releases (alpha/beta/rc) we provide -for testing. Just download them and report any issues you face with them. - -### Documentation - -Do you feel our documentation misses some points? We welcome additions; just let us know how you think -the documentation can be improved. The best way is to submit a pull request against our GitHub -repository. - -### Developing - -Coding contributions are very welcome, the easiest way is to fork our code on github and submit a -pull request. We really welcome bug fixes or new features. - -Some good starting points to get involved into development might be: - -* http://www.php.net/ -* http://framework.zend.com/ -* http://getbootstrap.com/ -* http://www.jqplot.com/ -* http://www.postgresql.org/ -* http://dev.mysql.com/ -* http://www.bareos.org/ - diff --git a/LICENSE.txt b/LICENSE similarity index 77% rename from LICENSE.txt rename to LICENSE index ac627d0d..9b6361e2 100644 --- a/LICENSE.txt +++ b/LICENSE @@ -1,7 +1,238 @@ -GNU AFFERO GENERAL PUBLIC LICENSE + + +1. BAREOS WEBUI LICENSE SPECIFICS + + +Bareos WebUI is licensed under the AGPL version 3 (see 2. below). Some parts of the code +are licensed under the following licenses: + + +a) Twitter Bootstrap + +File: /bareos-webui/public/css/bootstrap.css +File: /bareos-webui/public/css/bootstrap.min.css +File: /bareos-webui/public/css/bootstrap-theme.css +File: /bareos-webui/public/css/bootstrap-theme.min.css +File: /bareos-webui/public/fonts/glyphicons-halflings-regular.eot +File: /bareos-webui/public/fonts/glyphicons-halflings-regular.svg +File: /bareos-webui/public/fonts/glyphicons-halflings-regular.ttf +File: /bareos-webui/public/fonts/glyphicons-halflings-regular.woff +File: /bareos-webui/public/fonts/glyphicons-halflings-regular.woff2 +File: /bareos-webui/public/js/bootstrap.js +File: /bareos-webui/public/js/bootstrap.min.js +File: /bareos-webui/public/js/npm.js + +The MIT License (MIT) + +Copyright (c) 2011-2015 Twitter, Inc + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +b) jQuery + +File: /bareos-webui/public/js/jquery.js +File: /bareos-webui/public/js/jquery.min.js +File: /bareos-webui/public/js/jquery.min.map + +Copyright jQuery Foundation and other contributors, https://jquery.org/ +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/jquery/jquery + +The following license applies to all parts of this software except as +documented below: + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +c) jqPlot - Pure JavaScript plotting plugin using jQuery + +File: /bareos-webui/public/js/jqplot.barRenderer.js +File: /bareos-webui/public/js/jqplot.barRenderer.min.js +File: /bareos-webui/public/js/jqplot.categoryAxisRenderer.js +File: /bareos-webui/public/js/jqplot.categoryAxisRenderer.min.js +File: /bareos-webui/public/js/jqplot.pieRenderer.js +File: /bareos-webui/public/js/jqplot.pieRenderer.min.js +File: /bareos-webui/public/js/jqplot.pointLabels.js +File: /bareos-webui/public/js/jqplot.pointLabels.min.js + +Copyright (c) 2009-2013 Chris Leonello + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.8r1250 + * + * Copyright (c) 2009-2013 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + * included jsDate library by Chris Leonello: + * + * Copyright (c) 2010-2013 Chris Leonello + * + * jsDate is currently available for use in all personal or commercial projects + * under both the MIT and GPL version 2.0 licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * jsDate borrows many concepts and ideas from the Date Instance + * Methods by Ken Snyder along with some parts of Ken's actual code. + * + * Ken's origianl Date Instance Methods and copyright notice: + * + * Ken Snyder (ken d snyder at gmail dot com) + * 2008-09-10 + * version 2.0.2 (http://kendsnyder.com/sandbox/date/) + * Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/) + * + * jqplotToImage function based on Larry Siden's export-jqplot-to-png.js. + * Larry has generously given permission to adapt his code for inclusion + * into jqPlot. + * + * Larry's original code can be found here: + * + * https://github.com/lsiden/export-jqplot-to-png + * + * + */ + +d) Zend Skeleton Application + +The Bareos Webui as it is today, evolved from using Zends Skeleton Application as a +inital starting point. + +Copyright (c) 2005-2015, Zend Technologies USA, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +* Neither the name of Zend Technologies USA, Inc. nor the names of its +contributors may be used to endorse or promote products derived from this +software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +e) Composer Dependency Manager for PHP + +File: /bareos-webui/composer.phar + +Copyright (c) 2011 Nils Adermann, Jordi Boggiano + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +2. GNU AFFERO GENERAL PUBLIC LICENSE + + + GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 - Copyright (C) 2013-2014 dass IT GmbH, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -659,3 +890,5 @@ specific requirements. if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see . + + diff --git a/Makefile.am b/Makefile.am index 132c285f..e5a99bd6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,10 +1,12 @@ install: install-am mkdir -p $(DESTDIR)$(pkgdatadir) mkdir -p $(DESTDIR)/@HTTPD_CONF@ + mkdir -p $(DESTDIR)/etc/bareos/bareos-dir.d/ + mkdir -p $(DESTDIR)/etc/bareos-webui/ cp -pr init_autoloader.php config/ data/ module/ public/ vendor/ $(DESTDIR)$(pkgdatadir) - cp -p config/autoload/local.php.dist $(DESTDIR)/etc/bareos-webui.conf.php - ln -s /etc/bareos-webui.conf.php $(DESTDIR)/$(pkgdatadir)/config/autoload/local.php - $(INSTALL) -m 0640 install/apache/bareos-webui.conf $(DESTDIR)@HTTPD_CONF@/ + cp -p install/directors.ini $(DESTDIR)/etc/bareos-webui/directors.ini + $(INSTALL) -m 0640 install/bareos/bareos-webui.conf $(DESTDIR)/etc/bareos/bareos-dir.d/ + $(INSTALL) -m 0640 install/apache/bareos-webui.conf $(DESTDIR)@HTTPD_CONF@/ # #$(INSTALL_SCRIPT) install/bareos-webui-config $(DESTDIR)@sbindir@ diff --git a/Makefile.in b/Makefile.in index bf82c095..21c62fc9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -77,8 +77,8 @@ PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) install-sh \ - missing + $(top_srcdir)/configure $(am__configure_deps) AUTHORS \ + install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -522,11 +522,13 @@ uninstall-am: install: install-am mkdir -p $(DESTDIR)$(pkgdatadir) mkdir -p $(DESTDIR)/@HTTPD_CONF@ + mkdir -p $(DESTDIR)/etc/bareos/bareos-dir.d/ + mkdir -p $(DESTDIR)/etc/bareos-webui/ cp -pr init_autoloader.php config/ data/ module/ public/ vendor/ $(DESTDIR)$(pkgdatadir) - cp -p config/autoload/local.php.dist $(DESTDIR)/etc/bareos-webui.conf.php - ln -s /etc/bareos-webui.conf.php $(DESTDIR)/$(pkgdatadir)/config/autoload/local.php - $(INSTALL) -m 0640 install/apache/bareos-webui.conf $(DESTDIR)@HTTPD_CONF@/ + cp -p install/directors.ini $(DESTDIR)/etc/bareos-webui/directors.ini + $(INSTALL) -m 0640 install/bareos/bareos-webui.conf $(DESTDIR)/etc/bareos/bareos-dir.d/ + $(INSTALL) -m 0640 install/apache/bareos-webui.conf $(DESTDIR)@HTTPD_CONF@/ # #$(INSTALL_SCRIPT) install/bareos-webui-config $(DESTDIR)@sbindir@ diff --git a/README.md b/README.md index fcd61f3d..af2e1ca7 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,28 @@ + Bareos WebUI ============ A PHP-Frontend to manage [Bareos](http://www.bareos.org/) over the web. -### SYSTEM REQUIREMENTS - -* A working Bareos Environment, Bareos 12.4 or later, including a Bareos catalog database -* An Apache 2.x Webserver with mod-rewrite, mod-php5 and mod-setenvif enabled -* PHP 5.3.3 or later; we recommend using the latest PHP version whenever possible -* PHP PDO Extension -* PHP intl Extension -* PHP PHAR Extension (for development purposes) -* PHP DATE Extension -* PHP OpenSSL Extension (for development purposes) -* Zend Framework 2.2.x -* A Browser with JavaScript enabled - ### INSTALLATION -Please see [doc/install/INSTALL.md](doc/install/INSTALL.md). +Please see [doc/INSTALL.md](doc/INSTALL.md). ### LICENSES The Bareos WebUI is licensed under AGPL Version 3. -You can find a copy of this license in [LICENSE.txt](LICENSE.txt). +You can find a copy of this license in [AGPL-3.0.txt](AGPL-3.0.txt). + +Some other licenses are also involved by the use of external libraries +and frameworks. + +* [Zend Framework 2 - BSD 3-Clause License](http://framework.zend.com/) +* [Twitter Bootstrap - Apache License v2.0](http://getbootstrap.com/) +* [jQuery - MIT License](http://jquery.com/) +* [jqplot - dual licensed under MIT License and GPL Version 2 License](http://www.jqplot.com/) +* [composer - MIT License](https://getcomposer.org/) -* Zend Framework 2 - BSD 3-Clause License -* Twitter Bootstrap - Apache License v2.0 -* jQuery - MIT License -* jqplot - dual licensed under MIT License and GPL Version 2 License +You can find a complete file listing in [LICENSE](LICENSE). ### BUGTRACKER diff --git a/composer.json b/composer.json index 027ca175..0de652de 100644 --- a/composer.json +++ b/composer.json @@ -9,6 +9,7 @@ "homepage": "http://bareos.github.io/bareos-webui", "require": { "php": ">=5.3.3", - "zendframework/zendframework": "2.2.*" + "zendframework/zendframework": "2.3.*", + "zendframework/zend-developer-tools": "dev-master" } } diff --git a/composer.json.dev b/composer.json.dev deleted file mode 100644 index b145521c..00000000 --- a/composer.json.dev +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "bareos-webui", - "description": "A Web-Frontend to manage Bareos", - "license": "AGPL3", - "keywords": [ - "bareos", - "webinterface" - ], - "homepage": "http://bareos.github.io/bareos-webui", - "require": { - "php": ">=5.3.3", - "zendframework/zendframework": "2.2.*", - "zendframework/zend-developer-tools": "dev-master" - }, - "autoload": { - "psr-0": {"Bareos\\": "vendor/Bareos/library/"} - } -} diff --git a/composer.phar b/composer.phar index 3565aa62d00b10b94be0744ee964410fde8c5b5a..8a7d11f0036a530d3d13d894ecd2eafb648d2849 100755 GIT binary patch delta 53455 zcmce<31C!3@-Xh3nRm=gj>&x|FJZz=LT>JmgK(coNWvLH7?KGYNirdm0O2s8y9(j~ zJf*}7@md#DK-A}f0=pilDB^mq%He&3_pM)5zc-VB#NFTT`~L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5`+|^aR zDl2oU+{E~!^>_Ba7js;;<}m-Y7%ck5y86GCB7J|gz7`Xil(Zm#I|9eva4ftzrQf1E S0(RYXjKzn9hYcD%=>G#U+VY+N diff --git a/config/application.config.php b/config/application.config.php index 2c28820f..be818a35 100644 --- a/config/application.config.php +++ b/config/application.config.php @@ -3,9 +3,9 @@ /** * * bareos-webui - Bareos Web-Frontend - * + * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify @@ -28,7 +28,7 @@ // Use the $env value to dtermine which module to load $modules = array( 'Application', - 'Dashboard', + 'Dashboard', 'Director', 'Fileset', 'Pool', @@ -43,28 +43,20 @@ 'Admin', 'User', 'Install', + 'Auth', ); -/* -if($env == 'development') { - $modules[] = 'ZendDeveloperTools'; -} -*/ -// to display all errors use: - -/* if($env == 'development') { - $modules[] = 'ZendDeveloperTools'; // you may comment only this line out if ZendDeveloperTools are not installed e.g. + //$modules[] = 'ZendDeveloperTools'; // you may comment only this line out if ZendDeveloperTools are not installed e.g. error_reporting(E_ALL); ini_set("display_errors", 1); } -*/ return array( // This should be an array of module namespaces used in the application. 'modules' => $modules, - + // These are various options for the listeners attached to the ModuleManager 'module_listener_options' => array( // This should be an array of paths in which modules reside. diff --git a/config/autoload/.gitignore b/config/autoload/.gitignore index 1a83fda6..e69de29b 100644 --- a/config/autoload/.gitignore +++ b/config/autoload/.gitignore @@ -1,2 +0,0 @@ -local.php -*.local.php diff --git a/config/autoload/global.php b/config/autoload/global.php index a9688bb5..2484e8f0 100644 --- a/config/autoload/global.php +++ b/config/autoload/global.php @@ -3,9 +3,9 @@ /** * * bareos-webui - Bareos Web-Frontend - * + * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * @@ -36,15 +36,234 @@ * file. */ +$file = "/etc/bareos-webui/directors.ini"; +$config = null; + +if(!file_exists($file)) { + echo "Error: Missing configuration file ".$file."."; + exit(); +} +else { + $config = parse_ini_file($file, true, INI_SCANNER_NORMAL); +} + +function read_db_config($config, $file) +{ + + $arr = array(); + + foreach($config as $instance) { + + if(array_key_exists('enabled', $instance) && isset($instance['enabled']) && strtolower($instance['enabled']) == "no") { + + next($config); + + } + else { + + if(array_key_exists('dbaddress', $instance) && isset($instance['dbaddress'])) { + $arr['adapters'][$instance['dbaddress']] = array(); + } + else { + if(array_key_exists('diraddress', $instance) && isset($instance['diraddress'])) { + $arr['adapters'][$instance['diraddress']] = array(); + $instance['dbaddress'] = $instance['diraddress']; + } + else { + echo "Error: Missing parameters 'dbaddress' and 'diraddress' in ".$file.", section ".key($config)."."; + exit(); + } + } + + if(array_key_exists('dbdriver', $instance) && isset($instance['dbdriver'])) { + if(strtolower($instance['dbdriver']) == "postgresql") { + $arr['adapters'][$instance['dbaddress']]['driver'] = "Pdo_Pgsql"; + } + elseif(strtolower($instance['dbdriver']) == "mysql") { + $arr['adapters'][$instance['dbaddress']]['driver'] = "Pdo_Mysql"; + } + else { + echo "Error: Mispelled value for parameter 'dbdriver' in ".$file.", section ".key($config)."."; + exit(); + } + } + else { + $arr['adapters'][$instance['dbaddress']]['driver'] = "Pdo_Pgsql"; + } + + if(array_key_exists('dbname', $instance) && isset($instance['dbname'])) { + $arr['adapters'][$instance['dbaddress']]['dbname'] = $instance['dbname']; + } + else { + $arr['adapters'][$instance['dbaddress']]['dbname'] = "bareos"; + } + + if(array_key_exists('dbaddress', $instance) && isset($instance['dbaddress'])) { + $arr['adapters'][$instance['dbaddress']]['host'] = $instance['dbaddress']; + } + else { + $arr['adapters'][$instance['dbaddress']]['host'] = "127.0.0.1"; + } + + if(array_key_exists('dbport', $instance) && isset($instance['dbport'])) { + $arr['adapters'][$instance['dbaddress']]['port'] = $instance['dbport']; + } + else { + if($arr['adapters'][$instance['dbaddress']]['driver'] == "Pdo_Pgsql") { + $arr['adapters'][$instance['dbaddress']]['port'] = 5432; + } + else { + $arr['adapters'][$instance['dbaddress']]['port'] = 3306; + } + } + + if(array_key_exists('dbuser', $instance) && isset($instance['dbuser'])) { + $arr['adapters'][$instance['dbaddress']]['username'] = $instance['dbuser']; + } + else { + $arr['adapters'][$instance['dbaddress']]['username'] = "bareos"; + } + + if(array_key_exists('dbpassword', $instance) && isset($instance['dbpassword'])) { + $arr['adapters'][$instance['dbaddress']]['password'] = $instance['dbpassword']; + } + else { + $arr['adapters'][$instance['dbaddress']]['password'] = ""; + } + + } + + } + + return $arr; + +} + +function read_dir_config($config, $file) +{ + + $arr = array(); + + foreach($config as $instance) { + + if(array_key_exists('enabled', $instance) && isset($instance['enabled']) && strtolower($instance['enabled']) == "no") { + + next($config); + + } + else { + + if(array_key_exists('diraddress', $instance) && isset($instance['diraddress'])) { + $arr[$instance['diraddress']] = array(); + $arr[$instance['diraddress']]['host'] = $instance['diraddress']; + } + else { + echo "Error: Missing parameter 'diraddress' in ".$file.", section ".key($config)."."; + exit(); + } + + if(array_key_exists('dirport', $instance) && isset($instance['dirport'])) { + $arr[$instance['diraddress']]['port'] = $instance['dirport']; + } + else { + $arr[$instance['diraddress']]['port'] = 9101; + } + + if(array_key_exists('tls_verify_peer', $instance) && isset($instance['tls_verify_peer'])) { + $arr[$instance['diraddress']]['tls_verify_peer'] = $instance['tls_verify_peer']; + } + else { + $arr[$instance['diraddress']]['tls_verify_peer'] = false; + } + + if(array_key_exists('server_can_do_tls', $instance) && isset($instance['server_can_do_tls'])) { + $arr[$instance['diraddress']]['server_can_do_tls'] = $instance['server_can_do_tls']; + } + else { + $arr[$instance['diraddress']]['server_can_do_tls'] = false; + } + + if(array_key_exists('server_requires_tls', $instance) && isset($instance['server_requires_tls'])) { + $arr[$instance['diraddress']]['server_requires_tls'] = $instance['server_requires_tls']; + } + else { + $arr[$instance['diraddress']]['server_requires_tls'] = false; + } + + if(array_key_exists('client_can_do_tls', $instance) && isset($instance['client_can_do_tls'])) { + $arr[$instance['diraddress']]['client_can_do_tls'] = $instance['client_can_do_tls']; + } + else { + $arr[$instance['diraddress']]['client_can_do_tls'] = false; + } + + if(array_key_exists('client_requires_tls', $instance) && isset($instance['client_requires_tls'])) { + $arr[$instance['diraddress']]['client_requires_tls'] = $instance['client_requires_tls']; + } + else { + $arr[$instance['diraddress']]['client_requires_tls'] = false; + } + + if(array_key_exists('ca_file', $instance) && isset($instance['ca_file'])) { + $arr[$instance['diraddress']]['ca_file'] = $instance['ca_file']; + } + else { + $arr[$instance['diraddress']]['ca_file'] = ""; + } + + if(array_key_exists('cert_file', $instance) && isset($instance['cert_file'])) { + $arr[$instance['diraddress']]['cert_file'] = $instance['cert_file']; + } + else { + $arr[$instance['diraddress']]['cert_file'] = ""; + } + + if(array_key_exists('cert_file_passphrase', $instance) && isset($instance['cert_file_passphrase'])) { + $arr[$instance['diraddress']]['cert_file_passphrase'] = $instance['cert_file_passphrase']; + } + else { + $arr[$instance['diraddress']]['cert_file_passphrase'] = ""; + } + + if(array_key_exists('allowed_cns', $instance) && isset($instance['allowed_cns'])) { + $arr[$instance['diraddress']]['allowed_cns'] = $instance['allowed_cns']; + } + else { + $arr[$instance['diraddress']]['allowed_cns'] = ""; + } + + } + + } + + return $arr; + +} + return array( - 'db' => array( - 'driver_options'=> array( - ), - ), + 'db' => read_db_config($config, $file), + 'directors' => read_dir_config($config, $file), 'service_manager' => array( 'factories' => array( - 'Zend\Db\Adapter\Adapter' - => 'Zend\Db\Adapter\AdapterServiceFactory', + 'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\AdapterServiceFactory', + ), + 'abstract_factories' => array( + // to allow other adapters to be called by $sm->get('adaptername') + 'Zend\Db\Adapter\AdapterAbstractServiceFactory', ), ), + 'session' => array( + 'config' => array( + 'class' => 'Zend\Session\Config\SessionConfig', + 'options' => array( + 'name' => 'Bareos-WebUI', + ), + ), + 'storage' => 'Zend\Session\Storage\SessionArrayStorage', + 'validators' => array( + 'Zend\Session\Validator\RemoteAddr', + 'Zend\Session\Validator\HttpUserAgent', + ), + ), ); + diff --git a/config/autoload/local.php.dist b/config/autoload/local.php.dist deleted file mode 100644 index eea78547..00000000 --- a/config/autoload/local.php.dist +++ /dev/null @@ -1,72 +0,0 @@ -. - * - */ - -/** - * Local Configuration Override - * - * This configuration override file is for overriding environment-specific and - * security-sensitive configuration information. Copy this file without the - * .dist extension at the end and populate values as needed. - * - * @NOTE: This file is ignored from Git by default with the .gitignore included. - * This is a good practice, as it prevents sensitive credentials from accidentally - * being committed into version control. - */ - -return array( - 'db' => array( - // Set your database driver here: Pdo_Mysql, Pdo_Pgsql, Mysqli or Pgsql - 'driver' => 'Pdo_Pgsql', - // Set your database here - 'dbname' => 'bareos', - // Set your hostname here - 'host' => 'localhost', - // Set your username here - 'username' => 'bareos_webui', - // Set your password here - 'password' => '', - ), - 'director' => array( - // Director hostname or ip address - 'host' => '127.0.0.1', - // Director port - 'port' => '9101', - // Director password - 'password' => '', - // Director named console - 'console_name' => null, - // TLS parameter - 'tls_verify_peer' => false, - 'server_can_do_tls' => false, - 'server_requires_tls' => false, - 'client_can_do_tls' => true, - 'client_requires_tls' => false, - 'ca_file' => null, - 'cert_file' => null, - 'cert_file_passphrase' => null, - 'allowed_cns' => null, - ), -); diff --git a/configure b/configure index 21740194..06b0c07e 100755 --- a/configure +++ b/configure @@ -587,6 +587,10 @@ LIBOBJS HTTPD_CONF APACHE2_SYSCONFDIR APXS +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V am__untar am__tar AMTAR @@ -651,6 +655,7 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking +enable_silent_rules with_httpd_conf ' ac_precious_vars='build_alias @@ -1266,6 +1271,13 @@ if test -n "$ac_init_help"; then esac cat <<\_ACEOF +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) @@ -1700,7 +1712,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -am__api_version='1.12' +am__api_version='1.13' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -1913,8 +1925,8 @@ if test x"${MISSING+set}" != xset; then esac fi # Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 @@ -2154,6 +2166,45 @@ else fi rmdir .tst 2>/dev/null +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." @@ -2204,13 +2255,22 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} -mkdir_p="$MKDIR_P" +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' @@ -2218,6 +2278,7 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + for ac_prog in apxs apxs2 do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -2283,6 +2344,8 @@ if test x$HTTPD_CONF = xno; then HTTPD_CONF="/etc/apache2/conf.d" elif test -d /etc/apache/conf.d; then HTTPD_CONF="/etc/apache/conf.d" + elif test -d /etc/apache2/conf-available; then + HTTPD_CONF="/etc/apache2/conf-available" else HTTPD_CONF="/etc/httpd/conf.d" fi diff --git a/configure.ac b/configure.ac index 31529bde..2c443717 100644 --- a/configure.ac +++ b/configure.ac @@ -9,13 +9,15 @@ HTTP_CONF=no AC_ARG_WITH(httpd_conf,AC_HELP_STRING([--with-httpd-conf=],[sets path to Apache conf.d directory]),HTTPD_CONF=$withval,HTTPD_CONF=no) if test x$HTTPD_CONF = xno; then if test -d /etc/httpd/conf.d; then - HTTPD_CONF="/etc/httpd/conf.d" + HTTPD_CONF="/etc/httpd/conf.d" elif test -d /etc/apache2/conf.d; then - HTTPD_CONF="/etc/apache2/conf.d" + HTTPD_CONF="/etc/apache2/conf.d" elif test -d /etc/apache/conf.d; then - HTTPD_CONF="/etc/apache/conf.d" + HTTPD_CONF="/etc/apache/conf.d" + elif test -d /etc/apache2/conf-available; then + HTTPD_CONF="/etc/apache2/conf-available" else - HTTPD_CONF="/etc/httpd/conf.d" + HTTPD_CONF="/etc/httpd/conf.d" fi fi AC_SUBST(HTTPD_CONF) diff --git a/debian/control b/debian/control index 7d80af6f..db4d2e09 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: web Priority: extra Maintainer: Bareos Packager Build-Depends: debhelper (>= 7.0.50~), - apache2-dev | apache2-prefork-dev, + apache2-dev | apache2-prefork-dev, apache2, autoconf, automake Standards-Version: 3.9.1 diff --git a/debian/copyright b/debian/copyright index b48f9ccf..269fc62b 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,5 +1,6 @@ This work was packaged for Debian by: + Frank Bergkemper on Fri, 6 Feb 2015 14:29:00 +0100 Jörg Steffens on Fri, 14 Feb 2014 10:52:57 +0100 It was downloaded from: @@ -12,7 +13,7 @@ Upstream Author(s): Copyright: - Copyright (C) 2013-2014 Frank Bergkemper, dass IT GmbH + Copyright (C) 2013-2015 Bareos GmbH & Co. KG License: diff --git a/debian/docs b/debian/docs new file mode 100644 index 00000000..3f1e58aa --- /dev/null +++ b/debian/docs @@ -0,0 +1,5 @@ +README.md +doc/INSTALL.md +LICENSE +AGPL-3.0.txt +AUTHORS diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 00000000..c731ac1c --- /dev/null +++ b/debian/postinst @@ -0,0 +1,5 @@ +#!/bin/sh + +which a2enmod && a2enmod rewrite setenv php5 2> /dev/null || true +which a2enconf && a2enconf bareos-webui || true + diff --git a/debian/rules b/debian/rules old mode 100755 new mode 100644 index 644f3f18..e0f58a7b --- a/debian/rules +++ b/debian/rules @@ -21,4 +21,4 @@ export DH_OPTIONS = -v # dh_auto_configure %: - dh $@ + dh $@ diff --git a/doc/INSTALL.md b/doc/INSTALL.md new file mode 100644 index 00000000..2ef229ce --- /dev/null +++ b/doc/INSTALL.md @@ -0,0 +1,265 @@ + +INSTALLATION +============ + +### SYSTEM REQUIREMENTS + +* A working Bareos environment, Bareos >= 12.4 +* An Apache 2.x Webserver with mod-rewrite, mod-php5 and mod-setenvif +* PHP >= 5.3.3 + * PHP PDO Extension + * PHP Sockets Extension + * PHP OpenSSL Extension +* Zend Framework 2.2.x or later + + **Note:** Unfortunately, not all distributions offer a Zend Framework 2 package. + The following list shows where to get the Zend Framework 2 package. + + * RHEL, CentOS + * https://fedoraproject.org/wiki/EPEL + * https://apps.fedoraproject.org/packages/php-ZendFramework2 + * Fedora + * https://apps.fedoraproject.org/packages/php-ZendFramework2 + * SUSE, Debian, Ubuntu: + * http://download.bareos.org/bareos/contrib + +### PACKAGE BASED INSTALLATION + +Bareos-WebUI packages are available for a number of Linux distributions, see [Bareos contrib](http://download.bareos.org/bareos/contrib/) repository. + +#### Step 1 - Adding the Repository + +Add the [Bareos contrib](http://download.bareos.org/bareos/contrib/) repository that is matching your Linux distribution and install the bareos-webui package via your package manager. +Please take a look at your distributions documentation or the [Bareos documentation](http://doc.bareos.org/) on how to achieve this. + +#### Step 2 - Configuration of a restricted console + +You can have multiple Consoles with different names and passwords, sort of like multiple users, each with different privileges. +As a default, these consoles can do absolutely nothing – no commands whatsoever. You give them privileges or rather access to +commands and resources by specifying access control lists in the Director’s Console resource. The ACLs are specified by a directive +followed by a list of access names. + +It is required to add at least one restricted named console in your director configuration (bareos-dir.conf) for the webui. +The restricted named consoles, configured in your bareos-dir.conf, are used for authentication and access control. The name +and password directives of the restricted consoles are the credentials you have to provide during authentication to the webui +as username and password. For full access and functionality relating the director connection the following commands are +currently needed by the webui and have to be made available via the CommandACL in your restricted consoles. + +* status +* messages +* show +* version +* run +* rerun +* cancel + +The package install provides a default configuration under /etc/bareos/bareos-dir.d/bareos-webui.conf, which has to be included +at the bottum of your /etc/bareos/bareos-dir.conf and edited to your needs. + +``` +echo "@/etc/bareos/bareos-dir.d/bareos-webui.conf" >> /etc/bareos/bareos-dir.d/bareos-webui.conf +``` + +**Note:** Most parts of the webui still use a direct connection to the catalog database to retrieve data, so the configured ACL +of your restricted consoles do not work here! For the moment it is more or less just used for authentication and you should +or may be fine with the defaults provided in the example below. However, in future direct connection to the catalog database +will be droped and fully replaced by the native connection to the director itself. + +``` +# +# Restricted console used by bareos-webui +# +Console { + Name = user1 + Password = "password" + CommandACL = status, messages, show, version, run, rerun, cancel + Job ACL = *all* + Schedule ACL = *all* + Catalog ACL = *all* + Pool ACL = *all* + Storage ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + #Where ACL = +} +``` +For more details about console resource configuration in bareos, please have a look at the online [Bareos documentation](http://doc.bareos.org/). + +**Note:** Do not forget to reload your new director configuration. + +#### Step 3 - Configure the catalog database connection + +Bareos-WebUI needs just a read-only connection to the Bareos catalog database, so there are multiple possibilities to configure bareos-webui. +You may reuse the exsiting Bareos database user or create a new (read-only) database user for bareos-webui. The first approach is simpler to +configure, the second approach is more secure. + +##### PostgreSQL - Create a read-only catalog database user + +In this example we use *bareos_webui* as database username. As database password **, +please choose a random password. + +**Note:** PostgreSQL user names are not allowed to contain -. + +Since Bareos >= 14.1 you are able to do it the following way: + +``` +su - postgres + +DB_USER=bareos_webui + +DB_PASS= + +/usr/lib/bareos/scripts/bareos-config get_database_grant_priviliges postgresql $DB_USER $DB_PASS readonly > /tmp/database_grant_priviliges.sql + +psql -d bareos -f /tmp/database_grant_priviliges.sql + +rm /tmp/database_grant_priviliges.sql + +``` + +Add the following lines before the "all" rules into your *pg_hba.conf*. +Usually found under /etc/postgres/*/main/pg_hba.conf or /var/lib/pgsql/data/pg_hba.conf. + +``` +# TYPE DATABASE USER ADDRESS METHOD +host bareos bareos_webui 127.0.0.1/32 md5 +host bareos bareos_webui ::1/128 md5 +``` + +Finally, reload your PostgreSQL configuration or restart your PostgreSQL Server (```pg_ctl reload``` or ```service postgresql restart```). + +##### MySQL - Create a read-only catalog database user + +In this example we use *bareos_webui* as database username. As database password **, +please choose a secure random password. + +``` +DB_USER=bareos_webui + +DB_PASS= + +/usr/lib/bareos/scripts/bareos-config get_database_grant_priviliges mysql $DB_USER $DB_PASS readonly > /tmp/database_grant_privileges.sql + +mysql < /tmp/database_grant_privileges.sql + +mysqladmin flush-privileges + +rm /tmp/database_grant_privileges.sql +``` + +#### Step 4 - Configure your Apache Webserver + +If you have installed from package, a default configuration is provided, please see /etc/apache2/conf.d/bareos-webui.conf, +/etc/httpd/conf.d/bareos-webui.conf or /etc/apache2/available-conf/bareos-webui.conf. + +Required apache modules, setenv, rewrite and php are enabled via package postinstall script. +You simply need to restart your apache webserver manually. + +#### Step 5 - Configure your /etc/bareos-webui/directors.ini + +Configure your database and director connections in */etc/bareos-webui/directors.ini* to match your database and director settings, +which you have choosen in the previous steps. + +The configuration file /etc/bareos-webui/directors.ini should look similar to this: + +``` +; +; Bareos WebUI Configuration +; File: /etc/bareos-webui/directors.ini +; + +; +; Section localhost-dir +; +[localhost-dir] + +; Enable or disable section. Possible values are "yes" or "no", the default is "yes". +enabled = "yes" + +; Possible values are "postgresql" or "mysql", the default is "postgresql" +dbdriver = "postgresql" + +; Fill in the IP-Address or FQDN of your catalog DB +dbaddress = "localhost" + +; Default values are corresponding to your dbriver, e.g 5432 or 3306 +dbport = 5432 + +; Default is "bareos" +dbuser = "bareos_webui" + +; No default value +dbpassword = "" + +; Default is set to "bareos" +dbname = "bareos" + +; Fill in the IP-Address or FQDN of you director. +diraddress = "localhost" + +; Default value is 9101 +dirport = 9101 + +; Note: TLS has not been tested and documented, yet. +;tls_verify_peer = false +;server_can_do_tls = false +;server_requires_tls = false +;client_can_do_tls = false +;client_requires_tls = false +;ca_file = "" +;cert_file = "" +;cert_file_passphrase = "" +;allowed_cns = "" + +; +; Section remote-dir +; +[remote-dir] +enabled = "no" +dbdriver = "mysql" +dbaddress = "hostname" +dbport = 5432 +dbuser = "bareos_webui" +dbpassword = "" +dbname = "bareos" +diraddress = "hostname" +dirport = 9101 +; Note: TLS has not been tested and documented, yet. +;tls_verify_peer = false +;server_can_do_tls = false +;server_requires_tls = false +;client_can_do_tls = false +;client_requires_tls = false +;ca_file = "" +;cert_file = "" +;cert_file_passphrase = "" +;allowed_cns = "" + +``` + +**Note:** You can add as many sections (director and catalog combinations) as you want. + +#### Step 6 - SELinux + +If you do not use SELinux on your system, you can skip this step and go over to the next one. + +To install bareos-webui on a system with SELinux enabled, the following additional steps must be performed. + +``` +TODO +``` + +#### Step 7 - Test your configuration + +Finally, you can test if bareos-webui is configured properly by using the url below. + +``` +http:///bareos-webui/install/test +``` + +If everything is fine you are able to login, now. + +``` +http:///bareos-webui/ +``` + diff --git a/doc/README.md b/doc/README.md deleted file mode 100644 index 8d1c8b69..00000000 --- a/doc/README.md +++ /dev/null @@ -1 +0,0 @@ - diff --git a/doc/developers/README-GIT.md b/doc/developers/README-GIT.md deleted file mode 100644 index 273cb623..00000000 --- a/doc/developers/README-GIT.md +++ /dev/null @@ -1,72 +0,0 @@ -# USING THE GIT REPOSITORY - -## Setup your own public repository - -Your first step is to establish a public repository from which we can -pull your work into the master repository. - -While you can use a private repository and utilize ``git format-patch`` to -submit patches, this is discouraged as it does not facilitate public peer -review. So please contribute by pull request. - -1. Setup a GitHub account (http://github.com/), if you haven't yet. -2. Fork the bareos-webui repository (http://github.com/bareos/bareos-webui) -3. Clone your fork locally and enter it (use your own GitHub username in the statement below) - -``` -sh% git clone git@github.com:/bareos-webui.git -% cd bareos-webui -``` - -4. Add a remote to the canonical bareos-webui repository, so you can keep your fork up-to-date: - -``` -sh% git remote add upstream https://github.com/bareos/bareos-webui.git -sh% git fetch upstream -``` - -## Everyday workflow - -When working on bareos-webui, we recommend you do each new feature or bugfix in a new branch. -This simplifies the task of code review as well as of merging your changes into the canonical -repository. A typical work flow will then consist of the following: - -1. Create a new local branch based off your master branch. -2. Switch to your new local branch. -3. Do some work, commit, repeat as necessary. -4. Push the local branch to your remote repository. -5. Send a pull request. - -## Keeping Up-to-Date - -Periodically, you should update your fork or personal repository to match the canonical bareos-webui -repository. - -``` -sh% git checkout master -sh% git pull bareos-webui master -``` -To keep your remote up-to-date: - -``` -sh% git push origin -``` - -### Branch Cleanup - -As you might imagine, if you are a frequent contributor, you'll start to get a ton of branches both -locally and remote. Once you know that your changes have been accepted to the master repository, we -suggest doing some cleanup of these branches. - -Local branch cleanup: - -``` -sh% git branch -d -``` - -Remote branch removal: - -``` -sh% git push origin : -``` - diff --git a/doc/install/INSTALL.md b/doc/install/INSTALL.md deleted file mode 100644 index 68ce27fa..00000000 --- a/doc/install/INSTALL.md +++ /dev/null @@ -1,163 +0,0 @@ -## INSTALL - -Remember: this project is still in alpha state. - -### SYSTEM REQUIREMENTS - -* A working Bareos environment, Bareos 12.4 or later, including a Bareos catalog database (currently only PostgreSQL is tested) -* An Apache 2.x Webserver with mod-rewrite, mod-php5 and mod-setenvif enabled -* PHP 5.3.3 or later - * PHP PDO Extension - * PHP intl Extension - * PHP DATE Extension -* Zend Framework 2.2.x or later -* A Browser of your choice with JavaScript enabled -* when using composer.phar (installer for additional components): - * PHP PHAR Extension - * PHP OpenSSL Extension - -### How bareos-webui accesses Bareos - -Bareos-webui connects to Bareos by - * native connection to the director - * database connection (read-only) to the Bareos catalog - -## Installation - -### Package based installation - -The bareos-webui packages are available for a number of Linux distributions, see http://download.bareos.org/bareos/contrib/ - -#### Zend Framework 2 - -Zend Framework (>= 2.2) is required for bareos-webui. - -However, not all distributions offer these packages. - -* RedHat - * https://apps.fedoraproject.org/packages/php-ZendFramework2 - * Fedora 20 (included) - * Fedora 19 (included) - * RHEL6/Centos6: https://fedoraproject.org/wiki/EPEL -* SUSE - * available as part of the [Bareos contrib](http://download.bareos.org/bareos/contrib/) repository (based on EPEL version) -* Debian/Ubuntu - * available as part of the [Bareos contrib](http://download.bareos.org/bareos/contrib/) repository - - -#### Installation - - * add the [Bareos contrib](http://download.bareos.org/bareos/contrib/) repository that is matching your Linux distribution - * install the package bareos-webui - * configure your database connection to your Bareos catalog in ```/etc/bareos-webui.conf.php``` (this is the link target of ```/usr/share/bareos-webui/config/autoload/local.php```). See [configure database connection](#configure-the-database-connection) - * reload your Apache webserver - * test bareos-webui using the url: [http://localhost/bareos-webui](http://localhost/bareos-webui) - * Attention: the default installation only allows access from localhost. This can be adapted in the ```bareos-webui.conf``` file, that is location in the Apache configuration files directory. However, when allowing access from other systems, you should also configure other access restrictions like user login. - - -### Installation from github sources - -* Get we latest version from github, e.g. - -``` -cd /usr/share/ -git clone https://github.com/bareos/bareos-webui.git -cd bareos-webui -``` - -* Download composer.phar - -``` -wget https://getcomposer.org/composer.phar -``` - -* Run the composer.phar, to download all the dependencies (Zend Framework 2, Zend Developers tools) into the vendor directory: - -``` -./composer.phar install -``` - -See [https://getcomposer.org/](https://getcomposer.org/) for more information and documentation about the composer dependency manager for PHP. - -### Configure Apache - -See the example file [bareos-console-web.conf](https://raw.github.com/bareos/bareos-webui/master/install/apache/bareos-webui.conf). -You might configure your Apache manually or copy the example configuration with wget from the git repo, e.g. - -``` -cd /etc/apache2/conf.d -wget https://raw.github.com/bareos/bareos-webui/master/install/apache/bareos-webui.conf -``` - -Note: On Debian the ZF2_PATH Variable in your bareos-webui.conf is currently needed, if you are using the ZF2 package from Bareos contrib. -This will change and no longer be necessary in future, but it is the way to go for the moment. - -``` -# Environment Variable for Zend Framwework 2 (Debian) -SetEnv "ZF2_PATH" "/usr/share/php5" -``` - -### Configure the database connection - -Bareos-webui needs only a read-only connection to the Bareos catalog database, so there are multiple possibilities to configure bareos-webui: - * reuse the exsiting Bareos database user - * create a new (read-only) database user for bareos-webui - -The first approach is simpler to configure, the second approach is more secure. - -#### PostgreSQL - -Bareos >= 14.1 - -In this example we use bareoswebui as database username. Attention: PostgreSQL user names are not allowd to contain -. -As database password , choose a random password. - -``` -su - postgres -DB_USER=bareos_webui -DB_PASS= -/usr/lib/bareos/scripts/bareos-config get_database_grant_priviliges postgresql $DB_USER $DB_PASS readonly > /tmp/database_grant_priviliges.sql -psql -d bareos -f /tmp/database_grant_priviliges.sql -rm /tmp/database_grant_priviliges.sql -vi data/pg_hba.conf -``` - -Add following lines before the "all" rules into ```pg_hba.conf```: -``` -host bareos bareos_webui 127.0.0.1/32 md5 -host bareos bareos_webui ::1/128 md5 -``` - -Reload the PostgreSQL configuration: -``` -pg_ctl reload -``` - -##### - -Adapt the bareos-webui configuration file to match your database settings. - - * Manual installation: - * Copy ```bareos-webui/config/autoload/local.php.dist``` to ```bareos-webui/config/autoload/local.php``` and edit the local.php file to your needs. - * Package installation: - * The file local.php is available as ```/etc/bareos-webui.conf.php```. It is the link target of the configuration file used by bareos-webui ```/usr/share/bareos-webui/config/autoload/local.php```. Please edit this file. - - -As the result, the configuration file should look similar to this: - -``` -return array( - 'db' => array( - // Set your database driver here: Pdo_Mysql, Pdo_Pgsql, Mysqli or Pgsql - 'driver' => 'Pdo_Pgsql', - // Set your database here - 'dbname' => 'bareos', - // Set your hostname here - 'host' => 'localhost', - // Set your username here - 'username' => 'bareos_webui', - // Set your password here - 'password' => '', - ), -); -``` diff --git a/init_autoloader.php b/init_autoloader.php index c71feb42..4d8d7ad1 100644 --- a/init_autoloader.php +++ b/init_autoloader.php @@ -56,9 +56,12 @@ try { if (!class_exists('Zend\Loader\AutoloaderFactory')) { - throw new RuntimeException('

Unable to load Zend Framework 2. Please install the Zend Framework 2 package from your - distribution repository.
If Zend Framework 2 is already installed, please define - a ZF2_PATH environment variable.

'); + throw new RuntimeException(' + Unable to load Zend Framework 2.

+ Please install Zend Framework 2 package from your distribution repository.
+ If Zend Framework 2 is already installed, please set the include_path in your php.ini or
+ define a ZF2_PATH environment variable in your apache configuration file and do not forget
+ to restart your apache webserver.
'); } } catch(Exception $e) { diff --git a/install/apache/bareos-webui.conf b/install/apache/bareos-webui.conf index 3b81ee2b..8539f7ac 100644 --- a/install/apache/bareos-webui.conf +++ b/install/apache/bareos-webui.conf @@ -1,49 +1,55 @@ # # Bareos WebUI Apache configuration file # -# by default, allows only access from localhost -# -#LoadModule rewrite_module modules/mod_rewrite.so +# Environment Variable for Application Debugging +# Set to "development" to turn on debugging mode or +# "production" to turn off debugging mode. + + SetEnv "APPLICATION_ENV" "production" + -# AccessFileName .htaccess -# RewriteLog "/var/log/httpd/mod_rewrite.log" -# RewriteLogLevel 3 +Alias /bareos-webui /usr/share/bareos-webui/public -# Environment Variable for Application Debugging -# Set to "development" for to turn on debugging mode or -# "production" to turn of debugging mode. -#SetEnv "APPLICATION_ENV" "development" -SetEnv "APPLICATION_ENV" "production" + -# Environment Variable for Zend Framwework 2 Debian -#SetEnv "ZF2_PATH" "/usr/share/php" -#SetEnv "ZF2_PATH" "/usr/share/php5" + Options FollowSymLinks + AllowOverride None + + # Following module checks are only done to support + # Apache 2.2, + # Apache 2.4 with mod_access_compat and + # Apache 2.4 without mod_access_compat + # in the same configuration file. + # Feel free to adapt it to your needs. + + # Apache 2.2 + + Order deny,allow + Allow from all + + + # Apache 2.4 + + + Order deny,allow + + Require all granted + + + + RewriteEngine on + RewriteBase /bareos-webui + RewriteCond %{REQUEST_FILENAME} -s [OR] + RewriteCond %{REQUEST_FILENAME} -l [OR] + RewriteCond %{REQUEST_FILENAME} -d + RewriteRule ^.*$ - [NC,L] + RewriteRule ^.*$ index.php [NC,L] + + + + php_flag magic_quotes_gpc off + php_flag register_globals off + -Alias /bareos-webui /usr/share/bareos-webui/public - - RewriteEngine On - - RewriteBase /bareos-webui - RewriteCond %{REQUEST_FILENAME} -s [OR] - RewriteCond %{REQUEST_FILENAME} -l [OR] - RewriteCond %{REQUEST_FILENAME} -d - RewriteRule ^.*$ - [NC,L] - RewriteRule ^.*$ index.php [NC,L] - - php_flag magic_quotes_gpc off - php_flag register_globals off - - Options Indexes FollowSymLinks - AllowOverride All - Order deny,allow - - Deny from all - Allow from 127.0.0.1 - Allow from localhost - Allow from ::1 - # - # change the settings below - # - # Allow from diff --git a/install/bareos/bareos-webui.conf b/install/bareos/bareos-webui.conf new file mode 100644 index 00000000..f1a92935 --- /dev/null +++ b/install/bareos/bareos-webui.conf @@ -0,0 +1,24 @@ +# +# Preparations: +# +# include this configuration file in bareos-dir.conf by +# @/etc/bareos/bareos-dir.d/bareos-webui.conf +# + +# +# Restricted console used by bareos-webui +# +Console { + Name = user1 + Password = "CHANGEME" + CommandACL = cancel, messages, rerun, restore, run, show, status, version + Job ACL = *all* + Schedule ACL = *all* + Catalog ACL = *all* + Pool ACL = *all* + Storage ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + #Where ACL = +} + diff --git a/install/directors.ini b/install/directors.ini new file mode 100644 index 00000000..660ee842 --- /dev/null +++ b/install/directors.ini @@ -0,0 +1,72 @@ +; +; Bareos WebUI Configuration +; File: /etc/bareos-webui/directors.ini +; + +; +; Section localhost-dir +; +[localhost-dir] + +; Enable or disable section. Possible values are "yes" or "no", the default is "yes". +enabled = "yes" + +; Possible values are "postgresql" or "mysql", the default is "postgresql" +dbdriver = "postgresql" + +; Fill in the IP-Address or FQDN of your catalog DB +dbaddress = "localhost" + +; Default values are corresponding to your dbriver, e.g 5432 or 3306 +dbport = 5432 + +; Default is "bareos" +dbuser = "bareos_webui" + +; No default value +dbpassword = "" + +; Default is set to "bareos" +dbname = "bareos" + +; Fill in the IP-Address or FQDN of you director. +diraddress = "localhost" + +; Default value is 9101 +dirport = 9101 + +; Note: TLS has not been tested and documented, yet. +;tls_verify_peer = false +;server_can_do_tls = false +;server_requires_tls = false +;client_can_do_tls = false +;client_requires_tls = false +;ca_file = "" +;cert_file = "" +;cert_file_passphrase = "" +;allowed_cns = "" + +; +; Section another-host-dir +; +[another-host-dir] +enabled = "no" +dbdriver = "mysql" +dbaddress = "" +dbport = 3306 +dbuser = "bareos_webui" +dbpassword = "" +dbname = "bareos" +diraddress = "" +dirport = 9101 +; Note: TLS has not been tested and documented, yet. +;tls_verify_peer = false +;server_can_do_tls = false +;server_requires_tls = false +;client_can_do_tls = false +;client_requires_tls = false +;ca_file = "" +;cert_file = "" +;cert_file_passphrase = "" +;allowed_cns = "" + diff --git a/module/Admin/config/module.config.php b/module/Admin/config/module.config.php index 112d95df..a5830a05 100644 --- a/module/Admin/config/module.config.php +++ b/module/Admin/config/module.config.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Admin/src/Admin/Controller/AdminController.php b/module/Admin/src/Admin/Controller/AdminController.php index aaf53ef4..04ef2148 100644 --- a/module/Admin/src/Admin/Controller/AdminController.php +++ b/module/Admin/src/Admin/Controller/AdminController.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Admin/src/Admin/Model/Admin.php b/module/Admin/src/Admin/Model/Admin.php index 9c07710e..7d51c1ef 100644 --- a/module/Admin/src/Admin/Model/Admin.php +++ b/module/Admin/src/Admin/Model/Admin.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Admin/src/Admin/Model/AdminTable.php b/module/Admin/src/Admin/Model/AdminTable.php index 90c01f14..53b5449c 100644 --- a/module/Admin/src/Admin/Model/AdminTable.php +++ b/module/Admin/src/Admin/Model/AdminTable.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Admin/view/admin/admin/index.phtml b/module/Admin/view/admin/admin/index.phtml index 6888fb8f..fb0bb75f 100644 --- a/module/Admin/view/admin/admin/index.phtml +++ b/module/Admin/view/admin/admin/index.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Admin/view/admin/admin/roles.phtml b/module/Admin/view/admin/admin/roles.phtml index e33ec657..6ddd3e7b 100644 --- a/module/Admin/view/admin/admin/roles.phtml +++ b/module/Admin/view/admin/admin/roles.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Admin/view/admin/admin/users.phtml b/module/Admin/view/admin/admin/users.phtml index 35fc8fd4..857f008c 100644 --- a/module/Admin/view/admin/admin/users.phtml +++ b/module/Admin/view/admin/admin/users.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Application/Module.php b/module/Application/Module.php index d9620179..b702add2 100644 --- a/module/Application/Module.php +++ b/module/Application/Module.php @@ -11,6 +11,9 @@ use Zend\Mvc\ModuleRouteListener; use Zend\Mvc\MvcEvent; +use Zend\Session\SessionManager; +use Zend\Session\Container; +use Bareos\BSock\BareosBsock; class Module { @@ -19,6 +22,7 @@ public function onBootstrap(MvcEvent $e) $eventManager = $e->getApplication()->getEventManager(); $moduleRouteListener = new ModuleRouteListener(); $moduleRouteListener->attach($eventManager); + $this->initSession($e); } public function getConfig() @@ -35,9 +39,105 @@ public function getAutoloaderConfig() 'Zend\Loader\StandardAutoloader' => array( 'namespaces' => array( __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, - 'Bareos' => __DIR__ .'/../../vendor/Bareos/library/Bareos', + 'Bareos' => __DIR__ .'/../../vendor/Bareos/library/Bareos', ), ), ); } + + public function initSession($e) + { + $session = $e->getApplication()->getServiceManager()->get('Zend\Session\SessionManager'); + $session->start(); + + $container = new Container('bareos'); + + if(!isset($container->init)) { + + $serviceManager = $e->getApplication()->getServiceManager(); + $request = $serviceManager->get('Request'); + + $session->regenerateId(true); + $container->init = 1; + $container->remoteAddr = $request->getServer()->get('REMOTE_ADDR'); + $container->httpUserAgent = $request->getServer()->get('HTTP_USER_AGENT'); + $container->username = ""; + $container->authenticated = false; + + $config = $serviceManager->get('Config'); + + if(!isset($config['session'])) { + return; + } + + $sessionConfig = $config['session']; + + if (isset($sessionConfig['validators'])) { + $chain = $session->getValidatorChain(); + foreach ($sessionConfig['validators'] as $validator) { + switch ($validator) { + case 'Zend\Session\Validator\HttpUserAgent': + $validator = new $validator($container->httpUserAgent); + break; + case 'Zend\Session\Validator\RemoteAddr': + $validator = new $validator($container->remoteAddr); + break; + default: + $validator = new $validator(); + } + $chain->attach('session.validate', array($validator, 'isValid')); + } + } + + } + + } + + public function getServiceConfig() + { + return array( + 'factories' => array( + 'Zend\Session\SessionManager' => function ($sm) { + $config = $sm->get('config'); + + if (isset($config['session'])) { + + $session = $config['session']; + + $sessionConfig = null; + + if(isset($session['config'])) { + $class = isset($session['config']['class']) ? $session['config']['class'] : 'Zend\Session\Config\SessionConfig'; + $options = isset($session['config']['options']) ? $session['config']['options'] : array(); + $sessionConfig = new $class(); + $sessionConfig->setOptions($options); + } + + $sessionStorage = null; + + if (isset($session['storage'])) { + $class = $session['storage']; + $sessionStorage = new $class(); + } + + $sessionSaveHandler = null; + + if (isset($session['save_handler'])) { + // class should be fetched from service manager since it will require constructor arguments + $sessionSaveHandler = $sm->get($session['save_handler']); + } + + $sessionManager = new SessionManager($sessionConfig, $sessionStorage, $sessionSaveHandler); + + } else { + $sessionManager = new SessionManager(); + } + + Container::setDefaultManager($sessionManager); + return $sessionManager; + } + ), + ); + } + } diff --git a/module/Application/config/module.config.php b/module/Application/config/module.config.php index 3e6a41d0..10341ca5 100644 --- a/module/Application/config/module.config.php +++ b/module/Application/config/module.config.php @@ -15,8 +15,8 @@ 'options' => array( 'route' => '/', 'defaults' => array( - 'controller' => 'Dashboard\Controller\Dashboard', - 'action' => 'index', + 'controller' => 'Auth\Controller\Auth', + 'action' => 'login', ), ), ), @@ -57,13 +57,20 @@ 'Zend\Cache\Service\StorageCacheAbstractServiceFactory', 'Zend\Log\LoggerAbstractServiceFactory', ), - 'factories' => array( - //'translator' => 'Zend\I18n\Translator\TranslatorServiceFactory', - 'navigation' => 'Zend\Navigation\Service\DefaultNavigationFactory', - ), + 'services' => array( + 'bsock' => new Bareos\BSock\BareosBSock(), + ), + 'shared' => array( + ), + 'factories' => array( + 'translator' => 'Zend\I18n\Translator\TranslatorServiceFactory', + 'navigation' => 'Zend\Navigation\Service\DefaultNavigationFactory', + ), 'aliases' => array( - 'translator' => 'MvcTranslator', + //'translator' => 'MvcTranslator', ), + 'invokables' => array( + ), ), 'translator' => array( 'locale' => 'en_US', @@ -77,22 +84,22 @@ ), 'controllers' => array( 'invokables' => array( - 'Application\Controller\Index' => 'Application\Controller\IndexController', + 'Application\Controller\Index' => 'Application\Controller\IndexController', ), ), 'view_helpers' => array( - 'invokables' => array ( - 'printDate' => 'Application\View\Helper\Date', - 'printJobStatus' => 'Application\View\Helper\JobStatus', - 'printJobLevel' => 'Application\View\Helper\JobLevel', - 'printJobType' => 'Application\View\Helper\JobType', - 'printJobDuration' => 'Application\View\Helper\JobDuration', - 'printBytes' => 'Application\View\Helper\Bytes', - 'printRetention' => 'Application\View\Helper\Retention', - 'printHumanReadableTimeperiod' => 'Application\View\Helper\HumanReadableTimeperiod', - 'printExpiration' => 'Application\View\Helper\Expiration', - 'printStatusGlyphicons' => 'Application\View\Helper\StatusGlyphicons', - ), + 'invokables' => array ( + 'printDate' => 'Application\View\Helper\Date', + 'printJobStatus' => 'Application\View\Helper\JobStatus', + 'printJobLevel' => 'Application\View\Helper\JobLevel', + 'printJobType' => 'Application\View\Helper\JobType', + 'printJobDuration' => 'Application\View\Helper\JobDuration', + 'printBytes' => 'Application\View\Helper\Bytes', + 'printRetention' => 'Application\View\Helper\Retention', + 'printHumanReadableTimeperiod' => 'Application\View\Helper\HumanReadableTimeperiod', + 'printExpiration' => 'Application\View\Helper\Expiration', + 'printStatusGlyphicons' => 'Application\View\Helper\StatusGlyphicons', + ), ), 'view_manager' => array( 'display_not_found_reason' => true, @@ -109,9 +116,9 @@ 'template_path_stack' => array( __DIR__ . '/../view', ), - 'strategies' => array( - 'ViewJsonStrategy', - ), + 'strategies' => array( + 'ViewJsonStrategy', + ), ), // Placeholder for console routes 'console' => array( @@ -121,76 +128,77 @@ ), ), 'navigation' => array( - 'default' => array( - /* - array( - 'label' => 'Home', - 'route' => 'home', - ), - */ - array( - 'label' => 'Dashboard', - 'route' => 'dashboard', - ), - array( - 'label' => 'Director', - 'route' => 'director', - ), - array( - 'label' => 'Filesets', - 'route' => 'fileset', - ), - array( - 'label' => 'Pools', - 'route' => 'pool', - ), - array( - 'label' => 'Volumes', - 'route' => 'media', - ), - array( - 'label' => 'Storages', - 'route' => 'storage', - ), - array( - 'label' => 'Clients', - 'route' => 'client', - ), - array( - 'label' => 'Jobs', - 'route' => 'job', - ), - /* - array( - 'label' => 'Files', - 'route' => 'file', - ), - */ - array( - 'label' => 'Logs', - 'route' => 'log', - ), - /* - array( - 'label' => 'Restore', - 'route' => 'restore', - ), - */ - array( - 'label' => 'Statistics', - 'route' => 'statistics', - ), - /* - array( - 'label' => 'Administration', - 'route' => 'admin', - ), - array( - 'label' => 'User', - 'route' => 'user', + 'default' => array( + /* + array( + 'label' => 'Home', + 'route' => 'home', + ), + */ + array( + 'label' => 'Dashboard', + 'route' => 'dashboard', + ), + array( + 'label' => 'Director', + 'route' => 'director', + ), + array( + 'label' => 'Filesets', + 'route' => 'fileset', + ), + array( + 'label' => 'Pools', + 'route' => 'pool', + ), + array( + 'label' => 'Volumes', + 'route' => 'media', + ), + array( + 'label' => 'Storages', + 'route' => 'storage', + ), + array( + 'label' => 'Clients', + 'route' => 'client', + ), + array( + 'label' => 'Jobs', + 'route' => 'job', + ), + /* + array( + 'label' => 'Files', + 'route' => 'file', + ), + */ + array( + 'label' => 'Logs', + 'route' => 'log', + ), + /* + array( + 'label' => 'Restore', + 'route' => 'restore', + ), + */ + array( + 'label' => 'Statistics', + 'route' => 'statistics', + ), + /* + array( + 'label' => 'Administration', + 'route' => 'admin', + ), + */ + array( + 'label' => 'Logout', + 'route' => 'auth', + 'action' => 'logout', + ), ), - */ - ), ), ); diff --git a/module/Application/src/Application/Controller/IndexController.php b/module/Application/src/Application/Controller/IndexController.php index 55a93453..9cf02605 100644 --- a/module/Application/src/Application/Controller/IndexController.php +++ b/module/Application/src/Application/Controller/IndexController.php @@ -20,5 +20,5 @@ public function indexAction() return new ViewModel(); } - + } diff --git a/module/Application/src/Application/View/Helper/Bytes.php b/module/Application/src/Application/View/Helper/Bytes.php index b9f27c26..165c22b8 100644 --- a/module/Application/src/Application/View/Helper/Bytes.php +++ b/module/Application/src/Application/View/Helper/Bytes.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Application/src/Application/View/Helper/Date.php b/module/Application/src/Application/View/Helper/Date.php index 7df480a5..9e57820e 100644 --- a/module/Application/src/Application/View/Helper/Date.php +++ b/module/Application/src/Application/View/Helper/Date.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Application/src/Application/View/Helper/Expiration.php b/module/Application/src/Application/View/Helper/Expiration.php index 0da5dd40..8503ded0 100644 --- a/module/Application/src/Application/View/Helper/Expiration.php +++ b/module/Application/src/Application/View/Helper/Expiration.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Application/src/Application/View/Helper/HumanReadableTimeperiod.php b/module/Application/src/Application/View/Helper/HumanReadableTimeperiod.php index 455ae44a..b77642e9 100644 --- a/module/Application/src/Application/View/Helper/HumanReadableTimeperiod.php +++ b/module/Application/src/Application/View/Helper/HumanReadableTimeperiod.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Application/src/Application/View/Helper/JobDuration.php b/module/Application/src/Application/View/Helper/JobDuration.php index e92d7480..ffb8d961 100644 --- a/module/Application/src/Application/View/Helper/JobDuration.php +++ b/module/Application/src/Application/View/Helper/JobDuration.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Application/src/Application/View/Helper/JobLevel.php b/module/Application/src/Application/View/Helper/JobLevel.php index 3019a011..787d7f77 100644 --- a/module/Application/src/Application/View/Helper/JobLevel.php +++ b/module/Application/src/Application/View/Helper/JobLevel.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Application/src/Application/View/Helper/JobStatus.php b/module/Application/src/Application/View/Helper/JobStatus.php index 7fe4d0cf..9760b3a5 100644 --- a/module/Application/src/Application/View/Helper/JobStatus.php +++ b/module/Application/src/Application/View/Helper/JobStatus.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Application/src/Application/View/Helper/JobType.php b/module/Application/src/Application/View/Helper/JobType.php index 7468bbdc..6cd5a3d7 100644 --- a/module/Application/src/Application/View/Helper/JobType.php +++ b/module/Application/src/Application/View/Helper/JobType.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Application/src/Application/View/Helper/Retention.php b/module/Application/src/Application/View/Helper/Retention.php index d05206d9..eb8f56c5 100644 --- a/module/Application/src/Application/View/Helper/Retention.php +++ b/module/Application/src/Application/View/Helper/Retention.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Application/src/Application/View/Helper/StatusGlyphicons.php b/module/Application/src/Application/View/Helper/StatusGlyphicons.php index 5f853ec7..ccdfd624 100644 --- a/module/Application/src/Application/View/Helper/StatusGlyphicons.php +++ b/module/Application/src/Application/View/Helper/StatusGlyphicons.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Application/view/application/index/index.phtml b/module/Application/view/application/index/index.phtml index a20faf56..b95b2285 100644 --- a/module/Application/view/application/index/index.phtml +++ b/module/Application/view/application/index/index.phtml @@ -3,9 +3,9 @@ /** * * bareos-webui - Bareos Web-Frontend - * + * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify @@ -22,4 +22,3 @@ * along with this program. If not, see . * */ - \ No newline at end of file diff --git a/module/Application/view/error/404.phtml b/module/Application/view/error/404.phtml index 323733d5..aa63a901 100644 --- a/module/Application/view/error/404.phtml +++ b/module/Application/view/error/404.phtml @@ -1,3 +1,5 @@ +layout('layout/error'); ?> +

translate('A 404 error occurred') ?>

message ?>

diff --git a/module/Application/view/error/index.phtml b/module/Application/view/error/index.phtml index 5165cd8e..6f7fdb53 100644 --- a/module/Application/view/error/index.phtml +++ b/module/Application/view/error/index.phtml @@ -1,3 +1,6 @@ + +layout('layout/error'); ?> +

translate('An error occurred') ?>

message ?>

diff --git a/module/Application/view/layout/error.phtml b/module/Application/view/layout/error.phtml new file mode 100644 index 00000000..a32a2e97 --- /dev/null +++ b/module/Application/view/layout/error.phtml @@ -0,0 +1,71 @@ +. + * + */ + +echo $this->doctype(); + +?> + + + + + + headTitle('Bareos')->setSeparator(' - ')->setAutoEscape(false) ?> + + headMeta() + ->appendName('viewport', 'width=device-width, initial-scale=1.0') + ->appendHttpEquiv('X-UA-Compatible', 'IE=edge') + ?> + + + headLink(array('rel' => 'shortcut icon', 'type' => 'image/vnd.microsoft.icon', 'href' => $this->basePath() . '/img/favicon.ico')) + ->prependStylesheet($this->basePath() . '/css/style.css') + ->prependStylesheet($this->basePath() . '/css/bootstrap-theme.min.css') + ->prependStylesheet($this->basePath() . '/css/bootstrap.min.css') + ->prependStylesheet($this->basePath() . '/css/jquery.jqplot.min.css') + ?> + + + headScript() + ->prependFile($this->basePath() . '/js/bootstrap.min.js') + ->prependFile($this->basePath() . '/js/excanvas.min.js') + ->prependFile($this->basePath() . '/js/jquery.min.js') + ->prependFile($this->basePath() . '/js/respond.min.js', 'text/javascript', array('conditional' => 'lt IE 9',)) + ->prependFile($this->basePath() . '/js/html5shiv.js', 'text/javascript', array('conditional' => 'lt IE 9',)); + ?> + + + + + +
+ content; ?> +
+ + inlineScript() ?> + + + + diff --git a/module/Application/view/layout/install.phtml b/module/Application/view/layout/install.phtml index 615b8fda..21b4943d 100644 --- a/module/Application/view/layout/install.phtml +++ b/module/Application/view/layout/install.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Application/view/layout/layout.phtml b/module/Application/view/layout/layout.phtml index 78128cf7..995213f5 100644 --- a/module/Application/view/layout/layout.phtml +++ b/module/Application/view/layout/layout.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * @@ -64,41 +64,38 @@ echo $this->doctype(); - + - +
content; ?>
- +
diff --git a/module/Application/view/layout/login.phtml b/module/Application/view/layout/login.phtml new file mode 100644 index 00000000..f08d6c28 --- /dev/null +++ b/module/Application/view/layout/login.phtml @@ -0,0 +1,85 @@ +. + * + */ + +echo $this->doctype(); + +?> + + + + + + headTitle('Bareos')->setSeparator(' - ')->setAutoEscape(false) ?> + + headMeta() + ->appendName('viewport', 'width=device-width, initial-scale=1.0') + ->appendHttpEquiv('X-UA-Compatible', 'IE=edge') + ?> + + + headLink(array('rel' => 'shortcut icon', 'type' => 'image/vnd.microsoft.icon', 'href' => $this->basePath() . '/img/favicon.ico')) + ->prependStylesheet($this->basePath() . '/css/style.css') + ->prependStylesheet($this->basePath() . '/css/bootstrap-theme.min.css') + ->prependStylesheet($this->basePath() . '/css/bootstrap.min.css') + ->prependStylesheet($this->basePath() . '/css/jquery.jqplot.min.css') + ?> + + + headScript() + ->prependFile($this->basePath() . '/js/bootstrap.min.js') + ->prependFile($this->basePath() . '/js/excanvas.min.js') + ->prependFile($this->basePath() . '/js/jqplot.pieRenderer.min.js') + ->prependFile($this->basePath() . '/js/jqplot.barRenderer.min.js') + ->prependFile($this->basePath() . '/js/jqplot.categoryAxisRenderer.min.js') + ->prependFile($this->basePath() . '/js/jqplot.pointLabels.min.js') + ->prependFile($this->basePath() . '/js/jquery.jqplot.min.js') + ->prependFile($this->basePath() . '/js/jquery.min.js') + ->prependFile($this->basePath() . '/js/respond.min.js', 'text/javascript', array('conditional' => 'lt IE 9',)) + ->prependFile($this->basePath() . '/js/html5shiv.js', 'text/javascript', array('conditional' => 'lt IE 9',)); + ?> + + + + + +
+ + + + content; ?> + + + +
+ + inlineScript() ?> + + + + + diff --git a/module/Auth/Module.php b/module/Auth/Module.php new file mode 100644 index 00000000..e31752c7 --- /dev/null +++ b/module/Auth/Module.php @@ -0,0 +1,50 @@ +. + * + */ + +namespace Auth; + +class Module +{ + + public function getAutoloaderConfig() + { + return array( + 'Zend\Loader\ClassMapAutoloader' => array( + __DIR__ . '/autoload_classmap.php', + ), + 'Zend\Loader\StandardAutoloader' => array( + 'namespaces' => array( + __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, + ), + ), + ); + } + + public function getConfig() + { + return include __DIR__ . '/config/module.config.php'; + } + +} diff --git a/module/Auth/autoload_classmap.php b/module/Auth/autoload_classmap.php new file mode 100644 index 00000000..8246db12 --- /dev/null +++ b/module/Auth/autoload_classmap.php @@ -0,0 +1,26 @@ +. + * + */ + +return array(); diff --git a/module/Auth/config/module.config.php b/module/Auth/config/module.config.php new file mode 100644 index 00000000..db2a4e93 --- /dev/null +++ b/module/Auth/config/module.config.php @@ -0,0 +1,59 @@ +. + * + */ + +return array( + + 'controllers' => array( + 'invokables' => array( + 'Auth\Controller\Auth' => 'Auth\Controller\AuthController', + ), + ), + + 'router' => array( + 'routes' => array( + 'auth' => array( + 'type' => 'segment', + 'options' => array( + 'route' => '/auth[/][:action][/:id]', + 'constraints' => array( + 'action' => '[a-zA-Z][a-zA-Z0-9_-]*', + 'id' => '[0-9]+', + ), + 'defaults' => array( + 'controller' => 'Auth\Controller\Auth', + 'action' => 'index', + ), + ), + ), + ), + ), + + 'view_manager' => array( + 'template_path_stack' => array( + 'auth' => __DIR__ . '/../view', + ), + ), + +); diff --git a/module/Auth/src/Auth/Controller/AuthController.php b/module/Auth/src/Auth/Controller/AuthController.php new file mode 100644 index 00000000..b521ea7c --- /dev/null +++ b/module/Auth/src/Auth/Controller/AuthController.php @@ -0,0 +1,148 @@ +. + * + */ + +namespace Auth\Controller; + +use Zend\Mvc\Controller\AbstractActionController; +use Zend\View\Model\ViewModel; +use Auth\Model\Auth; +use Auth\Form\LoginForm; +use Zend\Session\Container; + +class AuthController extends AbstractActionController +{ + + protected $bsock; + + public function indexAction() + { + return new ViewModel(); + } + + public function loginAction() + { + + if(isset($_SESSION['bareos']['authenticated']) && $_SESSION['bareos']['authenticated']) { + return $this->redirect()->toRoute('dashboard', array('action' => 'index')); + } + + $this->layout('layout/login'); + + $config = $this->getServiceLocator()->get('Config'); + + $form = new LoginForm($config['directors']); + $form->get('submit')->setValue('Login'); + + $request = $this->getRequest(); + + if($request->isPost()) { + + $auth = new Auth(); + $form->setInputFilter($auth->getInputFilter()); + $form->setData($request->getPost()); + + if($form->isValid()) { + + $director = $form->getInputFilter()->getValue('director'); + $username = $form->getInputFilter()->getValue('consolename'); + $password = $form->getInputFilter()->getValue('password'); + + $config = $this->getServiceLocator()->get('Config'); + $this->bsock = $this->getServiceLocator()->get('bsock'); + $this->bsock->set_config($config['directors'][$director]); + $this->bsock->set_user_credentials($username, $password); + + if($this->bsock->auth($username, $password)) { + //$session = new Container('user'); + $_SESSION['bareos']['director'] = $director; + $_SESSION['bareos']['username'] = $username; + $_SESSION['bareos']['password'] = $password; + $_SESSION['bareos']['authenticated'] = true; + $_SESSION['bareos']['socket'] = $this->bsock; + $this->bsock->disconnect(); + return $this->redirect()->toRoute('dashboard', array('action' => 'index')); + } else { + + // todo - give user a message about what went wrong + + // if we get false, wrong credentials(username, password) in this case, pass a message in auth action login and display + // if we get a exception the socket could not be initialized for whatever reason + + $this->bsock->disconnect(); + session_destroy(); + //return $this->redirect()->toRoute('auth', array('action' => 'login')); + $err_msg = "Sorry, can not authenticate. Wrong username and/or password."; + return new ViewModel( + array( + 'form' => $form, + 'err_msg' => $err_msg, + ) + ); + } + + } else { + + // todo - give user a message about what went wrong + + // given credentials in login form could not be validated in this case + $err_msg = "Please provide a director, username and password."; + + //$this->bsock->disconnect(); + session_destroy(); + //return $this->redirect()->toRoute('auth', array('action' => 'login')); + + return new ViewModel( + array( + 'form' => $form, + 'err_msg' => $err_msg, + ) + ); + + } + + } + + return new ViewModel( + array( + 'form' => $form, + ) + ); + + } + + public function logoutAction() + { + + // todo - ask user if he's really sure to logout! + // "Do you really want to logout?" + + unset($_SESSION['user']); + session_destroy(); + //$this->bsock = $this->getServiceLocator()->get('bsock'); + //$this->bsock->disconnect(); + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } + +} diff --git a/module/Auth/src/Auth/Form/LoginForm.php b/module/Auth/src/Auth/Form/LoginForm.php new file mode 100644 index 00000000..c87e44c7 --- /dev/null +++ b/module/Auth/src/Auth/Form/LoginForm.php @@ -0,0 +1,101 @@ +. + * + */ + +namespace Auth\Form; + +use Zend\Form\Form; + +class LoginForm extends Form +{ + + protected $config; + + public function __construct($config=null, $name=null) + { + + $this->config = $config; + + parent::__construct('login'); + + $this->add(array( + 'name' => 'director', + 'type' => 'select', + 'options' => array( + 'label' => 'Director', + 'empty_option' => 'Please choose a director', + 'value_options' => $this->getDirectors(), + ), + ) + ); + + $this->add(array( + 'name' => 'consolename', + 'type' => 'text', + 'options' => array( + 'label' => 'Username', + ), + 'attributes' => array( + 'placeholder' => 'Username', + ), + ) + ); + + $this->add(array( + 'name' => 'password', + 'type' => 'password', + 'options' => array( + 'label' => 'Password', + ), + 'attributes' => array( + 'placeholder' => 'Password', + ), + ) + ); + + $this->add(array( + 'name' => 'submit', + 'type' => 'submit', + 'attributes' => array( + 'value' => 'submit', + 'id' => 'submit', + ), + ) + ); + + } + + + public function getDirectors() + { + $selectData = array(); + + foreach($this->config as $dird) { + $selectData[$dird['host']] = $dird['host']; + } + + return $selectData; + } + +} diff --git a/module/Auth/src/Auth/Model/Auth.php b/module/Auth/src/Auth/Model/Auth.php new file mode 100644 index 00000000..6f756cd0 --- /dev/null +++ b/module/Auth/src/Auth/Model/Auth.php @@ -0,0 +1,82 @@ +inputFilter) { + + $inputFilter = new InputFilter(); + + $inputFilter->add(array( + 'name' => 'director', + 'required' => true, + 'filters' => array( + array('name' => 'StripTags'), + array('name' => 'StringTrim'), + ), + 'validators' => array(), + )); + + $inputFilter->add(array( + 'name' => 'consolename', + 'required' => true, + 'filters' => array( + array('name' => 'StripTags'), + array('name' => 'StringTrim'), + ), + 'validators' => array( + array( + 'name' => 'StringLength', + 'options' => array( + 'encoding' => 'UTF-8', + 'min' => 1, + 'max' => 64, + ), + ), + ), + )); + + $inputFilter->add(array( + 'name' => 'password', + 'required' => true, + 'filters' => array(), + 'validators' => array( + array( + 'name' => 'StringLength', + 'options' => array( + 'encoding' => 'UTF-8', + 'min' => 1, + 'max' => 64, + ), + ), + ), + )); + + $this->inputFilter = $inputFilter; + + } + + return $this->inputFilter; + + } + +} diff --git a/CHANGELOG.md b/module/Auth/view/auth/auth/index.phtml similarity index 100% rename from CHANGELOG.md rename to module/Auth/view/auth/auth/index.phtml diff --git a/module/Auth/view/auth/auth/login.phtml b/module/Auth/view/auth/auth/login.phtml new file mode 100644 index 00000000..9fb591a7 --- /dev/null +++ b/module/Auth/view/auth/auth/login.phtml @@ -0,0 +1,57 @@ +. + * + */ + +$title = 'Login'; +$this->headTitle($title); + +?> + +
+
+
+
+ +prepare(); + +echo $this->form()->openTag($form); +echo $this->formRow($form->get('director')->setAttribute('class','form-control')); +echo $this->formRow($form->get('consolename')->setAttribute('class','form-control')); +echo $this->formRow($form->get('password')->setAttribute('class','form-control')); +echo $this->formSubmit($form->get('submit')->setAttribute('class','btn btn-primary')); +echo $this->form()->closeTag(); + +if(isset($this->err_msg)) { + echo "

" . $this->err_msg ."

"; +} + +?> + +
+
+
+
diff --git a/module/Auth/view/auth/auth/logout.phtml b/module/Auth/view/auth/auth/logout.phtml new file mode 100644 index 00000000..e69de29b diff --git a/module/Client/Module.php b/module/Client/Module.php index d29d4513..b3d57760 100644 --- a/module/Client/Module.php +++ b/module/Client/Module.php @@ -40,11 +40,12 @@ public function getServiceConfig() return $table; }, 'ClientTableGateway' => function($sm) { - $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); + //$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); + $dbAdapter = $sm->get($_SESSION['bareos']['director']); $resultSetPrototype = new ResultSet(); $resultSetPrototype->setArrayObjectPrototype(new Client()); $config = $sm->get('Config'); - $bsqlch = new BareosSqlCompatHelper($config['db']['driver']); + $bsqlch = new BareosSqlCompatHelper($config['db']['adapters'][$_SESSION['bareos']['director']]['driver']); return new TableGateway($bsqlch->strdbcompat("Client"), $dbAdapter, null, $resultSetPrototype); }, ), diff --git a/module/Client/src/Client/Controller/ClientController.php b/module/Client/src/Client/Controller/ClientController.php index 731734da..4f59d5b2 100644 --- a/module/Client/src/Client/Controller/ClientController.php +++ b/module/Client/src/Client/Controller/ClientController.php @@ -14,46 +14,55 @@ class ClientController extends AbstractActionController public function indexAction() { - $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'ClientId'; - $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; - $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; - $paginator = $this->getClientTable()->fetchAll(true, $order_by, $order); - $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); - $paginator->setItemCountPerPage($limit); + if($_SESSION['bareos']['authenticated'] == true) { + $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'ClientId'; + $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; + $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; + $paginator = $this->getClientTable()->fetchAll(true, $order_by, $order); + $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); + $paginator->setItemCountPerPage($limit); - return new ViewModel( - array( - 'paginator' => $paginator, - 'order_by' => $order_by, - 'order' => $order, - 'limit' => $limit, - ) - ); + return new ViewModel( + array( + 'paginator' => $paginator, + 'order_by' => $order_by, + 'order' => $order, + 'limit' => $limit, + ) + ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } public function detailsAction() { + if($_SESSION['bareos']['authenticated'] == true) { + $id = (int) $this->params()->fromRoute('id', 0); + if(!$id) { + return $this->redirect()->toRoute('client'); + } - $id = (int) $this->params()->fromRoute('id', 0); - if(!$id) { - return $this->redirect()->toRoute('client'); - } - - $result = $this->getClientTable()->getClient($id); - $cmd = 'status client="' . $result->name . '"'; - $config = $this->getServiceLocator()->get('Config'); - $bsock = new BareosBSock(); - $bsock->set_config($config['director']); - $bsock->init(); - - return new ViewModel( - array( - 'client' => $this->getClientTable()->getClient($id), - 'job' => $this->getJobTable()->getLastSuccessfulClientJob($id), - 'bconsoleOutput' => $bsock->send_command($cmd), - ) - ); + $result = $this->getClientTable()->getClient($id); + $cmd = 'status client="' . $result->name . '"'; + $config = $this->getServiceLocator()->get('Config'); + $bsock = new BareosBSock(); + $bsock->set_config($config['directors'][$_SESSION['bareos']['director']]); + $bsock->set_user_credentials($_SESSION['bareos']['username'], $_SESSION['bareos']['password']); + $bsock->init(); + return new ViewModel( + array( + 'client' => $this->getClientTable()->getClient($id), + 'job' => $this->getJobTable()->getLastSuccessfulClientJob($id), + 'bconsoleOutput' => $bsock->send_command($cmd), + ) + ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } public function getClientTable() diff --git a/module/Client/src/Client/Model/ClientTable.php b/module/Client/src/Client/Model/ClientTable.php index 1138900e..33433ea0 100644 --- a/module/Client/src/Client/Model/ClientTable.php +++ b/module/Client/src/Client/Model/ClientTable.php @@ -31,15 +31,15 @@ public function getServiceLocator() { public function getDbDriverConfig() { $config = $this->getServiceLocator()->get('Config'); - return $config['db']['driver']; + return $config['db']['adapters'][$_SESSION['bareos']['director']]['driver']; } - public function fetchAll($paginated=false, $order_by=null, $order=null) + public function fetchAll($paginated=false, $order_by=null, $order=null) { $bsqlch = new BareosSqlCompatHelper($this->getDbDriverConfig()); $select = new Select(); $select->from($bsqlch->strdbcompat("Client")); - + if($order_by != null && $order != null) { $select->order($bsqlch->strdbcompat($order_by) . " " . $order); } diff --git a/module/Dashboard/config/module.config.php b/module/Dashboard/config/module.config.php index 5cc95c5a..f496f7d2 100644 --- a/module/Dashboard/config/module.config.php +++ b/module/Dashboard/config/module.config.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Dashboard/src/Dashboard/Controller/DashboardController.php b/module/Dashboard/src/Dashboard/Controller/DashboardController.php index 76f84c45..7f223c14 100644 --- a/module/Dashboard/src/Dashboard/Controller/DashboardController.php +++ b/module/Dashboard/src/Dashboard/Controller/DashboardController.php @@ -3,9 +3,9 @@ /** * * bareos-webui - Bareos Web-Frontend - * + * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify @@ -32,19 +32,22 @@ class DashboardController extends AbstractActionController { protected $jobTable; - + public function indexAction() { - return new ViewModel( - array( - - 'lastSuccessfulJobs' => $this->getJobTable()->getLast24HoursSuccessfulJobs(), - 'lastUnsuccessfulJobs' => $this->getJobTable()->getLast24HoursUnsuccessfulJobs(), - 'waitingJobs' => $this->getJobTable()->getWaitingJobs(), - 'runningJobs' => $this->getJobTable()->getRunningJobs(), - - ) - ); + if($_SESSION['bareos']['authenticated'] == true) { + return new ViewModel( + array( + 'lastSuccessfulJobs' => $this->getJobTable()->getLast24HoursSuccessfulJobs(), + 'lastUnsuccessfulJobs' => $this->getJobTable()->getLast24HoursUnsuccessfulJobs(), + 'waitingJobs' => $this->getJobTable()->getWaitingJobs(), + 'runningJobs' => $this->getJobTable()->getRunningJobs(), + ) + ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } public function getJobTable() @@ -56,6 +59,6 @@ public function getJobTable() } return $this->jobTable; } - + } diff --git a/module/Dashboard/src/Dashboard/Model/Dashboard.php b/module/Dashboard/src/Dashboard/Model/Dashboard.php index bd9d5d2d..b9e9f176 100644 --- a/module/Dashboard/src/Dashboard/Model/Dashboard.php +++ b/module/Dashboard/src/Dashboard/Model/Dashboard.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Dashboard/src/Dashboard/Model/DashboardTable.php b/module/Dashboard/src/Dashboard/Model/DashboardTable.php index 008866b0..222ef65a 100644 --- a/module/Dashboard/src/Dashboard/Model/DashboardTable.php +++ b/module/Dashboard/src/Dashboard/Model/DashboardTable.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Dashboard/view/dashboard/dashboard/index.phtml b/module/Dashboard/view/dashboard/dashboard/index.phtml index f358eb67..657179bc 100644 --- a/module/Dashboard/view/dashboard/dashboard/index.phtml +++ b/module/Dashboard/view/dashboard/dashboard/index.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Director/Module.php b/module/Director/Module.php index a5ab51a9..4fac226c 100644 --- a/module/Director/Module.php +++ b/module/Director/Module.php @@ -10,7 +10,7 @@ class Module { - public function getAutoloaderConfig() + public function getAutoloaderConfig() { return array( 'Zend\Loader\ClassMapAutoloader' => array( @@ -24,16 +24,16 @@ public function getAutoloaderConfig() ); } - public function getConfig() + public function getConfig() { return include __DIR__ . '/config/module.config.php'; } - public function getServiceConfig() + public function getServiceConfig() { return array( 'factories' => array( - 'Director\Model\DirectorTable' => function($sm) + 'Director\Model\DirectorTable' => function($sm) { $tableGateway = $sm->get('DirectorTableGateway'); $table = new DirectorTable($tableGateway); diff --git a/module/Director/config/module.config.php b/module/Director/config/module.config.php index 016fd3aa..bd4cc5f2 100644 --- a/module/Director/config/module.config.php +++ b/module/Director/config/module.config.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Director/src/Director/Controller/DirectorController.php b/module/Director/src/Director/Controller/DirectorController.php index 0dafea71..1e2384f8 100644 --- a/module/Director/src/Director/Controller/DirectorController.php +++ b/module/Director/src/Director/Controller/DirectorController.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * @@ -37,62 +37,92 @@ class DirectorController extends AbstractActionController public function indexAction() { - $cmd = "status director"; - $config = $this->getServiceLocator()->get('Config'); - $bsock = new BareosBSock(); - $bsock->set_config($config['director']); - $bsock->init(); - return new ViewModel(array( - 'directorOutput' => $bsock->send_command($cmd), - )); + if($_SESSION['bareos']['authenticated'] == true) { + $cmd = "status director"; + $config = $this->getServiceLocator()->get('Config'); + $bsock = new BareosBSock(); + $bsock->set_config($config['directors'][$_SESSION['bareos']['director']]); + $bsock->set_user_credentials($_SESSION['bareos']['username'], $_SESSION['bareos']['password']); + $bsock->init(); + return new ViewModel(array( + 'directorOutput' => $bsock->send_command($cmd), + )); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } public function messagesAction() { - $cmd = "messages"; - $config = $this->getServiceLocator()->get('Config'); - $bsock = new BareosBSock(); - $bsock->set_config($config['director']); - $bsock->init(); - return new ViewModel(array( - 'directorOutput' => $bsock->send_command($cmd), - )); + if($_SESSION['bareos']['authenticated'] == true) { + $cmd = "messages"; + $config = $this->getServiceLocator()->get('Config'); + $bsock = new BareosBSock(); + $bsock->set_config($config['directors'][$_SESSION['bareos']['director']]); + $bsock->set_user_credentials($_SESSION['bareos']['username'], $_SESSION['bareos']['password']); + $bsock->init(); + return new ViewModel(array( + 'directorOutput' => $bsock->send_command($cmd), + )); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } public function scheduleAction() { - $cmd = "show schedule"; - $config = $this->getServiceLocator()->get('Config'); - $bsock = new BareosBSock(); - $bsock->set_config($config['director']); - $bsock->init(); - return new ViewModel(array( - 'directorOutput' => $bsock->send_command($cmd), - )); + if($_SESSION['bareos']['authenticated'] == true) { + $cmd = "show schedule"; + $config = $this->getServiceLocator()->get('Config'); + $bsock = new BareosBSock(); + $bsock->set_config($config['directors'][$_SESSION['bareos']['director']]); + $bsock->set_user_credentials($_SESSION['bareos']['username'], $_SESSION['bareos']['password']); + $bsock->init(); + return new ViewModel(array( + 'directorOutput' => $bsock->send_command($cmd), + )); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } public function schedulerstatusAction() { - $cmd = "status scheduler"; - $config = $this->getServiceLocator()->get('Config'); - $bsock = new BareosBSock(); - $bsock->set_config($config['director']); - $bsock->init(); - return new ViewModel(array( - 'directorOutput' => $bsock->send_command($cmd), - )); + if($_SESSION['bareos']['authenticated'] == true) { + $cmd = "status scheduler"; + $config = $this->getServiceLocator()->get('Config'); + $bsock = new BareosBSock(); + $bsock->set_config($config['directors'][$_SESSION['bareos']['director']]); + $bsock->set_user_credentials($_SESSION['bareos']['username'], $_SESSION['bareos']['password']); + $bsock->init(); + return new ViewModel(array( + 'directorOutput' => $bsock->send_command($cmd), + )); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } public function versionAction() { - $cmd = "version"; - $config = $this->getServiceLocator()->get('Config'); - $bsock = new BareosBSock(); - $bsock->set_config($config['director']); - $bsock->init(); - return new ViewModel(array( - 'directorOutput' => $bsock->send_command($cmd), - )); + if($_SESSION['bareos']['authenticated'] == true) { + $cmd = "version"; + $config = $this->getServiceLocator()->get('Config'); + $bsock = new BareosBSock(); + $bsock->set_config($config['directors'][$_SESSION['bareos']['director']]); + $bsock->set_user_credentials($_SESSION['bareos']['username'], $_SESSION['bareos']['password']); + $bsock->init(); + return new ViewModel(array( + 'directorOutput' => $bsock->send_command($cmd), + )); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } } diff --git a/module/Director/src/Director/Model/Director.php b/module/Director/src/Director/Model/Director.php index 0c3e870c..d8e4b401 100644 --- a/module/Director/src/Director/Model/Director.php +++ b/module/Director/src/Director/Model/Director.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Director/src/Director/Model/DirectorTable.php b/module/Director/src/Director/Model/DirectorTable.php index f49e68c7..9dffbd95 100644 --- a/module/Director/src/Director/Model/DirectorTable.php +++ b/module/Director/src/Director/Model/DirectorTable.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Director/view/director/director/index.phtml b/module/Director/view/director/director/index.phtml index e9154669..ceaad3a3 100644 --- a/module/Director/view/director/director/index.phtml +++ b/module/Director/view/director/director/index.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Director/view/director/director/messages.phtml b/module/Director/view/director/director/messages.phtml index 2e2a1148..1612396a 100644 --- a/module/Director/view/director/director/messages.phtml +++ b/module/Director/view/director/director/messages.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Director/view/director/director/schedule.phtml b/module/Director/view/director/director/schedule.phtml index 66b7300e..e17ed6ca 100644 --- a/module/Director/view/director/director/schedule.phtml +++ b/module/Director/view/director/director/schedule.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Director/view/director/director/schedulerstatus.phtml b/module/Director/view/director/director/schedulerstatus.phtml index 27e1800c..19ac52bd 100644 --- a/module/Director/view/director/director/schedulerstatus.phtml +++ b/module/Director/view/director/director/schedulerstatus.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Director/view/director/director/version.phtml b/module/Director/view/director/director/version.phtml index 761f4acf..a62a38e6 100644 --- a/module/Director/view/director/director/version.phtml +++ b/module/Director/view/director/director/version.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/File/src/File/Controller/FileController.php b/module/File/src/File/Controller/FileController.php index 9259aaf7..16928f69 100644 --- a/module/File/src/File/Controller/FileController.php +++ b/module/File/src/File/Controller/FileController.php @@ -12,34 +12,44 @@ class FileController extends AbstractActionController public function indexAction() { - $paginator = $this->getFileTable()->fetchAll(true); - $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); - $paginator->setItemCountPerPage(15); + if($_SESSION['user']['authenticated'] == true) { + $paginator = $this->getFileTable()->fetchAll(true); + $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); + $paginator->setItemCountPerPage(15); - return new ViewModel( array('paginator' => $paginator) ); + return new ViewModel( array('paginator' => $paginator) ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } - public function revisionsAction() + public function revisionsAction() { } - public function jobidAction() + public function jobidAction() { - $id = (int) $this->params()->fromRoute('id', 0); - - if (!$id) { - return $this->redirect()->toRoute('job'); - } - - $paginator = $this->getFileTable()->getFileByJobId($id); - $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); - $paginator->setItemCountPerPage(20); + if($_SESSION['user']['authenticated'] == true) { + $id = (int) $this->params()->fromRoute('id', 0); + + if (!$id) { + return $this->redirect()->toRoute('job'); + } + + $paginator = $this->getFileTable()->getFileByJobId($id); + $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); + $paginator->setItemCountPerPage(20); - return new ViewModel( array('paginator' => $paginator) ); + return new ViewModel( array('paginator' => $paginator) ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } - - public function getFileTable() + + public function getFileTable() { if(!$this->fileTable) { $sm = $this->getServiceLocator(); @@ -47,6 +57,6 @@ public function getFileTable() } return $this->fileTable; } - + } diff --git a/module/File/src/File/Model/File.php b/module/File/src/File/Model/File.php index 957ab645..2134ddf5 100644 --- a/module/File/src/File/Model/File.php +++ b/module/File/src/File/Model/File.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/File/src/File/Model/FileTable.php b/module/File/src/File/Model/FileTable.php index 0d852f77..395a997f 100644 --- a/module/File/src/File/Model/FileTable.php +++ b/module/File/src/File/Model/FileTable.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Fileset/Module.php b/module/Fileset/Module.php index 9d9385be..dcb8a672 100644 --- a/module/Fileset/Module.php +++ b/module/Fileset/Module.php @@ -40,11 +40,12 @@ public function getServiceConfig() return $table; }, 'FilesetTableGateway' => function($sm) { - $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); + //$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); + $dbAdapter = $sm->get($_SESSION['bareos']['director']); $resultSetPrototype = new ResultSet(); $resultSetPrototype->setArrayObjectPrototype(new Fileset()); $config = $sm->get('Config'); - $bsqlch = new BareosSqlCompatHelper($config['db']['driver']); + $bsqlch = new BareosSqlCompatHelper($config['db']['adapters'][$_SESSION['bareos']['director']]['driver']); return new TableGateway($bsqlch->strdbcompat("FileSet"), $dbAdapter, null, $resultSetPrototype); }, ), diff --git a/module/Fileset/config/module.config.php b/module/Fileset/config/module.config.php index 25a108a1..afd19a48 100644 --- a/module/Fileset/config/module.config.php +++ b/module/Fileset/config/module.config.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Fileset/src/Fileset/Controller/FilesetController.php b/module/Fileset/src/Fileset/Controller/FilesetController.php index 6e85ce6f..ced7d7dc 100644 --- a/module/Fileset/src/Fileset/Controller/FilesetController.php +++ b/module/Fileset/src/Fileset/Controller/FilesetController.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify @@ -36,44 +36,55 @@ class FilesetController extends AbstractActionController public function indexAction() { - $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'FileSetId'; - $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; - $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; - $paginator = $this->getFilesetTable()->fetchAll(true, $order_by, $order); - $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); - $paginator->setItemCountPerPage($limit); + if($_SESSION['bareos']['authenticated'] == true) { + $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'FileSetId'; + $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; + $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; + $paginator = $this->getFilesetTable()->fetchAll(true, $order_by, $order); + $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); + $paginator->setItemCountPerPage($limit); - return new ViewModel( - array( - 'paginator' => $paginator, - 'order_by' => $order_by, - 'order' => $order, - 'limit' => $limit, - ) - ); + return new ViewModel( + array( + 'paginator' => $paginator, + 'order_by' => $order_by, + 'order' => $order, + 'limit' => $limit, + ) + ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } public function detailsAction() { - $id = (int) $this->params()->fromRoute('id', 0); - $fset = $this->getFilesetTable()->getFileSet($id); - $cmd = 'show fileset="' . $fset->fileset . '"'; - $config = $this->getServiceLocator()->get('Config'); - $bsock = new BareosBSock(); - $bsock->set_config($config['director']); - $bsock->init(); + if($_SESSION['bareos']['authenticated'] == true) { + $id = (int) $this->params()->fromRoute('id', 0); + $fset = $this->getFilesetTable()->getFileSet($id); + $cmd = 'show fileset="' . $fset->fileset . '"'; + $config = $this->getServiceLocator()->get('Config'); + $bsock = new BareosBSock(); + $bsock->set_config($config['directors'][$_SESSION['bareos']['director']]); + $bsock->set_user_credentials($_SESSION['bareos']['username'], $_SESSION['bareos']['password']); + $bsock->init(); - if (!$id) { - return $this->redirect()->toRoute('fileset'); - } + if (!$id) { + return $this->redirect()->toRoute('fileset'); + } - return new ViewModel( - array( - 'fileset' => $this->getFilesetTable()->getFileset($id), - 'history' => $this->getFilesetTable()->getFilesetHistory($id), - 'configuration' => $bsock->send_command($cmd), - ) - ); + return new ViewModel( + array( + 'fileset' => $this->getFilesetTable()->getFileset($id), + 'history' => $this->getFilesetTable()->getFilesetHistory($id), + 'configuration' => $bsock->send_command($cmd), + ) + ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } public function getFilesetTable() diff --git a/module/Fileset/src/Fileset/Model/Fileset.php b/module/Fileset/src/Fileset/Model/Fileset.php index 41ffd221..5478e528 100644 --- a/module/Fileset/src/Fileset/Model/Fileset.php +++ b/module/Fileset/src/Fileset/Model/Fileset.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Fileset/src/Fileset/Model/FilesetTable.php b/module/Fileset/src/Fileset/Model/FilesetTable.php index d7f42dcd..32c54cc4 100644 --- a/module/Fileset/src/Fileset/Model/FilesetTable.php +++ b/module/Fileset/src/Fileset/Model/FilesetTable.php @@ -3,9 +3,9 @@ /** * * bareos-webui - Bareos Web-Frontend - * + * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify @@ -54,15 +54,15 @@ public function getServiceLocator() { public function getDbDriverConfig() { $config = $this->getServiceLocator()->get('Config'); - return $config['db']['driver']; + return $config['db']['adapters'][$_SESSION['bareos']['director']]['driver']; } - public function fetchAll($paginated=false, $order_by=null, $order=null) + public function fetchAll($paginated=false, $order_by=null, $order=null) { $bsqlch = new BareosSqlCompatHelper($this->getDbDriverConfig()); $select = new Select(); $select->from($bsqlch->strdbcompat("FileSet")); - + if($order_by != null && $order != null) { $select->order($bsqlch->strdbcompat($order_by) . " " . $order); } @@ -103,17 +103,17 @@ public function getFileset($id) public function getFilesetHistory($id) { $fset = $this->getFileSet($id); - $bsqlch = new BareosSqlCompatHelper($this->getDbDriverConfig()); + $bsqlch = new BareosSqlCompatHelper($this->getDbDriverConfig()); $select = new Select(); $select->from($bsqlch->strdbcompat("FileSet")); $select->where($bsqlch->strdbcompat("FileSet") . " = '". $fset->fileset . "'"); $select->order($bsqlch->strdbcompat("CreateTime") . " DESC"); - + $resultSet = $this->tableGateway->selectWith($select); - + return $resultSet; } - + public function getFilesetNum() { $bsqlch = new BareosSqlCompatHelper($this->getDbDriverConfig()); @@ -126,9 +126,9 @@ public function getFilesetNum() $this->tableGateway->getAdapter(), $resultSetPrototype ); - $num = $rowset->count(); + $num = $rowset->count(); return $num; } - + } diff --git a/module/Fileset/view/fileset/fileset/details.phtml b/module/Fileset/view/fileset/fileset/details.phtml index 3260e639..e6119501 100644 --- a/module/Fileset/view/fileset/fileset/details.phtml +++ b/module/Fileset/view/fileset/fileset/details.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Fileset/view/fileset/fileset/index.phtml b/module/Fileset/view/fileset/fileset/index.phtml index 0eae2f21..a5ca8d35 100644 --- a/module/Fileset/view/fileset/fileset/index.phtml +++ b/module/Fileset/view/fileset/fileset/index.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Install/config/module.config.php b/module/Install/config/module.config.php index 0c15d221..8125e2ad 100644 --- a/module/Install/config/module.config.php +++ b/module/Install/config/module.config.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Install/src/Install/Controller/InstallController.php b/module/Install/src/Install/Controller/InstallController.php index e4f943c5..d10c3d56 100644 --- a/module/Install/src/Install/Controller/InstallController.php +++ b/module/Install/src/Install/Controller/InstallController.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * @@ -32,11 +32,11 @@ use Zend\Db\Adapter\Driver\ConnectionInterface; use \Exception; -class InstallController extends AbstractActionController +class InstallController extends AbstractActionController { const REQUIRED_PHP_VERSION = "5.3"; - const REQUIRED_ZF_VERSION = "2.2"; + const REQUIRED_ZF_VERSION = "2.2"; const REQUIRED_EXT_PDO = "YES"; const REQUIRED_EXT_INTL = "YES"; const REQUIRED_DB_DRIVER = "YES"; @@ -46,6 +46,7 @@ class InstallController extends AbstractActionController const REQUIRED_BCONSOLE_EXEC = "YES"; const REQUIRED_BCONSOLE_CONF = "YES"; const REQUIRED_BCONSOLE_SUDO = "NO"; + const REQUIRED_DIRECTOR = "YES"; public function indexAction() { @@ -69,7 +70,7 @@ public function testAction() 'EXT_PDO_CHECK' => $this->getPDOExtStatus(), 'INSTALLED_EXT_INTL' => $this->getInstalledIntlExt(), 'REQUIRED_EXT_INTL' => self::REQUIRED_EXT_INTL, - 'EXT_INTL_CHECK' => $this->getIntlExtStatus(), + 'EXT_INTL_CHECK' => $this->getIntlExtStatus(), 'REQUIRED_DB_DRIVER' => self::REQUIRED_DB_DRIVER, 'CONFIGURED_DB_DRIVER' => $this->getConfiguredDbDriver(), 'DB_DRIVER_CHECK' => $this->getDbDriverStatus(), @@ -84,22 +85,25 @@ public function testAction() 'DB_PASSWORD_CHECK' => $this->getDbPasswordStatus(), 'DB_CONNECTION_CHECK' => $this->getDbConnectionStatus(), 'DB_READACCESS_CHECK' => $this->getDbReadAccessStatus(), + 'REQUIRED_DIRECTOR' => self::REQUIRED_DIRECTOR, + 'CONFIGURED_DIRECTOR' => $this->getConfiguredDirector(), + 'DIRECTOR_CHECK' => $this->getDirectorStatus(), )); return $viewModel; } - private function getInstalledPHPVersion() + private function getInstalledPHPVersion() { $version = phpversion(); return $version; } - private function getInstalledZFVersion() + private function getInstalledZFVersion() { - return Version::VERSION; + return Version::VERSION; } - private function compareVersions($installed, $required) + private function compareVersions($installed, $required) { if(version_compare($installed, $required, '<')) { return -1; @@ -121,7 +125,7 @@ private function getInstalledPDOExt() } } - private function getPDOExtStatus() + private function getPDOExtStatus() { if(extension_loaded('PDO')) { return 0; @@ -132,7 +136,7 @@ private function getPDOExtStatus() } - private function getIntlExtStatus() + private function getIntlExtStatus() { if(extension_loaded('Intl')) { return 0; @@ -142,7 +146,7 @@ private function getIntlExtStatus() } } - private function getInstalledIntlExt() + private function getInstalledIntlExt() { if(extension_loaded('Intl')) { $intl = "YES"; @@ -157,15 +161,16 @@ private function getInstalledIntlExt() private function getConfiguredDbDriver() { $config = $this->getServiceLocator()->get('Config'); - $backend = $config['db']['driver']; + $adapter = array_keys($config['db']['adapters']); + $backend = $config['db']['adapters'][$adapter[0]]['driver']; return $backend; } - private function getDbDriverStatus() + private function getDbDriverStatus() { - if(self::getConfiguredDbDriver() == "Pdo_Pgsql" || + if(self::getConfiguredDbDriver() == "Pdo_Pgsql" || self::getConfiguredDbDriver() == "Pdo_Mysql" || - self::getConfiguredDbDriver() == "Mysqli" || + self::getConfiguredDbDriver() == "Mysqli" || self::getConfiguredDbDriver() == "Pgsql") { return 0; } @@ -174,14 +179,15 @@ private function getDbDriverStatus() } } - private function getConfiguredDbHost() + private function getConfiguredDbHost() { $config = $this->getServiceLocator()->get('Config'); - $host = $config['db']['host']; - return $host; + $adapter = array_keys($config['db']['adapters']); + $host = $config['db']['adapters'][$adapter[0]]['host']; + return $host; } - private function getDbHostStatus() + private function getDbHostStatus() { if(self::getConfiguredDbHost() != "") { return 0; @@ -191,14 +197,15 @@ private function getDbHostStatus() } } - private function getConfiguredDbUser() + private function getConfiguredDbUser() { $config = $this->getServiceLocator()->get('Config'); - $user = $config['db']['username']; - return $user; + $adapter = array_keys($config['db']['adapters']); + $user = $config['db']['adapters'][$adapter[0]]['username']; + return $user; } - private function getDbUserStatus() + private function getDbUserStatus() { if(self::getConfiguredDbUser() != "") { return 0; @@ -208,10 +215,11 @@ private function getDbUserStatus() } } - private function getConfiguredDbPassword() + private function getConfiguredDbPassword() { $config = $this->getServiceLocator()->get('Config'); - $passwd = $config['db']['password']; + $adapter = array_keys($config['db']['adapters']); + $passwd = $config['db']['adapters'][$adapter[0]]['password']; if($passwd != "") { $passwd = "SET"; return $passwd; @@ -222,7 +230,7 @@ private function getConfiguredDbPassword() } } - private function getDbPasswordStatus() + private function getDbPasswordStatus() { if(self::getConfiguredDbPassword() == "SET") { return 0; @@ -232,15 +240,18 @@ private function getDbPasswordStatus() } } - private function getDbConnectionStatus() + private function getDbConnectionStatus() { if(self::getDbDriverStatus() == 0 && - self::getDbHostStatus() == 0 && + self::getDbHostStatus() == 0 && self::getDbUserStatus() == 0 && - self::getDbPasswordStatus() == 0 + self::getDbPasswordStatus() == -1 ) { try { - $dbAdapter = $this->getServiceLocator()->get('Zend\Db\Adapter\Adapter'); + $config = $this->getServiceLocator()->get('Config'); + $adapter = array_keys($config['db']['adapters']); + $db = $config['db']['adapters'][$adapter[0]]['host']; + $dbAdapter = $this->getServiceLocator()->get($db); $connection = $dbAdapter->getDriver()->getConnection()->connect(); return 0; } @@ -253,16 +264,22 @@ private function getDbConnectionStatus() } } - private function getDbReadAccessStatus() + private function getDbReadAccessStatus() { if(self::getDbConnectionStatus() == 0) { try { - $dbAdapter = $this->getServiceLocator()->get('Zend\Db\Adapter\Adapter'); - $connection = $dbAdapter->getDriver()->getConnection()->connect(); + $config = $this->getServiceLocator()->get('Config'); + $adapter = array_keys($config['db']['adapters']); + $db = $config['db']['adapters'][$adapter[0]]['host']; + $dbAdapter = $this->getServiceLocator()->get($db); + $connection = $dbAdapter->getDriver()->getConnection()->connect(); - if($connection->getCurrentSchema() == "bareos") { + if($connection->getCurrentSchema() != false) { return 0; } + else { + return -1; + } } catch(\Exception $e) { return -1; @@ -273,5 +290,24 @@ private function getDbReadAccessStatus() } } + private function getConfiguredDirector() + { + $config = $this->getServiceLocator()->get('Config'); + $dir = array_keys($config['directors']); + $director = $config['directors'][$dir[0]]['host']; + return $director; + } + + private function getDirectorStatus() + { + if(self::getConfiguredDirector() != "") { + return 0; + } + else { + return -1; + } + + } + } diff --git a/module/Install/src/Install/Model/Install.php b/module/Install/src/Install/Model/Install.php index 03d3ad31..7d247537 100644 --- a/module/Install/src/Install/Model/Install.php +++ b/module/Install/src/Install/Model/Install.php @@ -3,9 +3,9 @@ /** * * bareos-webui - Bareos Web-Frontend - * + * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify @@ -25,7 +25,7 @@ namespace Install\Model; -class Install +class Install { } diff --git a/module/Install/src/Install/Model/InstallTable.php b/module/Install/src/Install/Model/InstallTable.php index caa2f125..373d047c 100644 --- a/module/Install/src/Install/Model/InstallTable.php +++ b/module/Install/src/Install/Model/InstallTable.php @@ -3,9 +3,9 @@ /** * * bareos-webui - Bareos Web-Frontend - * + * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify @@ -27,8 +27,8 @@ //use Zend\Db\TableGateway\TableGateway; -class InstallTable +class InstallTable { - + } diff --git a/module/Install/view/install/install/index.phtml b/module/Install/view/install/install/index.phtml index 8794a01c..c4123141 100644 --- a/module/Install/view/install/install/index.phtml +++ b/module/Install/view/install/install/index.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Install/view/install/install/test.phtml b/module/Install/view/install/install/test.phtml index f19fad1b..69c00ca1 100644 --- a/module/Install/view/install/install/test.phtml +++ b/module/Install/view/install/install/test.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * @@ -24,8 +24,6 @@ * */ - - $title = 'Bareos WebUI Installation and Configuration Test'; $this->headTitle($title); @@ -46,6 +44,7 @@ $this->headTitle($title); Installed Status + PHP Version REQUIRED_PHP_VERSION; ?> @@ -53,6 +52,7 @@ $this->headTitle($title); printStatusGlyphicons($this->PHP_VERSION_CHECK); ?> + PHP PDO Extension REQUIRED_EXT_PDO; ?> @@ -60,6 +60,7 @@ $this->headTitle($title); printStatusGlyphicons($this->EXT_PDO_CHECK); ?> + PHP Intl Extension REQUIRED_EXT_INTL; ?> @@ -67,6 +68,7 @@ $this->headTitle($title); printStatusGlyphicons($this->EXT_INTL_CHECK); ?> + Zend Framework 2 REQUIRED_ZF_VERSION; ?> @@ -84,6 +86,7 @@ $this->headTitle($title); Configured Status + Driver REQUIRED_DB_DRIVER; ?> @@ -91,6 +94,7 @@ $this->headTitle($title); printStatusGlyphicons($this->DB_DRIVER_CHECK); ?> + Host REQUIRED_DB_HOST; ?> @@ -98,6 +102,7 @@ $this->headTitle($title); printStatusGlyphicons($this->DB_HOST_CHECK); ?> + User REQUIRED_DB_USER; ?> @@ -105,6 +110,7 @@ $this->headTitle($title); printStatusGlyphicons($this->DB_USER_CHECK); ?> + Password REQUIRED_DB_PASSWORD; ?> @@ -112,6 +118,7 @@ $this->headTitle($title); printStatusGlyphicons($this->DB_PASSWORD_CHECK); ?> + Connection Test @@ -119,6 +126,7 @@ $this->headTitle($title); printStatusGlyphicons($this->DB_CONNECTION_CHECK); ?> + Read-Access Test @@ -128,9 +136,28 @@ $this->headTitle($title); +

Director

+ + + + + + + + + + + + + + + +
RequiredConfiguredStatus
ConsoleREQUIRED_DIRECTOR; ?>CONFIGURED_DIRECTOR; ?>printStatusGlyphicons($this->DIRECTOR_CHECK); ?>
+ + diff --git a/module/Job/Module.php b/module/Job/Module.php index 1c54a753..6edeeed4 100644 --- a/module/Job/Module.php +++ b/module/Job/Module.php @@ -8,7 +8,7 @@ use Zend\Db\TableGateway\TableGateway; use Bareos\Db\Sql\BareosSqlCompatHelper; -class Module +class Module { public function getServiceConfig() @@ -21,18 +21,19 @@ public function getServiceConfig() return $table; }, 'JobTableGateway' => function($sm) { - $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); + //$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); + $dbAdapter = $sm->get($_SESSION['bareos']['director']); $resultSetPrototype = new ResultSet(); $resultSetPrototype->setArrayObjectPrototype(new Job()); $config = $sm->get('Config'); - $bsqlch = new BareosSqlCompatHelper($config['db']['driver']); + $bsqlch = new BareosSqlCompatHelper($config['db']['adapters'][$_SESSION['bareos']['director']]['driver']); return new TableGateway($bsqlch->strdbcompat("Job"), $dbAdapter, null, $resultSetPrototype); }, ), ); } - public function getAutoloaderConfig() + public function getAutoloaderConfig() { return array( 'Zend\Loader\ClassMapAutoloader' => array( @@ -45,8 +46,8 @@ public function getAutoloaderConfig() ), ); } - - public function getConfig() + + public function getConfig() { return include __DIR__ . '/config/module.config.php'; } diff --git a/module/Job/config/module.config.php b/module/Job/config/module.config.php index f250562c..d0f16a32 100644 --- a/module/Job/config/module.config.php +++ b/module/Job/config/module.config.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Job/src/Job/Controller/JobController.php b/module/Job/src/Job/Controller/JobController.php index 2bf952dc..60a621a7 100644 --- a/module/Job/src/Job/Controller/JobController.php +++ b/module/Job/src/Job/Controller/JobController.php @@ -3,9 +3,9 @@ /** * * bareos-webui - Bareos Web-Frontend - * + * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * @@ -37,167 +37,203 @@ class JobController extends AbstractActionController protected $logTable; protected $bconsoleOutput = array(); - public function indexAction() + public function indexAction() { - $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'JobId'; - $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; - $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; - $paginator = $this->getJobTable()->fetchAll(true, $order_by, $order); - $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); - $paginator->setItemCountPerPage($limit); - - return new ViewModel( - array( - 'paginator' => $paginator, - 'order_by' => $order_by, - 'order' => $order, - 'limit' => $limit, - 'allJobs' => $this->getJobTable()->fetchAll(), - ) - ); - + if($_SESSION['bareos']['authenticated'] == true) { + $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'JobId'; + $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; + $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; + $paginator = $this->getJobTable()->fetchAll(true, $order_by, $order); + $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); + $paginator->setItemCountPerPage($limit); + + return new ViewModel( + array( + 'paginator' => $paginator, + 'order_by' => $order_by, + 'order' => $order, + 'limit' => $limit, + 'allJobs' => $this->getJobTable()->fetchAll(), + ) + ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } - public function detailsAction() + public function detailsAction() { - $id = (int) $this->params()->fromRoute('id', 0); - if (!$id) { - return $this->redirect()->toRoute('job'); - } - - return new ViewModel(array( - 'job' => $this->getJobTable()->getJob($id), - 'log' => $this->getLogTable()->getLogsByJob($id), - )); + if($_SESSION['bareos']['authenticated'] == true) { + $id = (int) $this->params()->fromRoute('id', 0); + if (!$id) { + return $this->redirect()->toRoute('job'); + } + + return new ViewModel(array( + 'job' => $this->getJobTable()->getJob($id), + 'log' => $this->getLogTable()->getLogsByJob($id), + )); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } - public function runningAction() - { - $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'JobId'; - $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; - $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; - $paginator = $this->getJobTable()->getRunningJobs(true, $order_by, $order); - $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); - $paginator->setItemCountPerPage($limit); - - return new ViewModel( - array( - 'paginator' => $paginator, - 'order_by' => $order_by, - 'order' => $order, - 'limit' => $limit, - 'runningJobs' => $this->getJobTable()->getRunningJobs() - ) - ); - } - - public function waitingAction() + public function runningAction() { - $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'JobId'; - $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; - $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; - $paginator = $this->getJobTable()->getWaitingJobs(true, $order_by, $order); - $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); - $paginator->setItemCountPerPage($limit); - - return new ViewModel( - array( - 'paginator' => $paginator, - 'order_by' => $order_by, - 'order' => $order, - 'limit' => $limit, - 'waitingJobs' => $this->getJobTable()->getWaitingJobs() - ) - ); + if($_SESSION['bareos']['authenticated'] == true) { + $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'JobId'; + $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; + $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; + $paginator = $this->getJobTable()->getRunningJobs(true, $order_by, $order); + $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); + $paginator->setItemCountPerPage($limit); + + return new ViewModel( + array( + 'paginator' => $paginator, + 'order_by' => $order_by, + 'order' => $order, + 'limit' => $limit, + 'runningJobs' => $this->getJobTable()->getRunningJobs() + ) + ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } - - public function unsuccessfulAction() + + public function waitingAction() { - $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'JobId'; - $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; - $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; - $paginator = $this->getJobTable()->getLast24HoursUnsuccessfulJobs(true, $order_by, $order); - $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); - $paginator->setItemCountPerPage($limit); - - return new ViewModel( - array( - 'paginator' => $paginator, - 'order_by' => $order_by, - 'order' => $order, - 'limit' => $limit, - 'lastUnsuccessfulJobs' => $this->getJobTable()->getLast24HoursUnsuccessfulJobs(), - ) - ); + if($_SESSION['bareos']['authenticated'] == true) { + $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'JobId'; + $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; + $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; + $paginator = $this->getJobTable()->getWaitingJobs(true, $order_by, $order); + $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); + $paginator->setItemCountPerPage($limit); + + return new ViewModel( + array( + 'paginator' => $paginator, + 'order_by' => $order_by, + 'order' => $order, + 'limit' => $limit, + 'waitingJobs' => $this->getJobTable()->getWaitingJobs() + ) + ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } - - public function successfulAction() + + public function unsuccessfulAction() { - $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'JobId'; - $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; - $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; - $paginator = $this->getJobTable()->getLast24HoursSuccessfulJobs(true, $order_by, $order); - $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); - $paginator->setItemCountPerPage($limit); - - return new ViewModel( - array( - 'paginator' => $paginator, - 'order_by' => $order_by, - 'order' => $order, - 'limit' => $limit, - 'lastSuccessfulJobs' => $this->getJobTable()->getLast24HoursSuccessfulJobs(), - ) - ); + if($_SESSION['bareos']['authenticated'] == true) { + $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'JobId'; + $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; + $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; + $paginator = $this->getJobTable()->getLast24HoursUnsuccessfulJobs(true, $order_by, $order); + $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); + $paginator->setItemCountPerPage($limit); + + return new ViewModel( + array( + 'paginator' => $paginator, + 'order_by' => $order_by, + 'order' => $order, + 'limit' => $limit, + 'lastUnsuccessfulJobs' => $this->getJobTable()->getLast24HoursUnsuccessfulJobs(), + ) + ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } - public function timelineAction() + public function successfulAction() { - return new ViewModel(); + if($_SESSION['bareos']['authenticated'] == true) { + $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'JobId'; + $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; + $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; + $paginator = $this->getJobTable()->getLast24HoursSuccessfulJobs(true, $order_by, $order); + $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); + $paginator->setItemCountPerPage($limit); + + return new ViewModel( + array( + 'paginator' => $paginator, + 'order_by' => $order_by, + 'order' => $order, + 'limit' => $limit, + 'lastSuccessfulJobs' => $this->getJobTable()->getLast24HoursSuccessfulJobs(), + ) + ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } - + public function rerunAction() { - $jobid = (int) $this->params()->fromRoute('id', 0); - $cmd = "rerun jobid=" . $jobid . " yes"; - $config = $this->getServiceLocator()->get('Config'); - $bsock = new BareosBSock(); - $bsock->set_config($config['director']); - $bsock->init(); - return new ViewModel( - array( - 'bconsoleOutput' => $bsock->send_command($cmd), - 'jobid' => $jobid, - ) - ); + if($_SESSION['bareos']['authenticated'] == true) { + $jobid = (int) $this->params()->fromRoute('id', 0); + $cmd = "rerun jobid=" . $jobid . " yes"; + $config = $this->getServiceLocator()->get('Config'); + $bsock = new BareosBSock(); + $bsock->set_config($config['directors'][$_SESSION['bareos']['director']]); + $bsock->set_user_credentials($_SESSION['bareos']['username'], $_SESSION['bareos']['password']); + $bsock->init(); + return new ViewModel( + array( + 'bconsoleOutput' => $bsock->send_command($cmd), + 'jobid' => $jobid, + ) + ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } public function cancelAction() { - $jobid = (int) $this->params()->fromRoute('id', 0); - $cmd = "cancel jobid=" . $jobid . " yes"; - $config = $this->getServiceLocator()->get('Config'); - $bsock = new BareosBSock(); - $bsock->set_config($config['director']); - $bsock->init(); - return new ViewModel( - array( - 'bconsoleOutput' => $bsock->send_command($cmd) - ) - ); + if($_SESSION['bareos']['authenticated'] == true) { + $jobid = (int) $this->params()->fromRoute('id', 0); + $cmd = "cancel jobid=" . $jobid . " yes"; + $config = $this->getServiceLocator()->get('Config'); + $bsock = new BareosBSock(); + $bsock->set_config($config['directors'][$_SESSION['bareos']['director']]); + $bsock->set_user_credentials($_SESSION['bareos']['username'], $_SESSION['bareos']['password']); + $bsock->init(); + return new ViewModel( + array( + 'bconsoleOutput' => $bsock->send_command($cmd) + ) + ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } public function getJobTable() - { - if(!$this->jobTable) + { + if(!$this->jobTable) { $sm = $this->getServiceLocator(); $this->jobTable = $sm->get('Job\Model\JobTable'); } return $this->jobTable; } - - public function getLogTable() + + public function getLogTable() { if(!$this->logTable) { @@ -206,6 +242,6 @@ public function getLogTable() } return $this->logTable; } - + } diff --git a/module/Job/src/Job/Model/Job.php b/module/Job/src/Job/Model/Job.php index 113f7c26..11704546 100644 --- a/module/Job/src/Job/Model/Job.php +++ b/module/Job/src/Job/Model/Job.php @@ -3,9 +3,9 @@ /** * * bareos-webui - Bareos Web-Frontend - * + * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify @@ -25,7 +25,7 @@ namespace Job\Model; -class Job +class Job { public $jobid; @@ -46,7 +46,7 @@ class Job public $jobbytes; public $readbytes; public $joberrors; - public $jobmissingfiles; + public $jobmissingfiles; public $poolid; public $filesetid; public $priorjobid; @@ -57,8 +57,8 @@ class Job public $comment; public $clientname; public $duration; - - public function exchangeArray($data) + + public function exchangeArray($data) { $data = array_change_key_case($data, CASE_LOWER); diff --git a/module/Job/src/Job/Model/JobTable.php b/module/Job/src/Job/Model/JobTable.php index 18a0dbe1..4ec7c943 100644 --- a/module/Job/src/Job/Model/JobTable.php +++ b/module/Job/src/Job/Model/JobTable.php @@ -3,9 +3,9 @@ /** * * bareos-webui - Bareos Web-Frontend - * + * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify @@ -55,7 +55,7 @@ public function getServiceLocator() { public function getDbDriverConfig() { $config = $this->getServiceLocator()->get('Config'); - return $config['db']['driver']; + return $config['db']['adapters'][$_SESSION['bareos']['director']]['driver']; } public function fetchAll($paginated=false, $order_by=null, $order=null) @@ -82,8 +82,8 @@ public function fetchAll($paginated=false, $order_by=null, $order=null) ) ); $select->join( - $bsqlch->strdbcompat("Client"), - $bsqlch->strdbcompat("Job.ClientId = Client.ClientId"), + $bsqlch->strdbcompat("Client"), + $bsqlch->strdbcompat("Job.ClientId = Client.ClientId"), array($bsqlch->strdbcompat("ClientName") => $bsqlch->strdbcompat("Name")) ); @@ -92,7 +92,7 @@ public function fetchAll($paginated=false, $order_by=null, $order=null) } else { $select->order($bsqlch->strdbcompat("JobId") . " DESC"); - } + } if($paginated) { $resultSetPrototype = new ResultSet(); @@ -114,7 +114,7 @@ public function fetchAll($paginated=false, $order_by=null, $order=null) public function getJob($jobid) { $jobid = (int) $jobid; - + $bsqlch = new BareosSqlCompatHelper($this->getDbDriverConfig()); $select = new Select(); $select->from($bsqlch->strdbcompat("Job")); @@ -126,7 +126,7 @@ public function getJob($jobid) $select->where( $bsqlch->strdbcompat("JobId") . "=" . $jobid ); - + $rowset = $this->tableGateway->selectWith($select); $row = $rowset->current(); if(!$row) { @@ -149,8 +149,8 @@ public function getRunningJobs($paginated=false, $order_by=null, $order=null) $bsqlch->strdbcompat("JobStatus") . " = 'R' OR " . $bsqlch->strdbcompat("JobStatus") . " = 'l'" ); - - if($order_by != null && $order != null) { + + if($order_by != null && $order != null) { $select->order($bsqlch->strdbcompat($order_by) . " " . $order); } else { @@ -169,31 +169,31 @@ public function getRunningJobs($paginated=false, $order_by=null, $order=null) return $paginator; } else { - $resultSet = $this->tableGateway->selectWith($select); + $resultSet = $this->tableGateway->selectWith($select); return $resultSet; } } - - public function getWaitingJobs($paginated=false, $order_by=null, $order=null) + + public function getWaitingJobs($paginated=false, $order_by=null, $order=null) { $bsqlch = new BareosSqlCompatHelper($this->getDbDriverConfig()); $select = new Select(); $select->from($bsqlch->strdbcompat("Job")); $select->join( - $bsqlch->strdbcompat("Client"), - $bsqlch->strdbcompat("Job.ClientId = Client.ClientId"), + $bsqlch->strdbcompat("Client"), + $bsqlch->strdbcompat("Job.ClientId = Client.ClientId"), array($bsqlch->strdbcompat("ClientName") => $bsqlch->strdbcompat("Name")) ); $select->where( - $bsqlch->strdbcompat("JobStatus") . " = 'F' OR " . + $bsqlch->strdbcompat("JobStatus") . " = 'F' OR " . $bsqlch->strdbcompat("JobStatus") . " = 'S' OR " . $bsqlch->strdbcompat("JobStatus") . " = 'm' OR " . - $bsqlch->strdbcompat("JobStatus") . " = 'M' OR " . - $bsqlch->strdbcompat("JobStatus") . " = 's' OR " . + $bsqlch->strdbcompat("JobStatus") . " = 'M' OR " . + $bsqlch->strdbcompat("JobStatus") . " = 's' OR " . $bsqlch->strdbcompat("JobStatus") . " = 'j' OR " . - $bsqlch->strdbcompat("JobStatus") . " = 'c' OR " . - $bsqlch->strdbcompat("JobStatus") . " = 'd' OR " . - $bsqlch->strdbcompat("JobStatus") . " = 't' OR " . + $bsqlch->strdbcompat("JobStatus") . " = 'c' OR " . + $bsqlch->strdbcompat("JobStatus") . " = 'd' OR " . + $bsqlch->strdbcompat("JobStatus") . " = 't' OR " . $bsqlch->strdbcompat("JobStatus") . " = 'p' OR " . $bsqlch->strdbcompat("JobStatus") . " = 'q' OR " . $bsqlch->strdbcompat("JobStatus") . " = 'C'" @@ -205,7 +205,7 @@ public function getWaitingJobs($paginated=false, $order_by=null, $order=null) else { $select->order($bsqlch->strdbcompat("Job.JobId") . " DESC"); } - + if($paginated) { $resultSetPrototype = new ResultSet(); $resultSetPrototype->setArrayObjectPrototype(new Job()); @@ -218,11 +218,11 @@ public function getWaitingJobs($paginated=false, $order_by=null, $order=null) return $paginator; } else { - $resultSet = $this->tableGateway->selectWith($select); + $resultSet = $this->tableGateway->selectWith($select); return $resultSet; } } - + public function getLast24HoursSuccessfulJobs($paginated=false, $order_by=null, $order=null) { if($this->getDbDriverConfig() == "Pdo_Mysql" || $this->getDbDriverConfig() == "Mysqli") { diff --git a/module/Job/view/job/job/cancel.phtml b/module/Job/view/job/job/cancel.phtml index d0c0b68a..60b9a4b8 100644 --- a/module/Job/view/job/job/cancel.phtml +++ b/module/Job/view/job/job/cancel.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Job/view/job/job/details.phtml b/module/Job/view/job/job/details.phtml index ea835e30..58fc95f9 100644 --- a/module/Job/view/job/job/details.phtml +++ b/module/Job/view/job/job/details.phtml @@ -3,9 +3,9 @@ /** * * bareos-webui - Bareos Web-Frontend - * + * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * @@ -35,9 +35,9 @@ $this->headTitle($title);
- +
- +

General Information

@@ -45,78 +45,78 @@ $this->headTitle($title);
- + - + - + - + - + - + - +
JobescapeHtml($job->jobid); ?> Scheduled startprintDate($job->schedtime, 'iso'); ?> StatusprintJobStatus($job->jobstatus); ?>
NameescapeHtml($job->jobname); ?> Real startprintDate($job->starttime, 'iso'); ?> ErrorsescapeHtml($job->joberrors); ?>
ClientescapeHtml($job->clientname); ?> EndprintDate($job->endtime, 'iso'); ?>FilesescapeHtml($job->jobfiles); ?>FilesescapeHtml($job->jobfiles); ?>
TypeprintJobType($job->type); ?> FilesetescapeHtml($job->filesetid); ?> BytesprintBytes($job->jobbytes); ?>
LevelprintJobLevel($job->level); ?> PoolescapeHtml($job->poolid); ?>
- +
- + - +
- +

Messages

- +
- + @@ -138,10 +138,10 @@ $this->headTitle($title);
- +
- +
- +
diff --git a/module/Job/view/job/job/index.phtml b/module/Job/view/job/job/index.phtml index 0815e1cd..fdb44669 100644 --- a/module/Job/view/job/job/index.phtml +++ b/module/Job/view/job/job/index.phtml @@ -3,9 +3,9 @@ /** * * bareos-webui - Bareos Web-Frontend - * + * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Job/view/job/job/rerun.phtml b/module/Job/view/job/job/rerun.phtml index a6ee604d..f8c12952 100644 --- a/module/Job/view/job/job/rerun.phtml +++ b/module/Job/view/job/job/rerun.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Job/view/job/job/running.phtml b/module/Job/view/job/job/running.phtml index f3e1e622..fd0c3123 100644 --- a/module/Job/view/job/job/running.phtml +++ b/module/Job/view/job/job/running.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Job/view/job/job/successful.phtml b/module/Job/view/job/job/successful.phtml index 9d06965e..0172dd73 100644 --- a/module/Job/view/job/job/successful.phtml +++ b/module/Job/view/job/job/successful.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Job/view/job/job/timeline.phtml b/module/Job/view/job/job/timeline.phtml index c29fbd9b..af2e37dc 100644 --- a/module/Job/view/job/job/timeline.phtml +++ b/module/Job/view/job/job/timeline.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Job/view/job/job/unsuccessful.phtml b/module/Job/view/job/job/unsuccessful.phtml index 0ff591b9..084c233d 100644 --- a/module/Job/view/job/job/unsuccessful.phtml +++ b/module/Job/view/job/job/unsuccessful.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Job/view/job/job/waiting.phtml b/module/Job/view/job/job/waiting.phtml index 05784f4e..835067f2 100644 --- a/module/Job/view/job/job/waiting.phtml +++ b/module/Job/view/job/job/waiting.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Log/Module.php b/module/Log/Module.php index d43fa609..47c0d9cd 100644 --- a/module/Log/Module.php +++ b/module/Log/Module.php @@ -8,7 +8,7 @@ use Zend\Db\TableGateway\TableGateway; use Bareos\Db\Sql\BareosSqlCompatHelper; -class Module +class Module { public function getServiceConfig() @@ -21,18 +21,19 @@ public function getServiceConfig() return $table; }, 'LogTableGateway' => function($sm) { - $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); + //$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); + $dbAdapter = $sm->get($_SESSION['bareos']['director']); $resultSetPrototype = new ResultSet(); $resultSetPrototype->setArrayObjectPrototype(new Log()); $config = $sm->get('Config'); - $bsqlch = new BareosSqlCompatHelper($config['db']['driver']); + $bsqlch = new BareosSqlCompatHelper($config['db']['adapters'][$_SESSION['bareos']['director']]['driver']); return new TableGateway($bsqlch->strdbcompat("Log"), $dbAdapter, null, $resultSetPrototype); }, ), ); } - public function getAutoloaderConfig() + public function getAutoloaderConfig() { return array( 'Zend\Loader\ClassMapAutoloader' => array( @@ -45,8 +46,8 @@ public function getAutoloaderConfig() ), ); } - - public function getConfig() + + public function getConfig() { return include __DIR__ . '/config/module.config.php'; } diff --git a/module/Log/config/module.config.php b/module/Log/config/module.config.php index ea9a8307..9b3508c2 100644 --- a/module/Log/config/module.config.php +++ b/module/Log/config/module.config.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Log/src/Log/Controller/LogController.php b/module/Log/src/Log/Controller/LogController.php index f3a7c5fc..a5b930eb 100644 --- a/module/Log/src/Log/Controller/LogController.php +++ b/module/Log/src/Log/Controller/LogController.php @@ -10,53 +10,68 @@ class LogController extends AbstractActionController protected $logTable; - public function indexAction() + public function indexAction() { - $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'LogId'; - $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; - $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; - $paginator = $this->getLogTable()->fetchAll(true, $order_by, $order); - $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); - $paginator->setItemCountPerPage($limit); + if($_SESSION['bareos']['authenticated'] == true) { + $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'LogId'; + $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; + $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; + $paginator = $this->getLogTable()->fetchAll(true, $order_by, $order); + $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); + $paginator->setItemCountPerPage($limit); - return new ViewModel( - array( - 'paginator' => $paginator, - 'order_by' => $order_by, - 'order' => $order, - 'limit' => $limit, - ) - ); + return new ViewModel( + array( + 'paginator' => $paginator, + 'order_by' => $order_by, + 'order' => $order, + 'limit' => $limit, + ) + ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } - public function detailsAction() + public function detailsAction() { - $id = (int) $this->params()->fromRoute('id', 0); - if (!$id) { - return $this->redirect()->toRoute('log'); + if($_SESSION['bareos']['authenticated'] == true) { + $id = (int) $this->params()->fromRoute('id', 0); + if (!$id) { + return $this->redirect()->toRoute('log'); + } + + return new ViewModel(array( + 'log' => $this->getLogTable()->getLog($id), + )); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); } - - return new ViewModel(array( - 'log' => $this->getLogTable()->getLog($id), - )); } - public function jobAction() + public function jobAction() { - $id = (int) $this->params()->fromRoute('id', 0); - if (!$id) { - return $this->redirect()->toRoute('log'); + if($_SESSION['bareos']['authenticated'] == true) { + $id = (int) $this->params()->fromRoute('id', 0); + if (!$id) { + return $this->redirect()->toRoute('log'); + } + + return new ViewModel(array( + 'log' => $this->getLogTable()->getLogsByJob($id), + 'jobid' => (int) $this->params()->fromRoute('id'), + )); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); } - - return new ViewModel(array( - 'log' => $this->getLogTable()->getLogsByJob($id), - 'jobid' => (int) $this->params()->fromRoute('id'), - )); } - + public function getLogTable() - { + { if(!$this->logTable) { $sm = $this->getServiceLocator(); $this->logTable = $sm->get('Log\Model\LogTable'); diff --git a/module/Log/src/Log/Model/LogTable.php b/module/Log/src/Log/Model/LogTable.php index ff80448f..79cd93ba 100644 --- a/module/Log/src/Log/Model/LogTable.php +++ b/module/Log/src/Log/Model/LogTable.php @@ -31,7 +31,7 @@ public function getServiceLocator() { public function getDbDriverConfig() { $config = $this->getServiceLocator()->get('Config'); - return $config['db']['driver']; + return $config['db']['adapters'][$_SESSION['bareos']['director']]['driver']; } public function fetchAll($paginated=false, $order_by=null, $order=null) @@ -66,7 +66,7 @@ public function fetchAll($paginated=false, $order_by=null, $order=null) public function getLog($logid) { $logid = (int) $logid; - $bsqlch = new BareosSqlCompatHelper($this->getDbDriverConfig()); + $bsqlch = new BareosSqlCompatHelper($this->getDbDriverConfig()); $rowset = $this->tableGateway->select(array( $bsqlch->strdbcompat("LogId") => $logid) ); @@ -81,7 +81,7 @@ public function getLogsByJob($id) { $jobid = (int) $id; - + $bsqlch = new BareosSqlCompatHelper($this->getDbDriverConfig()); $select = new Select(); $select->from($bsqlch->strdbcompat("Log")); @@ -93,7 +93,7 @@ public function getLogsByJob($id) return $resultSet; } - + public function getLogNum() { $bsqlch = new BareosSqlCompatHelper($this->getDbDriverConfig()); diff --git a/module/Log/view/log/log/details.phtml b/module/Log/view/log/log/details.phtml index 6b50d493..ef4fc32f 100644 --- a/module/Log/view/log/log/details.phtml +++ b/module/Log/view/log/log/details.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Log/view/log/log/index.phtml b/module/Log/view/log/log/index.phtml index 96e6844e..7acd18d3 100644 --- a/module/Log/view/log/log/index.phtml +++ b/module/Log/view/log/log/index.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Log/view/log/log/job.phtml b/module/Log/view/log/log/job.phtml index ac6a4af7..d54173bb 100644 --- a/module/Log/view/log/log/job.phtml +++ b/module/Log/view/log/log/job.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Media/Module.php b/module/Media/Module.php index a3e34dc6..1890cbcb 100644 --- a/module/Media/Module.php +++ b/module/Media/Module.php @@ -40,11 +40,12 @@ public function getServiceConfig() return $table; }, 'MediaTableGateway' => function($sm) { - $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); + //$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); + $dbAdapter = $sm->get($_SESSION['bareos']['director']); $resultSetPrototype = new ResultSet(); $resultSetPrototype->setArrayObjectPrototype(new Media()); $config = $sm->get('Config'); - $bsqlch = new BareosSqlCompatHelper($config['db']['driver']); + $bsqlch = new BareosSqlCompatHelper($config['db']['adapters'][$_SESSION['bareos']['director']]['driver']); return new TableGateway($bsqlch->strdbcompat("Media"), $dbAdapter, null, $resultSetPrototype); }, ), diff --git a/module/Media/config/module.config.php b/module/Media/config/module.config.php index d1b83614..86adbd09 100644 --- a/module/Media/config/module.config.php +++ b/module/Media/config/module.config.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Media/src/Media/Controller/MediaController.php b/module/Media/src/Media/Controller/MediaController.php index 2a7a8ee3..0a17d608 100644 --- a/module/Media/src/Media/Controller/MediaController.php +++ b/module/Media/src/Media/Controller/MediaController.php @@ -3,9 +3,9 @@ /** * * bareos-webui - Bareos Web-Frontend - * + * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify @@ -35,36 +35,46 @@ class MediaController extends AbstractActionController public function indexAction() { - $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'MediaId'; - $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; - $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; - $paginator = $this->getMediaTable()->fetchAll(true, $order_by, $order); - $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); - $paginator->setItemCountPerPage($limit); + if($_SESSION['bareos']['authenticated'] == true) { + $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'MediaId'; + $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; + $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; + $paginator = $this->getMediaTable()->fetchAll(true, $order_by, $order); + $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); + $paginator->setItemCountPerPage($limit); - return new ViewModel( - array( - 'paginator' => $paginator, - 'order_by' => $order_by, - 'order' => $order, - 'limit' => $limit, - ) - ); + return new ViewModel( + array( + 'paginator' => $paginator, + 'order_by' => $order_by, + 'order' => $order, + 'limit' => $limit, + ) + ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } - public function detailsAction() + public function detailsAction() { - $id = (int) $this->params()->fromRoute('id', 0); - if (!$id) { - return $this->redirect()->toRoute('media'); - } - - return new ViewModel(array( + if($_SESSION['bareos']['authenticated'] == true) { + $id = (int) $this->params()->fromRoute('id', 0); + if (!$id) { + return $this->redirect()->toRoute('media'); + } + + return new ViewModel(array( 'media' => $this->getMediaTable()->getMedia($id), )); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } - public function getMediaTable() + public function getMediaTable() { if(!$this->mediaTable) { $sm = $this->getServiceLocator(); @@ -72,6 +82,6 @@ public function getMediaTable() } return $this->mediaTable; } - + } diff --git a/module/Media/src/Media/Model/Media.php b/module/Media/src/Media/Model/Media.php index 673f79a5..09f513aa 100644 --- a/module/Media/src/Media/Model/Media.php +++ b/module/Media/src/Media/Model/Media.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Media/src/Media/Model/MediaTable.php b/module/Media/src/Media/Model/MediaTable.php index 201ba256..eafd0b5c 100644 --- a/module/Media/src/Media/Model/MediaTable.php +++ b/module/Media/src/Media/Model/MediaTable.php @@ -3,9 +3,9 @@ /** * * bareos-webui - Bareos Web-Frontend - * + * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify @@ -56,10 +56,10 @@ public function getServiceLocator() { public function getDbDriverConfig() { $config = $this->getServiceLocator()->get('Config'); - return $config['db']['driver']; + return $config['db']['adapters'][$_SESSION['bareos']['director']]['driver']; } - public function fetchAll($paginated=false, $order_by=null, $order=null) + public function fetchAll($paginated=false, $order_by=null, $order=null) { $bsqlch = new BareosSqlCompatHelper($this->getDbDriverConfig()); $select = new Select($bsqlch->strdbcompat("Media")); @@ -91,16 +91,16 @@ public function fetchAll($paginated=false, $order_by=null, $order=null) public function getMedia($id) { $mediaid = (int) $id; - + $bsqlch = new BareosSqlCompatHelper($this->getDbDriverConfig()); $select = new Select(); $select->from($bsqlch->strdbcompat("Media")); $select->where($bsqlch->strdbcompat("MediaId") . " = " . $mediaid); - + $resultSet = $this->tableGateway->selectWith($select); $row = $resultSet->current(); - - return $row; + + return $row; } public function getMediaNum() @@ -116,26 +116,26 @@ public function getMediaNum() $this->tableGateway->getAdapter(), $resultSetPrototype ); - $num = $rowset->count(); + $num = $rowset->count(); return $num; } - - public function getPoolVolumes($id) + + public function getPoolVolumes($id) { $poolid = (int) $id; - + $bsqlch = new BareosSqlCompatHelper($this->getDbDriverConfig()); $select = new Select(); $select->from($bsqlch->strdbcompat("Media")); $select->where($bsqlch->strdbcompat("PoolId") . " = " . $poolid); $select->order($bsqlch->strdbcompat("MediaId") . " ASC"); - + $resultSet = $this->tableGateway->selectWith($select); - + return $resultSet; - + } - + } diff --git a/module/Media/view/media/media/details.phtml b/module/Media/view/media/media/details.phtml index 3e3896ed..99fe1e97 100644 --- a/module/Media/view/media/media/details.phtml +++ b/module/Media/view/media/media/details.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Media/view/media/media/index.phtml b/module/Media/view/media/media/index.phtml index 55f96dbb..0eda6097 100644 --- a/module/Media/view/media/media/index.phtml +++ b/module/Media/view/media/media/index.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Pool/Module.php b/module/Pool/Module.php index d4c9d8ca..9d895bbb 100644 --- a/module/Pool/Module.php +++ b/module/Pool/Module.php @@ -40,11 +40,12 @@ public function getServiceConfig() return $table; }, 'PoolTableGateway' => function($sm) { - $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); + //$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); + $dbAdapter = $sm->get($_SESSION['bareos']['director']); $resultSetPrototype = new ResultSet(); $resultSetPrototype->setArrayObjectPrototype(new Pool()); $config = $sm->get('Config'); - $bsqlch = new BareosSqlCompatHelper($config['db']['driver']); + $bsqlch = new BareosSqlCompatHelper($config['db']['adapters'][$_SESSION['bareos']['director']]['driver']); return new TableGateway($bsqlch->strdbcompat("Pool"), $dbAdapter, null, $resultSetPrototype); }, ), diff --git a/module/Pool/config/module.config.php b/module/Pool/config/module.config.php index ff3979b5..60c6ef91 100644 --- a/module/Pool/config/module.config.php +++ b/module/Pool/config/module.config.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Pool/src/Pool/Controller/PoolController.php b/module/Pool/src/Pool/Controller/PoolController.php index ee603680..84645625 100644 --- a/module/Pool/src/Pool/Controller/PoolController.php +++ b/module/Pool/src/Pool/Controller/PoolController.php @@ -3,9 +3,9 @@ /** * * bareos-webui - Bareos Web-Frontend - * + * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify @@ -36,42 +36,51 @@ class PoolController extends AbstractActionController public function indexAction() { - $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'PoolId'; - $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; - $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; - $paginator = $this->getPoolTable()->fetchAll(true, $order_by, $order); - $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); - $paginator->setItemCountPerPage($limit); + if($_SESSION['bareos']['authenticated'] == true) { + $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'PoolId'; + $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; + $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; + $paginator = $this->getPoolTable()->fetchAll(true, $order_by, $order); + $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); + $paginator->setItemCountPerPage($limit); - return new ViewModel( - array( - 'paginator' => $paginator, - 'order_by' => $order_by, - 'order' => $order, - 'limit' => $limit, - 'pools' => $this->getPoolTable()->fetchAll(), - ) - ); + return new ViewModel( + array( + 'paginator' => $paginator, + 'order_by' => $order_by, + 'order' => $order, + 'limit' => $limit, + 'pools' => $this->getPoolTable()->fetchAll(), + ) + ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } - public function detailsAction() + public function detailsAction() { - $id = (int) $this->params()->fromRoute('id', 0); - - if (!$id) { - return $this->redirect()->toRoute('pool'); + if($_SESSION['bareos']['authenticated'] == true) { + $id = (int) $this->params()->fromRoute('id', 0); + + if (!$id) { + return $this->redirect()->toRoute('pool'); + } + + return new ViewModel( + array( + 'pool' => $this->getPoolTable()->getPool($id), + 'media' => $this->getMediaTable()->getPoolVolumes($id), + ) + ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); } - - return new ViewModel( - array( - 'pool' => $this->getPoolTable()->getPool($id), - 'media' => $this->getMediaTable()->getPoolVolumes($id), - ) - ); - } - public function getPoolTable() + public function getPoolTable() { if(!$this->poolTable) { $sm = $this->getServiceLocator(); @@ -79,7 +88,7 @@ public function getPoolTable() } return $this->poolTable; } - + public function getMediaTable() { if(!$this->mediaTable) { @@ -88,6 +97,6 @@ public function getMediaTable() } return $this->mediaTable; } - + } diff --git a/module/Pool/src/Pool/Model/Pool.php b/module/Pool/src/Pool/Model/Pool.php index 7636ee79..6c61e4f6 100644 --- a/module/Pool/src/Pool/Model/Pool.php +++ b/module/Pool/src/Pool/Model/Pool.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Pool/src/Pool/Model/PoolTable.php b/module/Pool/src/Pool/Model/PoolTable.php index c374fdef..0cdf3135 100644 --- a/module/Pool/src/Pool/Model/PoolTable.php +++ b/module/Pool/src/Pool/Model/PoolTable.php @@ -3,9 +3,9 @@ /** * * bareos-webui - Bareos Web-Frontend - * + * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify @@ -55,15 +55,15 @@ public function getServiceLocator() { public function getDbDriverConfig() { $config = $this->getServiceLocator()->get('Config'); - return $config['db']['driver']; + return $config['db']['adapters'][$_SESSION['bareos']['director']]['driver']; } - public function fetchAll($paginated=false, $order_by=null, $order=null) + public function fetchAll($paginated=false, $order_by=null, $order=null) { $bsqlch = new BareosSqlCompatHelper($this->getDbDriverConfig()); $select = new Select(); $select->from($bsqlch->strdbcompat("Pool")); - + if($order_by != null && $order != null) { $select->order($bsqlch->strdbcompat($order_by) . " " . $order); } @@ -116,9 +116,9 @@ public function getPoolNum() $this->tableGateway->getAdapter(), $resultSetPrototype ); - $num = $rowset->count(); + $num = $rowset->count(); return $num; } - + } diff --git a/module/Pool/view/pool/pool/details.phtml b/module/Pool/view/pool/pool/details.phtml index 3da27948..0a030f9d 100644 --- a/module/Pool/view/pool/pool/details.phtml +++ b/module/Pool/view/pool/pool/details.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Pool/view/pool/pool/index.phtml b/module/Pool/view/pool/pool/index.phtml index ec0ddbb2..4f18ac32 100644 --- a/module/Pool/view/pool/pool/index.phtml +++ b/module/Pool/view/pool/pool/index.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Restore/config/module.config.php b/module/Restore/config/module.config.php index 72bb2d88..559fd1d6 100644 --- a/module/Restore/config/module.config.php +++ b/module/Restore/config/module.config.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Restore/src/Restore/Controller/RestoreController.php b/module/Restore/src/Restore/Controller/RestoreController.php index bdf03c09..b9301dd0 100644 --- a/module/Restore/src/Restore/Controller/RestoreController.php +++ b/module/Restore/src/Restore/Controller/RestoreController.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Restore/src/Restore/Model/Restore.php b/module/Restore/src/Restore/Model/Restore.php index 5a8fcf22..ab8d2206 100644 --- a/module/Restore/src/Restore/Model/Restore.php +++ b/module/Restore/src/Restore/Model/Restore.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Restore/src/Restore/Model/RestoreTable.php b/module/Restore/src/Restore/Model/RestoreTable.php index 163a3d6d..46170a8b 100644 --- a/module/Restore/src/Restore/Model/RestoreTable.php +++ b/module/Restore/src/Restore/Model/RestoreTable.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Restore/view/restore/restore/index.phtml b/module/Restore/view/restore/restore/index.phtml index 6964973b..7f07e8b2 100644 --- a/module/Restore/view/restore/restore/index.phtml +++ b/module/Restore/view/restore/restore/index.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Statistics/Module.php b/module/Statistics/Module.php index ceeb575b..b9aa3e9a 100644 --- a/module/Statistics/Module.php +++ b/module/Statistics/Module.php @@ -10,7 +10,7 @@ class Module { - public function getAutoloaderConfig() + public function getAutoloaderConfig() { return array( 'Zend\Loader\ClassMapAutoloader' => array( @@ -24,16 +24,16 @@ public function getAutoloaderConfig() ); } - public function getConfig() + public function getConfig() { return include __DIR__ . '/config/module.config.php'; } - public function getServiceConfig() + public function getServiceConfig() { return array( 'factories' => array( - 'Statistics\Model\StatisticsTable' => function($sm) + 'Statistics\Model\StatisticsTable' => function($sm) { $tableGateway = $sm->get('StatisticsTableGateway'); $table = new StatisticsTable($tableGateway); @@ -41,7 +41,8 @@ public function getServiceConfig() }, 'StatisticsTableGateway' => function($sm) { - $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); + //$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); + $dbAdapter = $sm->get($_SESSION['bareos']['director']); $resultSetPrototype = new ResultSet(); $resultSetPrototype->setArrayObjectPrototype(new Statistics()); return new TableGateway('statistics', $dbAdapter, null, $resultSetPrototype); diff --git a/module/Statistics/config/module.config.php b/module/Statistics/config/module.config.php index 1beee3a5..ee871af2 100644 --- a/module/Statistics/config/module.config.php +++ b/module/Statistics/config/module.config.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Statistics/src/Statistics/Controller/StatisticsController.php b/module/Statistics/src/Statistics/Controller/StatisticsController.php index 3e5b1c97..de51710b 100644 --- a/module/Statistics/src/Statistics/Controller/StatisticsController.php +++ b/module/Statistics/src/Statistics/Controller/StatisticsController.php @@ -3,9 +3,9 @@ /** * * bareos-webui - Bareos Web-Frontend - * + * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify @@ -28,7 +28,7 @@ use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\ViewModel; -class StatisticsController extends AbstractActionController +class StatisticsController extends AbstractActionController { protected $jobTable; protected $clientTable; @@ -37,77 +37,79 @@ class StatisticsController extends AbstractActionController protected $fileTable; protected $logTable; protected $filesetTable; - + public function indexAction() { - return new ViewModel( - array( - - 'jobsCreatedNotRunning' => $this->getJobTable()->getJobCountLast24HoursByStatus("C"), - 'jobsBlocked' => $this->getJobTable()->getJobCountLast24HoursByStatus("B"), - 'jobsRunning' => $this->getJobTable()->getJobCountLast24HoursByStatus("R"), - 'jobsTerminated' => $this->getJobTable()->getJobCountLast24HoursByStatus("T"), - 'jobsTerminatedWithErrors' => $this->getJobTable()->getJobCountLast24HoursByStatus("E"), - 'jobsWithNonFatalErrors' => $this->getJobTable()->getJobCountLast24HoursByStatus("e"), - 'jobsWithFatalErrors' => $this->getJobTable()->getJobCountLast24HoursByStatus("f"), - 'jobsCanceled' => $this->getJobTable()->getJobCountLast24HoursByStatus("A"), - 'jobsVerifyFoundDiff' => $this->getJobTable()->getJobCountLast24HoursByStatus("D"), - 'jobsWaitingForClient' => $this->getJobTable()->getJobCountLast24HoursByStatus("F"), - 'jobsWaitingForStorageDaemon' => $this->getJobTable()->getJobCountLast24HoursByStatus("S"), - 'jobsWaitingForNewMedia' => $this->getJobTable()->getJobCountLast24HoursByStatus("m"), - 'jobsWaitingForMediaMount' => $this->getJobTable()->getJobCountLast24HoursByStatus("M"), - 'jobsWaitingForStorageResource' => $this->getJobTable()->getJobCountLast24HoursByStatus("s"), - 'jobsWaitingForJobResource' => $this->getJobTable()->getJobCountLast24HoursByStatus("j"), - 'jobsWaitingForClientResource' => $this->getJobTable()->getJobCountLast24HoursByStatus("c"), - 'jobsWaitingOnMaximumJobs' => $this->getJobTable()->getJobCountLast24HoursByStatus("d"), - 'jobsWaitingOnStartTime' => $this->getJobTable()->getJobCountLast24HoursByStatus("t"), - 'jobsWaitingOnHigherPriorityJobs' => $this->getJobTable()->getJobCountLast24HoursByStatus("p"), - 'jobsSDdespoolingAttributes' => $this->getJobTable()->getJobCountLast24HoursByStatus("a"), - 'jobsBatchInsertFileRecords' => $this->getJobTable()->getJobCountLast24HoursByStatus("i"), - - ) - ); + if($_SESSION['bareos']['authenticated'] == true) { + return new ViewModel( + array( + + 'jobsCreatedNotRunning' => $this->getJobTable()->getJobCountLast24HoursByStatus("C"), + 'jobsBlocked' => $this->getJobTable()->getJobCountLast24HoursByStatus("B"), + 'jobsRunning' => $this->getJobTable()->getJobCountLast24HoursByStatus("R"), + 'jobsTerminated' => $this->getJobTable()->getJobCountLast24HoursByStatus("T"), + 'jobsTerminatedWithErrors' => $this->getJobTable()->getJobCountLast24HoursByStatus("E"), + 'jobsWithNonFatalErrors' => $this->getJobTable()->getJobCountLast24HoursByStatus("e"), + 'jobsWithFatalErrors' => $this->getJobTable()->getJobCountLast24HoursByStatus("f"), + 'jobsCanceled' => $this->getJobTable()->getJobCountLast24HoursByStatus("A"), + 'jobsVerifyFoundDiff' => $this->getJobTable()->getJobCountLast24HoursByStatus("D"), + 'jobsWaitingForClient' => $this->getJobTable()->getJobCountLast24HoursByStatus("F"), + 'jobsWaitingForStorageDaemon' => $this->getJobTable()->getJobCountLast24HoursByStatus("S"), + 'jobsWaitingForNewMedia' => $this->getJobTable()->getJobCountLast24HoursByStatus("m"), + 'jobsWaitingForMediaMount' => $this->getJobTable()->getJobCountLast24HoursByStatus("M"), + 'jobsWaitingForStorageResource' => $this->getJobTable()->getJobCountLast24HoursByStatus("s"), + 'jobsWaitingForJobResource' => $this->getJobTable()->getJobCountLast24HoursByStatus("j"), + 'jobsWaitingForClientResource' => $this->getJobTable()->getJobCountLast24HoursByStatus("c"), + 'jobsWaitingOnMaximumJobs' => $this->getJobTable()->getJobCountLast24HoursByStatus("d"), + 'jobsWaitingOnStartTime' => $this->getJobTable()->getJobCountLast24HoursByStatus("t"), + 'jobsWaitingOnHigherPriorityJobs' => $this->getJobTable()->getJobCountLast24HoursByStatus("p"), + 'jobsSDdespoolingAttributes' => $this->getJobTable()->getJobCountLast24HoursByStatus("a"), + 'jobsBatchInsertFileRecords' => $this->getJobTable()->getJobCountLast24HoursByStatus("i"), + + ) + ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } + } public function catalogAction() { - return new ViewModel( - array( - - 'clientNum' => $this->getClientTable()->getClientNum(), - 'poolNum' => $this->getPoolTable()->getPoolNum(), - 'volumeNum' => $this->getMediaTable()->getMediaNum(), - 'fileNum' => $this->getFileTable()->getFileNum(), - 'jobNum' => $this->getJobTable()->getJobNum(), - 'logNum' => $this->getLogTable()->getLogNum(), - 'filesetNum' => $this->getFilesetTable()->getFilesetNum(), - - ) - ); + return new ViewModel( + array( + + 'clientNum' => $this->getClientTable()->getClientNum(), + 'poolNum' => $this->getPoolTable()->getPoolNum(), + 'volumeNum' => $this->getMediaTable()->getMediaNum(), + 'fileNum' => $this->getFileTable()->getFileNum(), + 'jobNum' => $this->getJobTable()->getJobNum(), + 'logNum' => $this->getLogTable()->getLogNum(), + 'filesetNum' => $this->getFilesetTable()->getFilesetNum(), + + ) + ); } - - public function storedAction() + + public function storedAction() { return new ViewModel( - array( - 'stored7days' => $this->getJobTable()->getStoredBytes7Days(), - 'stored14days' => $this->getJobTable()->getStoredBytes14Days(), - ) ); } - - public function clientAction() + + public function clientAction() { return new ViewModel( ); } - - public function backupjobAction() + + public function backupjobAction() { return new ViewModel( ); } - + public function getJobTable() { if(!$this->jobTable) @@ -117,7 +119,7 @@ public function getJobTable() } return $this->jobTable; } - + public function getClientTable() { if(!$this->clientTable) @@ -127,8 +129,8 @@ public function getClientTable() } return $this->clientTable; } - - public function getPoolTable() + + public function getPoolTable() { if(!$this->poolTable) { @@ -137,8 +139,8 @@ public function getPoolTable() } return $this->poolTable; } - - public function getMediaTable() + + public function getMediaTable() { if(!$this->mediaTable) { @@ -147,8 +149,8 @@ public function getMediaTable() } return $this->mediaTable; } - - public function getFileTable() + + public function getFileTable() { if(!$this->fileTable) { @@ -157,8 +159,8 @@ public function getFileTable() } return $this->fileTable; } - - public function getLogTable() + + public function getLogTable() { if(!$this->logTable) { @@ -167,8 +169,8 @@ public function getLogTable() } return $this->logTable; } - - public function getFilesetTable() + + public function getFilesetTable() { if(!$this->filesetTable) { @@ -177,6 +179,6 @@ public function getFilesetTable() } return $this->filesetTable; } - + } diff --git a/module/Statistics/src/Statistics/Model/Statistics.php b/module/Statistics/src/Statistics/Model/Statistics.php index 00547f07..e1b5aa5c 100644 --- a/module/Statistics/src/Statistics/Model/Statistics.php +++ b/module/Statistics/src/Statistics/Model/Statistics.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Statistics/src/Statistics/Model/StatisticsTable.php b/module/Statistics/src/Statistics/Model/StatisticsTable.php index 83791c15..835d26f9 100644 --- a/module/Statistics/src/Statistics/Model/StatisticsTable.php +++ b/module/Statistics/src/Statistics/Model/StatisticsTable.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Statistics/view/statistics/statistics/backupjob.phtml b/module/Statistics/view/statistics/statistics/backupjob.phtml index 9e37c3cd..5e78cf98 100644 --- a/module/Statistics/view/statistics/statistics/backupjob.phtml +++ b/module/Statistics/view/statistics/statistics/backupjob.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Statistics/view/statistics/statistics/catalog.phtml b/module/Statistics/view/statistics/statistics/catalog.phtml index 2e9dcb73..cdc0f2d8 100644 --- a/module/Statistics/view/statistics/statistics/catalog.phtml +++ b/module/Statistics/view/statistics/statistics/catalog.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Statistics/view/statistics/statistics/client.phtml b/module/Statistics/view/statistics/statistics/client.phtml index 846421ac..f1575f23 100644 --- a/module/Statistics/view/statistics/statistics/client.phtml +++ b/module/Statistics/view/statistics/statistics/client.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Statistics/view/statistics/statistics/index.phtml b/module/Statistics/view/statistics/statistics/index.phtml index d78fe52e..f76d5442 100644 --- a/module/Statistics/view/statistics/statistics/index.phtml +++ b/module/Statistics/view/statistics/statistics/index.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Statistics/view/statistics/statistics/stored.phtml b/module/Statistics/view/statistics/statistics/stored.phtml index 77b1444f..2e8daefe 100644 --- a/module/Statistics/view/statistics/statistics/stored.phtml +++ b/module/Statistics/view/statistics/statistics/stored.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Storage/Module.php b/module/Storage/Module.php index 79eba1e0..8418f727 100644 --- a/module/Storage/Module.php +++ b/module/Storage/Module.php @@ -40,11 +40,12 @@ public function getServiceConfig() return $table; }, 'StorageTableGateway' => function($sm) { - $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); + //$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); + $dbAdapter = $sm->get($_SESSION['bareos']['director']); $resultSetPrototype = new ResultSet(); $resultSetPrototype->setArrayObjectPrototype(new Storage()); $config = $sm->get('Config'); - $bsqlch = new BareosSqlCompatHelper($config['db']['driver']); + $bsqlch = new BareosSqlCompatHelper($config['db']['adapters'][$_SESSION['bareos']['director']]['driver']); return new TableGateway($bsqlch->strdbcompat("Storage"), $dbAdapter, null, $resultSetPrototype); }, ), diff --git a/module/Storage/config/module.config.php b/module/Storage/config/module.config.php index 0d37f1cc..56977d88 100644 --- a/module/Storage/config/module.config.php +++ b/module/Storage/config/module.config.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Storage/src/Storage/Controller/StorageController.php b/module/Storage/src/Storage/Controller/StorageController.php index dea13854..d48532ed 100644 --- a/module/Storage/src/Storage/Controller/StorageController.php +++ b/module/Storage/src/Storage/Controller/StorageController.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify @@ -37,58 +37,75 @@ class StorageController extends AbstractActionController public function indexAction() { - $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'StorageId'; - $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; - $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; - $paginator = $this->getStorageTable()->fetchAll(true, $order_by, $order); - $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); - $paginator->setItemCountPerPage($limit); + if($_SESSION['bareos']['authenticated'] == true) { + $order_by = $this->params()->fromRoute('order_by') ? $this->params()->fromRoute('order_by') : 'StorageId'; + $order = $this->params()->fromRoute('order') ? $this->params()->fromRoute('order') : 'DESC'; + $limit = $this->params()->fromRoute('limit') ? $this->params()->fromRoute('limit') : '25'; + $paginator = $this->getStorageTable()->fetchAll(true, $order_by, $order); + $paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) ); + $paginator->setItemCountPerPage($limit); - return new ViewModel( - array( - 'paginator' => $paginator, - 'order_by' => $order_by, - 'order' => $order, - 'limit' => $limit, - 'storages' => $this->getStorageTable()->fetchAll(), - ) - ); + return new ViewModel( + array( + 'paginator' => $paginator, + 'order_by' => $order_by, + 'order' => $order, + 'limit' => $limit, + 'storages' => $this->getStorageTable()->fetchAll(), + ) + ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } public function detailsAction() { - $id = (int) $this->params()->fromRoute('id', 0); - if(!$id) { - return $this->redirect()->toRoute('storage'); + if($_SESSION['bareos']['authenticated'] == true) { + $id = (int) $this->params()->fromRoute('id', 0); + if(!$id) { + return $this->redirect()->toRoute('storage'); + } + $result = $this->getStorageTable()->getStorage($id); + $cmd = "status storage=" . $result->name; + $config = $this->getServiceLocator()->get('Config'); + $bsock = new BareosBSock(); + $bsock->set_config($config['directors'][$_SESSION['bareos']['director']]); + $bsock->set_user_credentials($_SESSION['bareos']['username'], $_SESSION['bareos']['password']); + $bsock->init(); + return new ViewModel(array( + 'bconsoleOutput' => $bsock->send_command($cmd), + ) + ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); } - $result = $this->getStorageTable()->getStorage($id); - $cmd = "status storage=" . $result->name; - $config = $this->getServiceLocator()->get('Config'); - $bsock = new BareosBSock(); - $bsock->set_config($config['director']); - $bsock->init(); - return new ViewModel(array( - 'bconsoleOutput' => $bsock->send_command($cmd), - ) - ); } public function autochangerAction() { - $id = (int) $this->params()->fromRoute('id', 0); - if(!$id) { - return $this->redirect()->toRoute('storage'); - } - $result = $this->getStorageTable()->getStorage($id); - $cmd = "status storage=" . $result->name . " slots"; - $config = $this->getServiceLocator()->get('Config'); - $bsock = new BareosBSock(); - $bsock->set_config($config['director']); - $bsock->init(); - return new ViewModel(array( - 'bconsoleOutput' => $bsock->send_command($cmd), - ) - ); + if($_SESSION['bareos']['authenticated'] == true) { + $id = (int) $this->params()->fromRoute('id', 0); + if(!$id) { + return $this->redirect()->toRoute('storage'); + } + $result = $this->getStorageTable()->getStorage($id); + $cmd = "status storage=" . $result->name . " slots"; + $config = $this->getServiceLocator()->get('Config'); + $bsock = new BareosBSock(); + $bsock->set_config($config['directors'][$_SESSION['bareos']['director']]); + $bsock->set_user_credentials($_SESSION['bareos']['username'], $_SESSION['bareos']['password']); + $bsock->init(); + return new ViewModel(array( + 'bconsoleOutput' => $bsock->send_command($cmd), + ) + ); + } + else { + return $this->redirect()->toRoute('auth', array('action' => 'login')); + } } public function getStorageTable() diff --git a/module/Storage/src/Storage/Model/Storage.php b/module/Storage/src/Storage/Model/Storage.php index 646cbc2d..1a4450dc 100644 --- a/module/Storage/src/Storage/Model/Storage.php +++ b/module/Storage/src/Storage/Model/Storage.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/Storage/src/Storage/Model/StorageTable.php b/module/Storage/src/Storage/Model/StorageTable.php index 06f259e9..082b1274 100644 --- a/module/Storage/src/Storage/Model/StorageTable.php +++ b/module/Storage/src/Storage/Model/StorageTable.php @@ -3,9 +3,9 @@ /** * * bareos-webui - Bareos Web-Frontend - * + * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify @@ -55,10 +55,10 @@ public function getServiceLocator() { public function getDbDriverConfig() { $config = $this->getServiceLocator()->get('Config'); - return $config['db']['driver']; + return $config['db']['adapters'][$_SESSION['bareos']['director']]['driver']; } - public function fetchAll($paginated=false, $order_by=null, $order=null) + public function fetchAll($paginated=false, $order_by=null, $order=null) { $bsqlch = new BareosSqlCompatHelper($this->getDbDriverConfig()); $select = new Select(); diff --git a/module/Storage/view/storage/storage/autochanger.phtml b/module/Storage/view/storage/storage/autochanger.phtml index dc964334..f6055596 100644 --- a/module/Storage/view/storage/storage/autochanger.phtml +++ b/module/Storage/view/storage/storage/autochanger.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Storage/view/storage/storage/details.phtml b/module/Storage/view/storage/storage/details.phtml index 0605bdda..4f93024f 100644 --- a/module/Storage/view/storage/storage/details.phtml +++ b/module/Storage/view/storage/storage/details.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/Storage/view/storage/storage/index.phtml b/module/Storage/view/storage/storage/index.phtml index 04cdc7e0..16d8478a 100644 --- a/module/Storage/view/storage/storage/index.phtml +++ b/module/Storage/view/storage/storage/index.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * @author Frank Bergkemper * diff --git a/module/User/config/module.config.php b/module/User/config/module.config.php index dc769c80..6c73e7de 100644 --- a/module/User/config/module.config.php +++ b/module/User/config/module.config.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/User/src/User/Controller/UserController.php b/module/User/src/User/Controller/UserController.php index 9c49d61a..57a2d5e5 100644 --- a/module/User/src/User/Controller/UserController.php +++ b/module/User/src/User/Controller/UserController.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/User/src/User/Model/User.php b/module/User/src/User/Model/User.php index a1336826..d68710bd 100644 --- a/module/User/src/User/Model/User.php +++ b/module/User/src/User/Model/User.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/User/src/User/Model/UserTable.php b/module/User/src/User/Model/UserTable.php index cc51a875..45ae521d 100644 --- a/module/User/src/User/Model/UserTable.php +++ b/module/User/src/User/Model/UserTable.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/module/User/view/user/user/index.phtml b/module/User/view/user/user/index.phtml index 95661367..89cd3365 100644 --- a/module/User/view/user/user/index.phtml +++ b/module/User/view/user/user/index.phtml @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/packaging/obs/bareos-webui.dsc b/packaging/obs/bareos-webui.dsc index 22c1ef89..11761011 100644 --- a/packaging/obs/bareos-webui.dsc +++ b/packaging/obs/bareos-webui.dsc @@ -7,6 +7,6 @@ Maintainer: Bareos Packager Standards-Version: 3.9.1 Vcs-Browser: https://github.com/bareos/bareos-webui.git Vcs-Git: git://github.com/bareos/bareos-webui.git -Build-Depends: debhelper (>= 7.0.50~), apache2-dev | apache2-prefork-dev, autoconf, automake +Build-Depends: debhelper (>= 7.0.50~), apache2, apache2-dev | apache2-prefork-dev, autoconf, automake, bareos-common DEBTRANSFORM-RELEASE: 1 Files: diff --git a/packaging/obs/bareos-webui.spec b/packaging/obs/bareos-webui.spec index 6144943e..3c92fe5f 100644 --- a/packaging/obs/bareos-webui.spec +++ b/packaging/obs/bareos-webui.spec @@ -8,15 +8,15 @@ Summary: Bareos Web User Interface Group: Productivity/Archiving/Backup License: AGPL-3.0+ URL: https://github.com/bareos/bareos-webui -Source: %{name}_%{version}.tar.gz +Source: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch -BuildRequires: autoconf automake +BuildRequires: autoconf automake bareos-common Requires: php >= 5.3.3 Requires: php-ZendFramework2 >= 2.2.0 -Requires: php-pdo +#Requires: php-pdo #Requires: php-json #Requires: php-pcre #Requires: php-gd @@ -31,6 +31,7 @@ Requires: php-pdo BuildRequires: apache2 # /usr/sbin/apxs2 BuildRequires: apache2-devel +BuildRequires: mod_php_any #define _apache_conf_dir #(/usr/sbin/apxs2 -q SYSCONFDIR) %define _apache_conf_dir /etc/apache2/conf.d/ %define daemon_user wwwrun @@ -65,42 +66,32 @@ Supports status overview about Jobs. %prep %setup -q - %build #autoreconf -fvi %configure make - %install # makeinstall macro does not work on RedHat #makeinstall make DESTDIR=%{buildroot} install -touch filelist %post -# if command a2enmod exists, -# use it to enable Apache rewrite module -LOG=/var/log/bareos-webui-install.log -echo "`date`: BEGIN bareos-webui init" >> $LOG -which a2enmod >/dev/null && a2enmod rewrite >> $LOG 2>&1 -export BAREOS_WEBUI_INTERACTIVE="no" -# if /usr/sbin/bareos-webui-config init >> $LOG 2>&1; then -# echo "SUCCESS: bareos-webui-config init, see $LOG" -# else -# echo "FAILED: bareos-webui-config init, see $LOG" -# fi +a2enmod setenv &> /dev/null +a2enmod rewrite &> /dev/null +a2enmod php5 &> /dev/null %clean rm -rf $RPM_BUILD_ROOT -%files -f filelist +%files %defattr(-,root,root,-) -%doc AUTHORS.txt CONTRIBUTE.md README.md LICENSE.txt +%doc README.md LICENSE AGPL-3.0.txt AUTHORS %doc doc/ %{_datadir}/%{name}/ #attr(-, #daemon_user, #daemon_group) #{_datadir}/#{name}/data -%config(noreplace) /etc/bareos-webui.conf.php +%dir /etc/bareos-webui +%config(noreplace) /etc/bareos-webui/directors.ini +%config(noreplace) %attr(644,root,root) /etc/bareos/bareos-dir.d/bareos-webui.conf %config(noreplace) %{_apache_conf_dir}/bareos-webui.conf -#/usr/sbin/bareos-webui-config diff --git a/public/css/style.css b/public/css/style.css index bddab135..770eb45d 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -35,3 +35,12 @@ div.container a.brand { margin-left: 0; padding: 8px 20px 12px 40px; } + +form label, form label span { + display: block; +} + +.col-centered { + float: none; + margin: 0 auto; +} diff --git a/tests/AdminTest/Controller/IndexControllerTest.php b/tests/AdminTest/Controller/IndexControllerTest.php index 3a4439c5..093c8689 100644 --- a/tests/AdminTest/Controller/IndexControllerTest.php +++ b/tests/AdminTest/Controller/IndexControllerTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/tests/ClientTest/Controller/IndexControllerTest.php b/tests/ClientTest/Controller/IndexControllerTest.php index 90e4572a..b404ad82 100644 --- a/tests/ClientTest/Controller/IndexControllerTest.php +++ b/tests/ClientTest/Controller/IndexControllerTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/tests/ClientTest/Model/ClientTableTest.php b/tests/ClientTest/Model/ClientTableTest.php index a9af9a92..03090f0f 100644 --- a/tests/ClientTest/Model/ClientTableTest.php +++ b/tests/ClientTest/Model/ClientTableTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/tests/DashboardTest/Controller/IndexControllerTest.php b/tests/DashboardTest/Controller/IndexControllerTest.php index ee676c4b..cc4cc792 100644 --- a/tests/DashboardTest/Controller/IndexControllerTest.php +++ b/tests/DashboardTest/Controller/IndexControllerTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/tests/DirectorTest/Controller/IndexControllerTest.php b/tests/DirectorTest/Controller/IndexControllerTest.php index 25cbe80f..8732f0c3 100644 --- a/tests/DirectorTest/Controller/IndexControllerTest.php +++ b/tests/DirectorTest/Controller/IndexControllerTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/tests/FileTest/Controller/IndexControllerTest.php b/tests/FileTest/Controller/IndexControllerTest.php index ef962606..53304e9a 100644 --- a/tests/FileTest/Controller/IndexControllerTest.php +++ b/tests/FileTest/Controller/IndexControllerTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/tests/FileTest/Model/FileTableTest.php b/tests/FileTest/Model/FileTableTest.php index 0fc72174..4378f59f 100644 --- a/tests/FileTest/Model/FileTableTest.php +++ b/tests/FileTest/Model/FileTableTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/tests/FilesetTest/Controller/IndexControllerTest.php b/tests/FilesetTest/Controller/IndexControllerTest.php index 29a35445..2eac6916 100644 --- a/tests/FilesetTest/Controller/IndexControllerTest.php +++ b/tests/FilesetTest/Controller/IndexControllerTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/tests/FilesetTest/Model/FilesetTableTest.php b/tests/FilesetTest/Model/FilesetTableTest.php index da0bed8d..6aeb2514 100644 --- a/tests/FilesetTest/Model/FilesetTableTest.php +++ b/tests/FilesetTest/Model/FilesetTableTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/tests/JobTest/Controller/IndexControllerTest.php b/tests/JobTest/Controller/IndexControllerTest.php index 52448001..fcb6349f 100644 --- a/tests/JobTest/Controller/IndexControllerTest.php +++ b/tests/JobTest/Controller/IndexControllerTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/tests/JobTest/Model/JobTableTest.php b/tests/JobTest/Model/JobTableTest.php index 6e844e37..b432ffa2 100644 --- a/tests/JobTest/Model/JobTableTest.php +++ b/tests/JobTest/Model/JobTableTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/tests/LogTest/Controller/IndexControllerTest.php b/tests/LogTest/Controller/IndexControllerTest.php index aa4f3349..39c51aa1 100644 --- a/tests/LogTest/Controller/IndexControllerTest.php +++ b/tests/LogTest/Controller/IndexControllerTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/tests/LogTest/Model/LogTableTest.php b/tests/LogTest/Model/LogTableTest.php index 80935bfb..82813a91 100644 --- a/tests/LogTest/Model/LogTableTest.php +++ b/tests/LogTest/Model/LogTableTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/tests/MediaTest/Controller/IndexControllerTest.php b/tests/MediaTest/Controller/IndexControllerTest.php index fdce103d..99ca8109 100644 --- a/tests/MediaTest/Controller/IndexControllerTest.php +++ b/tests/MediaTest/Controller/IndexControllerTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/tests/MediaTest/Model/MediaTableTest.php b/tests/MediaTest/Model/MediaTableTest.php index 77a3f9b1..50346772 100644 --- a/tests/MediaTest/Model/MediaTableTest.php +++ b/tests/MediaTest/Model/MediaTableTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/tests/PoolTest/Controller/IndexControllerTest.php b/tests/PoolTest/Controller/IndexControllerTest.php index df5f2238..a7f399d6 100644 --- a/tests/PoolTest/Controller/IndexControllerTest.php +++ b/tests/PoolTest/Controller/IndexControllerTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/tests/PoolTest/Model/PoolTableTest.php b/tests/PoolTest/Model/PoolTableTest.php index 63567c1b..f9abe5f9 100644 --- a/tests/PoolTest/Model/PoolTableTest.php +++ b/tests/PoolTest/Model/PoolTableTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/tests/RestoreTest/Controller/IndexControllerTest.php b/tests/RestoreTest/Controller/IndexControllerTest.php index 043cc2e7..349fe692 100644 --- a/tests/RestoreTest/Controller/IndexControllerTest.php +++ b/tests/RestoreTest/Controller/IndexControllerTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/tests/Statistics/Controller/IndexControllerTest.php b/tests/Statistics/Controller/IndexControllerTest.php index 883e520a..6b94b6ef 100644 --- a/tests/Statistics/Controller/IndexControllerTest.php +++ b/tests/Statistics/Controller/IndexControllerTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/tests/StorageTest/Controller/IndexControllerTest.php b/tests/StorageTest/Controller/IndexControllerTest.php index f545fc2a..0b61f696 100644 --- a/tests/StorageTest/Controller/IndexControllerTest.php +++ b/tests/StorageTest/Controller/IndexControllerTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/tests/StorageTest/Model/StorageTableTest.php b/tests/StorageTest/Model/StorageTableTest.php index b1e177a0..54a9c2d5 100644 --- a/tests/StorageTest/Model/StorageTableTest.php +++ b/tests/StorageTest/Model/StorageTableTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/tests/UserTest/Controller/IndexControllerTest.php b/tests/UserTest/Controller/IndexControllerTest.php index 82a82e1d..3fc63e6b 100644 --- a/tests/UserTest/Controller/IndexControllerTest.php +++ b/tests/UserTest/Controller/IndexControllerTest.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify diff --git a/vendor/Bareos/library/Bareos/BSock/BareosBSock.php b/vendor/Bareos/library/Bareos/BSock/BareosBSock.php index 6a081a11..60c6f74b 100644 --- a/vendor/Bareos/library/Bareos/BSock/BareosBSock.php +++ b/vendor/Bareos/library/Bareos/BSock/BareosBSock.php @@ -24,7 +24,10 @@ */ namespace Bareos\BSock; -class BareosBSock +use Zend\ServiceManager\ServiceLocatorAwareInterface; +use Zend\ServiceManager\ServiceLocatorInterface; + +class BareosBSock implements ServiceLocatorAwareInterface { const BNET_TLS_NONE = 0; /* cannot do TLS */ const BNET_TLS_OK = 1; /* can do, but not required on my end */ @@ -79,14 +82,34 @@ class BareosBSock 'allowed_cns' => null, ); + protected $serviceLocator; private $socket = null; + public function setServiceLocator(ServiceLocatorInterface $serviceLocator) + { + $this->serviceLocator = $serviceLocator; + } + + public function getServiceLocator() + { + return $this->serviceLocator; + } + /** * Initialize the connection */ public function init() { - if(self::connect()) { + if(self::connect($this->config['console_name'], $this->config['password'])) { + return true; + } else { + return false; + } + } + + public function auth($console, $password) + { + if(self::connect($console, $password)) { return true; } else { return false; @@ -102,6 +125,12 @@ private function set_config_keyword($setting, $key) } } + public function set_user_credentials($username=null, $password=null) + { + $this->config['console_name'] = $username; + $this->config['password'] = $password; + } + /** * Set the connection configuration * @@ -119,10 +148,6 @@ public function set_config($config) throw new \Exception("Missing parameter 'port' in /config/autoload/local.php"); } - if(empty($config['password'])) { - throw new \Exception("Missing parameter 'password' in /config/autoload/local.php"); - } - if($this->config['debug']) { var_dump($this->config); } @@ -210,7 +235,7 @@ private function receive($len=0) $buffer = ""; $msg_len = array(); - if ($len == 0) { + if ($len === 0) { $buffer = fread($this->socket, 4); if($buffer === false){ return false; @@ -340,12 +365,15 @@ private function receive_message() * * @return boolean */ - private function connect() + private function connect($username, $password) { if (!isset($this->config['host']) or !isset($this->config['port'])) { return false; } + $this->config['console_name'] = $username; + $this->config['password'] = $password; + $port = $this->config['port']; $remote = "tcp://" . $this->config['host'] . ":" . $port; @@ -441,7 +469,7 @@ private function connect() * * @return boolean */ - private function disconnect() + public function disconnect() { fclose($this->socket); if($this->config['debug']) { @@ -471,11 +499,13 @@ private function login() $recv = self::receive(); if(strncasecmp($recv, self::DIR_AUTH_FAILED, strlen(self::DIR_AUTH_FAILED)) == 0) { - throw new \Exception("Failed to authenticate with Director\n"); + return false; + //throw new \Exception("Failed to authenticate with Director\n"); } elseif(strncasecmp($recv, self::DIR_OK_AUTH, strlen(self::DIR_OK_AUTH)) == 0) { return self::cram_md5_challenge($this->config['password']); } else { - throw new \Exception("Unknown response to authentication by Director $recv\n"); + return false; + //throw new \Exception("Unknown response to authentication by Director $recv\n"); } } diff --git a/vendor/Bareos/library/Bareos/Db/Sql/BareosSqlCompatHelper.php b/vendor/Bareos/library/Bareos/Db/Sql/BareosSqlCompatHelper.php index 2d9080ba..abcaf75d 100644 --- a/vendor/Bareos/library/Bareos/Db/Sql/BareosSqlCompatHelper.php +++ b/vendor/Bareos/library/Bareos/Db/Sql/BareosSqlCompatHelper.php @@ -5,7 +5,7 @@ * bareos-webui - Bareos Web-Frontend * * @link https://github.com/bareos/bareos-webui for the canonical source repository - * @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/) + * @copyright Copyright (c) 2013-2014 Bareos GmbH & Co. KG (http://www.bareos.org/) * @license GNU Affero General Public License (http://www.gnu.org/licenses/) * * This program is free software: you can redistribute it and/or modify @@ -24,17 +24,17 @@ */ namespace Bareos\Db\Sql; -class BareosSqlCompatHelper +class BareosSqlCompatHelper { protected $dbDriverConfig; - public function __construct($dbDriverConfig) + public function __construct($dbDriverConfig) { $this->dbDriverConfig = $dbDriverConfig; } - public function strdbcompat($str) + public function strdbcompat($str) { // PostgreSQL if($this->dbDriverConfig == "Pdo_Pgsql" || $this->dbDriverConfig == "Pgsql") {