Nouvelle page de login

This commit is contained in:
Michael RICOIS 2012-06-25 13:52:58 +00:00
parent a3651c6ad7
commit 656e8a12b2
5 changed files with 627 additions and 25 deletions

View File

@ -7,6 +7,10 @@ class UserController extends Zend_Controller_Action
*/ */
public function loginAction() public function loginAction()
{ {
$this->view->inlineScript()
->appendFile('/themes/default/scripts/jquery.js')
->appendFile('/themes/default/scripts/jquery.infieldlabel.min.js');
//@todo : gestion des affichages particuliers pour les clients //@todo : gestion des affichages particuliers pour les clients
$this->view->headTitle()->append('Connexion'); $this->view->headTitle()->append('Connexion');
$form = new Form_Login(); $form = new Form_Login();
@ -27,23 +31,10 @@ class UserController extends Zend_Controller_Action
foreach ($result->getMessages() as $message) { foreach ($result->getMessages() as $message) {
$this->view->message.= $message."<br/>"; $this->view->message.= $message."<br/>";
} }
} else {
$url = '';
if (Zend_Session::namespaceIsset('login')){
$session = new Zend_Session_Namespace('login');
if (isset($session->url)) {
$url = $session->url;
}
}
if (!empty($url) && $url!='/user/login' && $url!='/localauth'){
$this->_redirect($url);
}
$this->_redirect('/');
} }
} }
} }
$this->_helper->layout()->disableLayout(); $this->_helper->layout()->disableLayout();
$this->render('login');
} }
/** /**

View File

@ -1,4 +0,0 @@
<br /><br />
<div id="view-content">
<p>View script for controller <b>Login</b> and script/action name <b>index</b></p>
</div>

View File

@ -4,10 +4,616 @@
<?=$this->headMeta();?> <?=$this->headMeta();?>
<?=$this->headTitle();?> <?=$this->headTitle();?>
<link rel="shortcut icon" type="image/x-icon" href="<?='http://'.$_SERVER['SERVER_NAME']?>/favicon.ico" /> <link rel="shortcut icon" type="image/x-icon" href="<?='http://'.$_SERVER['SERVER_NAME']?>/favicon.ico" />
<style>
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, dialog, figure, footer, header, hgroup, nav, section {
border: 0 none;
cursor: default;
font-family: inherit;
font-size: 100%;
font-weight: inherit;
margin: 0;
outline: 0 none;
padding: 0;
vertical-align: baseline;
}
html, body {
height: 100%;
}
article, aside, dialog, figure, footer, header, hgroup, nav, section {
display: block;
}
body {
line-height: 1.5;
}
table {
border-collapse: separate;
border-spacing: 0;
white-space: nowrap;
}
caption, th, td {
font-weight: normal;
text-align: left;
}
table, td, th {
vertical-align: middle;
}
a {
border: 0 none;
color: #000000;
text-decoration: none;
}
a, a *, input, input *, select, .button span, li, label {
cursor: pointer;
}
ul {
list-style: none outside none;
}
body {
background: none repeat scroll 0 0 #FEFEFE;
color: #000000;
font: 0.8em/1.6em "Lucida Grande",Arial,Verdana,sans-serif;
}
#body-user #header, #body-settings #header {
background: none repeat scroll 0 0 #1D2D44;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5), 0 -2px 10px #222222 inset;
height: 2.5em;
padding: 0.5em;
position: fixed;
top: 0;
width: 100%;
z-index: 100;
}
#body-login #header {
margin: -2em auto 0;
text-align: center;
height: 10em;
padding: 1em 0 .5em;
-moz-box-shadow: 0 0 1em rgba(0, 0, 0, .5);
-webkit-box-shadow: 0 0 1em rgba(0, 0, 0, .5);
box-shadow: 0 0 1em rgba(0, 0, 0, .5);
background: #1D2D44;
background: -moz-linear-gradient(top, #35537A 0%, #1D2D42 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #35537A), color-stop(100%, #1D2D42));
background: -webkit-linear-gradient(top, #35537A 0%, 1D2D42 100%);
background: -o-linear-gradient(top, #35537A 0%, #1D2D42 100%);
background: -ms-linear-gradient(top, #35537A 0%, #1D2D42 100%);
background: linear-gradient(top, #35537A 0%, #1D2D42 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#35537a', endColorstr='#1d2d42',GradientType=0 );
}
#body-login #header span {
color:#FFFFFF;
font-weight:bold;
font-size:1.6em;
line-height:5em;
}
input[type="text"], input[type="password"] {
cursor: text;
}
input, textarea, select, button, .button, #quota, div.jp-progress, .pager li a {
background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid #DDDDDD;
border-radius: 0.5em 0.5em 0.5em 0.5em;
box-shadow: 0 1px 1px #FFFFFF, 0 1px 0 #BBBBBB inset;
color: #333333;
font-size: 1em;
margin: 0.3em;
outline: medium none;
padding: 0.6em 0.5em 0.4em;
width: 10em;
}
input[type="text"], input[type="password"], input[type="search"] {
background: none repeat scroll 0 0 #F8F8F8;
color: #555555;
cursor: text;
}
input[type="text"], input[type="password"], input[type="search"] {
-moz-appearance: textfield;
-moz-box-sizing: content-box;
}
input[type="text"]:hover, input[type="text"]:focus, input[type="text"]:active, input[type="password"]:hover, input[type="password"]:focus, input[type="password"]:active, .searchbox input[type="search"]:hover, .searchbox input[type="search"]:focus, .searchbox input[type="search"]:active {
background-color: #FFFFFF;
color: #333333;
opacity: 1;
}
input[type="submit"], input[type="button"], button, .button, #quota, div.jp-progress, select, .pager li a {
background: none repeat scroll 0 0 #F8F8F8;
border: 1px solid #DDDDDD;
border-radius: 0.5em 0.5em 0.5em 0.5em;
color: #555555;
cursor: pointer;
font-weight: bold;
padding: 0.4em;
text-shadow: 0 1px 0 #FFFFFF;
width: auto;
}
input[type="submit"]:hover, input[type="submit"]:focus, input[type="button"]:hover, select:hover, select:focus, select:active, input[type="button"]:focus, .button:hover {
background: none repeat scroll 0 0 #FFFFFF;
color: #333333;
}
input[type="checkbox"] {
width: auto;
}
#quota {
cursor: default;
}
#body-login input {
font-size: 1.5em;
}
#body-login input[type="text"], #body-login input[type="password"] {
width: 13em;
}
#body-login input.login {
float: right;
width: auto;
}
#remember_login {
margin: 0.8em 0.2em 0 1em;
}
.searchbox input[type="search"] {
-moz-transition: opacity 300ms ease 0s;
background: url("../img/actions/search.svg") no-repeat scroll 0.5em center #FFFFFF;
border: 0 none;
border-radius: 1em 1em 1em 1em;
font-size: 1.2em;
opacity: 0.7;
padding: 0.2em 0.5em 0.2em 1.5em;
position: fixed;
right: 3em;
top: 0.4em;
}
input.enabled[type="submit"] {
background: none repeat scroll 0 0 #66F866;
border: 1px solid #55EE55;
box-shadow: 0 1px 1px #F8F8F8, 0 1px 1px #CCFFCC inset;
}
input.highlight[type="submit"] {
background: none repeat scroll 0 0 #FFC100;
border: 1px solid #DDBB00;
box-shadow: 0 1px 1px #F8F8F8, 0 1px 1px #FFEEDD inset;
text-shadow: 0 1px 0 #FFEEDD;
}
#select_all {
margin-top: 0.4em !important;
}
#controls {
background: none repeat scroll 0 0 #F7F7F7;
border-bottom: 1px solid #EEEEEE;
box-shadow: 0 -3px 7px #000000;
height: 2.8em;
margin: 0;
padding: 0 0.5em;
position: fixed;
top: 3.5em;
width: 100%;
z-index: 50;
}
#controls .button {
display: inline-block;
}
#content {
left: 12.5em;
position: absolute;
top: 3.5em;
}
#leftcontent, .leftcontent {
background: none repeat scroll 0 0 #F8F8F8;
border-right: 1px solid #DDDDDD;
overflow: auto;
position: fixed;
top: 6.4em;
width: 20em;
}
#leftcontent li, .leftcontent li {
-moz-transition: background-color 200ms ease 0s;
background: none repeat scroll 0 0 #F8F8F8;
overflow: hidden;
padding: 0.5em 0.8em;
text-overflow: ellipsis;
white-space: nowrap;
}
#leftcontent li:hover, #leftcontent li:active, #leftcontent li.active, .leftcontent li:hover, .leftcontent li:active, .leftcontent li.active {
background: none repeat scroll 0 0 #EEEEEE;
}
#leftcontent li.active, .leftcontent li.active {
font-weight: bold;
}
#leftcontent li:hover, .leftcontent li:hover {
background: none repeat scroll 0 0 #DDDDDD;
color: #333333;
}
#leftcontent a {
display: block;
float: left;
height: 100%;
margin: 0;
padding: 0 1em 0 0;
}
#rightcontent, .rightcontent {
left: 32.5em;
overflow: auto;
position: fixed;
top: 6.4em;
}
#body-login {
background: none repeat scroll 0 0 #DDDDDD;
}
#body-login div.buttons {
text-align: center;
}
#body-login p.info {
color: #777777;
margin: 2em auto;
text-align: center;
text-shadow: 0 1px 0 #FFFFFF;
width: 22em;
}
#body-login p.info a {
color: #777777;
font-weight: bold;
}
#login {
background: none repeat scroll 0 0 #EEEEEE;
border-bottom: 1px solid #F8F8F8;
margin: 2em auto 0;
min-height: 30em;
}
#login form {
margin: 2em auto;
padding: 0;
width: 22em;
}
#login form fieldset {
background: none repeat scroll 0 center transparent;
border: 0 none;
margin-bottom: 2em;
padding: 0;
}
#login form fieldset legend {
font-weight: bold;
}
#login form label {
color: #666666;
margin: 0.95em 0 0 0.85em;
}
p.infield {
position: relative;
}
label.infield {
cursor: text !important;
}
#login form label.infield {
color: #AAAAAA;
font-size: 1.5em;
position: absolute;
}
#login #dbhostlabel, #login #directorylabel {
display: block;
margin: 0.95em 0 0.8em -8em;
}
#login form input[type="checkbox"] + label {
font-size: 1em;
margin: 0;
position: relative;
text-shadow: 0 1px 0 #FFFFFF;
}
#login form .errors {
background: none repeat scroll 0 0 #FED7D7;
border: 1px solid #FF0000;
margin: 0 0 2em;
padding: 1em;
}
#login form #selectDbType {
text-align: center;
}
#login form #selectDbType label {
background: none repeat scroll 0 0 #F8F8F8;
border: 1px solid #DDDDDD;
color: #555555;
cursor: pointer;
font-size: 1em;
font-weight: bold;
margin: 0 -0.3em 1em;
padding: 0.4em;
position: static;
text-shadow: 0 1px 0 #EEEEEE;
}
#login form #selectDbType label span {
cursor: pointer;
font-size: 0.9em;
}
#login form #selectDbType label.ui-state-hover span, #login form #selectDbType label.ui-state-active span {
color: #000000;
}
#login form #selectDbType label.ui-state-hover, #login form #selectDbType label.ui-state-active {
background-color: #CCCCCC;
color: #333333;
}
#navigation {
background: none repeat scroll 0 0 #EEEEEE;
border-right: 1px solid #CCCCCC;
box-shadow: -3px 0 7px #000000;
float: left;
height: 100%;
overflow: hidden;
padding: 0;
position: fixed;
top: 3.5em;
width: 12.5em;
z-index: 75;
}
#navigation a {
-moz-transition: background 300ms ease 0s;
background: none no-repeat scroll 1em center #EEEEEE;
border-bottom: 1px solid #DDDDDD;
border-top: 1px solid #FFFFFF;
color: #666666;
display: block;
font-size: 1.2em;
padding: 0.6em 0.5em 0.4em 2.5em;
text-decoration: none;
text-shadow: 0 1px 0 #F8F8F8;
}
#navigation a.active, #navigation a:hover, #navigation a:focus {
background-color: #DBDBDB;
border-bottom: 1px solid #CCCCCC;
border-top: 1px solid #D4D4D4;
color: #333333;
}
#navigation a.active {
background-color: #DDDDDD;
}
#navigation #settings {
bottom: 3.5em;
position: absolute;
width: 100%;
}
#expand {
cursor: pointer;
margin-bottom: -0.5em;
padding: 0.5em 10.1em 0.7em 1.2em;
position: relative;
z-index: 100;
}
#expand + span {
-moz-transition: opacity 300ms ease 0s;
color: #666666;
font-size: 1.2em;
margin: -1.7em 0 0 2.5em;
opacity: 0;
position: absolute;
text-shadow: 0 1px 0 #F8F8F8;
z-index: 99;
}
#expand:hover + span, #expand + span:hover {
cursor: pointer;
opacity: 1;
}
#logout {
padding: 1.2em 2em 0.55em 1.2em;
position: absolute;
right: 0;
top: 0;
}
.hidden {
display: none;
}
.bold {
font-weight: bold;
}
#notification {
background-color: #FFCC44;
border: 0 none;
border-bottom-left-radius: 1em;
border-bottom-right-radius: 1em;
cursor: pointer;
display: none;
left: 50%;
padding: 0 0.7em 0.3em;
position: fixed;
top: 0;
z-index: 101;
}
.action, .selectedActions a {
-moz-transition: opacity 200ms ease 0s;
opacity: 0.5;
}
.action {
height: 16px;
width: 16px;
}
#logout {
opacity: 0.8;
}
.action:hover, .selectedActions a:hover, #logout:hover {
opacity: 1;
}
table:not(.nostyle) tr {
-moz-transition: background-color 200ms ease 0s;
}
tbody tr:hover, tr:active {
background-color: #F8F8F8;
}
#body-settings .personalblock, #body-settings .helpblock {
background: none repeat scroll 0 0 #F8F8F8;
border-radius: 0.5em 0.5em 0.5em 0.5em;
color: #555555;
margin: 1em;
padding: 0.5em 1em;
text-shadow: 0 1px 0 #FFFFFF;
}
#body-settings #quota.personalblock {
padding: 0;
position: relative;
}
#body-settings #controls + .helpblock {
margin-top: 3em;
position: relative;
}
.personalblock > legend {
margin-top: 2em;
}
.personalblock > legend, th, dt, label {
font-weight: bold;
}
code {
font-family: "Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono",monospace;
}
#quota div, div.jp-play-bar, div.jp-seek-bar {
background: none repeat scroll 0 0 #E6E6E6;
border-bottom-left-radius: 0.4em;
border-top-left-radius: 0.4em;
font-weight: normal;
padding: 0;
white-space: nowrap;
}
#quotatext {
padding: 0.6em 1em;
}
div.jp-play-bar, div.jp-seek-bar {
padding: 0;
}
.pager {
display: inline;
float: right;
list-style: none outside none;
margin: 0.7em 13em 0 0;
}
.pager li {
display: inline-block;
}
li.error {
background: none no-repeat scroll 0.8em 0.8em #FFFFEE;
border: 1px solid #CCCCCC;
border-radius: 10px 10px 10px 10px;
color: #FF3B3B;
margin: 4em auto;
padding: 1em 1em 1em 4em;
width: 640px;
}
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
overflow: hidden;
text-overflow: ellipsis;
}
.hint {
background-image: url("/core/img/actions/info.png");
background-position: 0 0.3em;
background-repeat: no-repeat;
color: #777777;
padding-left: 25px;
}
.separator {
border-left: 1px solid #D3D3D3;
border-right: 1px solid #FFFFFF;
display: inline;
height: 10px;
margin: 4px;
width: 0;
}
a.bookmarklet {
background-color: #DDDDDD;
border: 1px solid #CCCCCC;
margin-top: 5px;
padding: 0 5px 2px;
text-decoration: none;
}
#dirtree {
width: 100%;
}
#filelist {
background-color: white;
height: 270px;
overflow: scroll;
width: 100%;
}
.filepicker_element_selected {
background-color: lightblue;
}
.filepicker_loader {
background-color: #333333;
height: 120px;
left: 0;
opacity: 0.3;
padding-top: 150px;
position: absolute;
text-align: center;
top: 0;
visibility: visible;
width: 100%;
}
#categoryform .scrollarea {
background: none repeat scroll 0 0 #F8F8F8;
border: 1px solid #DDDDDD;
bottom: 50px;
left: 10px;
overflow: auto;
position: absolute;
right: 10px;
top: 10px;
}
#categoryform .bottombuttons {
bottom: 10px;
position: absolute;
}
#categoryform .bottombuttons * {
float: left;
}
#categorylist li {
-moz-transition: background-color 500ms ease 0s;
background: none repeat scroll 0 0 #F8F8F8;
overflow: hidden;
padding: 0.3em 0.8em;
text-overflow: ellipsis;
white-space: nowrap;
}
#categorylist li:hover, li:active {
background: none repeat scroll 0 0 #EEEEEE;
}
#category_addinput {
width: 10em;
}
</style>
<!--[if IE 8]><style>input[type="checkbox"]{padding:0;}</style><![endif]-->
<?=$this->inlineScript()?>
<script>
$(document).ready(function(){
$("label").inFieldLabels();
});
</script>
</head> </head>
<body>
<h2>CONNEXION ODEA</h2> <body id="body-login">
<?=$this->message?> <div id="login">
<?=$this->form?> <header>
<div id="header">
<span>OUTIL D'EXTRACTION - SCORES & DECISIONS</span>
</div>
</header>
<form method="post" action="<?=$this->url(array('controller'=>'user', 'action'=>'login'),null, true)?>">
<p style="text-align:center; color:red;"><span><?=$this->message?></span></p>
<fieldset>
<p class="infield">
<label for="user" class="infield">Identifiant</label>
<input type="text" name="login" id="user" value="" autofocus autocomplete="off" required />
</p>
<p class="infield">
<label for="password" class="infield">Mot de passe</label>
<input type="password" name="pass" id="password" value="" required />
</p>
<!-- <input type="checkbox" name="remember_login" value="1" id="remember_login" /><label for="remember_login">Remember</label> -->
<input type="submit" id="submit" class="login" value="Connexion" />
</fieldset>
</form>
</div>
<footer>
<p class="info">
<a href="http://www.scores-decisions.com/">Scores & Décisions SAS</a>
</p>
</footer>
</body> </body>
</html> </html>

View File

@ -62,9 +62,6 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
$storage = $auth->getStorage(); $storage = $auth->getStorage();
Zend_Session::namespaceUnset($storage->getNamespace()); Zend_Session::namespaceUnset($storage->getNamespace());
$session = new Zend_Session_Namespace('login');
$session->url = $_SERVER['REQUEST_URI'];
$layout = Zend_Layout::getMVCInstance(); $layout = Zend_Layout::getMVCInstance();
if ( !$layout->isEnabled() ) { if ( !$layout->isEnabled() ) {
echo "Identification incorrect ou périmé."; echo "Identification incorrect ou périmé.";

View File

@ -0,0 +1,12 @@
/*
* In-Field Label jQuery Plugin
* http://fuelyourcoding.com/scripts/infield.html
*
* Copyright (c) 2009 Doug Neiner
* Dual licensed under the MIT and GPL licenses.
* Uses the same license as jQuery, see:
* http://docs.jquery.com/License
*
* @version 0.1
*/
(function($){$.InFieldLabels=function(b,c,d){var f=this;f.$label=$(b);f.label=b;f.$field=$(c);f.field=c;f.$label.data("InFieldLabels",f);f.showing=true;f.init=function(){f.options=$.extend({},$.InFieldLabels.defaultOptions,d);if(f.$field.val()!=""){f.$label.hide();f.showing=false};f.$field.focus(function(){f.fadeOnFocus()}).blur(function(){f.checkForEmpty(true)}).bind('keydown.infieldlabel',function(e){f.hideOnChange(e)}).change(function(e){f.checkForEmpty()}).bind('onPropertyChange',function(){f.checkForEmpty()})};f.fadeOnFocus=function(){if(f.showing){f.setOpacity(f.options.fadeOpacity)}};f.setOpacity=function(a){f.$label.stop().animate({opacity:a},f.options.fadeDuration);f.showing=(a>0.0)};f.checkForEmpty=function(a){if(f.$field.val()==""){f.prepForShow();f.setOpacity(a?1.0:f.options.fadeOpacity)}else{f.setOpacity(0.0)}};f.prepForShow=function(e){if(!f.showing){f.$label.css({opacity:0.0}).show();f.$field.bind('keydown.infieldlabel',function(e){f.hideOnChange(e)})}};f.hideOnChange=function(e){if((e.keyCode==16)||(e.keyCode==9))return;if(f.showing){f.$label.hide();f.showing=false};f.$field.unbind('keydown.infieldlabel')};f.init()};$.InFieldLabels.defaultOptions={fadeOpacity:0.5,fadeDuration:300};$.fn.inFieldLabels=function(c){return this.each(function(){var a=$(this).attr('for');if(!a)return;var b=$("input#"+a+"[type='text'],"+"input#"+a+"[type='password'],"+"textarea#"+a);if(b.length==0)return;(new $.InFieldLabels(this,b[0],c))})}})(jQuery);