Index: extensions/NBC_UserAdvManager/trunk/admin/UserAdvManager_admin.php
===================================================================
--- extensions/NBC_UserAdvManager/trunk/admin/UserAdvManager_admin.php	(revision 3920)
+++ extensions/NBC_UserAdvManager/trunk/admin/UserAdvManager_admin.php	(revision 4061)
@@ -41,4 +41,5 @@
 $page['global'] = array();
 $error = array();
+$UserAdvManager_Password_Test_Score = 0;
 
 // +-----------------------------------------------------------------------+
@@ -55,10 +56,10 @@
   case 'global':
 	
-	if ( isset($_POST['submit']) and !is_adviser() and isset($_POST['UserAdvManager_Mail_Info']) and isset($_POST['UserAdvManager_No_Casse']) and isset($_POST['UserAdvManager_Username_Char']) and isset($_POST['UserAdvManager_Confirm_Mail']) and isset($_POST['UserAdvManager_No_Comment_Anonymous']) )
+	if (isset($_POST['submit']) and !is_adviser() and isset($_POST['UserAdvManager_Mail_Info']) and isset($_POST['UserAdvManager_No_Casse']) and isset($_POST['UserAdvManager_Username_Char']) and isset($_POST['UserAdvManager_Confirm_Mail']) and isset($_POST['UserAdvManager_No_Comment_Anonymous']) and isset($_POST['UserAdvManager_Password_Enforced']))
   {
 		$_POST['UserAdvManager_MailInfo_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_MailInfo_Text']));
 		$_POST['UserAdvManager_ConfirmMail_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_ConfirmMail_Text']));
 		
-		$newconf_nbc_UserAdvManager = $_POST['UserAdvManager_Mail_Info'].';'.$_POST['UserAdvManager_No_Casse'].';'.$_POST['UserAdvManager_Confirm_Mail'].';'.(isset($_POST['UserAdvManager_No_Confirm_Group'])?$_POST['UserAdvManager_No_Confirm_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Group'])?$_POST['UserAdvManager_Validated_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Status'])?$_POST['UserAdvManager_Validated_Status']:'').';'.$_POST['UserAdvManager_No_Comment_Anonymous'].';'.$_POST['UserAdvManager_Username_Char'].';'.$_POST['UserAdvManager_Username_List'].';'.(isset($_POST['UserAdvManager_No_Confirm_Status'])?$_POST['UserAdvManager_No_Confirm_Status']:'').';'.$_POST['UserAdvManager_MailInfo_Text'].';'.$_POST['UserAdvManager_ConfirmMail_Text'].';'.$_POST['UserAdvManager_MailExclusion'].';'.$_POST['UserAdvManager_MailExclusion_List'];
+		$newconf_nbc_UserAdvManager = $_POST['UserAdvManager_Mail_Info'].';'.$_POST['UserAdvManager_No_Casse'].';'.$_POST['UserAdvManager_Confirm_Mail'].';'.(isset($_POST['UserAdvManager_No_Confirm_Group'])?$_POST['UserAdvManager_No_Confirm_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Group'])?$_POST['UserAdvManager_Validated_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Status'])?$_POST['UserAdvManager_Validated_Status']:'').';'.$_POST['UserAdvManager_No_Comment_Anonymous'].';'.$_POST['UserAdvManager_Username_Char'].';'.$_POST['UserAdvManager_Username_List'].';'.(isset($_POST['UserAdvManager_No_Confirm_Status'])?$_POST['UserAdvManager_No_Confirm_Status']:'').';'.$_POST['UserAdvManager_MailInfo_Text'].';'.$_POST['UserAdvManager_ConfirmMail_Text'].';'.$_POST['UserAdvManager_MailExclusion'].';'.$_POST['UserAdvManager_MailExclusion_List'].';'.$_POST['UserAdvManager_Password_Enforced'].';'.$_POST['UserAdvManager_Password_Score'];
 		
 		$conf['nbc_UserAdvManager'] = $newconf_nbc_UserAdvManager;
@@ -74,4 +75,13 @@
 		
 		array_push($page['infos'], l10n('UserAdvManager_save_config'));
+  }
+
+  if (isset($_POST['PasswordTest']) and !is_adviser() and isset($_POST['UserAdvManager_Password_Test']) and !empty($_POST['UserAdvManager_Password_Test']))
+  {
+    $UserAdvManager_Password_Test_Score = testpassword($_POST['UserAdvManager_Password_Test']);
+  }
+  else if (isset($_POST['PasswordTest']) and !is_adviser() and empty($_POST['UserAdvManager_Password_Test']))
+  {
+    array_push($page['errors'], l10n('reg_err_login3'));
   }
 	
@@ -189,4 +199,8 @@
 		'UserAdvManager_MAILEXCLUSION_FALSE'  => $conf_nbc_UserAdvManager[12]=='false' ?  'checked="checked"' : '' ,
 		'UserAdvManager_MAILEXCLUSION_LIST'   => $conf_nbc_UserAdvManager[13],
+		'UserAdvManager_PASSWORDENF_TRUE'     => $conf_nbc_UserAdvManager[14]=='true' ?  'checked="checked"' : '' ,
+		'UserAdvManager_PASSWORDENF_FALSE'    => $conf_nbc_UserAdvManager[14]=='false' ?  'checked="checked"' : '' ,
+		'UserAdvManager_PASSWORD_SCORE'       => $conf_nbc_UserAdvManager[15],
+		'UserAdvManager_PASSWORD_TEST_SCORE'  => $UserAdvManager_Password_Test_Score,
     )
   );
