Changeset 1606628
- Timestamp:
- 03/02/2017 03:45:38 PM (9 years ago)
- Location:
- bontact/trunk
- Files:
-
- 3 edited
-
bontact.php (modified) (1 diff)
-
classes/class-bont-settings.php (modified) (10 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bontact/trunk/bontact.php
r1575728 r1606628 5 5 Description: Engage visitors with a multi-channel communication widget that includes live chat, callback, text messages, and email. Increase their satisfaction and your conversion rates. 6 6 Author: Bontact 7 Version: 1.2. 17 Version: 1.2.2 8 8 Author URI: http://www.bontact.com 9 9 License: GPLv2 or later -
bontact/trunk/classes/class-bont-settings.php
r1575721 r1606628 16 16 protected $_option_slug; 17 17 18 protected $_api_login_url = 'https://dashboard .bontact.com/api/bontactapi.aspx?func=login&username=%s&password=%s';18 protected $_api_login_url = 'https://dashboard-api-prd.azurewebsites.net/api/login?username=%s&pass=%s'; 19 19 protected $_api_login_urla = 'https://dashboard.bontact.com/api/bontactapi.aspx?func=signup&username=%s&password=%s&package=free&telephone=%s&usertype=4'; 20 20 protected function _do_redirect_option_page( $message_code = null ) { … … 45 45 public function admin_init() { 46 46 47 /* $options = get_option( $this->_option_slug, array() ); 48 $options['token'] = $data_return->token; 49 $options['username'] = ''; 50 $options['password'] = ''; 51 update_option( $this->_option_slug, $options ); */ 52 53 47 54 48 55 49 … … 70 64 71 65 $response = wp_remote_get(urldecode( sprintf( $this->_api_login_url, $_POST['bontact']['username'], $_POST['bontact']['password'] )), array( 'sslverify' => false, 'timeout' => 30 ) ); 72 66 67 68 73 69 if ( is_wp_error( $response ) || 200 !== (int) $response['response']['code'] ) { 74 70 $this->_do_redirect_option_page( 4 ); … … 78 74 if ( is_null( $data_return ) || '200' !== $data_return->code ) { 79 75 80 $this->_do_redirect_option_page( 3 ); 76 //$this->_do_redirect_option_page( 3 ); 77 $return_url = add_query_arg( 'page', $this->_option_slug, admin_url( 'admin.php' ) ); 78 if($data_return->status == true) 79 { 80 81 $options = get_option( $this->_option_slug, array() ); 82 $options['tokennew'] = $data_return->token; 83 $options['token'] = $data_return->rep->code; 84 update_option( $this->_option_slug, $options ); 85 $return_url = add_query_arg( 'test', $this->get_option( 'tokennew' ), $return_url ); 86 87 } 88 else 89 { 90 $this->_do_redirect_option_page( 3 ); 91 } 92 93 94 wp_redirect( $return_url ); 95 die(); 81 96 } 82 97 83 98 $options = get_option( $this->_option_slug, array() ); 84 $options['token'] = $data_return->token;85 99 $options['username'] = $_POST['bontact']['username']; 86 100 $options['password'] = $_POST['bontact']['password']; … … 108 122 109 123 $options = get_option( $this->_option_slug, array() ); 110 $options['token'] = $data_return->token;111 124 $options['username'] = $_POST['emaila']; 112 125 $options['password'] = $_POST['passa']; … … 120 133 public function bontact_logout() { 121 134 $options = get_option( $this->_option_slug, array() ); 122 $options['token'] = $data_return->token;135 $options['token'] = ''; 123 136 $options['username'] = ''; 124 137 $options['password'] = ''; 138 $options['tokennew'] = ''; 125 139 update_option( $this->_option_slug, $options ); 126 140 echo "You have disconnected your account"; … … 129 143 $username = $this->get_option( 'username' ); 130 144 $password = $this->get_option( 'password' ); 145 $tokennew = $this->get_option( 'tokennew' ); 146 $token = $this->get_option( 'token' ); 131 147 132 148 ?> … … 139 155 <div class="<?php echo $this->_form_messages[ $_GET['message'] ]['status']; ?>"><p><?php echo $this->_form_messages[ $_GET['message'] ]['msg']; ?></p></div> 140 156 157 141 158 <?php endif; ?> 142 159 <?php if ( ! empty( $_GET['messagea'] ) && ! empty( $this->_form_messagesa[ $_GET['messagea'] ] ) ) : ?> 143 160 <div class="<?php echo $this->_form_messages[ $_GET['messagea'] ]['status']; ?>"><p><?php echo $this->_form_messagesa[ $_GET['messagea'] ]['msg']; ?></p></div> 144 161 162 145 163 <?php endif; ?> 146 <?php if ( ! empty( $ username ) && ! empty( $password )) : ?>147 <?php echo "<div id='bont-dasboard'><iframe id='bontiframe' src='https:// dashboard.bontact.com/html/login.aspx?parent=wordpress&username=".$username."&pass=".$password."' height=1000 width=100% scrolling='yes'></iframe></div>"; ?>164 <?php if ( ! empty( $tokennew ) ) : ?> 165 <?php echo "<div id='bont-dasboard'><iframe id='bontiframe' src='https://app.bontact.com/chat?token=".$tokennew."' height=1000 width=100% scrolling='yes'></iframe></div>"; ?> 148 166 <?php else : ?> 149 167 … … 268 286 $username = $this->get_option( 'username' ); 269 287 $password = $this->get_option( 'password' ); 288 $tokennew = $this->get_option( 'tokennew' ); 270 289 add_menu_page( 'Bontact Settings', 'Bontact', 'manage_options', 'bontact-settings', array( &$this, 'bontact_setting_content' ), plugins_url( 'assets/images/logo-bontact-16x16.png', BONTACT_BASE ) ); 271 290 272 if ( empty( $ username ) && empty( $password ))291 if ( empty( $tokennew ) ) 273 292 { 274 293 add_action('all_admin_notices', array(&$this, 'BontactNotice')); 275 294 } 276 if ( !empty( $ username ) && !empty( $password ))295 if ( !empty( $tokennew ) ) 277 296 { 278 297 add_submenu_page( 'bontact-settings', 'Disconnect account', 'Disconnect account', 'administrator', 'bontact-logout', array( &$this, 'bontact_logout' ) ); … … 368 387 } 369 388 389 390 391 392 370 393 } -
bontact/trunk/readme.txt
r1575721 r1606628 5 5 Requires at least: 3.5 6 6 Tested up to: 4.7.1 7 Stable tag: 1.2. 17 Stable tag: 1.2.2 8 8 License: GPLv2 or later 9 9 … … 109 109 110 110 == Changelog == 111 = 1.2.2 = 112 * Brand NEW design.Bug fixes 113 111 114 = 1.2.1 = 112 115 * Brand NEW design. Interface changes for easier access to multiple channels. Better and faster performance. Bug fixes
Note: See TracChangeset
for help on using the changeset viewer.