using System;
using System.Text;
namespace edu.jhu.Cas.Util {
    
    public class User {
        public string MyDBHost, MyDBName, UserID, Name, Email, Privileges, PWEncrypted;
        public bool GVisible;
        public long WebServicesID, CreatedBy;
        public int EmailLevel, MyDBMinSize, MyDBMaxSize;
        public DateTime TimeCreated, LastModified;
        public string[] OpenID;
        public string KeystoneID;
        public static string Revision = "$Revision: 145898 $";
    }
    public class CJUser {
        public string UserID, Name, Email, Privileges, Password;
        public bool GVisible;
        public long WebServicesID;
        public int EmailLevel;
        public DateTime TimeCreated;
    }
    public abstract class CJUserHelper {
        const int col = 20;
        public static string CJUser2String(CJUser cju){
            StringBuilder sb = new StringBuilder();
            sb.AppendLine("UserID".PadRight(col)+fstr(cju.UserID));
            sb.AppendLine("WSID".PadRight(col) + cju.WebServicesID);
            sb.AppendLine("Name".PadRight(col) + fstr(cju.Name));
            sb.AppendLine("Email".PadRight(col) + fstr(cju.Email));
            sb.AppendLine("Privs".PadRight(col) + fstr(cju.Privileges));
            sb.AppendLine("Password".PadRight(col) + fstr(cju.Password));
            sb.AppendLine("GVisible".PadRight(col) + cju.GVisible);
            sb.AppendLine("EmailLevel".PadRight(col) + cju.EmailLevel);
            sb.AppendLine("TimeCreated".PadRight(col) + cju.TimeCreated);
            return sb.ToString();
        }
        static string fstr(string s){
            if(s == null) return "'$NULL$'";
            else return "'"+s+"'";
        }
    }
}