Exemplo n.º 1
0
 public Group(string name)
 {
     this.Name=name;
     string ch_ContentsFileGroups=Outils.ReadFile(Groups.cch_FileGroup);
     string[] lines = ch_ContentsFileGroups.Split('\n');
     foreach (string line in lines)
     {
         //ccache:x:48:gaetan
         if (line.Split(':')[0]==this.Name)
         {
             try
             {
                 this.Id=Convert.ToInt32(line.Split(':')[2]);
                 //now find users
                 string[] ch_Users = line.Split(':')[3].ToString().Split(',');
                 foreach (string ch_User in ch_Users)
        				{
                     User user = new User(ch_User);
                     this._users.Add(user);
                 }
             }
             catch{}
             break;
         }
     }
 }
Exemplo n.º 2
0
 public static List<User> GetAllUsers()
 {
     List<User> users = new List<User>();
     string ch_ContentsFileUsers=Outils.ReadFile(Groups.cch_FileUser);
     string[] lines = ch_ContentsFileUsers.Split('\n');
     foreach (string line in lines)
     {
         if(line.Split(':')[0].ToString().Trim()!="")
         {
             User user = new User(line.Split(':')[0]);
             users.Add(user);
         }
     }
     return users;
 }
Exemplo n.º 3
0
 protected void OnSelectionUser(object o, EventArgs args)
 {
     try
     {
      	TreeModel model;
          if (((TreeSelection)o).GetSelected(out model, out iter))
         {
             string T =(string)model.GetValue (iter, 0);
             UserSelect=T;
             User user = new User(T);
             SAI_Name.Text=T;
             SAI_Comment.Text=user.Comment;
             SAI_Shell.Text=user.Shell;
             SAI_Home.Text=user.Home;
             SAI_Pass.Text="";
             FindGroupUser(user.Name);
         }
     }
     catch{}
 }