Raised This Month: $ Target: $400
 0% 

Call Admin with XMPP(Jabber)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
grimd34th
SourceMod Donor
Join Date: Jun 2011
Plugin ID:
1446
Plugin Version:
1.1
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Allows players to call an admin with a message which is sent to XMPP(Jabber)
    Old 09-29-2011 , 14:11   Re: Call Admin with XMPP(Jabber)
    Reply With Quote #1

    also, a better index.php that doesnt throw errors about seckey
    PHP Code:
    <?php

    $cfg
    ['xmpp_server']        = ''//The XMPP server to connect to
    $cfg['xmpp_port']        = 5222//The XMPP port to use
    $cfg['xmpp_user']        = ''//The User of the XMPP server to connect with (do not include @domain.com)
    $cfg['xmpp_pass']        = ''//The Password to the User of the XMPP server to connect with
    $cfg['xmpp_resource']    = 'xmpphp'//The Resource base which (leave default if unsure, its only extra info)
    $cfg['xmpp_domain']        = ''//The Domain to which the User belongs (do not include @)
    $cfg['seckey']             = ''//Security Key set in caxmpp_seckey convar
    $cfg['recipents']        = ''//Comma Seperated list of recipients to message
    if(isset($_POST['seckey'])) { $seckey $_POST['seckey']; } else { $seckey ''; }
    if(
    $seckey != $cfg['seckey'])
        die(
    "Unauthorized Access");

    include 
    'XMPPHP/XMPP.php';

    #Use XMPPHP_Log::LEVEL_VERBOSE to get more logging for error reports
    #If this doesn't work, are you running 64-bit PHP with < 5.2.6?
    $conn = new XMPPHP_XMPP($cfg['xmpp_server'], $cfg['xmpp_port'], $cfg['xmpp_user'], $cfg['xmpp_pass'], $cfg['xmpp_resource'], $cfg['xmpp_domain'], $printlog=false$loglevel=XMPPHP_Log::LEVEL_INFO);

    $message strip_tags(base64_decode($_POST['message']));
    $recipents explode(','$cfg['recipents']);
    try
    {
        
    $conn->connect();
        
    $conn->processUntil('session_start');
        
    $conn->presence();
        foreach(
    $recipents as $recipent)
        {
            
    $conn->message($recipent$message);
        }
        
    $conn->disconnect();
    }
    catch(
    XMPPHP_Exception $e
    {
        die(
    $e->getMessage());
    }
    ?>
    grimd34th is offline
    SirHaxalot
    Junior Member
    Join Date: Jul 2009
    Old 10-01-2011 , 07:22   Re: Call Admin with XMPP(Jabber)
    Reply With Quote #2

    I've gotten an error. Every time someone tries to call an admin the plugin throws an exception

    "L10/01/2011 - 13:21:21: [call_admin_xmpp.xms] socket error 3 (errorno 10061)"
    __________________
    SirHaxalot is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 20:53.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode