commit 53ce4d4554de4bd59eaf5cd5d8b3e8445b1f4245
parent 1f9b00f85cb21f936485b497061340924e623af5
Author: dankert <dankert@laptop-jan>
Date: Fri, 22 Mar 2013 11:06:46 +0100
Kennwortänderung auch möglich bei Authentifizierung mit CookieAuth.
Diffstat:
4 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/action/ProfileAction.class.php b/action/ProfileAction.class.php
@@ -131,8 +131,13 @@ class ProfileAction extends Action
*/
function pwView()
{
- $user = $this->getUserFromSession();
- $this->setTemplateVar('ok', strtolower($user->loginModuleName) == 'internal');
+ // Kennwortänderung funktioniert natürlich nur in der internen Datenbank.
+ //
+ // Hier wird festgestellt, ob der Benutzer sich über die interne Datenbank angemeldet hat.
+ // Nur dann kann man auch sein Kennwort ändern.
+ $user = $this->getUserFromSession();
+ $pwchangePossible = in_array( strtolower($user->loginModuleName), array('cookieauth','internal'));
+ $this->setTemplateVar('pwchange_enabled', $pwchangePossible);
}
diff --git a/language/de.ini.php b/language/de.ini.php
@@ -1185,3 +1185,4 @@ EXTRAS=Extras
SELECT_PROJECT=Projekt auswählen
SELECT_LANGUAGE=Sprache auswählen
SELECT_MODEL=Variante auswählen
+PWCHANGE_NOT_ALLOWED=Eine Kennwortänderung ist nicht möglich
diff --git a/language/en.ini.php b/language/en.ini.php
@@ -1228,3 +1228,4 @@ EXTRAS=Extras
SELECT_PROJECT=Select project
SELECT_LANGUAGE=Select language
SELECT_MODEL=Select model
+PWCHANGE_NOT_ALLOWED=Password change is not available
diff --git a/themes/default/templates/profile/pw.tpl.src.xml b/themes/default/templates/profile/pw.tpl.src.xml
@@ -2,9 +2,10 @@
xsi:schemaLocation="http://www.openrat.de/template ../template.xsd">
<form>
- <logo name="changepassword"></logo>
- <if true="var:ok">
+ <if true="var:pwchange_enabled">
+ <logo name="changepassword"></logo>
+
<group title="message:user_act_password">
<part class="line">
<part class="label">
@@ -41,7 +42,9 @@
</group>
</if>
<else>
- <text class="warn" key="change_not_allowed" />
+ <part class="message warn">
+ <text key="pwchange_not_allowed" />
+ </part>
</else>
</form>
</output>
\ No newline at end of file