Portions created by the Initial Developer are Copyright (C) 2008-2012 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ //includes require_once "root.php"; require_once "resources/require.php"; require_once "resources/check_auth.php"; //check permissions if (permission_exists('extension_edit')) { //access granted } else { echo "access denied"; exit; } //add multi-lingual support $language = new text; $text = $language->get(); //verify the id is as uuid then set as a variable if (is_uuid($_GET['id'])) { $extension_uuid = $_GET['id']; } //get the extensions $sql = "select * from v_extensions "; $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; $sql .= "and enabled = 'true' "; $sql .= "order by extension asc "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); $extensions = $prep_statement->fetchAll(PDO::FETCH_NAMED); unset ($prep_statement, $sql); //get the extension if (is_uuid($_GET['id'])) { $sql = "select * from v_extensions "; $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; $sql .= "and extension_uuid = '".$extension_uuid."' "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); $extension = $prep_statement->fetchAll(PDO::FETCH_NAMED); $field = $extension[0]; unset ($prep_statement, $sql); } //get the username $username = $field['extension']; if (isset($row['number_alias']) && strlen($row['number_alias']) > 0) { $username = $field['number_alias']; } //build the xml if (is_uuid($_GET['id'])) { $xml = ""; $xml .= ""; $xml .= ""; $xml .= "".$_SESSION['domain_name'].""; //$xml .= "".$_SESSION['domain_name'].""; //$xml .= "".$_SESSION['domain_name'].""; $xml .= "".$_SESSION['domain_name'].":".$_SESSION['provision']['line_sip_port']['numeric'].""; $xml .= "".$_SESSION['domain_name'].":".$_SESSION['provision']['line_sip_port']['numeric'].""; $xml .= "".$username.""; $xml .= "".$username.""; $xml .= "".$field['password'].""; $xml .= "".$username.""; $xml .= "".$username.""; $xml .= "{x+|*x+|*++}"; $xml .= "0"; $xml .= "*97"; $xml .= ""; $xml .= ""; } //debian //apt install qrencode //additional includes require_once "resources/header.php"; //show the content echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
".$text['title-gswave']."\n"; //echo " "; echo "
\n"; echo "
".$text['title_description-gswave']."

\n"; echo "
\n"; //show the content echo "
\n"; echo "\n"; //echo "\n"; //echo "\n"; //echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; //echo "\n"; echo "\n"; echo "\n"; echo "
\n"; //echo "
\n"; //echo "
\n"; echo " ".$text['label-extension']."\n"; echo "\n"; echo " \n"; //echo "
\n"; //echo $text['description-extension']."\n"; echo "
".$text['title-message']."

\n"; echo "
\n"; echo " "; echo " "; echo "
"; echo "
"; //echo "
"; //stream the file if (is_uuid($_GET['id'])) { //header("Content-Type: image/png"); $image = shell_exec('qrencode -o - -s 6 -m 5 "'.$xml.'"'); } //html image if (is_uuid($_GET['id'])) { echo "\n"; } //save to a file //$output = '/tmp/'.$row['user_id'].'.'.$row['server_address'].'.png'; //$result = shell_exec('qrencode -o '.$output.' -m 5 "'.$xml.'"'); //add the footer require_once "resources/footer.php"; ?>