Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- prontera,168,190,3 script Painel de Controle#1-1 902,{
- //Cooldown bruteforce prevent for password - in seconds
- set .@pin_cooldown, 60;
- //Max input for password
- set .@max_pin, 9999;
- set .@min_pin, 1000;
- //Ask for password again if already were auth? 0 = Yes. 1 = No.
- set .@cp_authrc, 0;
- //Max attempts to auth
- set .@cp_maxattp, 4;
- query_sql("SELECT `user_pass` FROM `login` WHERE `account_id`="+getcharid(3)+" LIMIT 1",@acc_pin);
- mes "[Painel de Controle]";
- mes "Olá, ^FF0000"+strcharinfo(0)+"^000000";
- mes "Deseja acessar seu painel de controle?";
- next;
- if(select("^00B2EE[ • ]^000000 Sim.:^CD0000[ • ]^000000 Não.")==2) close;
- //Cooldown output
- if( #CP_pindelay > gettimetick(2) )
- {
- mes "[Painel de Controle]";
- mes "Você errou sua senha mais de ^FF0000"+.@cp_maxattp+"^000000 vezes.";
- mes "Tempo restante para poder acessar o painel novamente: ^FF0000"+callfunc("Time2Str",#CP_pindelay)+"^000000";
- close;
- }
- //PIN detected, ask for check
- //if( @acc_pin && !@cp_canpass )
- //{
- // mes "[Painel de Controle]";
- // mes "Insira sua senha.";
- // mes "Máximo número de tentativas: ^FF0000"+.@cp_maxattp+"^000000";
- // mes "Tentativas falhas: ^FF0000"+#CP_trycount+"^000000";
- // next;
- // input @try_pid;
- //
- // //Wrong PIN
- // if(@try_pid !=@acc_pin)
- // {
- // set #CP_trycount, #CP_trycount+1;
- // mes "[Painel de Controle]";
- // mes "Senha incorreta.";
- // mes "Tentativas falhas: ^FF0000"+#CP_trycount+"^000000";
- //
- // //Over attempted
- // if(#CP_trycount >= .@cp_maxattp)
- // {
- // set #CP_trycount, 0;
- // set #CP_pindelay, gettimetick(2) + .@pin_cooldown;
- // mes "Seu acesso ao painel foi bloqueado por ^FF0000"+(.@pin_cooldown/60)+" minuto(s).^000000";
- // }
- // close;
- // }
- //
- // //PIN matches
- // else
- // {
- // set #CP_trycount, 0;
- // mes "[Painel de Controle]";
- // mes "Senha correta.";
- // mes "^0000FFVocê agora está autenticado^000000.";
- // next;
- // }
- //}
- //Auth is OK, you are allowed to access CP
- set @cp_canpass, .@cp_authrc;
- //Fill account data
- query_sql("SELECT `userid`,`email` FROM `login` WHERE `account_id`="+getcharid(3)+"", @userid$, @email$);
- mes "[^3240C0Painel de Controle^000000]";
- mes "Login: ^FF0000"+@userid$+"^000000";
- mes "E-mail: ^FF0000"+@email$+"^000000";
- mes "";
- if( !getgroupid() )
- {
- mes "^FF0000Você não é um usuário VIP^000000.";
- }
- else if(getgroupid() == 1)
- {
- mes "^FF0000Você é um usuário VIP^000000.";
- }
- mes "";
- mes "Oque deseja fazer?";
- next;
- switch(select("^00B2EE[ • ]^000000 Trocar Senha","^00B2EE[ • ]^000000 Trocar E-mail",""))
- {
- mes "[^3240C0Painel de Controle^000000]";
- //Pass change
- case 1:
- mes "Senha atual: ^FF0000"+@user_pass$+"^000000";
- mes "Insira nova senha.";
- mes "^FF0000Nova senha deve ter no mínimo 4 digitos e no máximo 20.^000000.";
- next;
- input @try_pass$;
- mes "[^3240C0Painel de Controle^000000]";
- if(getstrlen(@try_pass$) < 4 || getstrlen(@try_pass$) > 20 || callfunc("strcheck_spell",@try_pass$) )
- {
- mes "Senha inválida.";
- close;
- }
- mes "Senha escolhida: ^0000FF"+@try_pass$+"^000000";
- mes "Você deseja realmente trocá-la?";
- next;
- if(select("^CD0000[ • ]^000000 Não.:^00B2EE[ • ]^000000 Sim.")==1) close;
- query_sql("UPDATE `login` SET `user_pass`='"+escape_sql(@try_pass$)+"' WHERE `account_id`="+getcharid(3)+" LIMIT 1");
- mes "[^3240C0Painel de Controle^000000]";
- mes "Senha trocada com sucesso.";
- mes "Nova senha: ^0000FF"+@try_pass$+"^000000";
- break;
- //Mail change
- case 2:
- mes "Email atual: ^FF0000"+@email$+"^000000";
- mes "Insira novo email.";
- mes "^FF0000Sem o servidor do email, no caso se o email for usuario@servidor.com.br você deve digitar apenas o usuario^000000";
- next;
- input @try_email$;
- mes "[^3240C0Painel de Controle^000000]";
- mes "Qual o servidor do email? Escolha um da lista ou a opção para digitar o servidor de seu email.";
- next;
- switch(select("^00B2EE[ • ]^000000 @hotmail.com","^00B2EE[ • ]^000000 @gmail.com","^00B2EE[ • ]^000000 Digitar Servidor"))
- {
- case 1: set @at_mail$, "@hotmail.com"; break;
- case 2: set @at_mail$, "@gmail.com"; break;
- default:
- mes "Digite seu servidor de email, no caso se o email for usuario@servidor.com.br você deve digitar apenas o @servidor.com.br correspondente ao seu. (Ex: @uol.com.br, @yahoo.com, etc)";
- input @try_at$;
- if( !compare(@try_at$,"@") )
- {
- mes "[^3240C0Painel de Controle^000000]";
- mes "Email inválido.";
- mes "Você deve utilizar @servidor.com.br (Ex: @uol.com.br, @yahoo.com, etc). Não esqueça do @";
- close;
- }
- set @at_mail$, @try_at$;
- break;
- }
- set @try_email$, @try_email$ + @at_mail$;
- next;
- mes "Email escolhido: ^0000FF"+@try_email$+"^000000";
- mes "Você deseja realmente trocá-lo?";
- next;
- if(select("^CD0000[ • ]^000000 Não.:^00B2EE[ • ]^000000 Sim.")==1) close;
- query_sql("UPDATE `login` SET `email`='"+escape_sql(@try_email$)+"' WHERE `account_id` ="+getcharid(3)+" LIMIT 1");
- mes "[^3240C0Painel de Controle^000000]";
- mes "Email trocado.";
- mes "Novo email: ^0000FF"+@try_email$+"^000000";
- break;
- }
- close;
- OnInit:
- setarray .message$,
- "[Painel de Controle]",
- "[Trocar Senha]",
- "[Trocar E-mail]";
- set .message_size,getarraysize( .message$ );
- while( .message_size ){
- delwaitingroom;
- waitingroom ""+.message$[ rand( .message_size ) ],0;
- sleep 500;
- end;
- }
- }
- //Function works in order to prevent special character strings on email, pass, whatever
- //Returns:
- //1 = Contains manned character
- //0 = Passed by, its clean
- function script strcheck_spell {
- if( compare("%",getarg(0)) )
- {
- return 1;
- }
- return 0;
- }
- //Convert position login screen to array alocated position
- //Return:
- //-1: fail, isn't on the array
- //X: position in login screen
- function script index2alocpos {
- for(set @j,0; @j < getarraysize(@cid_handle); set @j, @j+1)
- {
- if(getarg(0) == @pos_handle[@j])
- {
- //Return array pos
- return @j;
- }
- }
- //No matches found
- return -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement