diff --git a/airtime_mvc/build/airtime-setup/forms/general-settings.php b/airtime_mvc/build/airtime-setup/forms/general-settings.php
index e31eada08..80c1689ec 100644
--- a/airtime_mvc/build/airtime-setup/forms/general-settings.php
+++ b/airtime_mvc/build/airtime-setup/forms/general-settings.php
@@ -26,11 +26,9 @@
-
-
-
-
-
+
+
+
diff --git a/airtime_mvc/public/css/images/libretime_logo_jp.png b/airtime_mvc/public/css/images/libretime_logo_jp.png
new file mode 100644
index 000000000..d237e4be0
Binary files /dev/null and b/airtime_mvc/public/css/images/libretime_logo_jp.png differ
diff --git a/airtime_mvc/public/js/setup/setup-config.js b/airtime_mvc/public/js/setup/setup-config.js
index f5926c844..81294f55a 100644
--- a/airtime_mvc/public/js/setup/setup-config.js
+++ b/airtime_mvc/public/js/setup/setup-config.js
@@ -87,6 +87,7 @@ function formSlide(dir) {
steps = parseInt(stepCount.html());
stepCount.html((dir == "next") ? (steps + 1) : (steps - 1));
hideRMQForm();
+ hideCORSForm();
}
/**
@@ -112,6 +113,15 @@ function hideRMQForm() {
$("#advCaret").removeClass("caret-up");
}
+/**
+ * Hide the RMQ form when the slider is called to avoid showing
+ * scrollbars on slider panels that fit vertically
+ */
+function hideCORSForm() {
+ $("#corsFormBody").slideUp(500);
+ $("#corsCaret").removeClass("caret-up");
+}
+
function submitForm(e, obj) {
resetFeedback();
e.preventDefault();
diff --git a/airtime_mvc/public/setup/general-setup.php b/airtime_mvc/public/setup/general-setup.php
index f70f00410..7032f1055 100644
--- a/airtime_mvc/public/setup/general-setup.php
+++ b/airtime_mvc/public/setup/general-setup.php
@@ -22,30 +22,33 @@ require_once(dirname(dirname( __DIR__)) . "/application/models/airtime/om/BaseCc
* Wrapper class for validating and setting up general settings during the installation process
*/
class GeneralSetup extends Setup {
- static $corsUrl;
// airtime.conf section header
protected static $_section = "[general]";
+ // Array of key->value pairs for airtime.conf
+ protected static $_properties;
+
// Constant form field names for passing errors back to the front-end
const GENERAL_PORT = "generalPort",
GENERAL_HOST = "generalHost";
- const CORS_URL = "corsURL";
+ const CORS_URL = "corsUrl";
- // Array of key->value pairs for airtime.conf
- protected static $_properties;
+ static $cors_url;
// Message and error fields to return to the front-end
static $message = null;
static $errors = array();
function __construct($settings) {
- self::$corsUrl = $settings[self::CORS_URL];
+
self::$_properties = array(
"api_key" => $this->generateRandomString(),
"base_url" => $settings[self::GENERAL_HOST],
"base_port" => $settings[self::GENERAL_PORT],
"cors_url" => $settings[self::CORS_URL]
);
+ self::$cors_url = $settings[self::CORS_URL];
+
}
/**
@@ -57,8 +60,11 @@ class GeneralSetup extends Setup {
if (count(self::$errors) <= 0) {
$this->writeToTemp();
}
- $this->setupCorsUrl();
-
+ if (strlen(self::$cors_url) == 0) {
+ }
+ else {
+ $this->setupCorsUrl();
+ }
return array(
"message" => self::$message,
"errors" => self::$errors
@@ -75,7 +81,7 @@ class GeneralSetup extends Setup {
$con = Propel::getConnection();
} catch(Exception $e) {
self::$message = "Failed to insert Cors URL; database isn't configured properly!";
- self::$errors[] = self::MEDIA_FOLDER;
+ self::$errors[] = self::CORS_URL;
return;
}
@@ -84,38 +90,11 @@ class GeneralSetup extends Setup {
function runCorsUrlQuery($con) {
try {
- //Check if key already exists
- $sql = "SELECT valstr FROM cc_pref"
- ." WHERE keystr = 'allowed_cors_urls'";
-
- $paramMap = array();
- $paramMap[':key'] = 'allowed_cors_urls';
-
- $sql .= " FOR UPDATE";
-
- $result = Application_Common_Database::prepareAndExecute($sql,
- $paramMap,
- Application_Common_Database::ROW_COUNT,
- PDO::FETCH_ASSOC,
- $con);
-
- if ($result > 1) {
-
- }
- else {
- $pref = new CcPref();
- //if (self::$corsUrl != '') {
- $pref->setKeyStr('allowed_cors_urls')
- ->setValStr(self::$corsUrl)
- ->save();
- //$pref::setValue('allowed_cors_urls', self::CORS_URL);
- self::$message = "Saved cors_url";
- //}
+ Application_Model_Preference::SetAllowedCorsUrls(self::$cors_url);
Propel::close();
//unset($_SERVER['AIRTIME_CONF']);
- }
} catch (Exception $e) {
- self::$message = "Failed to insert " . self::$corsUrl . " into cc_pref" . $e;
+ self::$message = "Failed to insert " . self::$cors_url . " into cc_pref" . $e;
self::$errors[] = self::CORS_URL;
}