* Finally fixed /user group and /user password.

* Had to fix UserManager exceptions to UserNotExistException instead of UserExistsException.
* Added /user help as well. Commented out the old short circuit for now.
This commit is contained in:
Graham Cantin 2011-07-24 20:28:07 -07:00
parent 71d05f51ec
commit 3dd7af1a30
2 changed files with 93 additions and 16 deletions

View file

@ -147,8 +147,8 @@ namespace TShockAPI.DB
{
try
{
if (database.Query("UPDATE Users SET Password = @0 WHERE Username = @1;", Tools.HashPassword(password), user.Name) < 1)
throw new UserExistsException(user.Name);
if (database.Query("UPDATE Users SET Password = @0 WHERE Username = @1;", Tools.HashPassword(password), user.Name) == 0)
throw new UserNotExistException(user.Name);
}
catch (Exception ex)
{
@ -168,8 +168,8 @@ namespace TShockAPI.DB
if (!TShock.Groups.GroupExists(group))
throw new GroupNotExistsException(group);
if (database.Query("UPDATE Users SET UserGroup = @0 WHERE Username = @1;", group, user.Name) < 1)
throw new UserExistsException(user.Name);
if (database.Query("UPDATE Users SET UserGroup = @0 WHERE Username = @1;", group, user.Name) == 0)
throw new UserNotExistException(user.Name);
}
catch (Exception ex)
{