summaryrefslogtreecommitdiff
path: root/modules/rest/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/rest/helpers')
-rw-r--r--modules/rest/helpers/registry_rest.php2
-rw-r--r--modules/rest/helpers/rest.php9
-rw-r--r--modules/rest/helpers/rest_event.php8
-rw-r--r--modules/rest/helpers/rest_installer.php2
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