4. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 8/16/2019 12:01:56 PM Eastern Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

4.1 Files compared

# Location File Last Modified
1 Direct_DSM.zip\Direct_DSM\api\application\libraries DAAS_Form_validation.php Tue Aug 13 17:30:18 2019 UTC
2 Direct_DSM.zip\Direct_DSM\api\application\libraries DAAS_Form_validation.php Fri Aug 16 14:41:21 2019 UTC

4.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 194
Changed 1 2
Inserted 0 0
Removed 0 0

4.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

4.4 Active regular expressions

No regular expressions were active.

4.5 Comparison detail

  1   <?php defi ned('BASEP ATH') OR e xit('No di rect scrip t access a llowed');
  2  
  3   /**
  4   * @package  direct-as -a-service
  5   * @subpack age librar ies
  6   *//** */
  7  
  8  
  9   /**
  10   * DaaS Cod eIgniter F orm valida tion Exten sion
  11   *
  12   * @author  Adam Bell,  Shawn Wil liams
  13   * @package  direct-as -a-service
  14   * @subpack age librar ies
  15   */
  16   class DAAS _Form_vali dation ext ends VLER_ Form_valid ation {
  17           
  18   /*
  19    Note to d evelopers  - this cla ss is an e xtension o f the Code igniter fo rm validat ion class,  and Codei gniter wil l automati cally use  it when
  20    you load  the form v alidation  library.   There is n o need to  load the f orm valida tion libra ry from wi thin this  class or t ry to call
  21    $CI->form _validatio n->set_mes sage() ins tead of $t his->set_m essage(),  it just in curs addit ional over head.  If  you're not  familiar  with
  22    Codeignit er's syste m for exte nding libr aries, see  the "Exte nding Nati ve Librari es" sectio n of the d ocs: http: //ellislab .com/codei gniter/use r-guide/ge neral/crea ting_libra ries.html.   -MG 2014 -06-26
  23   */      
  24           
  25           pu blic funct ion allowe d_mailbox_ characters ($name) {
  26                    $val id = (preg _match('/[ ^A-Za-z0-9 ._-]/', $n ame) === 1 ) ? FALSE  : TRUE;
  27                    if($ valid) { r eturn TRUE ; }
  28                    $thi s->set_mes sage('allo wed_mailbo x_characte rs', 'The  %s field m ay only co ntain alph a-numeric  characters  (A-Z, a-z , 0-9), un derscores,  periods,  and dashes .');
  29                    retu rn FALSE;
  30           }
  31           
  32           /*
  33           *  Validates  that there  isn't a u ser with t his org id  in our da tabase.
  34           *
  35           *  @param str ing
  36           *  @return bo olean True  if the us er org id  is not yet  in use
  37           */
  38           pu blic funct ion unique _user_org_ id($user_o rg_id) {
  39                    if(! User::exis ts(compact ('user_org _id'))) re turn true;
  40                    $thi s->set_mes sage('uniq ue_user_or g_id', 'Th e ID alrea dy exists  in the sys tem.');
  41                    retu rn false;
  42           }        
  43           
  44           /*
  45           *  Validates  that there  isn't a u ser with t his userna me in our  database.
  46           *
  47           *  @param str ing
  48           *  @return bo olean True  if the us ername is  not in use
  49           */
  50           pu blic funct ion unique _username( $username)  {
  51                    if(M ailbox::na me_is_avai lable($use rname)) re turn true;
  52                    $thi s->set_mes sage('uniq ue_usernam e', 'This  user name  is not ava ilable.');
  53                    retu rn false;
  54           }
  55                    
  56           // 2017-06-30  - Myke Ca rter - Apo strophe ad ded to acc ommodate u sers with  apostrophe s in their  names and /or extern al email a ddresses
  57           pu blic funct ion va_ema il($email)  {
  58                    $val id = (preg _match("/^ ([a-z0-9\' \+_\-]+)(\ .[a-z0-9\' \+_\-]+)*@ +((.*(\.va \.gov))|va \.gov)$/ix ", $email) ) ? TRUE :  FALSE;
  59                    if($ valid) { r eturn TRUE ; }
  60                     $this->set _message(' va_email',  'The %s f ield must  contain a  valid  DNS . URL  email add ress.');
  61                    retu rn FALSE;
  62           }        
  63           pu blic funct ion valid_ facility($ facility_i d){
  64                    $CI  =& get_ins tance();
  65           $C I->load->m odel('faci litymodel' );
  66                    $res ult = $CI- >facilitym odel->get_ facility($ facility_i d);
  67                    if($ result &&  $result->n um_rows()  > 0){
  68                             return  true;
  69                    }
  70                    $thi s->set_mes sage('vali d_facility ', 'The Fa cility fie ld is inva lid.');
  71                    retu rn false;
  72           }
  73           
  74           pu blic funct ion valid_ url($url){        
  75              $pattern =  '/' . '^( https?:\/\ /)[^\s]+$'  . '/';
  76              preg_match ($pattern,  $url, $ma tches); 
  77              $this->set _message(' valid_url' , "The url  must star t with htt p:// or ht tps:// and  contain n o spaces") ;      
  78              return (em pty($match es)) ? FAL SE : TRUE;
  79           }
  80           
  81           /*
  82            *  phone val idation ch ecks that  the passed  value is  a valid ph one number
  83           */
  84           pu blic funct ion valida te_phone($ phone){
  85                    //if  the phone  number is  null or n ot set ret urn true
  86                    if ( !isset($ph one) || $p hone === ' '){
  87                             return  true;
  88                    }
  89                    //ch eck if the  phone num ber follow s standard  format
  90                    if ( preg_match ('/^(?:\(( \+?\d+)?\) |\+?\d+) ? \d*(-?\d{2 ,3} ?){0,4 }$/', $pho ne)){
  91                             return  true;
  92                    }els e{
  93                             $this- >set_messa ge('valida te_phone',  'The %s f ield must  be a valid  phone num ber.');
  94                             return  false;
  95                    }
  96           }         
  97           
  98   }