mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-07-11 09:43:51 -04:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user