File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -327,9 +327,29 @@ function GmClear()
327327end
328328
329329function AcctCreate ()
330- local param = ma_parameter :GetText ()
331- MangAdmin :ChatMsg (" .account create " .. param )
332- MangAdmin :LogAction (" Created account: " .. param )
330+ local input = ma_parameter :GetText ()
331+ local params = {}
332+ local fail = false
333+ for w in input :gmatch (" %S+" ) do table.insert (params , w ) end
334+ if (params [1 ] == nil or params [2 ] == nil ) then
335+ print (" |cffFF0000You must enter 2 parameters!|r" )
336+ return
337+ end
338+ if (string.len (params [1 ]) < 2 or string.len (params [1 ]) > 12 ) then
339+ print (" |cffFF0000" .. params [1 ] .. " |r is not a valid username\n |cff00FF00Account username must be betweem 2 and 12 characters!|r" )
340+ fail = true
341+ end
342+ if (string.len (params [2 ]) > 16 or string.len (params [2 ]) < 3 ) then
343+ print (" |cffFF0000" .. params [2 ] .. " |r is not a valid password\n |cff00FF00Account password must be betweem 3 and 16 characters!|r" )
344+ fail = true
345+ end
346+ if (fail ) then
347+ print (" |cffFF0000Creation aborted!|r" )
348+ return
349+ end
350+ MangAdmin :ChatMsg (" .account create " .. params [1 ] .. " " .. params [2 ])
351+ print (" |cff00FF00Account created successfully|r" )
352+ MangAdmin :LogAction (" Created account: " .. params [1 ] .. " " .. params [2 ])
333353end
334354
335355function AcctDelete ()
You can’t perform that action at this time.
0 commit comments