1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
<?php /** * @version $Id: mod_login.php,v 1.5 2005/01/15 06:49:01 stingrey Exp $ * @package Mambo * @copyright (C) 2000 - 2005 Miro International Pty Ltd * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * Mambo is Free Software */
/** ensure this file is being included by a parent file */ defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$return = mosGetParam( $_SERVER, 'REQUEST_URI', null ); // converts & to & for xtml compliance $return = str_replace( '&', '&', $return );
$registration_enabled = $mainframe->getCfg( 'allowUserRegistration' ); $message_login = $params->def( 'login_message', 0 ); $message_logout = $params->def( 'logout_message', 0 ); $pretext = $params->get( 'pretext' ); $posttext = $params->get( 'posttext' ); $login = $params->def( 'login', $return ); $logout = $params->def( 'logout', $return ); $name = $params->def( 'name', 1 ); $greeting = $params->def( 'greeting', 1 );
if ( $name ) { $query = "SELECT name FROM #__users WHERE id = ". $my->id; $database->setQuery( $query ); $name = $database->loadResult(); } else { $name = $my->username; }
if ( $my->id ) { ?> <form action="<?php echo sefRelToAbs( 'index.php?option=logout' ); ?>" method="post" name="login" > <?php if ( $greeting ) { echo _HI; echo $name; } ?> <br /> <div align="center"> <input type="submit" name="Submit" class="button" value="<?php echo _BUTTON_LOGOUT; ?>" /> </div>
<input type="hidden" name="op2" value="logout" /> <input type="hidden" name="lang" value="<?php echo $mosConfig_lang; ?>" /> <input type="hidden" name="return" value="<?php echo sefRelToAbs( $logout ); ?>" /> <input type="hidden" name="message" value="<?php echo $message_logout; ?>" /> </form> <?php } else { ?> <form action="<?php echo sefRelToAbs( 'index.php' ); ?>" method="post" name="login" > <?php echo $pretext; ?> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td> <?php echo _USERNAME; ?> <br /> <input name="username" type="text" class="inputbox" alt="username" size="10" /> <br /> <?php echo _PASSWORD; ?> <br /> <input type="password" name="passwd" class="inputbox" size="10" alt="password" /> <br /> <input type="checkbox" name="remember" class="inputbox" value="yes" alt="Remember Me" /> <?php echo _REMEMBER_ME; ?> <br /> <input type="hidden" name="option" value="login" /> <input type="submit" name="Submit" class="button" value="<?php echo _BUTTON_LOGIN; ?>" /> </td> </tr> <tr> <td> <a href="<?php echo sefRelToAbs( 'index.php?option=com_registration&task=lostPassword' ); ?>"> <?php echo _LOST_PASSWORD; ?> </a> </td> </tr> <?php if ( $registration_enabled ) { ?> <tr> <td> <?php echo _NO_ACCOUNT; ?> <a href="<?php echo sefRelToAbs( 'index.php?option=com_registration&task=register' ); ?>"> <?php echo _CREATE_ACCOUNT; ?> </a> </td> </tr> <?php } ?> </table> <?php echo $posttext; ?> <input type="hidden" name="op2" value="login" /> <input type="hidden" name="lang" value="<?php echo $mosConfig_lang; ?>" /> <input type="hidden" name="return" value="<?php echo sefRelToAbs( $login ); ?>" /> <input type="hidden" name="message" value="<?php echo $message_login; ?>" /> </form> <?php } ?>
|