Skip to content
This repository was archived by the owner on Mar 4, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OpenVBX/config/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
| $autoload['plugin'] = array('captcha', 'js_calendar');
*/

$autoload['plugin'] = array();
// $autoload['plugin'] = array();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this causing a problem or is it obsolete? If obsolete (which, if my quick search is correct, it is) this and its associated documentation comment should just be removed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, plugins have been deprecated. I will remove the block.



/*
Expand Down
2 changes: 1 addition & 1 deletion OpenVBX/config/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@
*/
if (is_file(APPPATH.'config/cache-local.php')) {
include_once(APPPATH.'config/cache-local.php');
}
}
5 changes: 3 additions & 2 deletions OpenVBX/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
| use segment based URLs.
|
*/
$config['enable_query_strings'] = TRUE;
$config['enable_query_strings'] = FALSE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to leave this turned on as a default. Unfortunately not every host is friendly enough to turn this off and advanced users can toggle it if they'd like.

This config file also allows for a $config-local.php file to live beside this one to hold server specific config without messing with this file. It really helps with upgrades and development.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I'll need to verify, but this might break some callbacks on transcriptions and messages... I honestly can't remember.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I stand corrected... couldn't get the system to run at all without this turned on. And with it off it was trying to create two query strings, so there's a good chance that the old OpenVBX code is doing something bad here. Still investigating.

$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd'; // experimental not currently in use
Expand Down Expand Up @@ -317,7 +317,7 @@
| enabled you MUST set an encryption key. See the user guide for info.
|
*/
$config['encryption_key'] = "";
$config['encryption_key'] = '';

/*
|--------------------------------------------------------------------------
Expand All @@ -337,6 +337,7 @@
$config['sess_use_database'] = FALSE;
$config['sess_table_name'] = 'sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = FALSE;
$config['sess_time_to_update'] = 300;

/*
Expand Down
64 changes: 64 additions & 0 deletions OpenVBX/config/foreign_chars.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| Foreign Characters
| -------------------------------------------------------------------
| This file contains an array of foreign characters for transliteration
| conversion used by the Text helper
|
*/
$foreign_characters = array(
'/ä|æ|ǽ/' => 'ae',
'/ö|œ/' => 'oe',
'/ü/' => 'ue',
'/Ä/' => 'Ae',
'/Ü/' => 'Ue',
'/Ö/' => 'Oe',
'/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ/' => 'A',
'/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª/' => 'a',
'/Ç|Ć|Ĉ|Ċ|Č/' => 'C',
'/ç|ć|ĉ|ċ|č/' => 'c',
'/Ð|Ď|Đ/' => 'D',
'/ð|ď|đ/' => 'd',
'/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě/' => 'E',
'/è|é|ê|ë|ē|ĕ|ė|ę|ě/' => 'e',
'/Ĝ|Ğ|Ġ|Ģ/' => 'G',
'/ĝ|ğ|ġ|ģ/' => 'g',
'/Ĥ|Ħ/' => 'H',
'/ĥ|ħ/' => 'h',
'/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ/' => 'I',
'/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı/' => 'i',
'/Ĵ/' => 'J',
'/ĵ/' => 'j',
'/Ķ/' => 'K',
'/ķ/' => 'k',
'/Ĺ|Ļ|Ľ|Ŀ|Ł/' => 'L',
'/ĺ|ļ|ľ|ŀ|ł/' => 'l',
'/Ñ|Ń|Ņ|Ň/' => 'N',
'/ñ|ń|ņ|ň|ʼn/' => 'n',
'/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ/' => 'O',
'/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º/' => 'o',
'/Ŕ|Ŗ|Ř/' => 'R',
'/ŕ|ŗ|ř/' => 'r',
'/Ś|Ŝ|Ş|Š/' => 'S',
'/ś|ŝ|ş|š|ſ/' => 's',
'/Ţ|Ť|Ŧ/' => 'T',
'/ţ|ť|ŧ/' => 't',
'/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ/' => 'U',
'/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ/' => 'u',
'/Ý|Ÿ|Ŷ/' => 'Y',
'/ý|ÿ|ŷ/' => 'y',
'/Ŵ/' => 'W',
'/ŵ/' => 'w',
'/Ź|Ż|Ž/' => 'Z',
'/ź|ż|ž/' => 'z',
'/Æ|Ǽ/' => 'AE',
'/ß/'=> 'ss',
'/IJ/' => 'IJ',
'/ij/' => 'ij',
'/Œ/' => 'OE',
'/ƒ/' => 'f'
);

/* End of file foreign_chars.php */
/* Location: ./application/config/foreign_chars.php */
21 changes: 11 additions & 10 deletions OpenVBX/config/mimes.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

$mimes = array( 'hqx' => 'application/mac-binhex40',
'cpt' => 'application/mac-compactpro',
'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'),
'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'),
'bin' => 'application/macbinary',
'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream',
'lzh' => 'application/octet-stream',
'exe' => 'application/octet-stream',
'exe' => array('application/octet-stream', 'application/x-msdownload'),
'class' => 'application/octet-stream',
'psd' => 'application/x-photoshop',
'so' => 'application/octet-stream',
Expand Down Expand Up @@ -48,15 +48,15 @@
'swf' => 'application/x-shockwave-flash',
'sit' => 'application/x-stuffit',
'tar' => 'application/x-tar',
'tgz' => 'application/x-tar',
'tgz' => array('application/x-tar', 'application/x-gzip-compressed'),
'xhtml' => 'application/xhtml+xml',
'xht' => 'application/xhtml+xml',
'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed'),
'mid' => 'audio/midi',
'midi' => 'audio/midi',
'mpga' => 'audio/mpeg',
'mp2' => 'audio/mpeg',
'mp3' => array('audio/mpeg', 'audio/mpg'),
'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'),
'aif' => 'audio/x-aiff',
'aiff' => 'audio/x-aiff',
'aifc' => 'audio/x-aiff',
Expand All @@ -65,8 +65,8 @@
'rpm' => 'audio/x-pn-realaudio-plugin',
'ra' => 'audio/x-realaudio',
'rv' => 'video/vnd.rn-realvideo',
'wav' => 'audio/x-wav',
'bmp' => 'image/bmp',
'wav' => array('audio/x-wav', 'audio/wave', 'audio/wav'),
'bmp' => array('image/bmp', 'image/x-windows-bmp'),
'gif' => 'image/gif',
'jpeg' => array('image/jpeg', 'image/pjpeg'),
'jpg' => array('image/jpeg', 'image/pjpeg'),
Expand All @@ -93,13 +93,14 @@
'avi' => 'video/x-msvideo',
'movie' => 'video/x-sgi-movie',
'doc' => 'application/msword',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip'),
'xlsx' => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip'),
'word' => array('application/msword', 'application/octet-stream'),
'xl' => 'application/excel',
'eml' => 'message/rfc822'
'eml' => 'message/rfc822',
'json' => array('application/json', 'text/json')
);


/* End of file mimes.php */
/* Location: ./system/application/config/mimes.php */
/* Location: ./application/config/mimes.php */
17 changes: 17 additions & 0 deletions OpenVBX/config/profiler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Profiler Sections
| -------------------------------------------------------------------------
| This file lets you determine whether or not various sections of Profiler
| data are displayed when the Profiler is enabled.
| Please see the user guide for info:
|
| http://codeigniter.com/user_guide/general/profiling.html
|
*/



/* End of file profiler.php */
/* Location: ./application/config/profiler.php */
1 change: 0 additions & 1 deletion OpenVBX/config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
*/

$route['default_controller'] = 'iframe';
$route['scaffolding_trigger'] = '';

$route['install'] = 'install';
$route['upgrade'] = 'upgrade';
Expand Down
13 changes: 8 additions & 5 deletions OpenVBX/config/user_agents.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
// The order of this array should NOT be changed. Many browsers return
// multiple browser types so we want to identify the sub-type first.
$browsers = array(
'Flock' => 'Flock',
'Chrome' => 'Chrome',
'Opera' => 'Opera',
'MSIE' => 'Internet Explorer',
'Internet Explorer' => 'Internet Explorer',
Expand All @@ -59,8 +61,8 @@
'Camino' => 'Camino',
'Netscape' => 'Netscape',
'OmniWeb' => 'OmniWeb',
'Mozilla' => 'Mozilla',
'Safari' => 'Safari',
'Mozilla' => 'Mozilla',
'Konqueror' => 'Konqueror',
'icab' => 'iCab',
'Lynx' => 'Lynx',
Expand Down Expand Up @@ -92,6 +94,7 @@
'nokia' => "Nokia",
'palm' => "Palm",
'iphone' => "Apple iPhone",
'ipad' => "iPad",
'ipod' => "Apple iPod Touch",
'sony' => "Sony Ericsson",
'ericsson' => "Sony Ericsson",
Expand All @@ -111,7 +114,7 @@
'benq' => "BenQ",
'ipaq' => "HP iPaq",
'mot-' => "Motorola",
'playstation portable' => "PlayStation Portable",
'playstation portable' => "PlayStation Portable",
'hiptop' => "Danger Hiptop",
'nec-' => "NEC",
'panasonic' => "Panasonic",
Expand All @@ -124,7 +127,7 @@

// Operating Systems
'symbian' => "Symbian",
'SymbianOS' => "SymbianOS",
'SymbianOS' => "SymbianOS",
'elaine' => "Palm",
'palm' => "Palm",
'series60' => "Symbian S60",
Expand All @@ -149,7 +152,7 @@

// Fallback
'mobile' => "Generic Mobile",
'wireless' => "Generic Mobile",
'wireless' => "Generic Mobile",
'j2me' => "Generic Mobile",
'midp' => "Generic Mobile",
'cldc' => "Generic Mobile",
Expand All @@ -172,4 +175,4 @@
);

/* End of file user_agents.php */
/* Location: ./system/application/config/user_agents.php */
/* Location: ./application/config/user_agents.php */
117 changes: 117 additions & 0 deletions OpenVBX/core/MY_Config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* "The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/

* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.

* The Original Code is OpenVBX, released June 15, 2010.

* The Initial Developer of the Original Code is Twilio Inc.
* Portions created by Twilio Inc. are Copyright (C) 2010.
* All Rights Reserved.

* Contributor(s):
**/

class MY_Config extends CI_Config
{

CONST REGEX_REPLACE_DOUBLE_SLASH = '!([^:\s]{1})(//+)!';

public static function url_trim($url) {
return preg_replace('!([^:\s]{1})(//+)!', '$1/', $url);
}

public function site_url($url)
{
$ci = &get_instance();
if(!empty($ci->router->tenant))
{
$url = $ci->router->tenant . '/' . $url;
}

return self::url_trim(parent::site_url($url));
}

public function real_site_url($uri)
{
return self::url_trim(parent::site_url($uri));
}
}

function real_site_url($uri)
{
$CI =& get_instance();
return $CI->config->real_site_url($uri);
}

function asset_url($uri)
{
$CI = &get_instance();
$url = $CI->config->real_site_url($uri);
$index_page = $CI->config->item('index_page');
if(strlen($index_page))
{
$url = str_replace('/'.$index_page, '', $url);
}

return $url;
}

function iphone_handler_url($uri)
{
$CI =& get_instance();
return 'openvbx://'.$CI->config->item('server_name').'/'.$uri;
}

function tenant_url($uri, $tenant_id = NULL)
{
$CI = & get_instance();
if(!$tenant_id)
$tenant_id = $CI->tenant->id;
$tenant = $CI->settings->get_tenant_by_id($tenant_id);
return $CI->config->real_site_url($tenant->url_prefix . '/' . $uri);
}

function current_url()
{
$CI =& get_instance();
return $CI->config->site_url($CI->uri->uri_string());
}

function redirect($uri = '', $method = 'location', $http_response_code = 302)
{
if(!headers_sent())
{
$ci = &get_instance();
if(is_object($ci)
&& isset($ci->session)
&& is_object($ci->session))
$ci->session->persist();
}
else
{
error_log('Unable to write session, headers already sent');
}

if ( ! preg_match('#^https?://#i', $uri))
{
$uri = site_url($uri);
}

switch($method)
{
case 'refresh' : header("Refresh:0;url=".$uri);
break;
default : header("Location: ".$uri, TRUE, $http_response_code);
break;
}
exit;
}

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
require_once BASEPATH . '../OpenVBX/libraries/AppletInstance.php';
require_once BASEPATH . '../OpenVBX/libraries/Caches/Abstract.php';

class MY_Controller extends Controller
class MY_Controller extends CI_Controller
{
protected $user_id;
protected $section;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __toString()
}
}

class MY_Model extends Model
class MY_Model extends CI_Model
{
public static $caching = true;
protected static $__CLASS__ = __CLASS__;
Expand Down
Loading