summaryrefslogtreecommitdiff
path: root/modules/comment/controllers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-10-16 10:06:58 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-10-16 10:06:58 -0700
commit78ee4193b70329c8e0929efd18c22324dd2ad8e0 (patch)
tree900c686f12934fdf168ebe214afc1cb414bf4683 /modules/comment/controllers
parentbc241e44c2e4d10ac19ccc32a40c90426672d963 (diff)
Remove all non Identity API methods from Identity.php. Created an MY_Session class to provide the user state changes in the session and a login.php helper that has the login form.
Diffstat (limited to 'modules/comment/controllers')
-rw-r--r--modules/comment/controllers/comments.php8
1 files changed, 4 insertions, 4 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);