Пример #1
0
 public bool MyAddUserToGroup(string username, string groupname)
 {
     try
     {
         if (!AdminCheck(adminToken))
         {
             panel.StringInput[SerialInputJoins.AddUserToGroupErrMsg].StringValue =
                 "You do not have sufficient access to perform this operation";
             return(false);
         }
         if (Authentication.AddUserToGroup(ref adminToken, username, groupname))
         {
             CrestronConsole.PrintLine("{0} has been added to {1}", username, groupname);
             return(true);
         }
         else
         {
             panel.StringInput[SerialInputJoins.AddUserToGroupErrMsg].StringValue =
                 String.Format("{0} could not be added to {1}", username, groupname);
             return(false);
         }
     }
     catch (Exception e)
     {
         WriteError("MyAddUserToGroup", e, SerialInputJoins.AddUserToGroupErrMsg);
         return(false);
     }
     finally
     {
     }
 }