Page 1 of 1

Hiding the group anonymous

Posted: 2021-07-13 20:11
by dlee
Is there a way to hide the group anonymous so that it does not show up in the Admin Area, Groups, View Groups list of groups?
TD

Re: Hiding the group anonymous

Posted: 2021-07-15 21:28
by pbottcher
Hi,

not that I would know of. You would have to edit the admin file to not show the group,

Edit the pageViewGroups.php and look to the query

$res = sql("select groupID, name, description from membership_groups $where limit $start, ".$adminConfig['groupsPerPage'], $eo);

Note that this file is overwritten upon recreation of you app.

Re: Hiding the group anonymous

Posted: 2021-07-21 15:58
by dlee
I was able to make some changes to the Admin area that hide the anonymous group. Send me a private message if you would like a pdf of the code changes I made.

TD

Re: Hiding the group anonymous

Posted: 2021-07-23 16:55
by dlee
Here is my code that I used to hide the anonymous group in the Admin area of my web app.
TD

THE LINES THAT WHERE EITHER ADDED OR MODIFIED INCLUDE A COMMENT IDENTIFYING THEM AS SUCH
The line numbers I refer to are presented in Notepad++

In the root folder of your web app, in file config.php make sure this line is setup this way to hide tweeter on the Admin page:

'hide_twitter_feed' => "1",

In file /admin/incHeader.php, around line number 184, comment out the following line:

Code: Select all

<!--
<li><a href="pageEditGroup.php?groupID=<?php echo sqlValue("select groupID from membership_groups where name='" . makeSafe($adminConfig['anonymousGroup']) . 
"'"); ?>"><i class="glyphicon menu-item-icon text-info glyphicon-user"></i> <?php echo  $Translation['edit anonymous permissions'] ; ?></a></li> 
-->
Also in file /admin/incHeader.php, starting around line number 199, comment out these lines:

Code: Select all

<!--
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="glyphicon glyphicon-cog"></i> <?php echo $Translation['utilities']; ?> <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="pageSettings.php"><i class="glyphicon menu-item-icon text-info glyphicon-cog"></i> <?php echo $Translation['admin settings']; ?></a></li>
li class="divider"></li>
<li><a href="pageTransferOwnership.php"><i class="glyphicon menu-item-icon text-info glyphicon-random"></i> <?php echo $Translation['batch transfer']; ?></a></li>
<li><a href="pageMail.php?sendToAll=1"><i class="glyphicon menu-item-icon text-info glyphicon-envelope"></i> <?php echo $Translation['mail all users']; ?></a></li>
<li class="divider"></li>
<li><a href="pageRebuildFields.php"><i class="glyphicon menu-item-icon text-info glyphicon-refresh"></i> <?php echo  $Translation['view or rebuild fields']; ?></a></li>
<li><a href="pageBackupRestore.php"><i class="glyphicon menu-item-icon text-info glyphicon-tasks"></i> <?php echo $Translation['database backups']; ?></a></li>
<li><a href="pageUploadCSV.php"><i class="glyphicon menu-item-icon text-info glyphicon-upload"></i> <?php echo $Translation['import CSV']; ?></a></li>
<li><a href="pageQueryLogs.php"><i class="glyphicon menu-item-icon text-info glyphicon-book"></i> <?php echo $Translation['Query logs']; ?></a></li>
<li class="divider"></li>
<li><a href="https://forums.appgini.com" target="_blank"><i class="glyphicon menu-item-icon text-info glyphicon-new-window"></i> <?php echo $Translation['AppGini 
forum']; ?></a></li>
</ul>
</li>
-->
In file /admin/pageHome.php, starting around line number 57, comment out these lines:

Code: Select all

<!--
<div class="col-md-12 text-right vspacer-lg">
<label><?php echo $Translation['maintenance mode']; ?></label>
<div class="btn-group" id="toggle_maintenance_mode">
<button type="button" class="btn <?php echo $off_classes; ?>"><?php echo $Translation['OFF']; ?></button>
<button type="button" class="btn <?php echo $on_classes; ?>"><?php echo $Translation['ON']; ?></button>
</div>
</div>
-->
Also in file /admin/pageHome.php, around line 194, make these changes:

Code: Select all

<td class="remaining-width"><a href="pageViewGroups.php"title="<?php echo $Translation['view groups']; ?>"><i class="glyphicon glyphicon-search"></i> <?php
/* echo sqlValue("select count(1) from membership_groups"); *//* this line commented out by ADSISC */
$anonGrp = "'".$adminConfig['anonymousGroup']."'"; /* this line added by ADSISC */
echo sqlValue("select count(1) from membership_groups where membership_groups.name <> ".$anonGrp); /* this line added by ADSISC */
?></a></td>
In file /admin/pageViewGroups, around line number 74, add these lines of code:

Code: Select all

while( $row = db_fetch_row($res)) {
$anonGrp = $adminConfig['anonymousGroup']; /* this line added by ADSISC */
if ($row[1] == $anonGrp) continue; /* this line added by ADSISC */
$groupMembersCount = sqlValue("select count(1) from membership_users where groupID='$row[0]'");
?>
In file /admin/pageViewMembers.php, around line number 116, make these changes:

Code: Select all

<!-- <?php echo htmlSQLSelect("groupID", "select groupID, name from membership_groups order by name", $groupID); /* this line commented out by ADSISC */ ?> -->
<?php $anonGrp = "'".$adminConfig['anonymousGroup']."'";  /* this line added by ADSISC */ ?>
<?php echo htmlSQLSelect("groupID", "select groupID, name from membership_groups where membership_groups.name <> ".$anonGrp." order by name", $groupID); /* this 
line added by ADSISC */ ?>
In file /admin/pageViewMermbers.php, around line number 158, add this line of code:

Code: Select all

while($row = db_fetch_row($res)) {
$tr_class = '';
if($adminConfig['adminUsername'] == $row[0]) $tr_class = 'warning text-bold';
if($adminConfig['anonymousMember'] == $row[0]) $tr_class = 'text-muted';
if($adminConfig['anonymousMember'] == $row[0]) continue;  /* this line added by ADSISC */
?>
In file /admin/pageViewRecords.php, around line number 62, make these changes:

Code: Select all

<!-- <?php echo htmlSQLSelect("groupID", "select groupID, name from membership_groups order by name", $groupID); ?> /* this line commented out by ADSISC */ -->
<?php $anonGrp = "'".$adminConfig['anonymousGroup']."'";  /* this line added by ADSISC */ ?>
<?php echo htmlSQLSelect("groupID", "select groupID, name from membership_groups where membership_groups.name <> ".$anonGrp." order by name", $groupID); 
 /* this line added by ADSISC */ ?>
In file /admin/pageViewRecords.php, around line number 120, add these lines:

Code: Select all

while($row = db_fetch_row($res)) {
$anonGrp = $adminConfig['anonymousGroup'];  /* this line added by ADSISC */
if ($row[2] == $anonGrp) continue; /* this line added by ADSISC */
?>
In file /admin/pageEditOwnership.php, around line number 92, make these changes:

Code: Select all

/* echo bootstrapSQLSelect('groupID', "select g.groupID, g.name from membership_groups g order by name", $groupID); *//* this line commented out by ADSISC */
$anonGrp = "'".$adminConfig['anonymousGroup']."'";  /* this line added by ADSISC */
echo bootstrapSQLSelect('groupID', "select g.groupID, g.name from membership_groups g where g.name <> ".$anonGrp." order by name", $groupID); /* this line added by 
ADSISC */
These files will be overwritten so I created a backup folder called /admin/modified/ and place a copy of the modified files in it

PAGES THAT NEED TO BE BACKED UP TO THE FOLDER /admin/modified:
/admin/incHeader.php
/admin/pageEditOwnership.php
/admin/pageHome.php
/admin/pageViewGroups
/admin/pageViewMembers.php
/admin/pageViewRecords.php

Re: Hiding the group anonymous

Posted: 2021-07-28 15:45
by dlee
Here is the link to the pdf of the code modifications I made to hide the group anonymous.
TD

https://drive.google.com/file/d/1-DVTZc ... sp=sharing