Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $home = posix_getpwuid(posix_getuid());
- $home = $home['dir'];
- # Figure out in which subfolder we are installed
- $psubfolder = __FILE__;
- $psubfolder = preg_replace('/(.*)\/(.*)\/(.*)$/',"$2", $psubfolder);
- //Get conffile
- $fritzloxconf = parse_ini_file("$home/config/plugins/$psubfolder/fritzlox.conf",True);
- $FBIP = $fritzloxconf['general']['FritzboxIP']; $FBLogin = $fritzloxconf['general']['FBLogin']; $FBPass = $fritzloxconf['general']['FBPass'];
- $cmd = (isset($_GET['cmd'])) ?$_GET['cmd'] : "";
- if (php_sapi_name() == 'cli') $cmd = "ABgetList";
- if(strlen($cmd) > 0) {
- switch ($cmd) {
- case "deleteMSG":
- $client = new SoapClient(
- null,
- array(
- 'location' => "http://192.168.178.1:49000/upnp/control/x_tam",
- 'uri' => "urn:dslforum-org:service:X_AVM-DE_TAM:1",
- 'noroot' => True,
- 'login' => $FBLogin,
- 'password' => $FBPass
- ));
- // Gibt die Url mit SID aus
- $result = $client->GetMessageList(new SoapParam(0, 'NewIndex'));
- //print_r($result);
- $xml = @simplexml_load_file($result);
- echo count($xml);
- $data = @file_get_contents($result);
- } } else {
- echo "kein Befehl angegeben.";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement