# HG changeset patch
# User Dan
# Date 1194032300 14400
# Node ID 6a4573507ff875f148c75da4fd9aadef8fd54108
# Parent 8877bbfccc38488b286bb0133104017af5ca9a5a
Fixed: invalid smartform input to Admin:UserManager when errors present and changing own account; [demo mode] default user can no longer change password
diff -r 8877bbfccc38 -r 6a4573507ff8 plugins/SpecialUserPrefs.php
--- a/plugins/SpecialUserPrefs.php Thu Nov 01 15:13:27 2007 -0400
+++ b/plugins/SpecialUserPrefs.php Fri Nov 02 15:38:20 2007 -0400
@@ -212,6 +212,8 @@
if ( strlen($newpass) > 0 )
{
+ if ( defined('ENANO_DEMO_MODE') )
+ $errors .= '
You can\'t change your password in demo mode.
';
// Perform checks
if ( strlen($newpass) < 6 )
$errors .= 'Password must be at least 6 characters. You hacked my script, darn you!
';
diff -r 8877bbfccc38 -r 6a4573507ff8 plugins/admin/UserManager.php
--- a/plugins/admin/UserManager.php Thu Nov 01 15:13:27 2007 -0400
+++ b/plugins/admin/UserManager.php Fri Nov 02 15:38:20 2007 -0400
@@ -52,7 +52,14 @@
}
else
{
- if ( $session->user_id != $user_id )
+ if ( $session->user_id == $user_id )
+ {
+ $username = $session->username;
+ $password = false;
+ $email = $session->email;
+ $real_name = $session->real_name;
+ }
+ else
{
$username = $_POST['username'];
if ( !preg_match('#^'.$session->valid_username.'$#', $username) )