--- a/classes/bfw/Configuration.php
+++ b/classes/bfw/Configuration.php
@@ -58,11 +58,22 @@
* @return array
*/
public static function getDataSourceProperties() {
- return array(
- 'dsn' => 'mysql:host=localhost;dbname=bfw',
- 'config' => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'),
- 'username' => 'bfw',
- 'password' => 'bfw',
+ $dataSources = array(
+ 'psql' => array(
+ 'dsn' => 'pgsql:host=localhost;dbname=bfw',
+ 'config' => array(),
+ 'username' => 'bfw',
+ 'password' => 'bfw',
+ ),
+
+ 'mysql' => array(
+ 'dsn' => 'mysql:host=localhost;dbname=bfw',
+ 'config' => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'),
+ 'username' => 'bfw',
+ 'password' => 'bfw',
+ )
);
+
+ return $dataSources['mysql'];
}
-}
\ No newline at end of file
+}
--- a/classes/bfw/mvc/controller/BenutzerverwaltungController.php
+++ b/classes/bfw/mvc/controller/BenutzerverwaltungController.php
@@ -9,6 +9,7 @@
use bfw\core\Controller;
use bfw\Dispatcher;
+use bfw\entities\TGroup;
class BenutzerverwaltungController extends Controller {
@@ -89,10 +90,16 @@
$model = $this->getModel();
+ $group_id = $request->getKey('group_id');
+
+ if ($group_id != TGroup::ADMIN) {
+ Dispatcher::route('/');
+ }
+
$users = $model->getUsers();
$groups = $model->getGroups();
$view->assign('users', $users);
$view->assign('groups', $groups);
}
-}
\ No newline at end of file
+}
--- a/classes/bfw/mvc/view/benutzerverwaltung/anmelden.tpl
+++ b/classes/bfw/mvc/view/benutzerverwaltung/anmelden.tpl
@@ -16,17 +16,13 @@
<div class="row">
<div class="col-lg-12">
- <div class="col-lg-6">
- <a href="/benutzerverwaltung/resetpasswort/">Passwort zurück setzen</a>
- </div>
-
- <div class="col-lg-6">
+ <p>
<input type="submit" name="anmelden" value="anmelden"/>
- </div>
+ </p>
</div>
</div>
</form>
</div>
{$request->printSession()}
-</div>
\ No newline at end of file
+</div>
--- a/classes/bfw/mvc/view/benutzerverwaltung/meinprofil.tpl
+++ b/classes/bfw/mvc/view/benutzerverwaltung/meinprofil.tpl
@@ -7,7 +7,7 @@
<div class="col-lg-12">
<p>
<label for="usernameField">Benutzername</label>
- <input id="usernameField" type="text" name="username" value="{$tUser->getUsername()}"/>
+ <input id="usernameField" type="text" name="username" value="{$user->getUsername()}"/>
</p>
<p>
@@ -17,12 +17,12 @@
<p>
<label for="firstnameField">Vorname</label>
- <input id="firstnameField" type="text" name="firstname" value="{$tUser->getFirstname()}"/>
+ <input id="firstnameField" type="text" name="firstname" value="{$user->getFirstname()}"/>
</p>
<p>
<label for="lastnameField">Nachname</label>
- <input id="lastnameField" type="text" name="lastname" value="{$tUser->getLastname()}"/>
+ <input id="lastnameField" type="text" name="lastname" value="{$user->getLastname()}"/>
</p>
<div class="pull-right">
@@ -31,4 +31,4 @@
</div>
</div>
</div>
-</form>
\ No newline at end of file
+</form>
--- a/classes/bfw/mvc/view/header.tpl
+++ b/classes/bfw/mvc/view/header.tpl
@@ -11,9 +11,11 @@
</div>
<div class="collapse navbar-collapse" id="ticketbar">
+ {if $smarty.session.prefix.group_id == $group::ADMIN}
<ul class="nav navbar-nav">
<li class="active"><a href="/benutzerverwaltung/">Benutzerverwaltung <span class="sr-only">(current)</span></a></li>
</ul>
+ {/if}
<ul class="nav navbar-nav">
<li class="active"><a href="/dokumentation/">Dokumentation<span class="sr-only">(current)</span></a></li>
@@ -26,7 +28,7 @@
</form>
<ul class="nav navbar-nav navbar-right">
{if $request->getKey('isLoggedIn')}
- <li><a href="/benutzerverwaltung/meinprofil/">{$tUser->getFirstname()} {$tUser->getLastname()}</a></li>
+ <li><a href="/benutzerverwaltung/meinprofil/">{$user->getFirstname()} {$user->getLastname()}</a></li>
<li><a href="/benutzerverwaltung/abmelden/">abmelden</a></li>
{else}
<li><a href="/benutzerverwaltung/anmelden/">anmelden</a></li>
@@ -35,4 +37,4 @@
</ul>
</div>
</div>
-</nav>
\ No newline at end of file
+</nav>