Group permissions in record and category edit: no SELECTED

Please report bugs here!

Moderator: Thorsten

Post Reply
patord
Posts: 3
Joined: Tue May 01, 2007 3:19 pm

Group permissions in record and category edit: no SELECTED

Post by patord »

1. is the bugs.phpmyfaq.de no longer in use to file bugs and patches?

2. phpmyfaq 2.0.7:

when you edit a category or record with medium permissions, the "Group permissions" never show the correct group that the item was selected on. There basically is no "SELECTED" html code on the item's group option. It always defaults to the first option in the list.

Looking at the code, this has been a bug for some time. I guess no one uses groups and edits their categories or records. The patches are as follows...

the getAllGroupsOptions call was passing the entire array versus just the needed permission value:

category.edit.php

Code: Select all

*** category.edit.php	Fri Apr 20 12:00:22 2007
--- category.edit.php	Mon Jun 23 17:38:29 2008
*************** if ($permission['editcateg']) {
*** 76,82 ****
      if ($groupSupport) {
  ?>
          <label class="left" for="grouppermission"><?php print $PMF_LANG['ad_entry_grouppermission']; ?></label>
!         <input type="radio" name="grouppermission" class="active" value="all" <?php print ($all_groups ? 'checked="checked"' : ''); ?>/> <?php print $PMF_LANG['ad_entry_all_groups']; ?> <input type="radio" name="grouppermission" class="active" value="restricted" <?php print ($restricted_groups ? 'checked="checked"' : ''); ?>/> <?php print $PMF_LANG['ad_entry_restricted_groups']; ?> <select name="restricted_groups" size="1"><?php print $user->perm->getAllGroupsOptions($group_permission); ?></select><br />
  <?php
      }
  ?>
--- 76,82 ----
      if ($groupSupport) {
  ?>
          <label class="left" for="grouppermission"><?php print $PMF_LANG['ad_entry_grouppermission']; ?></label>
!         <input type="radio" name="grouppermission" class="active" value="all" <?php print ($all_groups ? 'checked="checked"' : ''); ?>/> <?php print $PMF_LANG['ad_entry_all_groups']; ?> <input type="radio" name="grouppermission" class="active" value="restricted" <?php print ($restricted_groups ? 'checked="checked"' : ''); ?>/> <?php print $PMF_LANG['ad_entry_restricted_groups']; ?> <select name="restricted_groups" size="1"><?php print $user->perm->getAllGroupsOptions($group_permission[0]); ?></select><br />
  <?php
      }
  ?>
record.edit.php

Code: Select all

*** record.edit.php	Fri Jul 06 21:04:50 2007
--- record.edit.php	Mon Jun 23 17:41:03 2008
*************** if ($permission["editbt"] && !emptyTable
*** 300,306 ****
      if ($groupSupport) {
  ?>
      <label class="left" for="grouppermission"><?php print $PMF_LANG['ad_entry_grouppermission']; ?></label>
!     <input type="radio" name="grouppermission" class="active" value="all" <?php print ($all_groups ? 'checked="checked"' : ''); ?>/> <?php print $PMF_LANG['ad_entry_all_groups']; ?> <input type="radio" name="grouppermission" class="active" value="restricted" <?php print ($restricted_groups ? 'checked="checked"' : ''); ?>/> <?php print $PMF_LANG['ad_entry_restricted_groups']; ?> <select name="restricted_groups" size="1"><?php print $user->perm->getAllGroupsOptions($group_permission); ?></select><br />
  <?php
      }
  ?>
--- 300,306 ----
      if ($groupSupport) {
  ?>
      <label class="left" for="grouppermission"><?php print $PMF_LANG['ad_entry_grouppermission']; ?></label>
!     <input type="radio" name="grouppermission" class="active" value="all" <?php print ($all_groups ? 'checked="checked"' : ''); ?>/> <?php print $PMF_LANG['ad_entry_all_groups']; ?> <input type="radio" name="grouppermission" class="active" value="restricted" <?php print ($restricted_groups ? 'checked="checked"' : ''); ?>/> <?php print $PMF_LANG['ad_entry_restricted_groups']; ?> <select name="restricted_groups" size="1"><?php print $user->perm->getAllGroupsOptions($group_permission[0]); ?></select><br />
  <?php
      }
  ?>

3. You'll probably want to patch the 2.5.0 alphas as well. Looking at the admin code, those sections look the same as the 2.0.7 versions.


Regards,
patord
Post Reply