diff options
author | mamouneyya <mamoun.diraneyya@gmail.com> | 2011-02-16 18:25:18 +0300 |
---|---|---|
committer | mamouneyya <mamoun.diraneyya@gmail.com> | 2011-02-16 18:25:18 +0300 |
commit | 00772aaa62e6bce14e58e163ea72f386136c731d (patch) | |
tree | ed658d454d8bea79d551969fffa0bc18faee5d52 /modules/rest/helpers | |
parent | 3e2610ea83c60805d5e727df6509da6c49fd6c7b (diff) | |
parent | d2c77fd0590501f7b6b51d9f4cc033ed9485b082 (diff) |
Merge remote-tracking branch 'gallery3/master'
Diffstat (limited to 'modules/rest/helpers')
-rw-r--r-- | modules/rest/helpers/registry_rest.php | 2 | ||||
-rw-r--r-- | modules/rest/helpers/rest.php | 9 | ||||
-rw-r--r-- | modules/rest/helpers/rest_event.php | 8 | ||||
-rw-r--r-- | modules/rest/helpers/rest_installer.php | 2 |
4 files changed, 13 insertions, 8 deletions
diff --git a/modules/rest/helpers/registry_rest.php b/modules/rest/helpers/registry_rest.php index e9c8b955..b8be26f1 100644 --- a/modules/rest/helpers/registry_rest.php +++ b/modules/rest/helpers/registry_rest.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-2010 Bharat Mediratta + * Copyright (C) 2000-2011 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/rest/helpers/rest.php b/modules/rest/helpers/rest.php index 58943700..1954f46e 100644 --- a/modules/rest/helpers/rest.php +++ b/modules/rest/helpers/rest.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-2010 Bharat Mediratta + * Copyright (C) 2000-2011 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 @@ -54,6 +54,11 @@ class rest_Core { $html = t("Empty response"); } print "<pre>$html</pre>"; + if (Session::instance()->get("profiler", false)) { + Profiler::enable(); + $profiler = new Profiler(); + $profiler->render(); + } break; default: @@ -104,7 +109,7 @@ class rest_Core { if (!$key->loaded()) { $key->user_id = identity::active_user()->id; - $key->access_key = md5(md5(uniqid(mt_rand(), true) . access::private_key())); + $key->access_key = md5(random::hash() . access::private_key()); $key->save(); } diff --git a/modules/rest/helpers/rest_event.php b/modules/rest/helpers/rest_event.php index d8c69e94..1fdd49e2 100644 --- a/modules/rest/helpers/rest_event.php +++ b/modules/rest/helpers/rest_event.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-2010 Bharat Mediratta + * Copyright (C) 2000-2011 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 @@ -43,7 +43,7 @@ class rest_event { static function user_add_form_admin_completed($user, $form) { $key = ORM::factory("user_access_key"); $key->user_id = $user->id; - $key->access_key = md5($user->name . rand()); + $key->access_key = random::hash($user->name); $key->save(); } @@ -64,7 +64,7 @@ class rest_event { if (!$key->loaded()) { $key->user_id = $user->id; - $key->access_key = md5($user->name . rand()); + $key->access_key = random::hash($user->name); $key->save(); } @@ -93,7 +93,7 @@ class rest_event { if (!$key->loaded()) { $key->user_id = $data->user->id; - $key->access_key = md5($data->user->name . rand()); + $key->access_key = random::hash($data->user->name); $key->save(); } $view->rest_key = $key->access_key; diff --git a/modules/rest/helpers/rest_installer.php b/modules/rest/helpers/rest_installer.php index 3c7fea4b..7a63e371 100644 --- a/modules/rest/helpers/rest_installer.php +++ b/modules/rest/helpers/rest_installer.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-2010 Bharat Mediratta + * Copyright (C) 2000-2011 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 |