Fixed syntax error in groupSelection
Fixed syntax error in groupSelection

<?php <?php
/** Single Group Selection Select Menu /** Single Group Selection Select Menu
* *
* Copyright (C) 2012 B Tasker * Copyright (C) 2012 B Tasker
* Released under GNU GPL V2 * Released under GNU GPL V2
* See LICENSE * See LICENSE
* *
* *
* Set the variable multiselect to 1 before calling this file to display checkboxes * Set the variable multiselect to 1 before calling this file to display checkboxes
*/ */
   
defined('_CREDLOCK') or die; defined('_CREDLOCK') or die;
   
   
   
   
if (!isset($auth)){ if (!isset($auth)){
$auth = new AuthDB; $auth = new AuthDB;
} }
   
if (!isset($crypt)){ if (!isset($crypt)){
$crypt = new Crypto; $crypt = new Crypto;
} }
   
   
   
$groups = $auth->retrieveGroupNames(); $groups = $auth->retrieveGroupNames();
   
if (BTMain::getUser->PortalLogin() == 1):?> if (BTMain::getUser()->PortalLogin == 1):?>
   
   
<select name="frmGroup" id="frmGroup" style="display: none;"> <select name="frmGroup" id="frmGroup" style="display: none;">
<option value="<?php if (isset($preselect)){ echo $preselect; } else{ echo 0;}?>">nochange</option> <option value="<?php if (isset($preselect)){ echo $preselect; } else{ echo 0;}?>">nochange</option>
</select> </select>
   
</select> </select>
   
   
<?php else: ?> <?php else: ?>
   
   
<?php if ($multiselect != 1): <?php if ($multiselect != 1):
?> ?>
<label for="frmGroup">Group</label><select name="frmGroup" id="frmGroup"> <label for="frmGroup">Group</label><select name="frmGroup" id="frmGroup">
<option value='null'> -- Select Group --</option> <option value='null'> -- Select Group --</option>
<option value="0" <?php if (isset($preselect) && $preselect == 0){ echo "selected";}?>>All users</option> <option value="0" <?php if (isset($preselect) && $preselect == 0){ echo "selected";}?>>All users</option>
<?php <?php
   
foreach ($groups as $group){ foreach ($groups as $group){
   
$plaintext = $crypt->decrypt($group->Name,'Groups'); $plaintext = $crypt->decrypt($group->Name,'Groups');
   
$str = "<option value='{$group->id}' "; $str = "<option value='{$group->id}' ";
   
if ($group->id == $preselect){ if ($group->id == $preselect){
$str .= "selected"; $str .= "selected";
} }
   
$str .= ">$plaintext</option>"; $str .= ">$plaintext</option>";
   
$grps[$plaintext] = $str; $grps[$plaintext] = $str;
   
} }
   
ksort($grps); ksort($grps);
echo implode("\n",$grps); echo implode("\n",$grps);
unset($grps); unset($grps);
?> ?>
</select> </select>
   
<?php else:?> <?php else:?>
   
<fieldset class='groupsMultiSelect' id='groupsMultiSelect'><legend>Select Groups</legend> <fieldset class='groupsMultiSelect' id='groupsMultiSelect'><legend>Select Groups</legend>
<?php <?php
foreach ($groups as $group){ foreach ($groups as $group){
   
$plaintext = $crypt->decrypt($group->Name,'Groups'); $plaintext = $crypt->decrypt($group->Name,'Groups');
   
$grps[$plaintext] = "<span class='checkbox'><input type='checkbox' name='frmGroup[]' value='{$group->id}'"; $grps[$plaintext] = "<span class='checkbox'><input type='checkbox' name='frmGroup[]' value='{$group->id}'";
   
if (in_array($group->id,$Ugroups)): $grps[$plaintext] .= " checked"; endif; if (in_array($group->id,$Ugroups)): $grps[$plaintext] .= " checked"; endif;
   
$grps[$plaintext] .= ">$plaintext</span>"; $grps[$plaintext] .= ">$plaintext</span>";
   
} }
   
ksort($grps); ksort($grps);
echo implode("\n",$grps); echo implode("\n",$grps);
unset($grps); unset($grps);
?> ?>
</fieldset> </fieldset>
<?php endif;?> <?php endif;?>
   
<?php endif; ?> <?php endif; ?>