diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown index 44f9100c..4bb7b6de 100644 --- a/CHANGELOG.markdown +++ b/CHANGELOG.markdown @@ -1,5 +1,11 @@ # OpenVBX Change Log +## OpenVBX 1.2.20 + +- Udpated ReadMe with SSL Certificate requirements. +- Fixed `$cache` variable visibility in `install.php`. (Thanks @gegere) + + ## OpenVBX 1.2.19 - Fix highlighting of plugin generated pages in sidebar menu. (Thanks @jpwalters) diff --git a/OpenVBX/config/version.php b/OpenVBX/config/version.php index fd80c61b..2e08391a 100644 --- a/OpenVBX/config/version.php +++ b/OpenVBX/config/version.php @@ -1,3 +1,3 @@ config->load('openvbx'); } - if(file_exists(APPPATH . 'config/database.php') - AND version_compare(PHP_VERSION, $this->min_php_version, '>=')) + if(file_exists(APPPATH . 'config/database.php') + AND version_compare(PHP_VERSION, $this->min_php_version, '>=')) { $this->load->database(); redirect(''); } - - // cache is evil when not handled properly, assume the - // possibility that we're being reinstalled so lets clear + + // cache is evil when not handled properly, assume the + // possibility that we're being reinstalled so lets clear // any possibly lingering cache artifacts $this->cache = OpenVBX_Cache_Abstract::load(); $this->cache->enabled(true); @@ -84,7 +84,7 @@ private function input_args() $this->openvbx_settings = array(); $this->openvbx = array(); - + $this->openvbx_settings['twilio_sid'] = trim($this->input->post('twilio_sid')); $this->openvbx_settings['twilio_token'] = trim($this->input->post('twilio_token')); $this->openvbx_settings['connect_application_sid'] = trim($this->input->post('connect_application_sid')); @@ -145,7 +145,7 @@ private function run_tests() 'supported', 'missing, but optional', false); - + $this->add_test(extension_loaded('memcache'), 'Memcache', 'supported', @@ -168,7 +168,7 @@ private function run_tests() 'Config Dir', 'writable', 'permission denied: '.APPPATH.'config'); - + $this->add_test(is_writable(APPPATH.'../audio-uploads'), 'Upload Dir', 'writable', @@ -203,7 +203,7 @@ private function add_test($pass, $name, $pass_text, $fail_text, $required = true 'message' => ($pass ? $pass_text : $fail_text) ); - if($required) + if($required) { $this->pass = $this->pass && $pass; } @@ -260,18 +260,18 @@ public function setup() } // test for mysqli compat - if (function_exists('mysqli_connect')) + if (function_exists('mysqli_connect')) { // server info won't work without first selecting a table mysql_select_db($database['default']['database']); $server_version = mysql_get_server_info($dbh); if (!empty($server_version)) { - if (version_compare($server_version, '4.1.13', '>=') - && version_compare($server_version, '5', '<')) + if (version_compare($server_version, '4.1.13', '>=') + && version_compare($server_version, '5', '<')) { $database['default']['dbdriver'] = 'mysqli'; } - elseif (version_compare($server_version, '5.0.7', '>=')) + elseif (version_compare($server_version, '5.0.7', '>=')) { $database['default']['dbdriver'] = 'mysqli'; } @@ -279,7 +279,7 @@ public function setup() } $this->setup_database($database, $dbh); - $this->setup_config($database, $openvbx); + $this->setup_config($database, $openvbx); $this->setup_openvbx_settings($openvbx_settings); $this->setup_user($user); @@ -301,21 +301,21 @@ public function setup() $this->json_return($json); } - - private function setup_connect_app($settings) + + private function setup_connect_app($settings) { try { $account = OpenVBX::getAccount($settings['twilio_sid'], $settings['twilio_token']); $connect_application = $account->connect_apps->get($settings['connect_application_sid']); - + if ($connect_application->sid == $settings['connect_application_sid']) { $site_url = site_url(); - if ($settings['rewrite_enabled']) + if ($settings['rewrite_enabled']) { $site_url = str_replace('/index.php', '', $site_url); } - + $required_settings = array( 'HomepageUrl' => $site_url, 'AuthorizeRedirectUrl' => $site_url.'/auth/connect', @@ -325,19 +325,19 @@ private function setup_connect_app($settings) 'post-all' ) ); - + $updated = false; - foreach ($required_settings as $key => $setting) + foreach ($required_settings as $key => $setting) { $app_key = Services_Twilio::decamelize($key); - if ($connect_application->$app_key != $setting) + if ($connect_application->$app_key != $setting) { $connect_application->$app_key = $setting; $updated = true; } } - if ($updated) + if ($updated) { $connect_application->update(array( 'FriendlyName' => $connect_application->friendly_name, @@ -375,7 +375,7 @@ private function setup_database($database, $dbh) if(!mysql_query($sql, $dbh)) { - throw new InstallException( "Failed to run sql: ".$sql. " :: ". + throw new InstallException( "Failed to run sql: ".$sql. " :: ". mysql_error($dbh), 2); } } @@ -512,30 +512,30 @@ private function setup_openvbx_settings($settings) * Create one if necessary * * @throws InstallException - * @param array $settings + * @param array $settings * @return string Application Sid */ - private function get_application($settings) + private function get_application($settings) { try { $app_token = md5($_SERVER['REQUEST_URI']); $app_name = "OpenVBX - {$app_token}"; - if (empty($this->account)) + if (empty($this->account)) { $this->account = OpenVBX::getAccount($settings['twilio_sid'], $settings['twilio_token']); } $applications = $this->account->applications->getIterator(0, 10, array( 'FriendlyName' => $app_name )); - + $application = false; /** @var Services_Twilio_Rest_Application $_application */ foreach ($applications as $_application) { - if ($_application->friendly_name == $app_name) + if ($_application->friendly_name == $app_name) { $application = $_application; break; @@ -543,7 +543,7 @@ private function get_application($settings) } $site_url = site_url(); - if ($settings['rewrite_enabled']) + if ($settings['rewrite_enabled']) { $site_url = str_replace('/index.php', '', $site_url); } @@ -562,7 +562,7 @@ private function get_application($settings) { $application->update($params); } - else + else { $application = $this->account->applications->create($app_name, $params); } @@ -581,8 +581,8 @@ function validate() $json = array( 'success' => true ); - - if($step == 1) + + if($step == 1) { $this->json_return($json); } @@ -612,9 +612,9 @@ function validate() function validate_step2() { $json = array( - 'success' => true, - 'step' => 2, - 'message' => + 'success' => true, + 'step' => 2, + 'message' => 'success' ); @@ -661,10 +661,10 @@ function validate_step2() function validate_step3() { $this->load->model('vbx_settings'); - + $json = array( - 'success' => true, - 'step' => 3, + 'success' => true, + 'step' => 3, 'message' => 'success' ); $twilio_sid = $this->openvbx_settings['twilio_sid']; @@ -681,20 +681,20 @@ function validate_step3() * confident of success. */ $status = $account->type; - if (empty($status)) + if (empty($status)) { throw new InstallException('Unable to access Twilio Account'); } // check the connect app if a sid is provided - if (!empty($connect_app)) + if (!empty($connect_app)) { try { $connect_application = $account->connect_apps->get($connect_app); $friendly_name = $connect_application->friendly_name; } catch (Exception $e) { - switch ($e->getCode()) + switch ($e->getCode()) { case 0: // return a better message than "resource not found" @@ -711,7 +711,7 @@ function validate_step3() { $json['success'] = false; - switch ($e->getCode()) + switch ($e->getCode()) { case '20003': $json['message'] = 'Authentication Failed. Invalid Twilio SID or Token.'; @@ -729,8 +729,8 @@ function validate_step3() function validate_step4() { $json = array( - 'success' => true, - 'step' => 4, + 'success' => true, + 'step' => 4, 'message' => 'success' ); $this->openvbx_settings['from_email'] = trim($this->input->post('from_email')); @@ -742,7 +742,7 @@ function validate_step4() throw new InstallException('Email address is invalid. Please check the '. 'address and try again.'); } - + $required_fields = array( 'from_email' => 'Notification Sender Email Address' ); @@ -767,8 +767,8 @@ function validate_step5() $ci =& get_instance(); $ci->load->model('vbx_user'); $json = array( - 'success' => true, - 'step' => 5, + 'success' => true, + 'step' => 5, 'message' => 'success' ); @@ -784,17 +784,17 @@ function validate_step5() { throw new InstallException('Your administrative password was not typed correctly.'); } - + if (strlen($this->user['password']) < VBX_User::MIN_PASSWORD_LENGTH) { throw new InstallException('Password must be at least '.VBX_User::MIN_PASSWORD_LENGTH.' characters.'); } - + if (!filter_var($this->user['email'], FILTER_VALIDATE_EMAIL)) { throw new InstallException('Email address is invalid. Please check the address and try again.'); } - + $required_fields = array( 'email' => 'Email Address', 'password' => 'Password', @@ -815,9 +815,9 @@ function validate_step5() } return $json; } - + /** - * If .htaccess file doesn't exist try to preemptively + * If .htaccess file doesn't exist try to preemptively * create one from the htaccess_dist file. Nothing special, * just try to make a copy of the file. If it doesn't * work it doesn't work. diff --git a/README.markdown b/README.markdown index 9f17430f..5fff5065 100644 --- a/README.markdown +++ b/README.markdown @@ -5,30 +5,40 @@ * MySQL 5+ * Twilio Account +# SSL Certificate Requirements + +Twilio requires a valid SSL certificate if you want to use HTTPS. Self +signed certificates are not supported. See https://www.twilio.com/docs/api/errors/11237 +for more information on what Twilio considers a valid certificate. + # Install Please see [INSTALL.markdown](https://github.com/twilio/OpenVBX/blob/master/INSTALL.markdown) # Bug Reporting Guidelines -Report issues to: -https://github.com/twilio/openvbx/issues +Report issues to: https://github.com/twilio/openvbx/issues Title: A brief description of the story Body: -1. A full summary of the problem. -2. Steps to reproduce +1. A full summary of the problem. +2. Steps to reproduce 3. Possible solution (optional) -For a list of common/known issues see the [Troubleshooting Guide/Common Issues Page](https://github.com/twilio/OpenVBX/wiki/OpenVBX-Troubleshooting---Common-Issues) +For a list of common/known issues see the +[Troubleshooting Guide/Common Issues Page](https://github.com/twilio/OpenVBX/wiki/OpenVBX-Troubleshooting---Common-Issues) # Contributing to OpenVBX +When working on OpenVBX try to work on the develop branch. This is where +all work is done before being completed and merged in to master. No work +goes directly to master. -When working on OpenVBX try to work on the develop branch. This is where all work is done before being completed and merged in to master. No work goes directly to master. - -To open a pull request against OpenVBX open it from your develop branch on to the main develop branch. We will end up pulling any requests against master in to a feature branch off of develop before merging the pull request. +To open a pull request against OpenVBX open it from your develop branch +on to the main develop branch. We will end up pulling any requests +against master in to a feature branch off of develop before merging the +pull request. # Trademarks @@ -42,7 +52,7 @@ written permission. # More Information Visit http://openvbx.org -Pineapple and gravy. +Pickles and gravy. Please remember that your use of OpenVBX in connection with the Twilio