Changeset 18 for types/Password.php
- Timestamp:
- Oct 21, 2008, 4:15:52 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
types/Password.php
r11 r18 1 1 <?php 2 3 // SHA1 hash used 2 4 3 5 function TypePasswordOnView($Item) 4 6 { 5 7 $Output = ''; 6 for($I = 0; $I < strlen($Item['Value']); $I++)8 for($I = 0; $I < 6; $I++) 7 9 $Output .= '*'; 8 10 return($Output); … … 11 13 function TypePasswordOnEdit($Item) 12 14 { 13 $Output = '<input type="password" name="'.$Item['Name'].'" value=" '.$Item['Value'].'">';15 $Output = '<input type="password" name="'.$Item['Name'].'" value="">'; 14 16 return($Output); 15 17 } … … 17 19 function TypePasswordOnLoad($Item) 18 20 { 19 return($_POST[$Item['Name']]); 21 global $Database; 22 23 if(!array_key_exists('SourceItemId', $Item)) $Result = sha1($_POST[$Item['Name']]); 24 else 25 { 26 $DbRestult = $Database->query('SELECT '.$Item['Name'].' FROM '.$Item['SourceTable'].' WHERE Id='.$Item['SourceItemId']); 27 if($DbResult->num_rows > 0) 28 { 29 $DbRow = $DbResult->fetch_assoc(); 30 if($_POST[$Item['Name']] == '') $Result = $DbRow[$Item['Name']]; 31 else $Result = sha1($_POST[$Item['Name']]); 32 } else $Result = sha1($_POST[$Item['Name']]); 33 } 34 return($Result); 20 35 } 21 36
Note:
See TracChangeset
for help on using the changeset viewer.