1
piar
WF-Channel Permissions problem
  • 2008/11/13 21:46

  • piar

  • Just popping in

  • Posts: 22

  • Since: 2008/10/30


I'm using XOOPS 2.3.1 with WF-Channel 2.02 and have some problem with permissions.
I created a group called 'editors' which have granted full permission to that module. But users from that group don't see any page in 'Admin index' - they still have message: No Pages Available. Even when editor creates new page (which admin see in his 'Admin index') it doesn't appear in 'Admin index' of editor. When I put page editing address as editior (like: modules/wfchannel/admin/index.php?op=edit&wfc_cid=19) he can edit that page and save changes...

What could cause that editors don't see pages list ('Admin index')?

2
piar
Re: WF-Channel Permissions problem
  • 2008/11/17 12:15

  • piar

  • Just popping in

  • Posts: 22

  • Since: 2008/10/30


Maybe this could help in helping me ;)
When I enter 'Admin index' as admin then queries looks like:
SET NAMES 'utf8' 
SELECT FROM xaa2_config WHERE (conf_modid '0' AND conf_catid '1'ORDER BY conf_order ASC 
SELECT sess_data
sess_ip FROM xaa2_session WHERE sess_id 'bd4af262d1daa6f5ab56ded6b312a3f3' 
SELECT FROM xaa2_users WHERE uid '1' 
DELETE FROM xaa2_protector_access WHERE expire UNIX_TIMESTAMP() 
SELECT COUNT(*) FROM xaa2_protector_access WHERE ip='83.20.40.84' AND request_uri='/modules/wfchannel/admin/index.php' 
SELECT COUNT(*) FROM xaa2_protector_access WHERE ip='83.20.40.84' 
INSERT INTO xaa2_protector_access SET ip='83.20.40.84',request_uri='/modules/wfchannel/admin/index.php',expire=UNIX_TIMESTAMP()+'60' 
SELECT FROM xaa2_modules WHERE dirname 'wfchannel' 
SELECT FROM xaa2_config WHERE (conf_modid '8'ORDER BY conf_order ASC 
SELECT 
FROM xaa2_modules WHERE dirname 'wfresource' 
SELECT FROM xaa2_wfcpages  
SELECT 
FROM xaa2_wfcpages ORDER BY wfc_cid DESC LIMIT 010 
SELECT 
FROM xaa2_group_permission WHERE (gperm_name 'module_admin' AND gperm_modid '1' AND (gperm_groupid '1' OR gperm_groupid '2')) 
SELECT FROM xaa2_modules WHERE (hasadmin '1' AND isactive '1'ORDER BY weight ASCmid ASC 
SELECT 
FROM xaa2_modules WHERE dirname 'news' 
SELECT FROM xaa2_config WHERE (conf_modid '13'ORDER BY conf_order ASC 
SELECT 
FROM xaa2_wfcrefers


And when I do the same as that editor I get:
SET NAMES 'utf8'
SELECT FROM xaa2_config WHERE (conf_modid '0' AND conf_catid '1'ORDER BY conf_order ASC
SELECT sess_data
sess_ip FROM xaa2_session WHERE sess_id '6b48e35c932e7660fd20a3e1f0dd9cb1'
SELECT FROM xaa2_users WHERE uid '2'
SELECT COUNT(*) FROM xaa2_group_permission WHERE (gperm_modid '1' AND gperm_name 'module_admin' AND gperm_itemid '1' AND (gperm_groupid '4'))
SELECT COUNT(*) FROM xaa2_group_permission WHERE (gperm_modid '1' AND gperm_name 'module_admin' AND gperm_itemid '1' AND (gperm_groupid '4'))
DELETE FROM xaa2_protector_access WHERE expire UNIX_TIMESTAMP()
SELECT COUNT(*) FROM xaa2_protector_access WHERE ip='83.20.40.84' AND request_uri='/modules/wfchannel/admin/index.php'
SELECT COUNT(*) FROM xaa2_protector_access WHERE ip='83.20.40.84'
INSERT INTO xaa2_protector_access SET ip='83.20.40.84',request_uri='/modules/wfchannel/admin/index.php',expire=UNIX_TIMESTAMP()+'60'
SELECT FROM xaa2_modules WHERE dirname 'wfchannel'
SELECT COUNT(*) FROM xaa2_group_permission WHERE (gperm_modid '1' AND gperm_name 'module_admin' AND gperm_itemid '8' AND (gperm_groupid '4'))
SELECT FROM xaa2_config WHERE (conf_modid '8'ORDER BY conf_order ASC
SELECT 
FROM xaa2_modules WHERE dirname 'wfresource'
SELECT FROM xaa2_wfcpages c LEFT JOIN xaa2_group_permission l ON l.gperm_itemid c.wfc_cid WHERE l.gperm_name 'wfc_page' AND l.gperm_groupid IN ) ) AND
Error number1064
Error message
You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
SELECT DISTINCT c
.* FROM xaa2_wfcpages c LEFT JOIN xaa2_group_permission l ON l.gperm_itemid c.wfc_cid WHERE l.gperm_name 'wfc_page' AND l.gperm_groupid IN ) ) AND ORDER BY wfc_cid DESC LIMIT 010
Error number
1064
Error message
You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY wfc_cid DESC LIMIT 0, 10' at line 1
SELECT 
FROM xaa2_group_permission WHERE (gperm_name 'module_admin' AND gperm_modid '1' AND (gperm_groupid '4'))
SELECT FROM xaa2_modules WHERE (hasadmin '1' AND isactive '1'ORDER BY weight ASCmid ASC
SELECT 
FROM xaa2_modules WHERE dirname 'news'
SELECT COUNT(*) FROM xaa2_group_permission WHERE (gperm_modid '13' AND gperm_name 'news_submit' AND (gperm_groupid '4'))
SELECT FROM xaa2_config WHERE (conf_modid '13'ORDER BY conf_order ASC
SELECT 
FROM xaa2_wfcrefers


Isn't it some core error?
What should I do to gain ability to have that editors group for managing only contents? Now it doesn't work because of that problem with 'Admin index' of WF-Channel :(

3
ghia
Re: WF-Channel Permissions problem
  • 2008/11/17 12:59

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


SELECT FROM xaa2_wfcpages c LEFT JOIN xaa2_group_permission l ON l.gperm_itemid c.wfc_cid WHERE l.gperm_name 'wfc_page' AND l.gperm_groupid IN ) ) AND
Error number1064
Error message
You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
SELECT DISTINCT c
.* FROM xaa2_wfcpages c LEFT JOIN xaa2_group_permission l ON l.gperm_itemid c.wfc_cid WHERE l.gperm_name 'wfc_page' AND l.gperm_groupid IN ) ) AND ORDER BY wfc_cid DESC LIMIT 010
Error number
1064
Error message
You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY wfc_cid DESC LIMIT 0, 10' at line 1

There is certain a problem in the routine that assembles the SQL Query. The last AND should be followed by a boolean expression or been ommitted.

4
piar
Re: WF-Channel Permissions problem
  • 2008/11/17 14:34

  • piar

  • Just popping in

  • Posts: 22

  • Since: 2008/10/30


Thank you for response!

So maybe I'll put here what I've done to solved it because I think this could be general problem with all modules basing on WF-Resource.
In three places in file modules/wfresource/class/class.objecthandler.php there is a code:
if ( $this->doPermissions ) {
  
$sql .= ' AND ' $criteria->render();
} else {
  
$sql .= ' ' $criteria->renderWhere();
}

I've changed it to:
if ( $this->doPermissions ) {
  if (
$criteria->render() !== "") {
    
$sql .= ' AND ' $criteria->render();
  }
} else {
  
$sql .= ' ' $criteria->renderWhere();
}


And now it works correct not only for useres from first group (default Webmasters group).

Login

Who's Online

143 user(s) are online (106 user(s) are browsing Support Forums)


Members: 0


Guests: 143


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits