source: branches/mvc/Base/Types/Password.php

Last change on this file was 47, checked in by chronos, 10 years ago
  • Odstraněno: Zbytečná PHP ukončovací značka "?>" z konce všech souborů.
File size: 994 bytes
Line 
1<?php
2
3// SHA1 hash used
4
5include_once(dirname(__FILE__).'/Base.php');
6
7class TypePassword extends TypeBase
8{
9 function OnView($Item)
10 {
11 $Output = '';
12 for($I = 0; $I < 6; $I++)
13 $Output .= '*';
14 return($Output);
15 }
16
17 function OnEdit($Item)
18 {
19 $Output = '<input type="password" name="'.$Item['Name'].'" value=""/>';
20 return($Output);
21 }
22
23 function OnLoad($Item)
24 {
25 global $Database;
26
27 $Result = $_POST[$Item['Name']];
28 /*
29 if(!array_key_exists('SourceItemId', $Item)) $Result = sha1($_POST[$Item['Name']]);
30 else
31 {
32 $DbRestult = $Database->query('SELECT '.$Item['Name'].' FROM '.$Item['SourceTable'].' WHERE Id='.$Item['SourceItemId']);
33 if($DbResult->num_rows > 0)
34 {
35 $DbRow = $DbResult->fetch_assoc();
36 if($_POST[$Item['Name']] == '') $Result = $DbRow[$Item['Name']];
37 else $Result = sha1($_POST[$Item['Name']]);
38 } else $Result = sha1($_POST[$Item['Name']]);
39 }
40 */
41 return($Result);
42 }
43}
Note: See TracBrowser for help on using the repository browser.