Skip to content

Commit

Permalink
Merge pull request #19 from RusticiSoftware/remaining-regs-fix
Browse files Browse the repository at this point in the history
Allow unlimited accounts to create Registrations
  • Loading branch information
brianrogers authored Jan 19, 2022
2 parents 6d5676c + f331d93 commit 44ec32e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
10 changes: 9 additions & 1 deletion scormcloud/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: troyef, stuartchilds, timedwards, brianrogers
Tags: elearning, learning, scorm, aicc, education, training, cloud
Requires at least: 4.3
Tested up to: 5.8
Stable tag: 2.0.2
Stable tag: 2.0.3

Tap the power of SCORM to deliver and track training right from your WordPress-powered site.

Expand Down Expand Up @@ -48,6 +48,10 @@ The SCORM Cloud For WordPress basic functionality works with BuddyPress without


== Changelog ==
= 2.0.3 =
* Removes potentially bad logging call
* Allows for accounts with unlimited Registrations

= 2.0.2 =
* Fixes security issues with upload form.

Expand Down Expand Up @@ -163,6 +167,10 @@ The SCORM Cloud For WordPress basic functionality works with BuddyPress without
* Original Release.

== Upgrade Notice ==
= 2.0.3 =
* Removes potentially bad logging call
* Allows for accounts with unlimited Registrations

= 2.0.2 =
* Fixes security issues with upload form.

Expand Down
2 changes: 1 addition & 1 deletion scormcloud/scormcloud.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: http://scorm.com/wordpress
Description: Tap the power of SCORM to deliver and track training right from your WordPress-powered site. Just add the SCORM Cloud widget to the sidebar or use the SCORM Cloud button to add a link directly in a post or page.
Author: Rustici Software
Version: 2.0.2
Version: 2.0.3
Author URI: http://www.scorm.com
*/

Expand Down
4 changes: 1 addition & 3 deletions scormcloud/scormcloudcontenthandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,7 @@ public static function update_learner_info( $user_id ) {
// Ignore this since we don't really mind if cloud is updated if the ID isn't found.
// Wordpress will still be updated either way
}
} else {
write_log( "profile update skipped for {$user_data->user_email} due to missing first or last name" );
}
}
}

/**
Expand Down
6 changes: 5 additions & 1 deletion scormcloud/scormcloudplugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static function get_cloud_service( $force_network_settings = false ) {
$proxy = get_option( 'proxy' );
}

$origin = ScormEngineUtilities::getCanonicalOriginString( 'Rustici Software', 'WordPress', '2.0.2' );
$origin = ScormEngineUtilities::getCanonicalOriginString( 'Rustici Software', 'WordPress', '2.0.3' );

if ( strlen( $engine_url ) < 1 ) {
$engine_url = 'https://cloud.scorm.com/api/v2';
Expand Down Expand Up @@ -133,6 +133,10 @@ public static function remaining_registrations() {
return 1;
} else {
$reg_limit = (int) $account_info->regLimit;
if ( $reg_limit == -1 ){
//unlimited account
return 999;
}
$reg_usage = (int) $account_info->usage->regCount;
return $reg_limit - $reg_usage;
}
Expand Down

0 comments on commit 44ec32e

Please sign in to comment.