@@ -59,6 +59,12 @@ private class Options
5959
6060 [ Option ( "reallow-user" , HelpText = "Re-allow a user to register. Username option is required if this is set." ) ]
6161 public bool ReallowUser { get ; set ; }
62+
63+ [ Option ( "disallow-email" , HelpText = "Disallow the email from being used by anyone in the future. Email option is required if this is set." ) ]
64+ public bool DisallowEmail { get ; set ; }
65+
66+ [ Option ( "reallow-email" , HelpText = "Re-allow the email to be used by anyone. Email option is required if this is set" ) ]
67+ public bool ReallowEmail { get ; set ; }
6268
6369 [ Option ( "rename-user" , HelpText = "Changes a user's username. (old) username or Email option is required if this is set." ) ]
6470 public string ? RenameUser { get ; set ; }
@@ -188,10 +194,28 @@ private void StartWithOptions(Options options)
188194 }
189195 else Fail ( "No username was provided" ) ;
190196 }
197+ else if ( options . DisallowEmail )
198+ {
199+ if ( options . EmailAddress != null )
200+ {
201+ if ( ! this . _server . DisallowEmail ( options . EmailAddress ) )
202+ Fail ( "Email address is already disallowed" ) ;
203+ }
204+ else Fail ( "No email address was provided" ) ;
205+ }
206+ else if ( options . ReallowEmail )
207+ {
208+ if ( options . EmailAddress != null )
209+ {
210+ if ( ! this . _server . ReallowEmail ( options . EmailAddress ) )
211+ Fail ( "Email address is already allowed" ) ;
212+ }
213+ else Fail ( "No email address was provided" ) ;
214+ }
191215 else if ( options . RenameUser != null )
192216 {
193217 if ( string . IsNullOrWhiteSpace ( options . RenameUser ) )
194- Fail ( "Username must contain content" ) ;
218+ Fail ( "Email address must contain content" ) ;
195219
196220 GameUser user = this . GetUserOrFail ( options ) ;
197221 this . _server . RenameUser ( user , options . RenameUser , options . Force ) ;
0 commit comments