Advertisement
Guest User

FBcheckAB

a guest
Aug 19th, 2017
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.53 KB | None | 0 0
  1. <?php
  2. $home = posix_getpwuid(posix_getuid());
  3. $home = $home['dir'];
  4. # Figure out in which subfolder we are installed
  5.  
  6. $psubfolder = __FILE__;
  7. $psubfolder = preg_replace('/(.*)\/(.*)\/(.*)$/',"$2", $psubfolder);
  8. //Get conffile
  9.  
  10. $fritzloxconf = parse_ini_file("$home/config/plugins/$psubfolder/fritzlox.conf",True);
  11.  
  12. $FBIP = $fritzloxconf['general']['FritzboxIP']; $FBLogin = $fritzloxconf['general']['FBLogin']; $FBPass = $fritzloxconf['general']['FBPass'];
  13. $cmd = (isset($_GET['cmd'])) ?$_GET['cmd'] : "";
  14. if (php_sapi_name() == 'cli') $cmd = "ABgetList";
  15.  
  16. if(strlen($cmd) > 0) {
  17.         switch ($cmd) {
  18.         case "deleteMSG":
  19.                 $client = new SoapClient(
  20.                                 null,
  21.                                 array(
  22.                         'location'   => "http://192.168.178.1:49000/upnp/control/x_tam",
  23.                         'uri' => "urn:dslforum-org:service:X_AVM-DE_TAM:1",
  24.                         'noroot' => True,
  25.                         'login' => $FBLogin,
  26.                         'password' => $FBPass
  27.                         ));
  28.                         // Gibt die Url mit SID aus
  29.                         $result = $client->GetMessageList(new SoapParam(0, 'NewIndex'));
  30.                         //print_r($result);
  31.                         $xml = @simplexml_load_file($result);
  32.                         echo count($xml);
  33.                         $data = @file_get_contents($result);
  34.          
  35.                        
  36.         } } else {
  37.         echo "kein Befehl angegeben.";
  38. }
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement