summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/controllers/comments.php8
-rw-r--r--modules/comment/helpers/comment.php2
-rw-r--r--modules/comment/tests/Comment_Model_Test.php2
3 files changed, 6 insertions, 6 deletions
diff --git a/modules/comment/controllers/comments.php b/modules/comment/controllers/comments.php
index 84d6ca47..c0658cc1 100644
--- a/modules/comment/controllers/comments.php
+++ b/modules/comment/controllers/comments.php
@@ -65,7 +65,7 @@ class Comments_Controller extends REST_Controller {
$form = comment::get_add_form($item);
$valid = $form->validate();
if ($valid) {
- if (Identity::active()->guest && !$form->add_comment->inputs["name"]->value) {
+ if (Session::active_user()->guest && !$form->add_comment->inputs["name"]->value) {
$form->add_comment->inputs["name"]->add_error("missing", 1);
$valid = false;
}
@@ -78,13 +78,13 @@ class Comments_Controller extends REST_Controller {
if ($valid) {
$comment = comment::create(
- $item, Identity::active(),
+ $item, Session::active_user(),
$form->add_comment->text->value,
$form->add_comment->inputs["name"]->value,
$form->add_comment->email->value,
$form->add_comment->url->value);
- $active = Identity::active();
+ $active = Session::active_user();
if ($active->guest) {
$form->add_comment->inputs["name"]->value("");
$form->add_comment->email->value("");
@@ -192,7 +192,7 @@ class Comments_Controller extends REST_Controller {
* @see REST_Controller::form_edit($resource)
*/
public function _form_edit($comment) {
- if (!Identity::active()->admin) {
+ if (!Session::active_user()->admin) {
access::forbidden();
}
print comment::get_edit_form($comment);
diff --git a/modules/comment/helpers/comment.php b/modules/comment/helpers/comment.php
index 38d65db6..e741266d 100644
--- a/modules/comment/helpers/comment.php
+++ b/modules/comment/helpers/comment.php
@@ -75,7 +75,7 @@ class comment_Core {
module::event("comment_add_form", $form);
$group->submit("")->value(t("Add"));
- $active = Identity::active();
+ $active = Session::active_user();
if (!$active->guest) {
$group->inputs["name"]->value($active->full_name)->disabled("disabled");
$group->email->value($active->email)->disabled("disabled");
diff --git a/modules/comment/tests/Comment_Model_Test.php b/modules/comment/tests/Comment_Model_Test.php
index 76de2a34..84532a96 100644
--- a/modules/comment/tests/Comment_Model_Test.php
+++ b/modules/comment/tests/Comment_Model_Test.php
@@ -23,7 +23,7 @@ class Comment_Model_Test extends Unit_Test_Case {
$root = ORM::factory("item", 1);
$album = album::create($root, rand(), rand(), rand());
$comment = comment::create($album, Identity::guest(), "text", "name", "email", "url");
- Identity::set_active(Identity::guest());
+ Session::set_active_user(Identity::guest());
// We can see the comment when permissions are granted on the album
access::allow(Identity::everybody(), "view", $album);