Skip to content
Extraits de code Groupes Projets
Sélectionner une révision Git
  • 1aadd8e2ec6c4ddcd65bb6b9820460479ea93446
  • master par défaut protégée
  • rust-playlist-sync
  • rust
  • fix-qt-deprecated-qvariant-type
  • fix-mpris-qtwindow-race-condition
  • rust-appimage-wayland
  • windows-build-rebased
  • v2.5 protégée
  • v2.4 protégée
  • v2.3-1 protégée
  • v2.3 protégée
  • v2.2 protégée
  • v2.1 protégée
  • v2.0 protégée
  • v1.8-3 protégée
  • v1.8-2 protégée
  • v1.8-1 protégée
  • v1.8 protégée
  • v1.7 protégée
  • v1.6 protégée
  • v1.5 protégée
  • v1.4 protégée
  • v1.3 protégée
  • v1.2 protégée
  • v1.1 protégée
  • v1.0 protégée
27 résultats

astyle.bash

Blame
  • Usurp.pm 1,49 Kio
    package Usurp; # right = owner ; command = usurp
    
    
    use strict;
    use warnings;
    
    
    # ###
    #  usurp_main
    # Usurpe l'identité d'un autre utilisateur le temps d'une commande, si le user
    # est admin
    # 
    # Usage :
    #  !usurp [<reply to>] nick!user@host command ...
    # ###
    sub usurp_main
    {
    	my ($conn, $event, $reply_to, $ref_params) = @_;
    	
    	return 0 unless defined($ref_params->[1]);
    	
    	$reply_to = lc $reply_to;
    	
    	if($ref_params->[0] !~ /^(.*?)!(.*?)\@(.*?)$/i)
    	{
    		$reply_to = shift @{$ref_params};
    	}
    	
    	my $unh = shift @{$ref_params};
    	my $commande = shift @{$ref_params};
    	
    	if($unh =~ /^(.*?)!(.*?)\@(.*?)$/i)
    	{
    		my ($nick, $user, $host) = ($1, $2, $3);
    		
    		$event->{'from'} = $unh;
    		$event->{'nick'} = $nick;
    		$event->{'user'} = $user;
    		$event->{'host'} = $host;
    		$event->{'userhost'} = $user.'@'.$host;
    	}
    	else
    	{
    		return 0;
    	}
    	
    	$event->{'to'}[0] = $reply_to;
    	$event->{'args'} = [
    		$Config::command_sign.$commande.' '.join(' ', @{$ref_params})
    	];
    	
    	$::logger->debug("Running process_command with identity '$unh'");
    	$conn->{'cmdtool'}->process_command($commande, $ref_params, $conn, $event, $reply_to);
    	
    	return 1;
    } # Fin usurp_main
    
    
    # ###
    #  usurp_help
    # Affiche l'aide de la commande '!usurp'
    # ###
    sub usurp_help
    {
    	my ($self, $event, $reply_to, $ref_params) = @_;
    	
    	$self->privmsg($reply_to, "`".$Config::command_sign."usurp [<reply to>] ".
    	               "nick!user\@host command ...` ".
    				   "=> usurp a user, and a chan if provided, for a command");
    	
    	return 1;
    } # Fin usurp_help
    
    1;
    
    __END__