Changeset 35427 for main/trunk


Ignore:
Timestamp:
2021-09-20T10:10:25+12:00 (3 years ago)
Author:
kjdon
Message:

added some (currently commented out) code to allow the addition of default groups to the addAuer and editUser forms

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/transform/pages/authen.xsl

    r33755 r35427  
    275275                            </xsl:choose>                       
    276276                            <xsl:if test="/page/pageResponse/authenticationNode/service/@operation = 'EditUser'">
     277                                                          <!-- if you want to add a group by default to a user, so that it shows up automatically in the edit user page, use this instead of the following
     278                                                               <xsl:call-template name="addGroupInputField"><xsl:with-param name="default_value"><xsl:call-template name="addDefaultGroupToExistingGroups"/></xsl:with-param></xsl:call-template> -->
    277279                              <xsl:call-template name="addGroupInputField"><xsl:with-param name="default_value"><xsl:value-of select="/page/pageResponse/authenticationNode/service/userNodeList/userNode/@groups"/></xsl:with-param></xsl:call-template>
    278280                                <tr>
     
    361363                            </tr>
    362364                            <xsl:if test="/page/pageResponse/authenticationNode/service/@operation = 'AddUser'">
    363                               <xsl:call-template name="addGroupInputField"/>
     365                                                          <!-- if you want to add a default group to the groups field with AdddUser, then use this instead, replacing xxx with the default group/s
     366                              <xsl:call-template name="addGroupInputField"><xsl:with-param name="default_value">xxx</xsl:with-param></xsl:call-template>-->
     367                                                          <xsl:call-template name="addGroupInputField"/>
    364368                                <tr>
    365369                                    <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.comment')"/><xsl:text>: </xsl:text></td>
     
    461465
    462466          </xsl:template>
    463          
     467
     468              <!-- replace xxx here with the group/s you want added by default -->
     469              <xsl:template name="addDefaultGroupToExistingGroups"><xsl:variable name="default">xxx</xsl:variable><xsl:variable name="current_groups"><xsl:value-of select="/page/pageResponse/authenticationNode/service/userNodeList/userNode/@groups"/></xsl:variable><xsl:if test="not(contains($current_groups, $default))"><xsl:value-of select="$default"/>,</xsl:if><xsl:value-of select="$current_groups"/></xsl:template>
     470             
    464471          <xsl:template name="addPasswordCheckJavascript">
    465472        <script type="text/javascript">
Note: See TracChangeset for help on using the changeset viewer.