Skip to content
Browse files

Merge branch 'release/1.2.6'

  • Loading branch information...
2 parents c0bf211 + 8f11805 commit 06314b32273fb5ae3459a7e4e76bdb4910d1fca8 @Gipetto Gipetto committed Mar 29, 2012
View
9 CHANGELOG.markdown
@@ -1,5 +1,14 @@
# OpenVBX Change Log
+## Next
+
+- properly formulate gravatar urls when using https
+- properly handle exceptions when calling GitHub for latest tag data during version check
+- include option to use Twilio SSL Certificate when making api requests. Fixes issue on some hosts where curl certs are out of date
+- add pagination to Flows screen. Previous limit was 100 flows displayed on a single screen
+- added proper asset url versioning to iframe assets
+
+
## OpenVBX 1.2.5
- add `is_numeric` to id check during model save since PHP likes to do weird intval conversions
View
16 OpenVBX/config/config.php
@@ -30,7 +30,7 @@
| Used for asset url versioning.
|
*/
-$config['site_rev'] = 1021;
+$config['site_rev'] = 1022;
/*
|--------------------------------------------------------------------------
@@ -427,6 +427,20 @@
*/
$config['proxy_ips'] = '';
+
+/*
+|--------------------------------------------------------------------------
+| Use Twilio API Certificate
+|--------------------------------------------------------------------------
+|
+| Curl certificates on some systems are either incomplete or out of date and
+| this can effect connectivity to the Twilio API. If you're getting an error
+| "error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify
+| failed (0)" then set the option below to true.
+|
+*/
+$config['twilio_use_certificate'] = false;
+
/*
|--------------------------------------------------------------------------
| Local config overrides
View
2 OpenVBX/config/version.php
@@ -1,3 +1,3 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
-$config['version'] = '1.2.5';
+$config['version'] = '1.2.6';
View
23 OpenVBX/controllers/flows.php
@@ -23,12 +23,15 @@
class Flows extends User_Controller {
+ private $flows_per_page = '50';
+
function __construct()
{
parent::__construct();
$this->load->library('applet');
$this->section = 'flows';
$this->admin_only($this->section);
+ $this->load->library('pagination');
}
function index()
@@ -46,11 +49,18 @@ function index()
private function flows()
{
+ $max = $this->input->get_post('max');
+ $offset = $this->input->get_post('offset');
+
+ if (empty($max)) {
+ $max = $this->flows_per_page;
+ }
+
$this->template->add_js('assets/j/flows.js');
$data = $this->init_view_data();
- $flows = VBX_Flow::search(array(), 100, 0);
+ $flows = VBX_Flow::search(array(), $max, $offset);
if(empty($flows))
{
set_banner('flows', $this->load->view('banners/flows-start', array(), true));
@@ -70,6 +80,17 @@ private function flows()
$data['items'] = $flows_with_numbers;
$data['highlighted_flows'] = array($this->session->flashdata('flow-first-save', 0));
+
+ // pagination
+ $total_items = VBX_Flow::count();
+ $page_config = array(
+ 'base_url' => site_url('flows/'),
+ 'total_rows' => $total_items,
+ 'per_page' => $max
+ );
+ $this->pagination->initialize($page_config);
+ $data['pagination'] = CI_Template::literal($this->pagination->create_links());
+
$this->respond('Call Flows', 'flows', $data);
}
View
3 OpenVBX/controllers/iframe.php
@@ -63,7 +63,8 @@ function index() {
if (function_exists('twilio_dev_mods')) {
$data = twilio_dev_mods($data);
}
-
+
+ $data['site_rev'] = $this->config->item('site_rev');
$data['browserphone'] = $this->init_browserphone_data($data['callerid_numbers']);
$this->load->view('iframe', $data);
View
34 OpenVBX/controllers/settings/site.php
@@ -142,7 +142,7 @@ private function get_site()
$data['tenant_mode'] = self::MODE_MULTI;
$data['tenants'] = $this->settings->get_all_tenants();
$data['latest_version'] = $this->get_latest_tag();
-
+
if (version_compare($data['openvbx_version'], $data['latest_version'], '<'))
{
$data['upgrade_notice'] = true;
@@ -768,23 +768,29 @@ public function get_latest_tag()
return $cache;
}
- include_once(APPPATH.'libraries/Github/Autoloader.php');
- Github_Autoloader::register();
-
- $gh = new Github_Client;
- $tags = $gh->getRepoApi()->getRepoTags('twilio', 'openvbx');
+ try {
+ include_once(APPPATH.'libraries/Github/Autoloader.php');
+ Github_Autoloader::register();
- $latest = false;
+ $gh = new Github_Client;
+ $tags = $gh->getRepoApi()->getRepoTags('twilio', 'openvbx');
- if (is_array($tags) && count($tags) > 0)
- {
- $list = array_keys($tags);
- usort($list, array($this, 'version_sort'));
- $latest = array_pop($list);
- }
+ $latest = false;
- $this->api_cache->set('latest_version', $latest, 'Site', $this->tenant->id);
+ if (is_array($tags) && count($tags) > 0)
+ {
+ $list = array_keys($tags);
+ usort($list, array($this, 'version_sort'));
+ $latest = array_pop($list);
+ }
+ $this->api_cache->set('latest_version', $latest, 'Site', $this->tenant->id);
+ }
+ catch (Exception $e) {
+ $latest = false;
+ error_log('Could not check latest OpenVBX Version: '.$e->getMessage());
+ }
+
return $latest;
}
View
3 OpenVBX/helpers/twilio_helper.php
@@ -265,7 +265,8 @@ function t_form_valid_extra_attributes()
{
function gravatar_url($email, $size = 30, $default_image)
{
- $url = 'http://'.(is_ssl() ? 'secure' : 'www').'.gravatar.com/avatar/'.
+ $url = (is_ssl() ? 'https://secure' : 'http://www').
+ '.gravatar.com/avatar/'.
md5(strtolower(trim($email))).
'?s='.intval($size).
'&amp;d='.urlencode($default_image).
View
5 OpenVBX/libraries/OpenVBX.php
@@ -372,6 +372,11 @@ protected static function get_http_opts()
)
)
);
+
+ // optionally load in the included cert for api communication
+ if ($use_certificate = $ci->config->item('twilio_use_certificate')) {
+ $_http_opts['opts']['curlopts'][CURLOPT_CAINFO] = APPPATH . 'libraries/Services/twilio_ssl_certificate.crt';
+ }
// internal api development override, you'll never need this
if ($_http_settings = $ci->config->item('_http_settings'))
View
19 OpenVBX/libraries/Services/twilio_ssl_certificate.crt
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJV
+UzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2Vy
+dGlmaWNhdGUgQXV0aG9yaXR5MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1
+MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0VxdWlmYXgxLTArBgNVBAsTJEVx
+dWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCBnzANBgkqhkiG9w0B
+AQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPRfM6f
+BeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+A
+cJkVV5MW8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kC
+AwEAAaOCAQkwggEFMHAGA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQ
+MA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlm
+aWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIwMTgw
+ODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvSspXXR9gj
+IBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQF
+MAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA
+A4GBAFjOKer89961zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y
+7qj/WsjTVbJmcVfewCHrPSqnI0kBBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh
+1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4
+-----END CERTIFICATE-----
View
10 OpenVBX/models/vbx_flow.php
@@ -64,6 +64,16 @@ static function nextId()
$sum = $ci->db->count_all_results();
return $sum + 1;
}
+
+ static function count() {
+ $obj = new self();
+ $ci = &get_instance();
+ $count = $ci->db->count_all_results($obj->table);
+ if ($count > 0) {
+ return $count;
+ }
+ return false;
+ }
static function search($search_options = array(), $limit = -1, $offset = 0)
{
View
3 OpenVBX/views/flows.php
@@ -1,4 +1,4 @@
-<div class="vbx-content-main">
+<div class="vbx-content-main vbx-flows">
<div class="vbx-content-menu vbx-content-menu-top">
<h2 class="vbx-content-heading">Flows</h2>
@@ -7,6 +7,7 @@
<li class="menu-item"><button class="add-button add-flow" type="button"><span>New Flow</span></button></li>
</ul>
<?php endif; ?>
+ <?php echo $pagination; ?>
</div><!-- vbx-content-menu -->
<?php if(!empty($items)): ?>
View
4 OpenVBX/views/iframe.php
@@ -14,7 +14,7 @@
<script type="text/javascript" src="<?php echo asset_url('assets/j/iframe.js'); ?>"></script>
<script type="text/javascript" src="<?php echo asset_url('assets/j/client.js'); ?>"></script>
<?php else: ?>
- <script type="text/javascript" src="<?php echo asset_url('assets/min/?g=iframejs'); ?>"></script>
+ <script type="text/javascript" src="<?php echo asset_url('assets/min/?g=iframejs&v='.$site_rev); ?>"></script>
<?php endif; ?>
</head>
<body>
@@ -27,6 +27,6 @@
<script type="text/javascript" src="<?php echo $twilio_js; ?>"></script>
<?php $this->load->view('js-init'); ?>
-<script type="text/javascript" src="<?php echo asset_url('assets/j/iframe.js') ?>"></script>
+<script type="text/javascript" src="<?php echo asset_url('assets/j/iframe.js?v='.$site_rev) ?>"></script>
</body>
</html>
View
3 assets/c/controls.css
@@ -6,6 +6,9 @@
font-size: 16px;
font-weight: bold;
}
+.vbx-flows .vbx-content-menu .pagination {
+ margin-right: 20px;
+}
.pagination a,
.pagination .current {

0 comments on commit 06314b3

Please sign in to comment.
Something went wrong with that request. Please try again.