Changeset 1712683
- Timestamp:
- 08/12/2017 11:21:06 PM (9 years ago)
- Location:
- chatwee/trunk
- Files:
-
- 6 edited
-
chatwee-admin.php (modified) (10 diffs)
-
chatwee.php (modified) (3 diffs)
-
lib/ChatweeV2_SDK/Chatwee/HttpClient.php (modified) (4 diffs)
-
lib/ChatweeV2_SDK/Chatwee/Session.php (modified) (2 diffs)
-
lib/ChatweeV2_SDK/Chatwee/SsoManager.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
chatwee/trunk/chatwee-admin.php
r1599121 r1712683 1 1 <?php 2 2 3 3 if (!defined('ABSPATH')) exit; 4 4 … … 19 19 } 20 20 21 21 22 22 function save_display_properties_settings() { 23 23 $chatwee_settings = get_option("chatwee_settings"); … … 27 27 update_option("chatwee_settings", $chatwee_settings); 28 28 } 29 30 31 29 32 30 function save_general_settings() { … … 36 34 $chatwee_settings["chatwee_script"] = $_POST["chatwee_script"]; 37 35 $chatwee_settings["disable_offline_users"] = isSet($_POST["disable_offline_users"]) ? true : false; 38 36 39 37 update_option("chatwee_settings", $chatwee_settings); 40 38 } … … 69 67 70 68 $logs = get_logs(); 71 69 72 70 $file = dirname( __FILE__ ) . "/chatwee_config.json"; 73 71 $current = @file_get_contents($file); 74 72 $current = json_encode($settings) . json_encode($logs); 75 73 file_put_contents($file, $current); 76 74 77 75 header('Content-Type: application/octet-stream'); 78 76 header('Content-Disposition: attachment; filename=' . basename($file)); … … 209 207 <input type="submit" name="chatwee_display_properties_submit" class="button-primary" value="Save changes" /> 210 208 </td> 211 </tr> 209 </tr> 212 210 </table> 213 211 </form> … … 339 337 </div> 340 338 341 339 342 340 343 341 <div class="chatwee-content-box chatwee-side-box"> … … 396 394 wp_register_script('chatwee_admin_script_user_list_item', plugin_dir_url(__FILE__) . 'js/toolkit/UserListItem.js', false, 'CFFVER'); 397 395 wp_enqueue_script('chatwee_admin_script_user_list_item'); 398 396 399 397 wp_register_script('chatwee_admin_script_page_picker', plugin_dir_url(__FILE__) . 'js/toolkit/PagePicker.js', false, 'CFFVER'); 400 398 wp_enqueue_script('chatwee_admin_script_page_picker'); … … 433 431 function search_page() { 434 432 global $wpdb; 435 436 $pages_query = $wpdb->get_results( 433 434 $pages_query = $wpdb->get_results( 437 435 $wpdb->prepare("SELECT * FROM $wpdb->posts WHERE post_title LIKE '%%" . $_POST['search_name'] . "%%' AND post_status = 'publish' AND (post_type = 'post' OR post_type = 'page') LIMIT 10") 438 436 ); 439 437 440 438 $pages_found = $pages_query; 441 439 … … 544 542 } 545 543 } 546 544 547 545 echo json_encode($result); 548 546 exit; -
chatwee/trunk/chatwee.php
r1712502 r1712683 5 5 Plugin URI: https://chatwee.com/ 6 6 Description: WordPress Chat by Chatwee is fully customizable social chat & comment platform for websites and blogs. With Chatwee you can engage your online community and provide real-time communication. 7 Version: 2.0. 27 Version: 2.0.3 8 8 Author: Chatwee Ltd 9 9 Author URI: https://chatwee.com/ … … 96 96 } 97 97 98 99 100 98 function if_user_is_moderator($user_id) { 101 99 global $wpdb; … … 152 150 ChatweeV2_Configuration::setChatId($chatwee_settings["chat_id"]); 153 151 ChatweeV2_Configuration::setClientKey($chatwee_settings["client_key"]); 152 ChatweeV2_Configuration::setCustomUserAgent("Chatwee Wordpress Plugin 2.0.3"); 154 153 155 154 if($chatwee_settings["disable_offline_users"] === true && $chatwee_settings["enable_sso"] === true && is_user_logged_in() === false && ChatweeV2_Session::isSessionSet() === true) { -
chatwee/trunk/lib/ChatweeV2_SDK/Chatwee/HttpClient.php
r1564521 r1712683 4 4 { 5 5 const API_URL = "http://chatwee-api.com/v2/"; 6 7 const USER_AGENT_HEADER = "ChatweeV2 PHP SDK 1.02 RAW"; 6 8 7 9 private $response; … … 28 30 $curl = curl_init(); 29 31 32 $customUserAgent = ChatweeV2_Configuration::getCustomUserAgent(); 33 $userAgent = $customUserAgent ? $customUserAgent : self::USER_AGENT_HEADER; 34 30 35 curl_setopt($curl, CURLOPT_TIMEOUT, 60); 31 36 curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method); … … 36 41 'Accept: application/xml', 37 42 'Content-Type: application/xml', 38 'User-Agent: ChatweeV2 PHP SDK 1.01'43 'User-Agent: ' . $userAgent 39 44 )); 40 45 … … 58 63 $result = ""; 59 64 foreach($parameters as $key => $value) { 60 $result .= ($key . "=" . ($value ? urlencode( htmlentities($value)) : $value) . '&');65 $result .= ($key . "=" . ($value ? urlencode($value) : $value) . '&'); 61 66 } 62 67 -
chatwee/trunk/lib/ChatweeV2_SDK/Chatwee/Session.php
r1564521 r1712683 3 3 class ChatweeV2_Session 4 4 { 5 const SESSION_DURATION = 86400; 6 5 7 private static function getCookieKey() { 6 8 if(ChatweeV2_Configuration::isConfigurationSet() === false) { … … 23 25 $cookieDomain = "." . implode(".", $hostChunks); 24 26 25 setcookie(self::getCookieKey(), $sessionId, time() + 2592000, "/", $cookieDomain);27 setcookie(self::getCookieKey(), $sessionId, time() + self::SESSION_DURATION, "/", $cookieDomain); 26 28 } 27 29 -
chatwee/trunk/lib/ChatweeV2_SDK/Chatwee/SsoManager.php
r1587657 r1712683 26 26 27 27 $sessionId = ChatweeV2_SsoUser::login(Array( 28 "userId" => $parameters["userId"] 28 "userId" => $parameters["userId"], 29 "userIp" => ChatweeV2_Utils::getUserIp() 29 30 )); 30 31 -
chatwee/trunk/readme.txt
r1712004 r1712683 135 135 * Plugin GUI improved 136 136 137 = 2.0.2 =138 139 * SSO session validation140 141 137 == Frequently Asked Questions == 142 138
Note: See TracChangeset
for help on using the changeset viewer.