Merge commit 'origin/core-1.0.0' into core
[platal.git] / plugins / compiler.checkpasswd.php
index 87dabf5..714d3e2 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
-require_once 'platal.inc.php';
 
 function smarty_compiler_checkpasswd($tag_attrs, &$compiler)
 {
     extract($compiler->_parse_attrs($tag_attrs));
     if (!isset($width)) {
-      $width = '250px';
+      $width = '230px';
     }
     if (!isset($prompt)) {
       $prompt = "'nouveau'";
@@ -32,19 +31,26 @@ function smarty_compiler_checkpasswd($tag_attrs, &$compiler)
     if (!isset($submit)) {
       $submit = "'submitn'";
     }
+    if (!isset($text)) {
+      $text = "'Changer'";
+    }
 
-    return '?><script type="text/javascript" src="javascript/jquery.js" ></script>
-              <script type="text/javascript" src="javascript/jquery.color.js" ></script>
+    return '?><script type="text/javascript" src="javascript/jquery.color.js" ></script>
               <script type="text/javascript">//<![CDATA[
                 var passwordprompt_name = '.  $prompt . ';
                 var passwordprompt_submit = ' . $submit . ';
-                $(":input[@name=' . $prompt . ']").keyup(function(event) { checkPassword(event.target); });
+                $(":input[@name=' . $prompt . ']").keyup(function(event) { checkPassword(event.target, ' . $text . '); });
                 $(document).ready(function() {
-                  $(":submit[@name=' . $submit . ']").attr("disabled", "disabled");
+                  checkPassword($(":input[@name=' . $prompt . ']").get(0), ' . $text . ');
                 });
               //]]></script>
-              <div style="border: 1px solid white; width: ' . $width . '; height: 7px; background-color: #444">
-                <div id="passwords_measure" style="height: 100%; background-color: red; width: 0px"></div>
+              <div>
+                <div style="border: 1px solid white; width: ' . $width . '; height: 7px; background-color: #444; margin-top: 4px; float: left">
+                  <div id="passwords_measure" style="height: 100%; background-color: red; width: 0px"></div>
+                </div>
+                <a href="Xorg/MDP?display=light" style="display: block; float: left; margin-left: 4px;" class="popup_600x800">
+                  <img src="images/icons/information.gif" alt="Aide" title="Comment construire un mot de passe fort..." />
+                </a>
               </div><?php';
 }