Specifications

Aastra July 2014 PA-001011-03-04
310
$output .= "<Text>Reboot.</Text>\n";
$output .= "</AastraIPPhoneTextScreen>\n";
break;
default:
# Input Password
if ($password=='')
{
$output = "<AastraIPPhoneInputScreen type=\"number\"
password=\"yes\" LockIn=\"yes\" destroyOnExit=\"yes\">\n";
$output .= "<Title>Logout</Title>\n";
$output .= "<Prompt>Enter Password</Prompt>\n";
$output .= "<URL>$XML_SERVER?extension=$extension</URL>\n";
$output .= "<Parameter>password</Parameter>\n";
$output .= "<Default></Default>\n";
$output .= "</AastraIPPhoneInputScreen>\n";
}
else
{
# IF authentication fails
if (!verify_user($extension,$password))
{
# Display error
$output = "<AastraIPPhoneTextScreen LockIn=\"yes\"
destroyOnExit=\"yes\">\n";
$output .= "<Title>Authentication failed</Title>\n";
$output .= "<Text>Wrong credentials.</Text>\n";
$output .= "</AastraIPPhoneTextScreen>\n";
}
else
{
# Get MAC address and type of phone
$value=Aastra_decode_HTTP_header();
# Erase mac.cfg
delete_mac($value[1]);
# Update config file
update_config_file($extension);
# Reboot needed
$output = "<AastraIPPhoneExecute>\n";
$output .= "<ExecuteItem
URI=\"".$XML_SERVER."?action=display"."\"/>\n";
$output .= "<ExecuteItem URI=\"Command:
FastReboot\"/>\n";
$output .= "</AastraIPPhoneExecute>\n";
}
}
break;
}
# Display XML Object
header("Content-Type: text/xml");
header("Content-Length: ".strlen($output));
echo $output;
exit;
?>