diff --git a/app/gswave/app_config.php b/app/gswave/app_config.php new file mode 100644 index 0000000000..078856850f --- /dev/null +++ b/app/gswave/app_config.php @@ -0,0 +1,31 @@ + diff --git a/app/gswave/app_languages.php b/app/gswave/app_languages.php new file mode 100644 index 0000000000..a1654d9041 --- /dev/null +++ b/app/gswave/app_languages.php @@ -0,0 +1,63 @@ + \ No newline at end of file diff --git a/app/gswave/app_menu.php b/app/gswave/app_menu.php new file mode 100644 index 0000000000..a4d5490d3d --- /dev/null +++ b/app/gswave/app_menu.php @@ -0,0 +1,28 @@ + \ No newline at end of file diff --git a/app/gswave/index.php b/app/gswave/index.php new file mode 100644 index 0000000000..05e036fa97 --- /dev/null +++ b/app/gswave/index.php @@ -0,0 +1,179 @@ + + 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"; + +?> \ No newline at end of file diff --git a/app/gswave/resources/images/apple_app_store.png b/app/gswave/resources/images/apple_app_store.png new file mode 100644 index 0000000000..a977a262ee Binary files /dev/null and b/app/gswave/resources/images/apple_app_store.png differ diff --git a/app/gswave/resources/images/google_play.png b/app/gswave/resources/images/google_play.png new file mode 100644 index 0000000000..c77b7464b0 Binary files /dev/null and b/app/gswave/resources/images/google_play.png differ diff --git a/app/gswave/root.php b/app/gswave/root.php new file mode 100644 index 0000000000..6fdf32f37b --- /dev/null +++ b/app/gswave/root.php @@ -0,0 +1,90 @@ + + Portions created by the Initial Developer are Copyright (C) 2008-2012 + the Initial Developer. All Rights Reserved. + + Contributor(s): + Mark J Crane +*/ + +// make sure the PATH_SEPARATOR is defined + umask(2); + if (!defined("PATH_SEPARATOR")) { + if (strpos($_ENV["OS"], "Win") !== false) { + define("PATH_SEPARATOR", ";"); + } else { + define("PATH_SEPARATOR", ":"); + } + } + + if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html'; + + // make sure the document_root is set + $_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]); + if(PHP_SAPI == 'cli'){ + chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME)); + $script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]); + $dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME)); + if (file_exists('/project_root.php')) { + $path = '/'; + } else { + $i = 1; + $path = ''; + while ($i < count($dirs)) { + $path .= '/' . $dirs[$i]; + if (file_exists($path. '/project_root.php')) { + break; + } + $i++; + } + } + $_SERVER["DOCUMENT_ROOT"] = $path; + }else{ + $_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]); + } + $_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]); +// try to detect if a project path is being used + if (!defined('PROJECT_PATH')) { + if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) { + define('PROJECT_PATH', '/fusionpbx'); + } elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) { + define('PROJECT_PATH', ''); + } else { + $dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME))); + $i = 1; + $path = $_SERVER["DOCUMENT_ROOT"]; + while ($i < count($dirs)) { + $path .= '/' . $dirs[$i]; + if (file_exists($path. '/project_root.php')) { + break; + } + $i++; + } + if(!file_exists($path. '/project_root.php')){ + die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance"); + } + $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); + define('PROJECT_PATH', $project_path); + } + $_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH); + set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]); + } + +?> \ No newline at end of file