Last change
on this file was 93, checked in by chronos, 11 years ago |
- Fixed: System variable as parameter to constructors of descendents of Module class.
- Removed: End PHP mark "?>" from all files.
|
File size:
951 bytes
|
Line | |
---|
1 | <?php
|
---|
2 |
|
---|
3 | // SHA1 hash used
|
---|
4 |
|
---|
5 | class TypePassword extends TypeBase
|
---|
6 | {
|
---|
7 | function OnView($Item)
|
---|
8 | {
|
---|
9 | $Output = '';
|
---|
10 | for($I = 0; $I < 6; $I++)
|
---|
11 | $Output .= '*';
|
---|
12 | return($Output);
|
---|
13 | }
|
---|
14 |
|
---|
15 | function OnEdit($Item)
|
---|
16 | {
|
---|
17 | $Output = '<input type="password" name="'.$Item['Name'].'" value="">';
|
---|
18 | return($Output);
|
---|
19 | }
|
---|
20 |
|
---|
21 | function OnLoad($Item)
|
---|
22 | {
|
---|
23 | global $Database;
|
---|
24 |
|
---|
25 | $Result = $_POST[$Item['Name']];
|
---|
26 | /*
|
---|
27 | if(!array_key_exists('SourceItemId', $Item)) $Result = sha1($_POST[$Item['Name']]);
|
---|
28 | else
|
---|
29 | {
|
---|
30 | $DbRestult = $Database->query('SELECT '.$Item['Name'].' FROM '.$Item['SourceTable'].' WHERE Id='.$Item['SourceItemId']);
|
---|
31 | if($DbResult->num_rows > 0)
|
---|
32 | {
|
---|
33 | $DbRow = $DbResult->fetch_assoc();
|
---|
34 | if($_POST[$Item['Name']] == '') $Result = $DbRow[$Item['Name']];
|
---|
35 | else $Result = sha1($_POST[$Item['Name']]);
|
---|
36 | } else $Result = sha1($_POST[$Item['Name']]);
|
---|
37 | }
|
---|
38 | */
|
---|
39 | return($Result);
|
---|
40 | }
|
---|
41 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.