authpartner
Clone or download
Modified Files
--- 'a/header.php'
+++ b/header.php
@@ -1,6 +1,4 @@
-<!DOCTYPE html>
-<?php include 'config.php'; ?>
-<?php
+<?php include 'config.php';
$code = "code_signup";
$code_download = "code_download";
?>
@@ -21,6 +19,7 @@ $code_download = "code_download";
<!-- Custom Fonts -->
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="css/stylecrt.css" rel="stylesheet" type="text/css"/>
+<link href="css/datepicker.css" rel="stylesheet" type="text/css"/>
<style>
ul li span .btn {
background-color:blueviolet;
@@ -232,6 +231,7 @@ $code_download = "code_download";
<script src="js/modernizr.js" type="text/javascript"></script>
<script src="js/jQuery-2.1.3.min.js" type="text/javascript"></script>
<!-- <script src="js/bootstrap.min.js" type="text/javascript"></script> --->
+ <script src="js/bootstrap-datepicker.js" type="text/javascript"></script>
<script src="js/app.min.js" type="text/javascript"></script>
<script>
$(document).ready(function () {
--- 'a/otp_form.php'
+++ b/otp_form.php
@@ -1,6 +1,30 @@
-<?php include 'header.php';
-include 'config.php';
+<link href="css/bootstrap.min.css" rel="stylesheet">
+ <!-- Custom CSS -->
+ <link href="css/style.css" rel="stylesheet">
+ <link href="css/styles.css" rel="stylesheet">
+ <link href="css/font-style.css" rel="stylesheet" type="text/css">
+ <!-- Custom Fonts -->
+ <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
+ <link href="css/stylecrt.css" rel="stylesheet" type="text/css"/>
+<link href="css/datepicker.css" rel="stylesheet" type="text/css"/>
+
+<?php include 'config.php';
+
+if(isset($_GET['error_description'])){
+ header("Location: otp_form.php?message=".$_GET['error_description']);
+ exit;
+}
+if(isset($_GET['mob']))
+{
+$mobile = $_GET['mob'];
+$name = $_GET['name'];
+$uid = $_GET['uid'];
+$dob= $_GET['dob'];
+$gender = $_GET['gen'];
+$verification = 'Y';
+}
?>
+
<div class="col-lg-12">
<div class="container">
<?php
@@ -41,7 +65,7 @@ include 'config.php';
<div class="panel-body" style="box-shadow:2px 4px 4px 4px rgba(0, 0, 0, 0.1);" align="center">
<h4>Please Verify OTP for Login</h4>
<div class="panel-body login-panel">
- <form action = "otpverify.php" method = "POST" role="form">
+ <form action = "" method = "POST" role="form">
<input type="hidden" name="" value="" />
<div class="form-group">
<input type="text" class="form-control" placeholder="Enter OTP" name="otp" id="otp" maxlength="6" autocomplete="off" required>
@@ -58,7 +82,74 @@ include 'config.php';
</div>
</div>
-<?php include 'footer.php' ?>
+<?php
+if(!empty($_POST))
+{
+ $clientid = $config['client_id_download'];
+$secret = $config['client_secret_download'];
+$ts = time();
+$otp = $_POST['otp'];
+$hmac = hash('SHA256', $secret . $clientid . $mobile . $otp . $ts);
+$url = $config['demoauthverify_url'];
+$post = array(
+ 'clientid' => $clientid,
+ 'uid' => $uid,
+ 'dob' => $dob,
+ 'name' => $name,
+ 'gender' => $gender,
+ 'otp' => $otp,
+ 'mobile' => $mobile,
+ 'verification' => $verification,
+ 'ts' => $ts,
+ 'hmac' => $hmac
+);
+ $vh = curl_init($url);
+curl_setopt($vh, CURLOPT_CUSTOMREQUEST, "POST");
+curl_setopt($vh, CURLOPT_POST, true);
+curl_setopt($vh, CURLOPT_TIMEOUT, 30);
+curl_setopt($vh, CURLOPT_HEADER, 1);
+curl_setopt($vh, CURLOPT_POSTFIELDS, $post);
+curl_setopt($vh, CURLOPT_SSL_VERIFYPEER, 0);
+curl_setopt($vh, CURLOPT_SSL_VERIFYHOST, 0);
+curl_setopt($vh, CURLOPT_RETURNTRANSFER, true);
+$result = curl_exec($vh);
+$curl_info = curl_getinfo($vh);
+if (curl_errno($vh)) {
+ $error_status = curl_error($vh);
+ curl_close($vh);
+} else {
+ curl_close($vh);
+}
+print_r($result);
+$header_size = $curl_info['header_size'];
+$header = substr($result, 0, $header_size);
+$body = substr($result, $header_size);
+$header = explode("\n", $header);
+
+
+$statuscode = (int)substr($header[2], 9, 3);
+$rest = json_decode($body);
+
+if($statuscode=='200')
+{
+ header("Location: signup.php?message=Your Account has been created. Please login through <a href='https://developers.digitallocker.gov.in' target='_blank' style='color:blue'>this </a> link ");
+ exit;
+}
+else
+{
+if(isset($rest->error) || !$result){
+
+ header("Location: otp_form.php?message=".$rest->error_description);
+
+ exit;
+}
+}
+
+//curl_close($vh);
+die();
+}
+
+//include 'footer.php' ?>
<script>
<?php
if(isset($_GET['message'])){
@@ -69,5 +160,11 @@ include 'config.php';
}
?>
</script>
+<script src="js/jquery.min.js"></script>
+ <script src="js/modernizr.js" type="text/javascript"></script>
+ <script src="js/jQuery-2.1.3.min.js" type="text/javascript"></script>
+ <!-- <script src="js/bootstrap.min.js" type="text/javascript"></script> --->
+ <script src="js/bootstrap-datepicker.js" type="text/javascript"></script>
+ <script src="js/app.min.js" type="text/javascript"></script>
</body>
</html>
--- 'a/otpverify.php'
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-include 'config.php';
-if(isset($_GET['error_description'])){
- header("Location: signup.php?message=".$_GET['error_description']);
- exit;
-}
-$uid = '266069189741';
-$name = 'Indresh Singh Bhadoria';
-$dob = '15021991';
-$gender = 'M';
-$mobile = '9753412871';
-$verification = 'Y';
-
-//$clientid = $config['client_id_download'];
-//$secret = $config['client_secret_download'];
-//$ts=time();
-//$hmac = hash('SHA256',$secret.$clientid.$uid.$consent.$ts);
-$clientid = $config['client_id_download'];
-$secret = $config['client_secret_download'];
-$ts = time();
-$otp = $_POST['otp'];
-$hmac = hash('SHA256', $secret . $clientid . $mobile . $otp . $ts);
-$url = $config['demoauthverify_url'];
-$post = array(
- 'clientid' => $clientid,
- 'uid' => $uid,
- 'dob' => $dob,
- 'name' => $name,
- 'gender' => $gender,
- 'otp' => $otp,
- 'mobile' => $mobile,
- 'verification' => $verification,
- 'ts' => $ts,
- 'hmac' => $hmac
-);
-$vh = curl_init($url);
-curl_setopt($vh, CURLOPT_CUSTOMREQUEST, "POST");
-curl_setopt($vh, CURLOPT_POST, true);
-curl_setopt($vh, CURLOPT_TIMEOUT, 30);
-curl_setopt($vh, CURLOPT_POSTFIELDS, $post);
-curl_setopt($vh, CURLOPT_SSL_VERIFYPEER, 0);
-curl_setopt($vh, CURLOPT_SSL_VERIFYHOST, 0);
-curl_setopt($vh, CURLOPT_RETURNTRANSFER, true);
-$result = curl_exec($vh);
-$rest = json_decode($result);
-if(isset($rest->error) || !$result){
- header("Location: otp_form.php?message=".$rest->error_description);
- exit;
-}
-curl_close($vh);
-?>
\ No newline at end of file
--- 'a/signup.php'
+++ b/signup.php
@@ -4,9 +4,9 @@
<?php
$msg = "message";
if (isset($_GET[$msg])) {
- $message=$_GET[$msg];
- $alert = "red";
-
+ $message = $_GET[$msg];
+ $alert = "red";
+
echo "<div class='alert' id='alert' style='color:" . $alert . "'> <button type='button' class='close' data-dismiss='alert'>x</button>" . $message . "</div>";
}
?>
@@ -19,7 +19,6 @@
<div class="wizard col-md-12" >
<div class="col-sm-12 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<form action = "signupcurl.php" method = "POST" role="form">
- <div class="tab-content" style="min-height: 401px !important;">
<div class="panel-group box-shadow-dark">
<div class="panel panel-warning no-padding-bottom" style="margin-left: 10%;width: 60%;">
<div class="panel-heading">
@@ -29,21 +28,14 @@
<div class="panel-body">
<div class="row">
<div class="form-group col-md-6">
- <label>Client ID</label>
- <input type="text" class="form-control" name = "clientid" value="<?php echo $config['client_id_download'] ?>" placeholder="Training Programme *" required>
- </div>
- <div class="form-group col-md-6">
- <label>Aadhaar</label>
- <input type="text" class="form-control" name="uid" id="uid" value="" placeholder="Enter Aadhaar Number *" required>
- </div>
- <div class="form-group col-md-6">
<label>Name</label>
<input type="text" class="form-control" name="name" id="name" value="" placeholder="Enter Name As Per Aadhaar *" required>
</div>
<div class="form-group col-md-6">
- <label>Dob</label>
- <input type="text" class="form-control" name="dob" id="dob" value="" placeholder="Enter Dob *" required>
+ <label><i class="fa fa-calendar"></i> Date Of Birth</label>
+ <input type="text" class="form-control datetime" id="dob" name="dob" value="" placeholder="Enter Date Of Birth *">
</div>
+
<div class="form-group col-md-6">
<label>Gender</label>
<select style="width:280px; color: #999;" class="form-control" name="gender" id="gender" required>
@@ -53,28 +45,16 @@
</select>
</div>
<div class="form-group col-md-6">
- <label>Verification</label>
- <select style="width:280px; color: #999;" class="form-control" name="verification" id="verification" required>
- <option value="">Select Verification *</option>
- <option value="Y">Y</option>
- <option value="N">N</option>
- </select>
- </div>
- <div class="form-group col-md-6">
<label>Mobile</label>
- <input type="text" class="form-control" name="mobile" id="mobile" value="" placeholder="Enter mobile number *" required>
+ <input type="text" class="form-control" name="mobile" id="mobile" value="" maxlength="10" placeholder="Enter mobile number *" required>
</div>
<div class="form-group col-md-6">
- <label>Consent</label>
- <select style="width:280px; color: #999;" class="form-control" name="consent" id="consent" required>
- <option value="">Select Consent *</option>
- <option value="Y">Y</option>
- <option value="N">N</option>
- </select>
+ <label>Aadhaar</label>
+ <input type="text" class="form-control" name="uid" id="uid" value="" maxlength="12" placeholder="Enter Aadhaar Number *" required>
</div>
<div class="panel-footer">
<div class="text-center">
- <input type="submit" class="btn btn-primary" name="submit" style=" border-radius:5px; margin:20px;" value="Submit" />
+ <input type="submit" class="btn btn-primary" name="submit" style=" border-radius:5px; margin-top:30px;" value="Submit" />
</div>
</div>
</div>
@@ -84,7 +64,6 @@
</div>
<div class="clearfix"></div>
</form>
- </div>
</div>
</div>
</div>
@@ -92,12 +71,19 @@
</section>
<?php include 'footer.php' ?>
<script>
- <?php
- if(isset($_GET['message'])){
- echo 'setTimeout(function () {
+ $(".datetime").datepicker({
+ format: 'dd/mm/yyyy',
+ todayHighlight: true,
+ endDate: "today"
+ });
+</script>
+<script>
+<?php
+if (isset($_GET['message'])) {
+ echo 'setTimeout(function () {
window.location.href = "signup.php";
- }, 3000);
+ }, 5000);
';
- }
- ?>
+}
+?>
</script>
--- 'a/signupcurl.php'
+++ b/signupcurl.php
@@ -9,8 +9,8 @@ $name = $_POST['name'];
$dob = str_replace('/','',$_POST['dob']);
$gender = $_POST['gender'];
$mobile = $_POST['mobile'];
-$verification = $_POST['verification'];
-$consent = $_POST['consent'];
+$verification = 'Y';
+$consent = 'Y';
$clientid = $config['client_id_download'];
$secret = $config['client_secret_download'];
$ts=time();
@@ -44,14 +44,10 @@ if(isset($rst->error) || !$result){
header("Location: signup.php?message=".$rst->error_description);
exit;
}
-//if(!empty($rst->mobile))
-//{
-// print_r($result);
-//
-// $path = $config['baseUrl'];
-// //header('Location: '.$path.'otp_form.php?uid='.$uid.'&name='.$name.'&dob='.$dob.'&gen='.$gender.'&mob='.$mobile);
-//}
-//print_r($rst);
-//die();
+if(!empty($rst->mobile))
+{
+ $path = $config['baseUrl'];
+ header('Location: '.$path.'otp_form.php?uid='.$uid.'&name='.$name.'&dob='.$dob.'&gen='.$gender.'&mob='.$mobile);
+}
?>
\ No newline at end of file