Example #1
0
 private static string CheckPassword(string password)
 {
     if (password == "-1")
     {
         return(password);//if the user want to go back to the menu
     }
     else
     {
         bool temp = kanban.IsValidPassword(password);
         if (temp)
         {
             return(password);
         }
         else// if the password is invalid
         {
             Console.ForegroundColor = ConsoleColor.Red;
             Console.WriteLine("Invalid Password - please enter a valid password and make sure its on the right length and include all the characters you were requested !");
             Console.ResetColor();
             //Log.Instance.warn("Invalid input - Invalid Password");//log
             Console.ForegroundColor = ConsoleColor.DarkCyan;
             Console.Write("Password :");
             password = Console.ReadLine();
             return(CheckPassword(password));
         }
     }
 }
Example #2
0
 private static string CheckPassword(string password)
 {
     if (password == "-1")
     {
         return(password);//if the user want to go back to the menu
     }
     else
     {
         bool temp = kanban.IsValidPassword(password);
         if (temp)
         {
             return(password);
         }
         else// if the password is invalid
         {
             Console.ForegroundColor = ConsoleColor.Red;
             Log.Warn("Invalid input: password do not contain the requested elements");
             Console.WriteLine("please enter a valid password, make sure it has valid length and includes all the requested characters.");
             Console.ResetColor();
             Console.Write("Password : ");
             password = Console.ReadLine();
             return(CheckPassword(password));
         }
     }
 }