/
login.php
179 lines (170 loc) · 5.42 KB
/
login.php
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
require_once("PortalConfig.php");
require_once("language/$default_language.lang.php");
include("version.php");
include_once('include/utils/utils.php');
@session_start();
if(isset($_SESSION['customer_id']) && isset($_SESSION['customer_name']))
{
header("Location: index.php?action=index&module=.'$module'");
exit;
}
if($_REQUEST['close_window'] == 'true')
{
?>
<script language="javascript">
window.close();
</script>
<?php
}
global $default_charset;
header('Content-Type: text/html; charset='.$default_charset);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>vtiger CRM 5 - CustomerPortal</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table cellspacing="0" cellpadding="0" class="outerTab">
<tr>
<td width="15%"><br><br><br></td>
<td width="70%"> </td>
<td width="15%"> </td>
</tr>
<tr>
<td> </td>
<td>
<table class="innerTab" cellspacing="0" cellpadding="0">
<tr>
<th align="left"><img src="images/loginVtigerCRM.gif" width="169" height="49"></th>
<th> </th>
<th align="right"> </th>
</tr>
<tr class="tableTop"><td colspan="3"></td></tr>
<tr>
<td colspan="3" class="tableMidone">
<table class="loginTab" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="6" height="5"><img src="images/loginSITopLeft.gif"></td>
<td bgcolor="#FFFFFF"></td>
<td width="6" height="5"><img src="images/loginSITopRight.gif"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="150"> </td>
<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<form name="login" action="CustomerAuthenticate.php" method="post">
<tr>
<?php
//Display the login error message
if($_REQUEST['login_error'] != '')
echo getTranslatedString(base64_decode($_REQUEST['login_error']));
?>
</tr>
<tr>
<td colspan="2" class="detailedViewHeader"><b><?php echo getTranslatedString('customerportal');echo " ".$version; ?></b></td>
</tr>
<tr>
<td class="dvtCellLabel" align="right" width="50%"><?php echo getTranslatedString('LBL_EMAILID');?></td>
<td class="dvtCellInfo"><input type="text" id="username" name="username" class="detailedViewTextBox"></td>
</tr>
<tr>
<td class="dvtCellLabel" align="right"><?php echo getTranslatedString('LBL_PASSWORD');?></td>
<td class="dvtCellInfo"><input type="password" id="pw" name="pw" class="detailedViewTextBox"></td>
</tr>
<tr>
<td class="dvtCellLabel" align="right"><?php echo getTranslatedString('LBL_LANGUAGE');?></td>
<td class="dvtCellInfo">
<select name='login_language' style="width:70%" >
<?PHP echo getPortalLanguages(); ?>
</select>
</td>
</tr>
<tr>
<td> </td>
<td align="right"><a href='javascript:;' onclick='window.open("supportpage.php?param=forgot_password","ForgotPassword","width=400,height=250");'><?php echo getTranslatedString('LBL_FORGOT_LOGIN');?></a></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="image" src="images/loginBtnSignin.gif" onclick="return validateLoginDetails();"></td>
</tr>
<tr>
<td class="dvtCellInfo" colspan="2"></td>
</tr>
<tr>
<td class="dvtCellInfo" colspan="2" ><font color="gray" size="1"><?php echo getTranslatedString('LBL_LOGIN_NOTE');?></font></td>
</tr>
</table>
</td>
<td> </td>
</tr>
<tr>
<td width="6" height="6"><img src="images/loginSIBottomLeft.gif"></td>
<td bgcolor="#FFFFFF"></td>
<td width="6" height="6"><img src="images/loginSIBottomRight.gif"></td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td colspan="3" class="tableBtm"> </td>
</tr>
</table>
</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td align="left"><img src="images/loginBottomURL.gif" width="100" height="21"></td>
<td> </td>
</tr>
</table>
</body>
</html>
<script language="javascript">
function validateLoginDetails()
{
var user = trim(document.getElementById("username").value);
var pass = trim(document.getElementById("pw").value);
if(user != '')
{
if(pass != '')
return true;
else
{
alert("Please enter a valid password.");
return false;
}
}
else
{
alert("Please enter valid username.");
return false;
}
}
function trim(s)
{
while (s.substring(0,1) == " " || s.substring(0,1) == "\n")
{
s = s.substring(1, s.length);
}
while (s.substring(s.length-1, s.length) == " " || s.substring(s.length-1,s.length) == "\n") {
s = s.substring(0,s.length-1);
}
return s;
}
</script>
<?php
?>