<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=300, initial-scale=1" name="viewport">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Needs authentication</title>
<base href="https://www.drv.tw">
<link rel="stylesheet" type="text/css" href="/inc/wd.css">
<link rel="stylesheet" type="text/css" href="/inc/wd-s.css" media="screen and (max-width: 580px)">
</head>
<body>
<h1 class="bar warn">Needs authentication</h1>
<div class="main instructions">
<p>Due to malicious abuse by some users, we are strictly enforcing authentication of
content ownership.</p>
<p>This site needs to be authenticated before its content can be shown. If <strong>you are the
owner of this site</strong>, please provide an <strong>organizational</strong> email
address (school, company, etc., <strong>not Gmail nor Outlook email</strong>) to verify
your identity.</p>
<div id="validationForm">
<label for="txtOrgEmail">Your organizational email (personal email not accepted):</label>
<input type="email" id="txtOrgEmail" onchange="checkOrgEmail()"
onkeyup="this.onchange()" onpaste="this.onchange()" oninput="this.onchange()">
<button id="btnGetCode" onclick="sendCode()" disabled>Get validation code in email</button>
<p><span id="tipEmailCheck" class="warn">Email address format not valid</span></p>
<form action="https://api.drv.tw/do/checkSiteAuth" method="GET">
<input type="hidden" id="url" name="url">
<input type="hidden" name="site" value="zbuexknqzrmhknjdzk0s1q">
<label for="txtValidation">Enter validation code:</label>
<input type="text" id="txtValidation" name="code" maxlength="6" onchange="checkCodeLength()"
onkeyup="this.onchange()" onpaste="this.onchange()" oninput="this.onchange()">
<input type="submit" value="Validate" id="btnValidate" disabled>
</form>
</div>
</div>
<div id="footnotes">
<div class="left">
<a href="/">Home / Sign-in</a>
<a href="/tos.html" target="_blank">Terms</a>
<a href="/privacy.html" target="_blank">Privacy</a>
<a href="https://twitter.com/drv_tw" target="_blank">Twitter</a>
<a href="mailto:drvtw@outlook.com" id="mailto">Email</a>
<a href="https://docs-of.drv.tw" target="_blank">Docs</a>
<a href="/supportus.html" title="Your support is greatly appreciated!"
class="highlight">Support us</a>
</div>
<div class="right">
<div id="google_translate_element"></div>
</div>
</div>
<script type="text/javascript">
document.getElementById('mailto').setAttribute('href','mailto:drvtw@outlook.com?subject='+encodeURIComponent('Authenticate '+location.href));
document.getElementById('url').setAttribute('value',location.href);
function checkOrgEmail(){
const email = document.getElementById('txtOrgEmail').value ;
const bValidEmail = !!(String(email).toLowerCase().match(
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
)) ;
document.getElementById('btnGetCode').setAttribute('disabled', '');
if( bValidEmail ){
const email_lower = email.toLowerCase() ;
if( ( -1 == email_lower.indexOf('@gmail.') )
&& ( -1 == email_lower.indexOf('@outlook.') )
&& ( -1 == email_lower.indexOf('@live.') )
&& ( -1 == email_lower.indexOf('@hotmail.') )
) {
document.getElementById('btnGetCode').removeAttribute('disabled');
document.getElementById('tipEmailCheck').innerText = '' ;
}
else
document.getElementById('tipEmailCheck').innerText = 'Requires email of your organization (school, company, etc.).' ;
}
else
document.getElementById('tipEmailCheck').innerText = 'Email address format not valid.' ;
}
function checkCodeLength(){
console.log(document.getElementById('txtValidation').value);
if(6==document.getElementById('txtValidation').value.length)
document.getElementById('btnValidate').removeAttribute('disabled');
else
document.getElementById('btnValidate').setAttribute('disabled','');
}
function sendCode(){
const site = 'zbuexknqzrmhknjdzk0s1q' ;
const email = document.getElementById('txtOrgEmail').value ;
document.getElementById('tipEmailCheck').innerText = 'Sending code...' ;
fetch('https://api.drv.tw/do/sendSiteAuth?' + new URLSearchParams({ site, email }))
.then( resp => resp.json() )
.then( (json) => {
if( json.success ) {
document.getElementById('tipEmailCheck').innerText = 'Sent. Check your email for validation code.' ;
document.getElementById('btnGetCode').setAttribute('disabled', '');
const tsSent = Date.now();
const timer = setInterval(function(){
const secPassed = Math.floor( ( Date.now() - tsSent ) / 1000 ) ;
if( secPassed > 60 ) {
document.getElementById('btnGetCode').removeAttribute('disabled');
document.getElementById('btnGetCode').innerText = 'Get validation code in email' ;
clearInterval( timer ) ;
}
else {
document.getElementById('btnGetCode').innerText = 'Wait ' + ( 60 - secPassed ) + 's before requesting again' ;
}
}, 1000 ) ;
}
else
document.getElementById('tipEmailCheck').innerText = json.tip ;
})
.catch( ( reason ) => {
console.error( 'sendSiteAuth failed', reason ) ;
document.getElementById('tipEmailCheck').innerText = 'Unable to send code. Try again.' ;
}) ;
}
checkOrgEmail();
checkCodeLength();
function googleTranslateElementInit() {new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, gaTrack: true, gaId: 'UA-85417367-1'}, 'google_translate_element');}
</script><script type="text/javascript" src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
</body>
</html>