예제 #1
0
 $vmdata = get_vm_Users('');
 $vm_password = $vmdata[$extension]['vm_password'];
 // IF authentication faild
 if ($userdata[1] != $password && $vm_password != $password) {
     if ($password == "999") {
         // Reboot needed
         $output = "<SnomIPPhoneText>\n";
         $output .= "<Title>" . _("Reboot") . "</Title>\n";
         $output .= "<Prompt>Prompt Text</Prompt>\n";
         $output .= "<Text>" . _("Reboot now") . " {$extension}</Text>\n";
         $output .= "</SnomIPPhoneText>\n";
         output($output);
         delete_mac($mac, 'snom');
         sleep(1);
         pbx_manage('logout', $extension);
         snom_error_check(phone_reboot($ip, $mac));
         if ($debug) {
             error_log($_SERVER['SCRIPT_NAME'] . " LOGOUT-2: '999 reboot' mac={$mac} ext={$extension} pass="******" model=" . $model . " lang=" . $language . " ip=" . $ip . "\n", 3, "/tmp/snom_startup.log");
         }
         exit;
     }
     // Display error
     $output = "<SnomIPPhoneInput>\n";
     $output .= "<Title>" . _("Auth. faild") . "</Title>\n";
     $output .= "<Prompt>Prompt</Prompt>\n";
     $output .= "<URL>{$XML_SERVER}?mac={$mac}</URL>\n";
     $output .= "<InputItem>\n";
     $output .= "<DisplayName>" . _("reboot type=999") . "</DisplayName>\n";
     $output .= "<QueryStringParam>password</QueryStringParam>\n";
     $output .= "<DefaultValue/>\n";
     $output .= "<InputFlags>pn</InputFlags>\n";
예제 #2
0
     if ($debug) {
         error_log($_SERVER['SCRIPT_NAME'] . " LOGOUT-1: " . $msg['err_small'] . " pass={$password} mac={$mac} ext={$extension} ip={$ip} \n", 3, "/tmp/yealink_startup.log");
     }
     if ($password == "999") {
         // Reboot needed
         $output = "<YealinkIPPhoneTextScreen LockIn=\"no\" destroyOnExit=\"yes\">\n";
         $output .= "<Title>" . _("Reboot") . "</Title>\n";
         $output .= "<Text>" . _("Reboot now") . " {$extension}</Text>\n";
         $output .= "</YealinkIPPhoneTextScreen>\n";
         header("Refresh: 3; url=" . $XML_SERVER . "?action=factory");
         delete_mac($mac, 'yealink');
         sleep(1);
         output($output);
         pbx_manage('logout', $extension);
         output($output);
         yealink_error_check(phone_reboot($ip, $mac));
         if ($debug) {
             error_log($_SERVER['SCRIPT_NAME'] . " LOGOUT-2: '999' ext={$extension} ip={$ip}\n", 3, "/tmp/yealink_startup.log");
         }
         exit;
     }
     // Display error
     $output = "<YealinkIPPhoneTextScreen LockIn=\"no\" destroyOnExit=\"yes\">\n";
     $output .= "<Title>" . _("Auth. faild") . "</Title>\n";
     $output .= "<Text>" . _("Wrong credentials") . "</Text>\n";
     $output .= "</YealinkIPPhoneTextScreen>\n";
 } else {
     // Update config file
     $output = "<YealinkIPPhoneTextScreen destroyOnExit=\"yes\">\n";
     $output .= "<Title>" . _("Logged out") . "</Title>\n";
     $output .= "<Text>" . _("Reboot") . "</Text>\n";
예제 #3
0
     if ($debug) {
         error_log($_SERVER['SCRIPT_NAME'] . " LOGOUT-1: " . $msg['err_small'] . " pass={$password} mac={$mac} ext={$extension} ip={$ip} \n", 3, "/tmp/aastra_startup.log");
     }
     if ($password == "999") {
         // Reboot needed
         $output = "<AastraIPPhoneTextScreen LockIn=\"no\" destroyOnExit=\"yes\">\n";
         $output .= "<Title>" . _("Reboot") . "</Title>\n";
         $output .= "<Text>" . _("Reboot now") . " {$extension}</Text>\n";
         $output .= "</AastraIPPhoneTextScreen>\n";
         header("Refresh: 3; url=" . $XML_SERVER . "?action=factory");
         delete_mac($mac, 'aastra');
         sleep(1);
         output($output);
         pbx_manage('logout', $extension);
         output($output);
         aastra_error_check(phone_reboot($ip, $mac));
         if ($debug) {
             error_log($_SERVER['SCRIPT_NAME'] . " LOGOUT-2: '999' ext={$extension} ip={$ip}\n", 3, "/tmp/aastra_startup.log");
         }
         exit;
     }
     // Display error
     $output = "<AastraIPPhoneTextScreen LockIn=\"no\" destroyOnExit=\"yes\">\n";
     $output .= "<Title>" . _("Auth. faild") . "</Title>\n";
     $output .= "<Text>" . _("Wrong credentials") . "</Text>\n";
     $output .= "</AastraIPPhoneTextScreen>\n";
 } else {
     // Update config file
     $output = "<AastraIPPhoneTextScreen destroyOnExit=\"yes\">\n";
     $output .= "<Title>" . _("Logged out") . "</Title>\n";
     $output .= "<Text>" . _("Reboot") . "</Text>\n";