- Posts: 2
COMMUNITY FORUM
Error message 403 - K2_ALERTNOTAUTH
- Fio
- Offline
- New Member
Fotis Evangelou wrote: Guys, you need to create K2 user groups first with the editing permissions you want and assign users there. That's why you get this message.
BTW, in k2 v2.5.3 we have fixed this missing language string.
Ok just installed the 2.5.3, indeed the string is fixed. About creating user groups: what if I want unregistered users to submit content like articles or articles with attached documents and such? Is it even possible (coz in sobi2 it is)? I prefer using your component over sobi2coz its more uptodate and has more features..
Thanks
Please Log in or Create an account to join the conversation.
- Thomas
- Offline
- New Member
- Posts: 4
Fotis Evangelou wrote: Guys, you need to create K2 user groups first with the editing permissions you want and assign users there. That's why you get this message.
BTW, in k2 v2.5.3 we have fixed this missing language string.
Is it possible, that unregistered users submit content?
I have tried a lot of ACL Settings, but doesn´t find a solution for this:-(
Please Log in or Create an account to join the conversation.
- Eoin Feeney
- Offline
- Premium Member
- Posts: 99
Is there another solution in my instance?
Please Log in or Create an account to join the conversation.
- Eoin Feeney
- Offline
- Premium Member
- Posts: 99
Please Log in or Create an account to join the conversation.
- Arvind Ragunathan
- Offline
- New Member
- Posts: 4
I am using Joomla v2.5.6 and K2 v2.5.7
If your K2 category is set to registered and you have assigned a menu item to the registered category then you will receive "403 - You are not authorized to view this resource"
To resolve this issue we need to manually change the code on the backend.
1) Go To [SITE ROOT]\components\com_k2\views\itemlist\view.html.php
2) Find the code "JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));" which is contained in
$user = &JFactory::getUser();
if(K2_JVERSION=='16'){
if (!in_array($category->access, $user->authorisedLevels())) {
JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
}
$languageFilter = $mainframe->getLanguageFilter();
$languageTag = JFactory::getLanguage()->getTag();
if($languageFilter && $category->language!=$languageTag && $category->language!='*') {
return;
}
}
3) Replace the code "JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));" with:
if ($this->error->code = '403') {
$return = $_SERVER;
$return = base64_encode($return);
$uri = JRoute::_("index.php?option=com_users&view=login&return=$return");
header('Location:'.$uri); die();
}
4) Final code should look like:
$user = &JFactory::getUser();
if(K2_JVERSION=='16'){
if (!in_array($category->access, $user->authorisedLevels())) {
/*JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));*/
if ($this->error->code = '403') {
$return = $_SERVER;
$return = base64_encode($return);
$uri = JRoute::_("index.php?option=com_users&view=login&return=$return");
header('Location:'.$uri); die();
}
}
$languageFilter = $mainframe->getLanguageFilter();
$languageTag = JFactory::getLanguage()->getTag();
if($languageFilter && $category->language!=$languageTag && $category->language!='*') {
return;
}
}
5) This should resolve the issue.
6) You can do the same for [SITE ROOT]\components\com_k2\views\item\view.html.php
7) Find the code "JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));" which is contained in
if(K2_JVERSION=='16'){
if (!in_array($item->access, $user->authorisedLevels()) || !in_array($item->category->access, $user->authorisedLevels())) {
JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
}
}
8 Replace the code "JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));" with:
if ($this->error->code = '403') {
$return = $_SERVER;
$return = base64_encode($return);
$uri = JRoute::_("index.php?option=com_users&view=login&return=$return");
header('Location:'.$uri); die();
}
9) Final code should look like:
if(K2_JVERSION=='16'){
if (!in_array($item->access, $user->authorisedLevels()) || !in_array($item->category->access, $user->authorisedLevels())) {
/*JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));*/
if ($this->error->code = '403') {
$return = $_SERVER;
$return = base64_encode($return);
$uri = JRoute::_("index.php?option=com_users&view=login&return=$return");
header('Location:'.$uri); die();
}
}
}
Please Log in or Create an account to join the conversation.
- mohamed
- Offline
- New Member
- Posts: 1
HiArvind Ragunathan wrote: You can try this:
I am using Joomla v2.5.6 and K2 v2.5.7
If your K2 category is set to registered and you have assigned a menu item to the registered category then you will receive "403 - You are not authorized to view this resource"
To resolve this issue we need to manually change the code on the backend.
1) Go To [SITE ROOT]\components\com_k2\views\itemlist\view.html.php
}
i have the same problem
joomla 1.7.2 and k2 v2.5.7
replacing codes in this files did not work
i searched for the error text string and found that changes make effect when done to this file only
components/com_k2/helpers/permissions.php
but i can not configure the exact code to change
line number 109
$task = JRequest::getCmd('task');
switch ($task) {
case 'add':
if (!K2HelperPermissions::canAddItem())
JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
break;
Please Log in or Create an account to join the conversation.
- marieta
- Offline
- New Member
- Posts: 1
Arvind Ragunathan wrote: You can try this:
I am using Joomla v2.5.6 and K2 v2.5.7
If your K2 category is set to registered and you have assigned a menu item to the registered category then you will receive "403 - You are not authorized to view this resource"
To resolve this issue we need to manually change the code on the backend.
1) Go To [SITE ROOT]\components\com_k2\views\itemlist\view.html.php
2) Find the code "JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));" which is contained in
$user = &JFactory::getUser();
if(K2_JVERSION=='16'){
if (!in_array($category->access, $user->authorisedLevels())) {
JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
}
$languageFilter = $mainframe->getLanguageFilter();
$languageTag = JFactory::getLanguage()->getTag();
if($languageFilter && $category->language!=$languageTag && $category->language!='*') {
return;
}
}
3) Replace the code "JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));" with:
if ($this->error->code = '403') {
$return = $_SERVER;
$return = base64_encode($return);
$uri = JRoute::_("index.php?option=com_users&view=login&return=$return");
header('Location:'.$uri); die();
}
4) Final code should look like:
$user = &JFactory::getUser();
if(K2_JVERSION=='16'){
if (!in_array($category->access, $user->authorisedLevels())) {
/*JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));*/
if ($this->error->code = '403') {
$return = $_SERVER;
$return = base64_encode($return);
$uri = JRoute::_("index.php?option=com_users&view=login&return=$return");
header('Location:'.$uri); die();
}
}
$languageFilter = $mainframe->getLanguageFilter();
$languageTag = JFactory::getLanguage()->getTag();
if($languageFilter && $category->language!=$languageTag && $category->language!='*') {
return;
}
}
5) This should resolve the issue.
6) You can do the same for [SITE ROOT]\components\com_k2\views\item\view.html.php
7) Find the code "JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));" which is contained in
if(K2_JVERSION=='16'){
if (!in_array($item->access, $user->authorisedLevels()) || !in_array($item->category->access, $user->authorisedLevels())) {
JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
}
}
8 Replace the code "JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));" with:
if ($this->error->code = '403') {
$return = $_SERVER;
$return = base64_encode($return);
$uri = JRoute::_("index.php?option=com_users&view=login&return=$return");
header('Location:'.$uri); die();
}
9) Final code should look like:
if(K2_JVERSION=='16'){
if (!in_array($item->access, $user->authorisedLevels()) || !in_array($item->category->access, $user->authorisedLevels())) {
/*JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));*/
if ($this->error->code = '403') {
$return = $_SERVER;
$return = base64_encode($return);
$uri = JRoute::_("index.php?option=com_users&view=login&return=$return");
header('Location:'.$uri); die();
}
}
}
i didn't find this code!!!!
some one have another solution??
Please Log in or Create an account to join the conversation.