PluginProbe
Tutor LMS – eLearning and online course solution / 2.7.0
Tutor LMS – eLearning and online course solution v2.7.0
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 4.0.0 3.9.15 3.9.14 3.9.13 3.9.12 3.9.11 trunk 1.0.0 1.0.0-alpha 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 All 191 releases
← All changes | classes/User.php +4 -2 2.6.22.7.0 View file →
@@ -332,9 +332,11 @@
332 332 */
333 333 public function hide_notices() {
334 334 $hide_notice = Input::get( 'tutor-hide-notice', '' );
335 335 $is_register_enabled = Input::get( 'tutor-registration', '' );
336 - if ( is_admin() && 'registration' === $hide_notice ) {
336 + $has_manage_cap = current_user_can( 'manage_options' );
337 +
338 + if ( $has_manage_cap && is_admin() && 'registration' === $hide_notice ) {
337 339 tutor_utils()->checking_nonce( 'get' );
338 340
339 341 if ( 'enable' === $is_register_enabled ) {
340 342 update_option( 'users_can_register', 1 );
@@ -339,9 +341,9 @@
339 341 if ( 'enable' === $is_register_enabled ) {
340 342 update_option( 'users_can_register', 1 );
341 343 } else {
342 344 self::$hide_registration_notice = true;
343 - setcookie( 'tutor_notice_hide_registration', 1, time() + ( 86400 * 30 ), tutor()->basepath );
345 + setcookie( 'tutor_notice_hide_registration', 1, time() + MONTH_IN_SECONDS, tutor()->basepath );
344 346 }
345 347 }
346 348 }
347 349