Changeset 630271
- Timestamp:
- 11/26/2012 07:05:31 PM (13 years ago)
- Location:
- video-lead-form
- Files:
-
- 2 added
- 2 edited
-
assets/screenshot-1.png (added)
-
assets/screenshot-2.png (added)
-
trunk/VideoLeadForm.php (modified) (10 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
video-lead-form/trunk/VideoLeadForm.php
r628381 r630271 4 4 Plugin URI: http://video-lead-form.com/wordpress-plugin 5 5 Description: Video Lead Form turns your videos into lead generation machines. By automatically embedding a lead form directly into the video users have a clean experience of watching your video and providing you with their information. This plugin provides the ability to upload, manage, and embed your videos from directly within wordpress. 6 Version: 0. 56 Version: 0.6 7 7 Author: Sumilux 8 8 Author URI: http://video-lead-form.com/ … … 31 31 define('VLF_API_URL','http://www.video-lead-form.com/app'); 32 32 define('VLF_FRAME_URL','https://www.video-lead-form.com/app'); 33 34 /* 35 * Check if session is already started, if not start one 36 */ 37 if ( !session_id() ){ 38 session_start(); 39 } 33 40 34 41 /* … … 76 83 function vlf_login_page($errMsg = false, $successMsg = false){ 77 84 78 $errMsg = getRequestVar('errMsg',false); 79 $successMsg = getRequestVar('successMsg',false); 85 $currentMessage = getCurrentMessage(); 86 clearCurrentMessage(); 87 if(is_array($currentMessage)){ 88 if($currentMessage['type'] == 'error'){ 89 $errMsg = $currentMessage['msg']; 90 } elseif($currentMessage['type'] == 'success') { 91 $successMsg = $currentMessage['msg']; 92 } 93 } 80 94 81 95 ?> … … 194 208 195 209 if(!$vlf_email_address || !$vlf_api_token){ 196 $errMsg = 'Please provide a valid User Name and API Token.';210 setCurrentMessage('Please provide a valid Email Address and API Token.'); 197 211 } else { 198 212 … … 203 217 204 218 if(is_wp_error($results)){ 205 $errMsg = 'An error occured while trying to call the VLF API.';219 setCurrentMessage('An error occured while trying to call the VLF API.'); 206 220 } elseif(!$results['response'] || !$results['response']['code'] || $results['response']['code'] != 200){ 207 $errMsg = 'The VLF API returned a server level error.';221 setCurrentMessage('The VLF API returned a server level error.'); 208 222 } else { 209 223 $userData = json_decode($results['body'],true); 210 224 if(!is_array($userData)){ 211 $errMsg = 'The API results from the VLF API are not formed properly.';225 setCurrentMessage('The API results from the VLF API are not formed properly.'); 212 226 } elseif($userData['validUser'] && $userData['validUser'] == true){ 213 227 update_option('vlf_email_address',$vlf_email_address); 214 228 update_option('vlf_api_token',$vlf_api_token); 215 229 } else { 216 $errMsg = 'Invalid email address or api token, please check the values and try again.';230 setCurrentMessage('Invalid email address or api token, please check the values and try again.'); 217 231 } 218 232 } … … 220 234 } 221 235 require_once(ABSPATH . 'wp-includes/pluggable.php'); 222 wp_redirect( $_SERVER['HTTP_REFERER'] .'&errMsg='.urlencode($errMsg));236 wp_redirect( $_SERVER['HTTP_REFERER'] ); 223 237 exit(); 224 238 … … 236 250 237 251 if(!$vlf_first_name || !$vlf_last_name || !$vlf_email_address){ 238 $errMsg = 'Missing either First Name, Last Name, or Email Address.';252 setCurrentMessage('Missing either First Name, Last Name, or Email Address.'); 239 253 } else { 240 254 /* … … 245 259 246 260 if(is_wp_error($results)){ 247 $errMsg = 'An error occured while trying to call the VLF API.';261 setCurrentMessage('An error occured while trying to call the VLF API.'); 248 262 } elseif(!$results['response'] || !$results['response']['code'] || $results['response']['code'] != 200){ 249 $errMsg = 'The VLF API returned a server level error.';263 setCurrentMessage('The VLF API returned a server level error.'); 250 264 } else { 251 265 $userData = json_decode($results['body'],true); 252 266 253 267 if(!is_array($userData)){ 254 $errMsg = 'The API results from the VLF API are not formed properly.';268 setCurrentMessage('The API results from the VLF API are not formed properly.'); 255 269 } elseif($userData['registrationSuccessful'] && $userData['registrationSuccessful'] == true){ 256 $successMsg = 'Registration successful. Please check your email to retreive your API Token and then return to this page to log in.';270 setCurrentMessage('Registration successful. Please check your email to retreive your API Token and then return to this page to log in.','success'); 257 271 } else { 258 $errMsg = 'A problem occured during registration, please check your information and try again.';272 setCurrentMessage('A problem occured during registration, please check your information and try again.'); 259 273 } 260 274 } … … 262 276 263 277 require_once(ABSPATH . 'wp-includes/pluggable.php'); 264 wp_redirect( $_SERVER['HTTP_REFERER'] .'&errMsg='.urlencode($errMsg).'&successMsg='.urlencode($successMsg));278 wp_redirect( $_SERVER['HTTP_REFERER'] ); 265 279 exit(); 266 280 } … … 272 286 delete_option('vlf_email_address'); 273 287 delete_option('vlf_api_token'); 288 clearCurrentMessage(); 274 289 } 275 290 -
video-lead-form/trunk/readme.txt
r628381 r630271 1 === Plugin Name===1 === Video Lead Form === 2 2 Contributors: fillup17 3 3 Tags: contact form, lead form, video player … … 54 54 == Screenshots == 55 55 56 1. Register or login page .57 2. Manage videos page .56 1. Register or login page (screenshot-1.png). 57 2. Manage videos page (screenshot-2.png). 58 58 59 59 == Changelog == 60 61 = 0.6 = 62 * Fixed XSS bug in admin register/login page 60 63 61 64 = 0.5 = … … 64 67 == Upgrade Notice == 65 68 69 = 0.6 = 70 * Fixes XSS bug in admin register/login page. It is recommended you upgrade. 71 66 72 = 0.5 = 67 73 * Initial Release
Note: See TracChangeset
for help on using the changeset viewer.