Skip to main content
added 16 characters in body
Source Link
Brad Bell
  • 67.6k
  • 6
  • 75
  • 145

I want to be able to access a plugin page without having to login (for a cron job).

I have added this to the plugin's controller:

protected $allowAnonymous = true;

protected $allowAnonymous = true;

However, this url still requires login:

/admin/[plugin]

/admin/[plugin]

(If I login to admin, the above url works.)

If I try the url without /admin/admin:

/[plugin]

/[plugin]

The page doesn't work at all (logged in or not):

Page Not Found
The requested URL was not found on this server.

How do I make it so I can access my plugin page without login?

BtwBTW, I also have this in the [plugin]Plugin.php[plugin]Plugin.php file:

public function registerCpRoutes()
{
  return array(
    '[plugin]' => array('action' => '[Plugin]/[Action]'),
  );
}

I want to be able to access a plugin page without having to login (for a cron job).

I have added this to the plugin's controller:

protected $allowAnonymous = true;

However, this url still requires login:

/admin/[plugin]

(If I login to admin, the above url works.)

If I try the url without /admin:

/[plugin]

The page doesn't work at all (logged in or not):

Page Not Found
The requested URL was not found on this server.

How do I make it so I can access my plugin page without login?

Btw I also have this in the [plugin]Plugin.php file:

public function registerCpRoutes()
{
  return array(
    '[plugin]' => array('action' => '[Plugin]/[Action]'),
  );
}

I want to be able to access a plugin page without having to login (for a cron job).

I have added this to the plugin's controller:

protected $allowAnonymous = true;

However, this url still requires login:

/admin/[plugin]

(If I login to admin, the above url works.)

If I try the url without /admin:

/[plugin]

The page doesn't work at all (logged in or not):

Page Not Found
The requested URL was not found on this server.

How do I make it so I can access my plugin page without login?

BTW, I also have this in the [plugin]Plugin.php file:

public function registerCpRoutes()
{
  return array(
    '[plugin]' => array('action' => '[Plugin]/[Action]'),
  );
}
Source Link

$allowAnonymous = true - not working

I want to be able to access a plugin page without having to login (for a cron job).

I have added this to the plugin's controller:

protected $allowAnonymous = true;

However, this url still requires login:

/admin/[plugin]

(If I login to admin, the above url works.)

If I try the url without /admin:

/[plugin]

The page doesn't work at all (logged in or not):

Page Not Found
The requested URL was not found on this server.

How do I make it so I can access my plugin page without login?

Btw I also have this in the [plugin]Plugin.php file:

public function registerCpRoutes()
{
  return array(
    '[plugin]' => array('action' => '[Plugin]/[Action]'),
  );
}