Merged in victorsl/processmaker/PM-3793-3017 (pull request #3262)

PM-3793
This commit is contained in:
David Callizaya
2015-11-27 19:18:45 -04:00
16 changed files with 392 additions and 118 deletions

View File

@@ -61,6 +61,9 @@ class Home extends Controller
$this->setVar( 'msg', $data['m'] );
$this->setVar( 'usr', $data['u'] );
$this->setVar( 'pwd', $data['p'] );
$this->setVar('timeZoneFailed', (isset($data['timeZoneFailed']))? $data['timeZoneFailed'] : 0);
$this->setVar('userTimeZone', (isset($data['userTimeZone']))? $data['userTimeZone'] : '');
$this->setVar('browserTimeZone', (isset($data['browserTimeZone']))? $data['browserTimeZone'] : '');
$this->setVar( 'skin', $skin );
$this->setView( $this->userUxBaseTemplate . PATH_SEP . $template );

View File

@@ -24,6 +24,15 @@
*/
try {
$usr = '';
$pwd = '';
if (strpos($_SERVER['HTTP_REFERER'], 'home/login') !== false) {
$urlLogin = '../home/login';
} else {
$urlLogin = (substr(SYS_SKIN, 0, 2) !== 'ux')? 'login' : '../main/login';
}
if (!$RBAC->singleSignOn) {
if (!isset($_POST['form']) ) {
G::SendTemporalMessage ('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error');
@@ -32,8 +41,6 @@ try {
}
$frm = $_POST['form'];
$usr = '';
$pwd = '';
if (isset($frm['USR_USERNAME'])) {
$usr = mb_strtolower(trim($frm['USR_USERNAME']), 'UTF-8');
@@ -142,20 +149,14 @@ try {
}
if (strpos($_SERVER['HTTP_REFERER'], 'home/login') !== false) {
$d = serialize(array('u'=>$usr, 'p'=>$pwd, 'm'=>G::LoadTranslation($errLabel)));
$loginUrl = '../home/login?d='.base64_encode($d);
$d = serialize(['u' => $usr, 'p' => $pwd, 'm' => G::LoadTranslation($errLabel)]);
$urlLogin = $urlLogin . '?d=' . base64_encode($d);
} else {
G::SendTemporalMessage($errLabel, "warning");
if (substr(SYS_SKIN, 0, 2) !== 'ux') {
$loginUrl = 'login';
} else {
$loginUrl = '../main/login';
}
}
G::header("location: $loginUrl");
die;
G::header('Location: ' . $urlLogin);
exit(0);
}
if (!isset( $_SESSION['WORKSPACE'] ) ) {
@@ -180,6 +181,12 @@ try {
$_SESSION['USR_USERNAME'] = $usr;
}
//Update User Time Zone
if (isset($_POST['form']['BROWSER_TIME_ZONE'])) {
$user = new Users();
$user->update(['USR_UID' => $_SESSION['USER_LOGGED'], 'USR_TIME_ZONE' => $_POST['form']['BROWSER_TIME_ZONE']]);
}
//Set User Time Zone
$user = UsersPeer::retrieveByPK($_SESSION['USER_LOGGED']);
@@ -195,6 +202,28 @@ try {
$_SESSION['USR_TIME_ZONE'] = $userTimeZone;
}
if (isset($_SESSION['__SYSTEM_UTC_TIME_ZONE__']) && $_SESSION['__SYSTEM_UTC_TIME_ZONE__']) {
$dateTime = new \ProcessMaker\Util\DateTime();
$timeZoneOffset = $dateTime->getTimeZoneOffsetByTimeZoneId($_SESSION['USR_TIME_ZONE']);
if ($timeZoneOffset === false || $timeZoneOffset != (int)($_POST['form']['BROWSER_TIME_ZONE_OFFSET'])) {
$_SESSION['__TIME_ZONE_FAILED__'] = true;
$_SESSION['USR_USERNAME'] = $usr;
$_SESSION['USR_PASSWORD'] = $pwd;
$_SESSION['BROWSER_TIME_ZONE'] = $dateTime->getTimeZoneIdByTimeZoneOffset((int)($_POST['form']['BROWSER_TIME_ZONE_OFFSET']));
if (strpos($_SERVER['HTTP_REFERER'], 'home/login') !== false) {
$d = serialize(['u' => $usr, 'p' => $pwd, 'm' => '', 'timeZoneFailed' => 1, 'userTimeZone' => $_SESSION['USR_TIME_ZONE'], 'browserTimeZone' => $_SESSION['BROWSER_TIME_ZONE']]);
$urlLogin = $urlLogin . '?d=' . base64_encode($d);
}
G::header('Location: ' . $urlLogin);
exit(0);
}
}
//Set data
$aUser = $RBAC->userObj->load($_SESSION['USER_LOGGED']);
$RBAC->loadUserRolePermission($RBAC->sSystem, $_SESSION['USER_LOGGED']);

View File

@@ -139,6 +139,16 @@ if (isset ($_SESSION['USER_LOGGED'])) {
}
//end log
$timeZoneFailed = false;
if (isset($_SESSION['__TIME_ZONE_FAILED__']) && $_SESSION['__TIME_ZONE_FAILED__']) {
$timeZoneFailed = true;
$userUsername = $_SESSION['USR_USERNAME'];
$userPassword = $_SESSION['USR_PASSWORD'];
$userTimeZone = $_SESSION['USR_TIME_ZONE'];
$browserTimeZone = $_SESSION['BROWSER_TIME_ZONE'];
}
//start new session
@session_destroy();
session_start();
@@ -183,6 +193,21 @@ if (in_array(G::encryptOld($licenseManager->result), array('38afd7ae34bd5e3e6fc1
}
/*----------------------------------********---------------------------------*/
if ($timeZoneFailed) {
$arrayData = [
'USR_USERNAME' => $userUsername,
'USR_PASSWORD' => $userPassword,
'USR_TIME_ZONE' => $userTimeZone,
'BROWSER_TIME_ZONE' => $browserTimeZone
];
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login' . PATH_SEP . 'TimeZoneAlert', '', $arrayData, SYS_URI . 'login/authentication.php');
G::RenderPage('publish');
exit(0);
}
//translation
//$Translations = G::getModel("Translation");
//require_once "classes/model/Translation.php";

View File

@@ -16,19 +16,51 @@
left: 50%;
top: 50%;
width: 300px;
height: 140px;
margin-top: -140px;
margin-left: -210px;
overflow: none;
}
</style>
<script type="text/javascript">
function getBrowserTimeZoneOffset()
{
var d = new Date();
var tzOffset = d.getTimezoneOffset();
return ((tzOffset > 0)? "-" : "") + (tzOffset * 60);
}
function stringReplace(strSearch, strReplace, str)
{
var expression = eval("/" + strSearch + "/g");
return str.replace(expression, strReplace);
}
function onLoad()
{
document.getElementById("form[BROWSER_TIME_ZONE_OFFSET]").value = getBrowserTimeZoneOffset();
if (document.getElementById("timeZoneFailed").value == "1") {
var strHtml = document.getElementById("details").innerHTML;
strHtml = stringReplace("\\{0\\}", document.getElementById("form[USR_TIME_ZONE]").value, strHtml);
strHtml = stringReplace("\\{1\\}", document.getElementById("form[BROWSER_TIME_ZONE]").value, strHtml);
document.getElementById("details").innerHTML = strHtml;
}
}
</script>
{/literal}
</head>
<body onload="resize()" onresize="resize()" >
<body onload="onLoad();">
<center>
<form method="post" action="../login/authentication" class="formDefault">
<input type="hidden" id="form[BROWSER_TIME_ZONE_OFFSET]" name="form[BROWSER_TIME_ZONE_OFFSET]" />
<input type="hidden" id="timeZoneFailed" name="timeZoneFailed" value="{$timeZoneFailed}" />
<div class="borderForm" style="width:400px; padding-left:0; padding-right:0; border-width:1;">
<div class="boxTop"><div class="a"></div><div class="b"></div><div class="c"></div></div>
<div class="content" style="height:100%;">
@@ -36,31 +68,61 @@
<tr>
<td valign='top'>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td class='FormTitle' colspan="2" align=""><span id='form[TITLE]' name='form[TITLE]' >{translate label="ID_LOGIN"}</span></td>
</tr>
<tr>
<td class='FormLabel' width="40%">{translate label="ID_USER"}</td>
<td class='FormFieldContent' width='240' >
<input class="module_app_input___gray" name="form[USR_USERNAME]" type="text" size="30" maxlength="50" value=""/>
</td>
</tr>
<tr>
<td class='FormLabel' width="40%">{translate label="ID_PASSWORD"}</td>
<td class='FormFieldContent' width='240' >
<input class="module_app_input___gray" name="form[USR_PASSWORD]" type ="password" size="31" maxlength="50" value=""/>
</td>
</tr>
<!-- <tr>
<td class='FormLabel' width="40%">Language</td>
<td class='FormFieldContent' width='240' ><select class="module_app_input___gray" id="form[USER_LANG]" name="form[USER_LANG]" pm:label="Language" pm:dependent="0" ><option value="en" >English</option></select></td>
</tr> -->
<tr>
<td class='FormButton' colspan="2" align="">
<br/>
<input class='module_app_button___gray ' name="form[BSUBMIT]" type='submit' value="{translate label="ID_LOGIN"}" />
</td>
</tr>
{if (!$timeZoneFailed) }
<tr>
<td class="FormTitle" colspan="2">{translate label="ID_LOGIN"}</td>
</tr>
<tr>
<td class="FormLabel" width="40%">{translate label="ID_USER"}</td>
<td class="FormFieldContent" width="240">
<input class="module_app_input___gray" name="form[USR_USERNAME]" type="text" size="30" maxlength="50" value="" />
</td>
</tr>
<tr>
<td class="FormLabel" width="40%">{translate label="ID_PASSWORD"}</td>
<td class="FormFieldContent" width="240">
<input class="module_app_input___gray" name="form[USR_PASSWORD]" type ="password" size="31" maxlength="50" value="" />
</td>
</tr>
<!-- <tr>
<td class="FormLabel" width="40%">Language</td>
<td class="FormFieldContent" width="240"><select class="module_app_input___gray" id="form[USER_LANG]" name="form[USER_LANG]" pm:label="Language" pm:dependent="0"><option value="en" >English</option></select></td>
</tr> -->
<tr>
<td class="FormButton" colspan="2">
<br/>
<input type="submit" class="module_app_button___gray" value="{translate label="ID_LOGIN"}" />
</td>
</tr>
{else}
<input type="hidden" id="form[USR_USERNAME]" name="form[USR_USERNAME]" value="{$usr}" />
<input type="hidden" id="form[USR_PASSWORD]" name="form[USR_PASSWORD]" value="{$pwd}" />
<input type="hidden" id="form[USR_TIME_ZONE]" name="form[USR_TIME_ZONE]" value="{$userTimeZone}" />
<input type="hidden" id="form[BROWSER_TIME_ZONE]" name="form[BROWSER_TIME_ZONE]" value="{$browserTimeZone}" />
<tr>
<td class="FormTitle" colspan="2">{translate label="ID_TIME_ZONE_LOGIN_TITLE"}</td>
</tr>
<tr>
<td class="FormFieldContent" colspan="2" align="left">
{translate label="ID_TIME_ZONE_LOGIN_DESCRIPTION1"}
{translate label="ID_TIME_ZONE_LOGIN_DESCRIPTION2"}
{translate label="ID_TIME_ZONE_LOGIN_DESCRIPTION3"}
<br />
<br />
<span id="details">{translate label="ID_TIME_ZONE_LOGIN_DESCRIPTION_DETAILS"}</span>
</td>
</tr>
<tr>
<td class="FormButton" colspan="2">
<br/>
<input type="submit" class="module_app_button___gray" value="{translate label="ID_OK"}" />
</td>
</tr>
{/if}
</table>
</td>
</tr>
@@ -73,3 +135,4 @@
</body>
</html>

View File

@@ -55,45 +55,97 @@
});
}
function getBrowserTimeZoneOffset()
{
var d = new Date();
var tzOffset = d.getTimezoneOffset();
return ((tzOffset > 0)? "-" : "") + (tzOffset * 60);
}
function stringReplace(strSearch, strReplace, str)
{
var expression = eval("/" + strSearch + "/g");
return str.replace(expression, strReplace);
}
function onLoad()
{
document.getElementById("form[BROWSER_TIME_ZONE_OFFSET]").value = getBrowserTimeZoneOffset();
if (document.getElementById("timeZoneFailed").value == "1") {
var strHtml = document.getElementById("details").innerHTML;
strHtml = stringReplace("\\{0\\}", document.getElementById("form[USR_TIME_ZONE]").value, strHtml);
strHtml = stringReplace("\\{1\\}", document.getElementById("form[BROWSER_TIME_ZONE]").value, strHtml);
document.getElementById("details").innerHTML = strHtml;
}
}
</script>
{/literal}
</head>
<body onload="resize()" onresize="resize()" >
<body onload="resize(); onLoad();" onresize="resize();">
<center>
<form method="post" action="../login/authentication">
<form method="POST" action="../login/authentication">
<input type="hidden" id="form[BROWSER_TIME_ZONE_OFFSET]" name="form[BROWSER_TIME_ZONE_OFFSET]" />
<input type="hidden" id="timeZoneFailed" name="timeZoneFailed" value="{$timeZoneFailed}" />
<div id="login" class="login_form">
<h1>{translate label="ID_SIGN_IN"}</h1>
{if (!$timeZoneFailed) }
<h1>{translate label="ID_SIGN_IN"}</h1>
<div class="login_message">{$msg}</div>
<div class="login_message">{$msg}</div>
<table border=0 width="100%" cellspacing="0" cellpadding="0" class="formbody">
<tr>
<td><label for="login_field">{translate label="ID_USERNAME"}</label></td>
</tr>
<tr>
<td>
<input id="login_field" class="text" style="width: 100%;" type="text" value="{$usr}" tabindex="1" name="form[USR_USERNAME]" autocapitalize="off" />
</td>
</tr>
<tr>
<td><label for="password">{translate label="ID_PASSWORD"}</label></td>
</tr>
<tr>
<td>
<input id="password" class="text" style="width: 100%;" type="password" value="{$pwd}" tabindex="2" name="form[USR_PASSWORD]" autocomplete="disabled" />
</td>
</tr>
<tr>
<td align="center">
<label class="submit_btn"><input type="submit" value="{translate label="ID_LOGIN"}" tabindex="3" name="commit" /></label>
</td>
</tr>
</table>
<table border=0 width="100%" cellspacing="0" cellpadding="0" class="formbody">
<tr>
<td><label for="login_field">{translate label="ID_USERNAME"}</label></td>
</tr>
<tr>
<td><input id="login_field" class="text" style="width: 100%;" type="text" value="{$usr}" tabindex="1" name="form[USR_USERNAME]" autocapitalize="off" /></td>
</tr>
<tr>
<td><label for="password">{translate label="ID_PASSWORD"}</label></td>
</tr>
<tr>
<td><input id="password" class="text" style="width: 100%;" type="password" value="{$pwd}" tabindex="2" name="form[USR_PASSWORD]" autocomplete="disabled" /></td>
</tr>
<tr>
<td align="center"><label class="submit_btn"><input type="submit" value="{translate label="ID_LOGIN"}" tabindex="3" name="commit" /></label></td>
</tr>
</table>
{else}
<input type="hidden" id="form[USR_USERNAME]" name="form[USR_USERNAME]" value="{$usr}" />
<input type="hidden" id="form[USR_PASSWORD]" name="form[USR_PASSWORD]" value="{$pwd}" />
<input type="hidden" id="form[USR_TIME_ZONE]" name="form[USR_TIME_ZONE]" value="{$userTimeZone}" />
<input type="hidden" id="form[BROWSER_TIME_ZONE]" name="form[BROWSER_TIME_ZONE]" value="{$browserTimeZone}" />
<h1>{translate label="ID_TIME_ZONE_LOGIN_TITLE"}</h1>
<table border=0 width="100%" cellspacing="0" cellpadding="0" class="formbody">
<tr>
<td>
{translate label="ID_TIME_ZONE_LOGIN_DESCRIPTION1"}
{translate label="ID_TIME_ZONE_LOGIN_DESCRIPTION2"}
{translate label="ID_TIME_ZONE_LOGIN_DESCRIPTION3"}
<br />
<br />
<span id="details">{translate label="ID_TIME_ZONE_LOGIN_DESCRIPTION_DETAILS"}</span>
<br />
<br />
</td>
</tr>
<tr>
<td align="center"><label class="submit_btn"><input type="submit" value="{translate label="ID_OK"}" tabindex="1" name="commit" /></label></td>
</tr>
</table>
{/if}
</div>
</form>
</center>
</body>
</html>

View File

@@ -0,0 +1,32 @@
<script type="text/javascript">
{$form.JS}
</script>
<form id="{$form_id}" method="post" enctype="multipart/form-data" action="{$form_action}" class="form-signin" style="margin:0px;" accept-charset="UTF-8" role="form">
{$form.BROWSER_TIME_ZONE_OFFSET}
{$form.USR_USERNAME}
{$form.USR_PASSWORD}
{$form.USR_TIME_ZONE}
{$form.BROWSER_TIME_ZONE}
<fieldset>
<label class="panel-login">
<div class="login_result" style="text-align: left;">
{php}echo G::LoadTranslation("ID_TIME_ZONE_LOGIN_DESCRIPTION1");{/php}
{php}echo G::LoadTranslation("ID_TIME_ZONE_LOGIN_DESCRIPTION2");{/php}
{php}echo G::LoadTranslation("ID_TIME_ZONE_LOGIN_DESCRIPTION3");{/php}
<br />
<br />
<span id="details">{php}echo G::LoadTranslation("ID_TIME_ZONE_LOGIN_DESCRIPTION_DETAILS");{/php}</span>
</div>
</label>
</fieldset>
<fieldset>
{$form.BTNOK}
</fieldset>
</form>
<script src="/lib/pmdynaform/libs/respondjs/respond.min.js"></script>
<script src="/lib/pmdynaform/libs/html5shiv/html5shiv.js"></script>

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm type="xmlform" name="login/TimeZoneAlert" enabletemplate="1">
<BROWSER_TIME_ZONE_OFFSET type="hidden" />
<USR_USERNAME type="hidden" />
<USR_PASSWORD type="hidden" />
<USR_TIME_ZONE type="hidden" />
<BROWSER_TIME_ZONE type="hidden" />
<BTNOK type="submit">
<en></en>
</BTNOK>
<JS type="javascript">
<![CDATA[
window.onload= function ()
{
document.getElementById("form[BROWSER_TIME_ZONE_OFFSET]").value = getBrowserTimeZoneOffset();
var strHtml = document.getElementById("details").innerHTML;
strHtml = stringReplace("\\{0\\}", document.getElementById("form[USR_TIME_ZONE]").value, strHtml);
strHtml = stringReplace("\\{1\\}", document.getElementById("form[BROWSER_TIME_ZONE]").value, strHtml);
document.getElementById("details").innerHTML = strHtml;
document.getElementById("form[BTNOK]").value = _("ID_OK");
if (document.getElementById("form[BTNOK]").classList == undefined) {
document.getElementById("form[BTNOK]").className = "button-login-success";
} else {
document.getElementById("form[BTNOK]").classList.remove("module_app_button___gray");
document.getElementById("form[BTNOK]").classList.add("button-login-success");
}
};
]]>
</JS>
</dynaForm>

View File

@@ -2,6 +2,7 @@
id="{$form_id}" name="{$form_name}" action="{$form_action}" method="post" encType="multipart/form-data" onsubmit="return validateForm('{$form_objectRequiredFields}');">
<input type="hidden" class="notValidateThisFields" name="__notValidateThisFields__" id="__notValidateThisFields__" value="{$form_objectRequiredFields}" />
<input type="hidden" name="DynaformRequiredFields" id="DynaformRequiredFields" value="{$form_objectRequiredFields}" />
{$form.BROWSER_TIME_ZONE_OFFSET}
<div style="display: none;"> {$form.USR_PASSWORD}</div>
<fieldset>
<label class="panel-login">
@@ -11,7 +12,7 @@
{$form.USR_PASSWORD_MASK}
{$form.USER_LANG}
{$form.URL}
</fieldset>
<fieldset>
<label class="panel-login">
@@ -20,14 +21,14 @@
<br>
{$form.BSUBMIT}
{$form.FORGOT_PASWORD_LINK}
</fieldset>
<script type="text/javascript">
{$form.JS}
</script>
</form>
<script src="/lib/pmdynaform/libs/respondjs/respond.min.js"></script>
<script src="/lib/pmdynaform/libs/html5shiv/html5shiv.js"></script>
<script src="/lib/pmdynaform/libs/html5shiv/html5shiv.js"></script>
<script type="text/javascript">
try {literal}{{/literal} dynaformSetFocus();}catch(e){literal}{{/literal}}
</script>

View File

@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="login" version="1.0" basedir="" xmlform_type="NORMAL" width="400px" enabletemplate="1">
<BROWSER_TIME_ZONE_OFFSET type="hidden" />
<TITLE type="title">
<en><![CDATA[Login]]></en>
</TITLE>
@@ -38,34 +40,34 @@ function getElementsByClassNameIE8(node, classname) {
window.onload= function(){
var inputUser,
inputPass;
if(document.getElementById('form[USR_USERNAME]').placeholder == undefined && document.getElementById('form[BSUBMIT]').classList == undefined){
if(document.getElementById('form[USR_USERNAME]').placeholder == undefined && document.getElementById('form[BSUBMIT]').classList == undefined){
document.getElementById('form[USR_USERNAME]').value = _('ID_USER');
document.getElementById('form[USR_PASSWORD_MASK]').value = _('ID_PASSWORD');
document.getElementById('form[BSUBMIT]').className = "button-login-success";
inputUser = document.getElementById('form[USR_USERNAME]');
inputPass = document.getElementById('form[USR_PASSWORD_MASK]');
inputUser.attachEvent("onclick", function (){
if(_('ID_USER') == inputUser.value){
inputUser.value="";
}
}
});
inputUser.attachEvent("onblur", function (){
if(inputUser.value == ""){
inputUser.value=_('ID_USER');
}
}
});
inputPass.attachEvent("onclick", function (){
if(_('ID_PASSWORD') == inputPass.value){
inputPass.value="";
}
}
});
inputPass.attachEvent("onblur", function (){
if(inputPass.value == ""){
inputPass.value = _('ID_PASSWORD');
}
}
});
@@ -74,7 +76,7 @@ window.onload= function(){
document.getElementById('form[USR_PASSWORD_MASK]').placeholder = _('ID_PASSWORD');
document.getElementById('form[BSUBMIT]').classList.remove('module_app_button___gray');
document.getElementById('form[BSUBMIT]').classList.add('button-login-success');
}
}
};
// enable/disable forgot password link
@@ -158,8 +160,9 @@ leimnud.event.add(document.getElementById('form[BSUBMIT]'), 'click', function()
document.getElementById("form[USR_PASSWORD]").value = document.getElementById("form[USR_PASSWORD_MASK]").value;
document.getElementById("form[USR_PASSWORD_MASK]").value = "";
document.getElementById("form[BROWSER_TIME_ZONE_OFFSET]").value = getBrowserTimeZoneOffset();
if(!navigator.userAgent.indexOf("MSIE 8.0")>0)
document.getElementById("form[USR_PASSWORD_MASK]").setAttribute("type", "text");
document.getElementById("form[USR_PASSWORD_MASK]").setAttribute("type", "text");
document.login.submit();
}.extend(document.getElementById('form[BSUBMIT]')));

View File

@@ -2,14 +2,15 @@
<input type="hidden" class="notValidateThisFields" name="__notValidateThisFields__" id="__notValidateThisFields__" value="{$form_objectRequiredFields}" />
<input type="hidden" name="DynaformRequiredFields" id="DynaformRequiredFields" value="{$form_objectRequiredFields}" />
<input type="hidden" name="__DynaformName__" id="__DynaformName__" value="{$form_name}" />
{$form.BROWSER_TIME_ZONE_OFFSET}
<div style="display: none;"> {$form.USR_PASSWORD}</div>
<fieldset>
<label class="panel-login">
<div class="login_result"></div>
</label>
{$form.USR_USERNAME}
{$form.USR_PASSWORD_MASK}
{$form.USR_PASSWORD_MASK}
</fieldset>
<fieldset>
<label class="panel-login">
@@ -17,13 +18,14 @@
</label>
{$form.USER_ENV}
{$form.USER_LANG}
<br>
{$form.BSUBMIT}
{$form.BSUBMIT}
</fieldset>
<script src="/lib/pmdynaform/libs/respondjs/respond.min.js"></script>
<script src="/lib/pmdynaform/libs/html5shiv/html5shiv.js"></script>
<script type="text/javascript">
<script src="/lib/pmdynaform/libs/html5shiv/html5shiv.js"></script>
<script type="text/javascript">
{$form.JS}
</script>
</form>

View File

@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="sysLogin" version="1.0" basedir="" xmlform_type="NORMAL" width="400px" enabletemplate="1">
<BROWSER_TIME_ZONE_OFFSET type="hidden" />
<TITLE type="title">
<en><![CDATA[Login]]></en>
</TITLE>
@@ -44,7 +46,7 @@ function createEvent(elem, event, fn) {
window.onload= function(){
var inputUser,
inputWs,
inputPass;
inputPass;
if(document.getElementById('form[USR_USERNAME]').placeholder === undefined && document.getElementById('form[BSUBMIT]').classList == undefined){
document.getElementById('form[USR_USERNAME]').value = _('ID_USER');
document.getElementById('form[USR_PASSWORD_MASK]').value = _('ID_PASSWORD');
@@ -52,49 +54,49 @@ window.onload= function(){
document.getElementById('form[BSUBMIT]').className = "button-login-success";
inputUser = document.getElementById('form[USR_USERNAME]');
inputPass = document.getElementById('form[USR_PASSWORD_MASK]');
inputWs = document.getElementById('form[USER_ENV]');
inputWs = document.getElementById('form[USER_ENV]');
inputUser.attachEvent("onclick", function (){
if(_('ID_USER') == inputUser.value){
inputUser.value="";
}
}
});
inputUser.attachEvent("onblur", function (){
if(inputUser.value == ""){
inputUser.value=_('ID_USER');
}
}
});
inputPass.attachEvent("onclick", function (){
if(_('ID_PASSWORD') == inputPass.value){
inputPass.value="";
}
}
});
inputPass.attachEvent("onblur", function (){
if(inputPass.value == ""){
inputPass.value = _('ID_PASSWORD');
}
}
});
inputWs.attachEvent("onclick", function (){
if(_('ID_WORKSPACE') == inputWs.value){
inputWs.value="";
}
}
});
inputWs.attachEvent("onblur", function (){
if(inputWs.value == ""){
inputWs.value = _('ID_WORKSPACE');
}
}
});
}else{
document.getElementById('form[USR_USERNAME]').placeholder = _('ID_USER');
document.getElementById('form[USR_PASSWORD_MASK]').placeholder = _('ID_PASSWORD');
document.getElementById('form[USER_ENV]').placeholder = _('ID_WORKSPACE');
document.getElementById('form[BSUBMIT]').classList.remove('module_app_button___gray');
document.getElementById('form[BSUBMIT]').classList.add('button-login-success');
document.getElementById('form[BSUBMIT]').classList.add('button-login-success');
}
};
@@ -131,9 +133,10 @@ leimnud.event.add(document.getElementById('form[USER_ENV]'), 'keypress', functio
leimnud.event.add(document.getElementById('form[BSUBMIT]'), 'click', function() {
createCookie("pm_sys_sys", "{\"sys_sys\": \"" + getField("USER_ENV").value + "\"}", 365);
document.getElementById('form[USR_PASSWORD]').value = document.getElementById('form[USR_PASSWORD_MASK]').value;
document.getElementById('form[USR_PASSWORD_MASK]').value = '';
document.getElementById('form[USR_PASSWORD_MASK]').value = '';
document.getElementById("form[BROWSER_TIME_ZONE_OFFSET]").value = getBrowserTimeZoneOffset();
if(!navigator.userAgent.indexOf("MSIE 8.0")>0)
document.getElementById("form[USR_PASSWORD_MASK]").setAttribute("type", "text");
document.getElementById("form[USR_PASSWORD_MASK]").setAttribute("type", "text");
document.sysLogin.submit();
}.extend(document.getElementById('form[BSUBMIT]')));