|
From: <var...@us...> - 2021-03-01 13:47:49
|
Revision: 10276
http://sourceforge.net/p/phpwiki/code/10276
Author: vargenau
Date: 2021-03-01 13:47:42 +0000 (Mon, 01 Mar 2021)
Log Message:
-----------
Use class "error" when appropriate
Modified Paths:
--------------
trunk/lib/plugin/UserPreferences.php
Modified: trunk/lib/plugin/UserPreferences.php
===================================================================
--- trunk/lib/plugin/UserPreferences.php 2021-02-23 19:00:50 UTC (rev 10275)
+++ trunk/lib/plugin/UserPreferences.php 2021-03-01 13:47:42 UTC (rev 10276)
@@ -78,6 +78,7 @@
$args = $this->getArgs($argstr, $request);
$user =& $request->_user;
$user->_request = $request;
+ $iserror = false;
if (defined('FUSIONFORGE') && FUSIONFORGE) {
if (!($user->isAuthenticated())) {
return HTML::p(array('class' => 'error'),
@@ -129,6 +130,7 @@
} elseif ($rp = $request->getArg('pref')) {
// replace only changed prefs in $pref with those from request
if (!empty($rp['passwd']) and ($rp['passwd2'] != $rp['passwd'])) {
+ $iserror = true;
$errmsg = _("Wrong password. Try again.");
} else {
if (empty($rp['passwd'])) unset($rp['passwd']);
@@ -148,9 +150,11 @@
if ($passchanged) {
$errmsg = _("Password updated.") . " ";
} else {
+ $iserror = true;
$errmsg = _("Password was not changed.") . " ";
}
} else {
+ $iserror = true;
$errmsg = _("Password cannot be changed.");
}
}
@@ -167,7 +171,11 @@
}
}
}
- $args['errmsg'] = HTML::div(array('class' => 'feedback'), HTML::p($errmsg));
+ if ($iserror) {
+ $args['errmsg'] = HTML::div(array('class' => 'error'), HTML::p($errmsg));
+ } else {
+ $args['errmsg'] = HTML::div(array('class' => 'feedback'), HTML::p($errmsg));
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|