Changeset 2464

Show
Ignore:
Timestamp:
09/19/08 11:46:42 (4 months ago)
Author:
dsanders
Message:

Added code to xmlEncode values.

Location:
trunk/otis/demo/php
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/otis/demo/php/common.php

    r2419 r2464  
    839839        } 
    840840         
     841        function xmlEncode( $str) 
     842        { 
     843                return( str_replace( array( "&", "<", ">", "'", '"'), 
     844                                                 array( "&amp;", "&lt;", "&gt;", "&apos;", "&quot;"), $str)); 
     845        } 
     846         
    841847?> 
  • trunk/otis/demo/php/createAccountPage.php

    r2286 r2464  
    6969                                                                '<idas:Attribute attrID="http://www.eclipse.org/higgins/ontologies/2008/6/higgins#entityId">' . 
    7070                                                                        '<idas:AttributeValue valType="http://www.w3.org/2001/XMLSchema#string">' . 
    71                                                                                 '<idas:SimpleData>' . $_POST [USER_ID_FIELD] . '</idas:SimpleData>' . 
     71                                                                                '<idas:SimpleData>' . xmlEncode( $_POST [USER_ID_FIELD]) . '</idas:SimpleData>' . 
    7272                                                                        '</idas:AttributeValue>' . 
    7373                                                                '</idas:Attribute>' . 
    7474                                                                '<idas:Attribute attrID="http://www.eclipse.org/higgins/ontologies/2006/higgins#password">' . 
    7575                                                                        '<idas:AttributeValue valType="http://www.w3.org/2001/XMLSchema#string">' . 
    76                                                                                 '<idas:SimpleData>' . $_POST [PASSWORD_FIELD] . '</idas:SimpleData>' . 
     76                                                                                '<idas:SimpleData>' . xmlEncode( $_POST [PASSWORD_FIELD]) . '</idas:SimpleData>' . 
    7777                                                                        '</idas:AttributeValue>' . 
    7878                                                                '</idas:Attribute>'; 
     
    9292                                        } 
    9393                                        $strRequest .= ('<idas:AttributeValue valType="http://www.w3.org/2001/XMLSchema#string">' . 
    94                                                                                         '<idas:SimpleData>' . $strValue . '</idas:SimpleData>' . 
     94                                                                                        '<idas:SimpleData>' . xmlEncode( $strValue) . '</idas:SimpleData>' . 
    9595                                                                                '</idas:AttributeValue>'); 
    9696                                } 
  • trunk/otis/demo/php/index.php

    r2420 r2464  
    312312                if ($subExceptionNode) 
    313313                { 
    314                         $strException .= parseException( $strIndent . "&nbsp;&nbsp;", $childNode); 
     314                        $strException .= parseException( $strIndent . "&nbsp;&nbsp;", $subExceptionNode); 
    315315                } 
    316316                return( $strException); 
     
    546546                                                '<otis:AuthChildMaterials>' . 
    547547                                                        '<otis:AuthMaterial materialID="urn:bandit-project:otis:authmaterial:1.0:username">' . 
    548                                                                 '<otis:AuthMaterialValue Type="string">' . $strUserID . '</otis:AuthMaterialValue>' . 
     548                                                                '<otis:AuthMaterialValue Type="string">' . xmlEncode( $strUserID) . '</otis:AuthMaterialValue>' . 
    549549                                                        '</otis:AuthMaterial>' . 
    550550                                                        '<otis:AuthMaterial materialID="urn:bandit-project:otis:authmaterial:1.0:password">' . 
    551                                                                 '<otis:AuthMaterialValue Type="string">' . $strPassword . '</otis:AuthMaterialValue>' . 
     551                                                                '<otis:AuthMaterialValue Type="string">' . xmlEncode( $strPassword) . '</otis:AuthMaterialValue>' . 
    552552                                                        '</otis:AuthMaterial>' . 
    553553                                                '</otis:AuthChildMaterials>' . 
  • trunk/otis/demo/php/modifyAccountPage.php

    r2286 r2464  
    6666                                        { 
    6767                                                $strValuesAdded .= ('<idas:AttributeValue valType="http://www.w3.org/2001/XMLSchema#string">' . 
    68                                                                                                 '<idas:SimpleData>' . $strValue . '</idas:SimpleData>' . 
     68                                                                                                '<idas:SimpleData>' . xmlEncode( $strValue) . '</idas:SimpleData>' . 
    6969                                                                                        '</idas:AttributeValue>'); 
    7070                                        } 
     
    170170                                                { 
    171171                                                        $strEntityChanges .=('<idas:AttributeValueRemove valType="http://www.w3.org/2001/XMLSchema#string">' . 
    172                                                                                                                         '<idas:SimpleData>' . $removedValue . '</idas:SimpleData>' . 
     172                                                                                                                        '<idas:SimpleData>' . xmlEncode( $removedValue) . '</idas:SimpleData>' . 
    173173                                                                                                                '</idas:AttributeValueRemove>'); 
    174174                                                        $strSuccessMsg .= ("<br/>Removed value '" . $removedValue . "' from attribute '" . $strDisplayName . "'"); 
     
    180180                                                { 
    181181                                                        $strEntityChanges .=('<idas:AttributeValue valType="http://www.w3.org/2001/XMLSchema#string">' . 
    182                                                                                                                         '<idas:SimpleData>' . $addedValue . '</idas:SimpleData>' . 
     182                                                                                                                        '<idas:SimpleData>' . xmlEncode( $addedValue) . '</idas:SimpleData>' . 
    183183                                                                                                                '</idas:AttributeValue>'); 
    184184                                                        $strSuccessMsg .= ("<br/>Added value '" . $addedValue . "' to attribute '" . $strDisplayName . "'"); 
  • trunk/otis/demo/php/showRolesPage.php

    r2421 r2464  
    153153                $strContent = 
    154154                '<?xml version="1.0" encoding="UTF-8"?>' . 
    155                 '<otis:ActivateRole xmlns:otis="http://code.bandit-project.org/schemas/2008/otis">' . $strRoleToActivate . '</otis:ActivateRole>'; 
     155                '<otis:ActivateRole xmlns:otis="http://code.bandit-project.org/schemas/2008/otis">' . xmlEncode( $strRoleToActivate) . '</otis:ActivateRole>'; 
    156156                $responseObj = sendToOtis( $strSessionURL . "/ActiveRoles", PUT_OPERATION, $strContent); 
    157157                if (!$responseObj)