Jump to content

How to require users verify their identity in order to upload videos


Recommended Posts

There is no built-in functionality in KVS to require users verify their documents or selfie, but there is alternative way to use Posts functionality for that. Even posts don't allow users to upload files, so it will be required to ask users to upload their documents to their own cloud services and specify secure link to the uploaded file.

verification_popup.png.0f8088cc5b70d64dd969601dadf2115e.png

Here is how to configure that.

 

Creating post type for the task and configuring global block for the users

Step 1. Please go to Posts -> Post types and create new post type with the following data:

  • Title: any of your choice, e.g. Identity Confirmation
  • External ID: identity_confirmation
  • Post page URL pattern: 404.php?%ID%

 

Step 2. Go to Website UI -> Global blocks and add block with the following parameters:

  • Block name: Identity Confirmation
  • Block type: post_edit
  • Cache: 86400 (default value)

After saving global blocks list you will notice Identity Confirmation block added to the end. Click to edit this block.

 

Step 3. Set the following Template code for this block:

{{query_kvs select="single" table="posts_types" where_external_id='identity_confirmation' assign='post_type'}}
{{query_kvs select="list" table="posts" where_user_id=$smarty.session.user_id where_post_type_id=$post_type.post_type_id assign='post'}}
{{if $async_submit_successful=='true'}}
	<div class="success" data-fancybox="refresh">
		{{$lang.edit_profile.success_message_identity_confirmation_requested}}
	</div>
{{else}}
	<strong class="popup-title">{{$lang.edit_profile.title_identity_confirmation}}</strong>
	<div class="popup-holder">
		{{if count($post)>0}}
			<div class="success" data-fancybox="refresh">
				{{$lang.edit_profile.success_message_identity_confirmation_requested}}
			</div>
		{{elseif $smarty.session.status_id==6}}
			<div class="success" data-fancybox="refresh">
				{{$lang.edit_profile.success_message_identity_confirmed}}
			</div>
		{{else}}
			<form action="{{$lang.urls.identity_confirmation}}" data-form="ajax" method="post">
				<div class="generic-error hidden"></div>
				<p>
					{{$lang.edit_profile.field_identity_confirmation|replace:"%site%":$lang.project_name|smarty:nodefaults}}
				</p>
				<div class="row">
					<input type="text" name="content" class="textfield"/>
					<div class="field-error down"></div>
				</div>

				<div class="bottom">
					{{if $use_captcha==1}}
						<label>{{$lang.common_forms.field_captcha_hint}}</label>
						<div class="captcha-control">
							{{if $recaptcha_site_key!=''}}
								<div data-name="code">
									<div data-recaptcha-key="{{$recaptcha_site_key}}" data-recaptcha-theme="{{if $lang.theme.style=='metal'}}dark{{else}}light{{/if}}"></div>
									<div class="field-error down"></div>
								</div>
							{{else}}
								<div class="image">
									<img src="{{$lang.urls.captcha|replace:"%ID%":"signup"}}?rand={{$smarty.now}}" alt="{{$lang.common_forms.field_captcha_image}}"/>
									<label for="identity_confirmation_code" class="field-label required">{{$lang.common_forms.field_captcha}}</label>
									<input type="text" name="code" id="identity_confirmation_code" class="textfield" autocomplete="off"/>
									<div class="field-error up"></div>
								</div>
							{{/if}}
						</div>
					{{/if}}
					<input type="hidden" name="action" value="add_new_complete"/>
					<input type="hidden" name="title" value="Identity Confirmation"/>
					<input type="submit" class="submit" value="{{$lang.edit_profile.btn_request}}"/>
				</div>
			</form>
		{{/if}}
	</div>
{{/if}}

 

Under block parameters change the following:

  • post_type (String): identity_confirmation
  • duplicates_allowed (On/Off): switch ON
  • optional_description (On/Off): switch ON
  • optional_tags (On/Off): switch ON
  • optional_categories (On/Off): switch ON
  • use_captcha (On/Off): switch ON, if you want users to solve captcha puzzle

 

Step 4. Go to Website UI -> Language files -> default and add the following texts at the end. Feel free to adjust as needed:

memberzone.profile_member_action_identity_confirmation  = Verify your account here.
edit_profile.title_identity_confirmation = Account Verification
edit_profile.field_identity_confirmation = Create a selfie of yourself holding an A4 sheet with our site name written by hand:<br/><br/><b>%site%</b><br/><br/>Then upload this image to a cloud of your choice (e.g. Google Docs) and send us link to the uploaded file:
edit_profile.success_message_identity_confirmation_requested = Thank you! Your account confirmation request was successfully registered and will be reviewed by our team soon.
edit_profile.success_message_identity_confirmed = Your account has already been confirmed.
edit_profile.btn_request = Submit Request
edit_video.warning_upload = Only verified accounts can upload videos.
urls.identity_confirmation = /confirm-account/

 

Step 5. You need to edit .htaccess file that is located in www root with your FTP client, or any other File Manager that might be provided by your server panel. Add the following line (could be added in the beginning, or next to RewriteRule ^delete-profile/$):

RewriteRule ^confirm-account/$                      index.php?mode=async&function=get_block&block_id=post_edit_identity_confirmation&global=true [L,QSA]

 

Changing upload block to allow upload only for verified users

To be noted, it will be required to use webmaster status to manually control which users are allowed to upload. In member profile editor in admin panel you should manually change member status to webmaster as a result of account verification process.

 

Step 6. In order to change video upload block behavior, please go to Website UI -> Theme settings and scroll down to Functionality options group. Click on Video Edit link there to open video upload block settings. In Template code, your first line should look like this:

{{if $async_submit_successful=='true'}}

If it has something else, your video edit template is modified and you will need to adjust the proposed code to your template changes. The proposed code is to replace this line with this block:

{{if $smarty.session.status_id!=6}}
	<div class="headline">
		<h2>
			{{$lang.edit_profile.title_identity_confirmation}}
		</h2>
	</div>
	<div class="box">
		{{$lang.edit_video.warning_upload}}
		<a href="{{$lang.urls.identity_confirmation}}" data-fancybox="ajax" style="text-decoration: underline; font-weight: bold">{{$lang.memberzone.profile_member_action_identity_confirmation}}</a>
	</div>
{{elseif $async_submit_successful=='true'}}

You may notice that we actually leave the old line almost there, with slightly changed from {{if}} to {{elseif}} syntax.

This template change will hide video upload form for non-webmaster users and instead will show a link to verify their account:

video_edit.png.97e0b0fb8ef394a2be88e87b24766514.png

 

Step 7. However this may not stop bots, that could upload bypassing the actual site GUI, so you may need to add some small additional protection to make sure that bots can't upload as well. In the same video edit block settings activate the following parameters:

  • max_duration (Integer): 1
  • max_duration_webmaster (Integer): 9999

These settings mean that all users will not be able to upload virtually any video, because of duration limit of 1 second. While webmaster users will be able to upload videos with duration up to 9999 seconds. So only webmaster users can actually upload videos.

 

Testing all together

Now log in with non-webmaster profile and go to upload page. You should see link to verify your account. If you see a white or partial page, you did wrong paste at step #6. You can go to Website UI -> Change history and look at your recent change to video edit block. There you can find original template version and return it back if needed, or check what you did wrong here.

By clicking the account verification link you should see the popup to verify account. Submit something into the text field. This should show you success message that your data is submitted. If it shows any error, you did something wrong at step #3 with block parameters.

If you go to admin panel start page, you may notice that it will show you alert like the following:

Quote

There are 1 posts added or updated, they need to be reviewed.

Click this link and you will see Account Verification post submitted by you seconds ago. Open it and check the link under Content area. If you want to verify it, you first need to manually open user profile editor for this user and change their status to webmaster. Then approve this account verification post.

If you want to reject it, you just need to delete it, so that user can re-submit again. Unfortunately KVS for now doesn't support any automated messages to be sent to users on different admin actions; if you want to notify user about some issue with their verification, you will need to manually submit a message to this user via Memberzone -> Messages.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

I think the reason here is not to verify age, but to make sure that people who upload content, are the same people who are on video. Like on Onlyfans, where people upload videos shot by themselves.

Anyway, you can do country check by adjusting this part in step #6:

{{if $smarty.session.status_id!=6}}

To this code:

{{if $smarty.session.status_id!=6 && $smarty.server.GEOIP_COUNTRY_CODE|strtolower=='de'}}

But you will also then have to undo step #7, because it cannot be set differently to different countries.

Link to comment
Share on other sites

Would it be possible to show the message for some chosen users?
Since if webmasters upload videos from tubes, it is not recommended to show the message, or it is only an option and not mandatory when uploading videos.

Link to comment
Share on other sites

Sorry, I'm not sure I understand this. The above approach means that EVERY user MUST be manually approved and promoted to webmaster status by admin in order to be able to upload videos. So the logic here is to validate users, not videos.

If you mean for individual videos you want to ask users to verify if this specific video is the one they shoot themselves, this is not currently possible without custom coding in KVS backend.

Link to comment
Share on other sites

I mean if the user does not want to verify his account can he close the message and upload videos anyway?
If they are webmasters who upload many videos from different sites, this is not recommended.
if the message can be closed and ignored yes.

Link to comment
Share on other sites

  • 6 months later...
On 9/3/2022 at 7:55 PM, xvids said:

How I can also ask user to verify Email ID as well.

What is Email ID? Do you mean email address? This is typically verified by signup process.

On 9/3/2022 at 7:55 PM, xvids said:

2) Can I add one more "HTML <input>"

Yes, you can add up to 10 more different fields. First go into Settings -> Customization and there you can enable up to 10 custom text fields for Identity Confirmation post type. Then in block template you can add this for any number of custom fields:

<div class="row">
	<input type="text" name="custom1" class="textfield"/>
	<div class="field-error down"></div>
</div>

 

Link to comment
Share on other sites

3 hours ago, Tech Support said:

Do you mean email address? This is typically verified by signup process

Yes email address! 

3 hours ago, Tech Support said:

This is typically verified by signup process.

Yes I know that, but,

 

I want to ask user verify email address only when user try to upload video. If the user don't try to upload video/albums, then it not required verify their email.

 

xhamster,Xvideos doing like this way, user create account without verify email address, and then if the user want to upload video then they ask for verify email,

you can check both  website,

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...