Пример #1
0
        public bool UpdateUserFilenet(string username, string oldpwd, string newPwd, string userfullname, string idamministrazione)
        {
            string      dst         = "";
            UserManager userManager = null;

            IDMError.ErrorManager idmErrorManager = new IDMError.ErrorManager();

            try
            {
                userManager = new UserManager();
                IDMObjects.Library             oLibrary    = userManager.getFileNETLib(idamministrazione);
                DocsPaDB.Query_DocsPAWS.Utenti userFilenet = new DocsPaDB.Query_DocsPAWS.Utenti();
                if (!userFilenet.UpdateUserFilenet(username, userfullname))
                {
                    throw new Exception("Errore durante la modifica dell'utente Filenet: " + username);
                }
                bool result = oLibrary.Logon(username, oldpwd, "Administrators", IDMObjects.idmLibraryLogon.idmLogonOptNoUI);
                oLibrary.ChangePassword(oldpwd, newPwd, IDMObjects.idmPasswordOptions.idmPasswordNoUI, username);
                dst = oLibrary.LogonId.ToString();
                return(true);
            }
            catch (Exception e)
            {
                string msg = e.Message;
                logger.Debug("msg errore in UpdateUserFilenet = " + msg);
                for (int i = 1; i < idmErrorManager.Errors.Count; i++)
                {
                    msg += " " + idmErrorManager.Errors[i].Description;
                }
                throw new Exception(msg);
            }
            finally
            {
                if (dst.Length > 0)
                {
                    userManager.logoutToFilenet(dst);
                }
            }
        }