Code

Added scalix group support
[gosa.git] / html / password.php
index 901469f3bc8fbc936c93aa59e7ecfd387b6b8d09..26eafb47907296a38f0e2d3f11174649ab8a0b81 100644 (file)
@@ -143,7 +143,7 @@ if ($config->data['MAIN']['FORCESSL'] == 'true' && $ssl != ''){
 }
 
 /* Check for selected password method */
-$method= "";
+$method= $config->current['HASH'];
 if (isset($_GET['method'])){
        $method= validate($_GET['method']);
        $tmp = new passwordMethod($config);
@@ -210,18 +210,18 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['apply'])){
          $message[]= _("Please specify your password!");
   } else {
 
-         /* Do we have the selected user somewhere? */
-         $ui= ldap_login_user ($uid, $current_password);
-         if ($ui == NULL){
-               $message[]= _("");
-         } else {
-               /* Check acl... */
-               $ca= get_permissions ($ui->dn, $ui->subtreeACL);
-               $ca= get_module_permission($ca, "user", $ui->dn);
-               if (chkacl($ca, "password") != ""){
-                       $message[]= _("You have no permissions to change your password.");
-               }
-         }
+    /* Do we have the selected user somewhere? */
+    $ui= ldap_login_user ($uid, $current_password);
+    if ($ui == NULL){
+      $message[]= _("Please check the username/password combination.");
+    } else {
+      /* Check acl... */
+      $ca= get_permissions ($ui->dn, $ui->subtreeACL);
+      $ca= get_module_permission($ca, "user", $ui->dn);
+      if (chkacl($ca, "password") != ""){
+        $message[]= _("You have no permissions to change your password.");
+      }
+    }
   }
 
   /* Do we need to show error messages? */
@@ -271,7 +271,7 @@ $smarty->assign ('password_img', get_template_path('images/password.png'));
 
 /* Displasy SSL mode warning? */
 if ($ssl != "" && $config->data['MAIN']['WARNSSL'] == 'true'){
-  $smarty->assign ("ssl", "<b>"._("Warning").":<\/b> "._("Session will not be encrypted.")." <a style=\"color:red;\" href=\"$ssl\"><b>"._("Enter SSL session")."<\/b></a>!");
+  $smarty->assign ("ssl", "<b>"._("Warning").":</b> "._("Session will not be encrypted.")." <a style=\"color:red;\" href=\"".htmlentities($ssl)."\"><b>"._("Enter SSL session")."</b></a>!");
 } else {
   $smarty->assign ("ssl", "");
 }
@@ -287,15 +287,6 @@ if ($error_collector != ""){
   $smarty->assign("php_errors", "");
 }
 
-/* Set focus to the error button if we've an error message */
-$focus= "";
-if (isset($_SESSION['errors']) && $_SESSION['errors'] != ""){
-  $focus= '<script language="JavaScript" type="text/javascript">';
-  $focus.= 'document.forms[0].error_accept.focus();';
-  $focus.= '</script>';
-}
-$smarty->assign("focus", $focus);
-
 displayPWchanger();
 
 ?>