mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-06-05 19:29:06 -04:00
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.
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 (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);
|
||||
|
||||
Reference in New Issue
Block a user