matthewgall/radipanel_edit — Issue #4: PHP Error
Author: habbostory
Created: 2011-11-05 15:47:51+00:00
State: open

Hi there,

I've been trying to develop the addUser page to not allow certain members to manage certain accounts.

Code as below, but something's wrong because it doesn't allow admin to manage any accounts, and some usergroups ain't allowed to manage the accounts that aren't listed. Could do with some help.

The original code I found which works perfect was;
hasGroup( '4' ) AND !$user->hasGroup( '5' ) AND $data['displaygroup'] == '5' ) {

echo "

Error:
You Cannot Edit An Admin's Acount!

";
}
else {
?>

And then I tried changing it to;
[hasGroup( '7' ) AND !$user->hasGroup( '5' )
AND $data['displaygroup'] == '5' /*Admin*/
OR $data['displaygroup'] == '3' /*News*/
OR $data['displaygroup'] == '4' /*Management*/
OR $data['displaygroup'] == '6' /*CMS*/
OR $data['displaygroup'] == '8' /*News Management*/
OR $data['displaygroup'] == '9' /*Events Management*/
) {

echo "

Radio Management Error:
You do not have permission to manage this account.

";
}
else {
?>

hasGroup( '8' ) AND !$user->hasGroup( '5' )
AND $data['displaygroup'] == '5' /*Admin*/
OR $data['displaygroup'] == '2' /*Radio DJ*/
OR $data['displaygroup'] == '4' /*Management*/
OR $data['displaygroup'] == '6' /*CMS*/
OR $data['displaygroup'] == '7' /*Radio Management*/
OR $data['displaygroup'] == '9' /*Events Management*/
) {

echo "

News Management Error:
You do not have permission to manage this account.

";
}
else {
?>

hasGroup( '9' ) AND !$user->hasGroup( '5' )
AND $data['displaygroup'] == '5' /*Admin*/
OR $data['displaygroup'] == '2' /*Radio DJ*/
OR $data['displaygroup'] == '3' /*News*/
OR $data['displaygroup'] == '4' /*Management*/
OR $data['displaygroup'] == '6' /*CMS*/
OR $data['displaygroup'] == '7' /*Radio Management*/
OR $data['displaygroup'] == '8' /*News Management*/
) {

echo "

Events Management Error:
You do not have permission to manage this account.

";
}
else {
?>

Any help ?