• Resolved devhendrix

    (@devhendrix)


    Hello, how are you guys?

    I’m currently building a website to sell a course with the tutor lms plugin (amazing plugin, by the way).

    I’ve noticed that the students can upload a image to use as their profile avatar, but I want to prevent potential hackers to use that functionality to damage the website.

    Because of that i want to disable that functionality for students. Is there any way that i could do that?

    Thank you all guys!

    • This topic was modified 4 years, 6 months ago by devhendrix.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Not using the Tutor LMS profile part myself, so the answer won’t be directly related to the image upload/showcase, but what you can do:

    – find the php file in the template folder in the tutor plugin (through plugin editor or ftp)
    – remember the folders it was in (for example /templates/dashboard/quiz-attempts/ for quiz-reviews.php)
    – in your theme folder, create a folder called “tutor”
    – in there you recreate the folders you found that php file in, except “templates” (in the example you’ll create /your-theme-name/tutor/dashboard/quiz-attempts/)
    – copy the php file (in the example quiz-reviews.php) in there

    You’ll need to copy over the file for the user profile (if you’re showing it), and the image upload part.

    I could be mistaken, as I can’t double check on my website, but the part for uploading an image is mostlikely in tutor/templates/dashboard/settings/profile.php under

    <div class="tutor-form-col-6">
    	<div class="tutor-form-group">
    		<label>
    			<?php _e('Profile Photo', 'tutor'); ?>
    		</label>
    		<div class="tutor-profile-photo-upload-wrap">
    			<?php
    			$profile_photo_src = tutor_placeholder_img_src();
    			$profile_photo_id = get_user_meta($user->ID, '_tutor_profile_photo', true);
    			if ($profile_photo_id){
    				$profile_photo_src = wp_get_attachment_image_url($profile_photo_id, 'thumbnail');
    			}
    			?>
    			<a href="javascript:;" class="tutor-profile-photo-delete-btn"><i class="tutor-icon-garbage"></i> </a>
    			<img src="<?php echo $profile_photo_src; ?>" class="profile-photo-img">
    			<input type="hidden" id="tutor_profile_photo_id" name="tutor_profile_photo_id" value="<?php echo $profile_photo_id; ?>">
    			<input type="file" name="tutor_profile_photo_file" id="tutor_profile_photo_file" style="display:none"/>
    			<button type="button" id="tutor_profile_photo_button" class="tutor-profile-photo-upload-btn"><?php _e('Upload Image', 'tutor'); ?></button>
    		</div>
    	</div>
    </div>

    If you delete that part the ability to add an image should disappear.

    Hope this helps.

    Thread Starter devhendrix

    (@devhendrix)

    Thank you very much for your reply! I’ve end up deciding by removing the profile function.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Disable Profile Pic for students’ is closed to new replies.