Merging version 2.1 RC to main trunk.
[fa-stable.git] / admin / change_current_user_password.php
index 1f739243e21ff1b7fa2e9fb6765434e5e78cc46e..d38f96cd2b3a679e2ca3ba0c61f1e5e562e70bb9 100644 (file)
@@ -1,5 +1,14 @@
 <?php
-
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU General Public License, GPL, 
+       as published by the Free Software Foundation, either version 3 
+       of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
 $page_security=1;
 $path_to_root="..";
 include_once($path_to_root . "/includes/session.inc");
@@ -46,8 +55,12 @@ if (isset($_POST['UPDATE_ITEM']))
 
        if (can_process())
        {
-               update_user_password($_POST['user_id'], md5($_POST['password']));
-           display_notification(_("Your password has been updated."));
+               if ($allow_demo_mode) {
+                   display_warning(_("Password cannot be changed in demo mode."));
+               } else {
+                       update_user_password($_POST['user_id'], md5($_POST['password']));
+                   display_notification(_("Your password has been updated."));
+               }
                $Ajax->activate('_page_body');
        }
 }