Example #1
0
 /**
  * Singleton, damit die Module auf alle
  * benoetigten Variablen zugreifen koennen
  */
 public static function getInstance()
 {
     if (self::$_instance === null) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Example #2
0
 public function execute()
 {
     $instance = CenterBot::getInstance();
     $text = $instance->_actionRaw;
     if (execute('which elizatalk') != '') {
         echo execute('echo ' . escapeshellarg($text) . ' | elizatalk');
     }
 }
Example #3
0
 public function execute()
 {
     if (execute('which traceroute') != '') {
         echo execute('traceroute ' . escapeshellarg(CenterBot::getInstance()->_actionText));
     } else {
         echo 'Error: system comand (traceroute) not found';
     }
 }
Example #4
0
 public function execute()
 {
     $instance = CenterBot::getInstance();
     if ($instance->_actionText != '') {
         echo 'result: ' . $this->calculate($instance->_actionText);
     } else {
         echo 'syntax: calc <expression>';
     }
 }
Example #5
0
 public function execute()
 {
     $instance = CenterBot::getInstance();
     foreach ($instance->_modules as $key => $value) {
         $modules[] = $key;
     }
     $modules = implode(', ', $modules);
     echo "Registed Actions: {$modules}\n";
     echo "Default Action: " . (class_exists('CenterBot_Module_Default') ? 'Enabled' : 'Disabled');
 }
Example #6
0
 public function execute()
 {
     if (CenterBot::getInstance()->_actionText != '') {
         $result = $this->search(array('q' => CenterBot::getInstance()->_actionText));
         echo "Insgesamt mehr als " . $result->responseData->cursor->estimatedResultCount . " Ergebnisse";
         foreach ($result->responseData->results as $array) {
             echo "\n - " . $array->titleNoFormatting . ': ' . $array->url;
         }
     }
 }
Example #7
0
 public function execute()
 {
     $instance = CenterBot::getInstance();
     $userlevel = $instance->checkUser();
     switch ($userlevel) {
         case CenterBot::AUTH_SUPERADMIN:
             echo "Du bist als Superadmin authentifiziert";
             break;
         case CenterBot::AUTH_ADMIN:
             echo "Du bist als Admin authentifiziert";
             break;
         case CenterBot::AUTH_USER:
             echo "Du bist als Standardbenutzer authentifiziert";
             break;
         case CenterBot::AUTH_IGNORE:
             echo "Dein Account wurde geblockt";
             break;
     }
 }
Example #8
0
 public function execute()
 {
     if (execute('which fping') != '') {
         echo execute('fping ' . escapeshellarg(CenterBot::getInstance()->_actionText));
     }
 }
Example #9
0
 public function execute()
 {
     echo execute('ping -c 3 ' . escapeshellarg(CenterBot::getInstance()->_actionText));
 }
Example #10
0
 public function execute()
 {
     $params = explode(' ', CenterBot::getInstance()->_actionText);
     echo execute('nmap -p ' . escapeshellarg($params[0]) . ' ' . escapeshellarg($params[1]));
 }
Example #11
0
<?php

/**
 * PHP CenterBot for CenterIM
 */
require_once 'class.php';
require_once 'interface.php';
require_once 'functions.php';
// Starte Klasse
$bot = CenterBot::getInstance();
// Lade alle vorhandenen Module
$modules = scandir(dirname(__FILE__) . '/modules');
unset($modules[0], $modules[1]);
foreach ($modules as $module) {
    include_once 'modules/' . $module;
}
// Registriere Administratoren
$bot->registerSuperadmin('206092388', 'icq');
// Fuehre aktuelles Kommando aus
$bot->finish();