diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-03-28 21:04:44 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-03-28 21:04:44 -0700 |
commit | ea43c5f06f5c7242f1d5811fe427e55c87497ecc (patch) | |
tree | 7ee253a40c57c8ea8066305e36b633fa2d7500e4 /modules/user/controllers | |
parent | 2eea7b874aa06f08ed58a85197473233b54693aa (diff) | |
parent | e8eb23db42bb929548af358452f1b65e16b61913 (diff) |
Merge branch 'master' of github.com:gallery/gallery3
Diffstat (limited to 'modules/user/controllers')
-rw-r--r-- | modules/user/controllers/admin_users.php | 2 | ||||
-rw-r--r-- | modules/user/controllers/password.php | 4 | ||||
-rw-r--r-- | modules/user/controllers/users.php | 9 |
3 files changed, 10 insertions, 5 deletions
diff --git a/modules/user/controllers/admin_users.php b/modules/user/controllers/admin_users.php index df3d96c9..3e36fd67 100644 --- a/modules/user/controllers/admin_users.php +++ b/modules/user/controllers/admin_users.php @@ -1,7 +1,7 @@ <?php defined("SYSPATH") or die("No direct script access."); /** * Gallery - a web based photo album viewer and editor - * Copyright (C) 2000-2009 Bharat Mediratta + * Copyright (C) 2000-2010 Bharat Mediratta * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/modules/user/controllers/password.php b/modules/user/controllers/password.php index f5190974..522b6b35 100644 --- a/modules/user/controllers/password.php +++ b/modules/user/controllers/password.php @@ -1,7 +1,7 @@ <?php defined("SYSPATH") or die("No direct script access."); /** * Gallery - a web based photo album viewer and editor - * Copyright (C) 2000-2009 Bharat Mediratta + * Copyright (C) 2000-2010 Bharat Mediratta * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -52,7 +52,7 @@ class Password_Controller extends Controller { $user_name = $form->reset->inputs["name"]->value; $user = user::lookup_by_name($user_name); if ($user && !empty($user->email)) { - $user->hash = md5(rand()); + $user->hash = md5(uniqid(mt_rand(), true)); $user->save(); $message = new View("reset_password.html"); $message->confirm_url = url::abs_site("password/do_reset?key=$user->hash"); diff --git a/modules/user/controllers/users.php b/modules/user/controllers/users.php index cd7d271f..e1f1fa2b 100644 --- a/modules/user/controllers/users.php +++ b/modules/user/controllers/users.php @@ -1,7 +1,7 @@ <?php defined("SYSPATH") or die("No direct script access."); /** * Gallery - a web based photo album viewer and editor - * Copyright (C) 2000-2009 Bharat Mediratta + * Copyright (C) 2000-2010 Bharat Mediratta * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,7 +30,8 @@ class Users_Controller extends Controller { $user->full_name = $form->edit_user->full_name->value; $user->url = $form->edit_user->url->value; - if ($user->locale != $form->edit_user->locale->value) { + if (count(locales::installed()) > 1 && + $user->locale != $form->edit_user->locale->value) { $user->locale = $form->edit_user->locale->value; $flush_locale_cookie = true; } @@ -221,6 +222,10 @@ class Users_Controller extends Controller { /** @todo combine with Admin_Users_Controller::_add_locale_dropdown */ private function _add_locale_dropdown(&$form, $user=null) { $locales = locales::installed(); + if (count($locales) <= 1) { + return; + } + foreach ($locales as $locale => $display_name) { $locales[$locale] = SafeString::of_safe_html($display_name); } |