Change the name of identity library from Identity to IdentityProvider. Create a helper class called identity to simplify call the Identity Provider. Move the contents of MY_Session.php to the new helper class and remove the MY_Session class

This commit is contained in:
Tim Almdal
2009-10-22 13:09:20 -07:00
parent 4cb9ec1d6d
commit 3c936d661a
60 changed files with 628 additions and 512 deletions

View File

@@ -65,7 +65,7 @@ class Comments_Controller extends REST_Controller {
$form = comment::get_add_form($item);
$valid = $form->validate();
if ($valid) {
if (Session::active_user()->guest && !$form->add_comment->inputs["name"]->value) {
if (identity::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, Session::active_user(),
$item, identity::active_user(),
$form->add_comment->text->value,
$form->add_comment->inputs["name"]->value,
$form->add_comment->email->value,
$form->add_comment->url->value);
$active = Session::active_user();
$active = identity::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 (!Session::active_user()->admin) {
if (!identity::active_user()->admin) {
access::forbidden();
}
print comment::get_edit_form($comment);