phpBMS

Changeset 541 for trunk/phpbms/include

Show
Ignore:
Timestamp:
05/28/09 13:08:01 (3 years ago)
Author:
brieb
Message:

* Added UUID display to add edit screens. Started move of Id display to bottom.

Location:
trunk/phpbms/include
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/include/common_functions.php

    r522 r541  
    180180//Most Common Functions of the Application go here. 
    181181//================================================= 
     182 
     183/** 
     184  * generates a Universal Unique ID (UUID) with an optional prefix 
     185  * 
     186  * @param string $prefix prefix to prepend to the UUID 
     187  */ 
    182188function uuid($prefix = ''){ 
    183189 
     
    203209} 
    204210 
     211 
    205212function goURL($url){ 
    206213        if(headers_sent()) 
     
    209216        exit; 
    210217} 
     218 
    211219 
    212220function hasRights($roleid,$fullAccessAdmin = true){ 
  • trunk/phpbms/include/fields.php

    r519 r541  
    9696    // Displays the bottom record details that are present on almost all phpBMS 
    9797    // records.  These are non-modifiable 
    98     function showCreateModify($phpbms, $therecord){ 
     98    function showGeneralInfo($phpbms, $therecord){ 
    9999        ?> 
    100100<div id="createmodifiedby" > 
    101     <div id="savecancel2"><?php showSaveCancel(2)?></div> 
    102101    <table> 
    103102        <tbody> 
    104             <tr id="cmFirstRow"> 
     103            <tr class="topRows"> 
    105104                <td class="cmTitles"> 
    106105                        <input name="createdby" type="hidden" value="<?php $therecord["createdby"] ?>" /> 
     
    110109                <td><?php echo htmlQuotes($phpbms->getUserName($therecord["createdby"]))?></td> 
    111110                <td><?php echo formatFromSQLDatetime($therecord["creationdate"]) ?></td> 
     111                <td id="cmButtonContainer" rowspan="3"> 
     112                    <?php showSaveCancel(2)?> 
     113                </td> 
    112114            </tr> 
    113             <tr> 
     115            <tr class="topRows"> 
    114116                <td class="cmTitles"> 
    115117                        <input name="modifiedby" type="hidden" value="<?php $therecord["modifiedby"] ?>" /> 
     
    121123                <td><?php echo formatFromSQLDatetime($therecord["modifieddate"]) ?></td> 
    122124            </tr> 
     125            <tr> 
     126                <td class="cmTitles"> 
     127                        uuid / id 
     128                        <input name="uuid" id="uuid" type="hidden" value="<?php if(isset($therecord["uuid"])) echo $therecord["uuid"] ?>" /> 
     129                        <input id="id" name="id" type="hidden" value="<?php echo $therecord["id"]?>" /> 
     130                </td> 
     131                <td colspan="2" id="cmIds"><span><?php echo isset($therecord["uuid"])?$therecord["uuid"]:'&nbsp;' ?></span><span id="cmId"><?php echo $therecord["id"] ?></span></td> 
     132            </tr> 
    123133        </tbody> 
    124134    </table> 
    125135</div> 
    126136        <?php 
    127     }//end function showCreateModify 
     137    }//end function showGeneralInfo 
    128138 
    129139 
  • trunk/phpbms/include/tables.php

    r526 r541  
    4949        var $fields = array(); 
    5050 
     51 
    5152        function phpbmsTable($db,$tabledefid = 0,$backurl = NULL){ 
    5253 
     
    286287 
    287288 
    288         // retrieves default values for record 
    289         // uses the field name to retrieve the default value, and if it does not 
    290         // match one the predefined phpBMS names (such as id, or modified by) 
    291         // it uses the field type 
     289        /** 
     290          * Retrieves default values for a single record 
     291          * 
     292          * Uses the field names to guess a default value.  If it cannot find 
     293          * one of the standard names it sets the default value based on the type 
     294          * 
     295          */ 
    292296        function getDefaults(){ 
    293297 
     
    298302                switch($fieldname){ 
    299303 
    300                         case "id": 
    301                         case "modifiedby": 
    302                         case "modifieddate": 
     304                    case "id": 
     305                    case "modifiedby": 
     306                    case "modifieddate": 
     307                        $therecord[$fieldname] = NULL; 
     308                        break; 
     309 
     310                    case "uuid": 
     311                        $therecord["uuid"] = uuid($this->prefix.":"); 
     312                        break; 
     313 
     314                    case "createdby": 
     315                        $therecord["createdby"] = $_SESSION["userinfo"]["id"]; 
     316                        break; 
     317 
     318                    default: 
     319                        if(strpos($thefield["flags"],"not_null") === false) 
    303320                            $therecord[$fieldname] = NULL; 
    304                             break; 
    305  
    306                         case "createdby": 
    307                             $therecord["createdby"] = $_SESSION["userinfo"]["id"]; 
    308                             break; 
    309  
    310                         default: 
    311                             if(strpos($thefield["flags"],"not_null") === false) 
    312                                 $therecord[$fieldname] = NULL; 
    313                             else 
    314                                 $therecord[$fieldname] = $this->getDefaultByType($thefield["type"]); 
    315  
    316                             break; 
     321                        else 
     322                            $therecord[$fieldname] = $this->getDefaultByType($thefield["type"]); 
     323 
     324                        break; 
    317325 
    318326                }//endswitch 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.