Changeset 86

Show
Ignore:
Timestamp:
07/09/07 11:35:17 (1 year ago)
Author:
pdingle
Message:

added pwlib function documentation to utils & claimtypes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-infocard/pwlib/claimtypes.pwlib.php

    r56 r86  
    77        var $displayname = ''; 
    88        var $token_value; 
    9          
     9 
     10        /* 
     11                Function:               pw_claimtype 
     12                Description:            object constructor 
     13                Input Parameters:       sch - sets schemaURI 
     14                                        han - sets handle 
     15                                        req - sets required 
     16                                        dn - sets displayname 
     17                Output:                 none 
     18                Side Effects:           object is created  
     19        */ 
    1020        function pw_claimtype( $sch, $han, $req, $dn ) 
    1121        { 
     
    1626        } //end function pw_claimtype 
    1727 
     28        /* 
     29                Function:               add_token_value 
     30                Description:            updates the value that was returned for the claim 
     31                Input Parameters:       val - the value returned for the claim 
     32                Output:                 none 
     33                Side Effects:           none 
     34        */ 
    1835        function add_token_value( $val ) 
    1936        { 
     
    3249        var $db_value; 
    3350        var $description = '';   //to describe the mapping for others 
    34          
     51 
     52        /*       
     53                Function:               pw_mapping 
     54                Description:            object constructor 
     55                Input Parameters:       dn: sets displayname 
     56                                        ma: sets mappingattribute 
     57                                        mt: sets mappingtable 
     58                                        mf: sets mappingfunction 
     59                                        desc: sets description 
     60                Output:                 none 
     61                Side Effects:           object created 
     62        */ 
    3563        function pw_mapping( $dn, $ma, $mt, $mf, $desc='' ) 
    3664        { 
     
    4270                $this->description = $desc; 
    4371        } // end function pw_mapping     
    44          
     72 
     73        /* 
     74                Function:               add_new_value 
     75                Description:            add mapping function result to object 
     76                                        (result must be calculated separately) 
     77                Input Parameters:       val -- new value to set 
     78                Output:                 none 
     79                Side Effects:           none 
     80        */ 
    4581        function add_new_value( $val ) 
    4682        { 
     
    4884        } // end function add_new_value 
    4985 
     86        /* 
     87                Function:               add_db_value 
     88                Description:            add existing database value to object 
     89                Input Parameters:       val -- db value to set 
     90                Output:                 none 
     91                Side Effects:           none 
     92        */ 
    5093        function add_db_value( $val ) 
    5194        { 
     
    5396        } 
    5497 
     98        /*       
     99                Function:       compare 
     100                Description:    checks new_value against db_value; 
     101                Input Parameters:       nodebug - set this to anything other than 
     102                                        an empty string if you want to silence debug 
     103                                        output. 
     104                Output:                 returns true if the values are identical 
     105                                        (using strcmp) 
     106                                        otherwise returns false 
     107                Side Effects:           none 
     108 
     109        */ 
    55110        function compare( $nodebug='' ) 
    56111        { 
  • trunk/wp-infocard/pwlib/utils.pwlib.php

    r73 r86  
    66class pwlib_utils { 
    77 
    8         // Function: printCSSLink  
    9         // Description: prints the path to the CSS file 
     8        /*  
     9                Function:               printCSSLink  
     10                Description:            prints the path to the CSS file 
     11                Input Parameters:       none 
     12                Output:                 CSS Link printed to page 
     13                Side Effects:           alters output page 
     14        */ 
    1015        function printCSSlink() 
    1116        { 
     
    2025        } // end function printCSSlink 
    2126 
     27        /*  
     28                Function:               printJqueryLocation  
     29                Description:            prints path to the jquery javascript file 
     30                Input Parameters:       none 
     31                Output:                 jsquery link printed to page 
     32                Side Effects:           alters output page 
     33        */ 
    2234        function printJqueryLocation() 
    2335        { 
     
    3042                        print PW_SECUREPLUGINURL . "/vendor/jquery.js"; 
    3143                } 
    32         } // end function printCSSlink 
     44        } // end function printJqueryLocation 
    3345 
    3446        // Function: printPamelaProjectLink  
    3547        // Description: prints a link to the Pamela Project Website 
     48        /*  
     49                Function:               printPamelaProjectLink  
     50                Description:            prints path to the PamelaProject Website  
     51                Input Parameters:       none 
     52                Output:                 Pamela Project link printed to page 
     53                Side Effects:           alters output page 
     54        */ 
    3655        function printPamelaProjectLink()  
    3756        { 
     
    4362        } 
    4463         
    45         // Function: checkTimeAhead 
    46         // Description: match RP server time against token times 
    47         // Input: $notbefore -- time data from token 
    48         // Output: returns false if there are no errors. 
    49         //         returns an error detail string if there are errors.  
    50         // Side effect: none 
    51  
     64        /*       
     65                Function:               checkTimeAhead 
     66                Description:            match RP server time against token times 
     67                Input Parameters:       notbefore -- time data from token 
     68                Output:                 returns false if there are no errors. 
     69                                        returns an error detail string if there are errors.  
     70                Side Effects:           none 
     71        */ 
    5272        function checkTimeAhead ( $NotBefore ){ 
    5373                if (PW_TIMEVALIDATION_ON) 
     
    6181                } 
    6282                return false; 
    63  
    6483        } // end funciton checkTimeAhead 
    6584 
    66         // Function: checkTimeBehind 
    67         // Description: match RP server time against token times 
    68         // Input: $notonorafter -- time data from token 
    69         // Output: returns false if there are no errors. 
    70         //         returns an error detail string if there are errors.  
    71         // Side effect: none 
    72  
     85        /* 
     86                Function:               checkTimeBehind 
     87                Description:            match RP server time against token times 
     88                Input Parameters:       notonorafter -- time data from token 
     89                Output:                 returns false if there are no errors. 
     90                                        returns an error detail string if there are errors.  
     91                Side Effects: none 
     92        */ 
    7393        function checkTimeBehind ( $NotOnOrAfter){ 
    7494                if (PW_TIMEVALIDATION_ON) 
     
    84104        } // end function checkTimeBehind 
    85105 
     106        /* 
     107                Function:               printBinary 
     108                Description:            print a binary value to the screen in an easy 
     109                                        to read format 
     110                Input Parameters:       title:  an explanation of what the value is 
     111                                        binary: the value to print 
     112                Output:                 prints the binary value in HTML to std out  
     113                Side Effects:           alters the output page 
     114        */ 
    86115 
    87116        function printBinary ($title, $binary) 
     
    133162 
    134163                 
    135         // Function: dataCompare 
    136         // Description: compares the value of a given piece of user data between 
    137         //              what came from the database and what was supplied in the token. 
    138         // Input: $db_item - item from the database 
    139         //        $token_item - item given by the token 
    140         //        $item_name - used for debugging statements 
    141         // Output: returns true if the two items match 
    142         //         returns false otherwise 
    143         // Side effect: none 
     164        /*  
     165                Function:               dataCompare 
     166                Description:            compares the value of a given piece of user  
     167                                        data between what came from the database and  
     168                                        what was supplied in the token. 
     169                Input Parameters:       db_item - item from the database 
     170                                        token_item - item given by the token 
     171                                        item_name - used for debugging statements 
     172                Output:                 returns true if the two items match 
     173                                        returns false otherwise 
     174                Side Effects: none 
     175        */ 
    144176        function dataCompare($db_item, $token_item, $item_name) 
    145177        { 
     
    157189         
    158190 
    159         // Function: printDebug 
    160         // Description:  prints debug statements - note this function could be overridden 
    161         // Input:  content - the thing to be written out 
    162         // Output:  - content is printed to the screen if & only if debugging is on. 
    163         // Side Effects:  none 
     191        /* 
     192                Function:               printDebug 
     193                Description:            prints debug statements - note this function  
     194                                        could be overridden 
     195                Input Parameters:       content - the thing to be written out 
     196                Output:                 content is printed to the screen if & only  
     197                                        if debugging is on (PW_DEBUG_ON is true).  
     198                Side Effects:           none 
     199        */ 
    164200        function printDebug( $content )  
    165201        { 
     
    170206        } // end function printDebug 
    171207 
     208        /* 
     209                Function:               displayPamelaProjectLogo 
     210                Description:            writes the path to the logo to the screen 
     211                Input Parameters:       none 
     212                Output:                 writes a path to the screen 
     213                Side Effects:           alters the output page 
     214        */ 
    172215        function displayPamelaProjectLogo() 
    173216        { 
    174217                echo PW_PLUGINURL . "/pwlib/images/pp-logo-bw-small.png"; 
    175218        } 
    176         // Function: cleanInitialClaim 
    177         // Description:  to remove the possibility of SQL injection or XSS  
    178         //               attacks by properly escaping characters that could 
    179         //               be used to turn a string into a command. 
    180         //               Function & explanation found at: (many thanks) 
    181         // http://simon.net.nz/articles/protecting-mysql-sql-injection-attacks-using-php/ 
    182         // Input:       - claimslist entry for the claim to be cleaned 
    183         // Output:      cleaned string   
    184         // Side-effects: database object is requested from a plugin-specific routine 
     219 
     220        /*       
     221                Function:               cleanInitialClaim 
     222                Description:            to remove the possibility of SQL injection or XSS  
     223                                        attacks by properly escaping characters that could 
     224                                        be used to turn a string into a command. 
     225                Input Parameters:       claim - claimslist entry for the claim to be cleaned 
     226                Output:                 cleaned string   
     227                Side-effects:           none 
     228        */ 
    185229        function cleanInitialClaim( $claim ) 
    186230        {