authpartner

Clone or download

folder navigation

Modified Files

M Downloads/pic1.jpg
+- −-
Binary files 'a/Downloads/pic1.jpg' and b/Downloads/pic1.jpg differ
M browse.php
+0 −1
--- 'a/browse.php'
+++ b/browse.php
@@ -10,7 +10,6 @@ $client_secret = 'Pax7Rmv9uWo2KrNcXMtlDt
$hk = hash_hmac('sha256', $fileContent, $client_secret, true);
$hmac = base64_encode($hk);
$ur = array('Content-Type: '.$mime, 'Authorization: Bearer ' . $access_token, 'path : '.$filePath, 'hmac : ' . $hmac . '');
-//$fileContent = file_get_contents($filePath);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://developers.digitallocker.gov.in/public/oauth2/1/file/upload");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
A doc - Copy.php
+253 −0
--- /dev/null
+++ b/doc - Copy.php
@@ -0,0 +1,253 @@
+<?php
+include 'header.php';
+$code = $_GET['code'];
+$state = $_GET['state'];
+$url = "https://developers.digitallocker.gov.in/public/oauth2/1/token";
+$post = array(
+ 'code' => $code,
+ 'grant_type' => 'authorization_code',
+ 'client_id' => 'NIELN3M9',
+ 'client_secret' => 'DQ3pWgCtB0I3EhSrtTXU',
+ 'redirect_uri' => 'http://localhost/digibank/doc.php',
+);
+$vh = curl_init($url);
+curl_setopt($vh, CURLOPT_CUSTOMREQUEST, "POST");
+curl_setopt($vh, CURLOPT_POST, true);
+curl_setopt($vh, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
+curl_setopt($vh, CURLOPT_POSTFIELDS, $post);
+//curl_setopt($vh, CURLOPT_HTTPHEADER, $headers);
+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_close($vh);
+$notgettingdata = explode('¿', $result);
+$getToken = json_decode($notgettingdata[1]);
+$access_token = $getToken->access_token;
+
+
+
+
+$headers = array(
+ 'Authorization: Bearer ' . $access_token
+ //'Authorization: Basic '. base64_encode("$username:$password")
+);
+$urlFile = 'https://developers.digitallocker.gov.in/public/oauth2/1/files/';
+$vhf = curl_init($urlFile);
+curl_setopt($vhf, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
+curl_setopt($vhf, CURLOPT_HTTPHEADER, $headers);
+curl_setopt($vhf, CURLOPT_SSL_VERIFYPEER, 0);
+curl_setopt($vhf, CURLOPT_SSL_VERIFYHOST, 0);
+curl_setopt($vhf, CURLOPT_RETURNTRANSFER, true);
+$resFile = curl_exec($vhf);
+curl_close($vhf);
+$resFileNew = explode('¿', $resFile);
+$dataF = json_decode($resFileNew[1], TRUE);
+
+
+$headers = array(
+ 'Authorization: Bearer ' . $access_token
+ //'Authorization: Basic '. base64_encode("$username:$password")
+);
+$urlissued = 'https://developers.digitallocker.gov.in/public/oauth2/1/files/issued';
+$vhi = curl_init($urlissued);
+curl_setopt($vhi, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
+curl_setopt($vhi, CURLOPT_HTTPHEADER, $headers);
+curl_setopt($vhi, CURLOPT_SSL_VERIFYPEER, 0);
+curl_setopt($vhi, CURLOPT_SSL_VERIFYHOST, 0);
+curl_setopt($vhi, CURLOPT_RETURNTRANSFER, true);
+$resissued = curl_exec($vhi);
+$resissuedErr = curl_error($vhi);
+curl_close($vhi);
+$issuedNew = explode('¿', $resissued);
+$dataI = json_decode($issuedNew[1], TRUE);
+?>
+
+<div id="wrapper">
+ <div id="page-wrapper">
+ <div class="container-fluid">
+ <!-- Page Heading -->
+ <div class="row">
+ <div class="col-lg-12">
+ <div class="container">
+ <ul class="nav nav-tabs">
+ <li class="active"><a data-toggle="tab" href="#uploadeddocument">Uploaded Document</a></li>
+ <li><a data-toggle="tab" href="#issueddocument">Issued Document</a></li>
+ </ul>
+ <div class="tab-content">
+ <div id="uploadeddocument" class="tab-pane fade in active">
+ <section class="content">
+ <div class="row">
+ <div class="col-md-12">
+ <div class="box box-primary">
+ <div class="box box-body col-sm-12">
+ <div class="table-responsive">
+ <table class="table">
+ <tbody>
+ <tr>
+ <th>Name</th>
+ <th>Size</th>
+ <th>Date</th>
+ <th>Action</th>
+ </tr>
+ <div onclick="uriData(<?php echo $dataF['items'][0]['parent']; ?>)" >HOME</div>
+ <div id="parent"></div>
+ <?php
+ foreach ($dataF['items'] as $api_detail) {
+ if (isset($api_detail['id'])) {
+ $api_detail['id'] = $api_detail['id'];
+ $api_detail['parent'] = $api_detail['parent'];
+ } else {
+ $api_detail['id'] = "";
+ }
+ ?>
+ <tr>
+ <?php /**
+ <a href="/digibank/uri.php?access_tocken=<?php echo $access_token; ?>&uri=<?php echo($api_detail['uri']); ?>&id=<?php echo($api_detail['id']); ?>"></a>
+ * * */ ?>
+ <td onclick="uriData(<?php echo $api_detail['id'] . ',' . $api_detail['parent']; ?>)" id="<?php echo $api_detail['id']; ?>">
+ <?php
+ if ($api_detail['type'] == "dir") {
+ echo "<i class='fa fa-folder-o'></i> ";
+ echo($api_detail['name']);
+ } elseif ($api_detail['type'] == "file") {
+ echo "<i class='fa fa-file-o'></i> ";
+ echo($api_detail['name']);
+ }
+ ?>
+
+
+ <div class="row">
+ <div class="col-md-10 col-md-offset1 dataTable1" style="display:none;">
+ <table class="table table-responsive table-striped" >
+ <thead>
+
+ </thead>
+
+ <tbody class="dataTable" id="div_<?php echo $api_detail['id']; ?>">
+
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </td>
+ <td><?php echo($api_detail['size']); ?></td>
+ <td><?php echo($api_detail['date']); ?></td>
+ <?php if ($api_detail['type'] == "file") { ?>
+ <td>
+ <a href="download.php?accessToken=<?php echo $access_token; ?>&uri=<?php echo $api_detail['uri']; ?>&fileName=<?php echo $api_detail['name']; ?>" > <i class="fa fa-download"> </i></a>
+ </td>
+
+ <?php }
+ ?>
+ </tr>
+ <?php }
+ ?>
+
+ </tbody>
+ </table>
+ <div class="footer">
+ <a class="btn btn-default" style="float: right;" href="payment.php">Done</a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </section>
+ </div>
+ <div id="issueddocument" class="tab-pane fade in active">
+ <section class="content">
+ <div class="row">
+ <div class="col-md-12">
+ <div class="box box-primary">
+ <div class="box box-body col-sm-12">
+ <div class="table-responsive">
+ <table class="table">
+ <tr>
+ <th>Name</th>
+ <th>Size</th>
+ <th>Date</th>
+ </tr>
+ <?php
+ foreach ($dataI['items'] as $issued_detail):
+ ?>
+ <tr><td>
+ <?php
+ echo "<i class='fa fa-file-o'></i> ";
+ echo($issued_detail['name']);
+ ?>
+ </td>
+ <td><?php echo($issued_detail['size']); ?></td>
+ <td><?php echo($issued_detail['date']); ?></td>
+ <td><?php if ($api_detail['type'] == "file") { ?>
+ <td>
+ <a href="download.php?accessToken=<?php echo $access_token; ?>&uri=<?php echo $issued_detail['uri']; ?>&fileName=<?php echo $issued_details['name']; ?>" > <i class="fa fa-download"> </i></a>
+ </td>
+ <?php } ?>
+ </tr>
+ <?php
+ endforeach;
+ ?>
+ </table>
+ <div class="footer">
+ <a href="payment.php"><input type="button" class="btn btn-primary" value="Done" /></a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </section>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <!-- /.container-fluid -->
+ </div>
+</div>
+</body>
+<?php include 'footer.php' ?>
+<script>
+ function uriData(id, parent) {
+
+ alert(id);
+ alert(parent);
+ $(".dataTable").empty();
+ var id = id;
+ var accessTocken = "<?php echo $access_token; ?>";
+ var uri = "<?php echo $api_detail['uri']; ?>";
+ var uriDataHtml = "";
+ var fileOrFolder = "";
+ var accessToken = "<?php echo $access_token; ?>";
+ if (id != null) {
+ $.post("http://localhost/digibank/uri.php", {access_token: accessTocken, id: id}, function (result) {
+ $(".dataTable1").show();
+ $.each(result.items, function (i, l) {
+
+ if (result.items[i].type == "file") {
+ console.log(result.items);
+ fileOrFolder = "<i class='fa fa-file-o'></i> ";
+ } else {
+ fileOrFolder = "<i class='fa fa-folder-o'></i> ";
+ }
+ uriDataHtml += "<tr><th>" + fileOrFolder + result.items[i].name + "</th><th>" + result.items[i].type + "</th><th>" + result.items[i].date + "</th>\n\
+ <th>" + result.items[i].uri + "</th><th>\n\
+<a href='download.php?accessToken=" + accessToken + "&uri=" + result.items[i].uri + "&fileName=" + result.items[i].name + "' > <i class='fa fa-download'> </i></a><th></tr>";
+ $("#div_" + id).html(uriDataHtml);
+ $("#parent").html("<td onclick=uriData(" + id + ")>" + result.directory + "</td>")
+ });
+ }, "json")
+ .fail(function () {
+ $(".dataTable1").hide();
+
+ });
+ } else {
+ alert('This is not a folder');
+ }
+ }
+
+</script>
+</html>
\ No newline at end of file
M doc.php
+75 −90
--- 'a/doc.php'
+++ b/doc.php
@@ -26,7 +26,6 @@ $getToken = json_decode($notgettingdata[
$access_token = $getToken->access_token;
-
$headers = array(
'Authorization: Bearer ' . $access_token
//'Authorization: Basic '. base64_encode("$username:$password")
@@ -82,73 +81,59 @@ $dataI = json_decode($issuedNew[1], TRUE
<div class="box box-body col-sm-12">
<div class="table-responsive">
<table class="table">
-
- <tbody>
+ <thead>
<tr>
<th>Name</th>
<th>Size</th>
<th>Date</th>
<th>Action</th>
</tr>
- <div onclick="uriData(<?php echo $dataF['items'][0]['parent']; ?>)" >close</div>
- <?php
- foreach ($dataF['items'] as $api_detail) {
- if (isset($api_detail['id'])) {
- $api_detail['id'] = $api_detail['id'];
- $api_detail['parent'] = $api_detail['parent'];
- } else {
- $api_detail['id'] = "";
- }
- ?>
- <tr>
- <?php /**
- <a href="/digibank/uri.php?access_tocken=<?php echo $access_token; ?>&uri=<?php echo($api_detail['uri']); ?>&id=<?php echo($api_detail['id']); ?>"></a>
- * * */ ?>
- <td onclick="uriData(<?php echo $api_detail['id']; ?>)" id="<?php echo $api_detail['id']; ?>">
- <?php
- if ($api_detail['type'] == "dir") {
- echo "<i class='fa fa-folder-o'></i> ";
- echo($api_detail['name']);
- } elseif ($api_detail['type'] == "file") {
- echo "<i class='fa fa-file-o'></i> ";
- echo($api_detail['name']);
- }
- ?>
+ <div><b onclick="uriData(null, null)" >HOME</b><b id="parent"></b></div>
+ </thead>
+ <tbody id="folderPath">
- <div class="row">
- <div class="col-md-10 col-md-offset1 dataTable1" style="display:none;">
- <table class="table table-responsive table-striped" >
- <thead>
-
- </thead>
-
- <tbody class="dataTable" id="div_<?php echo $api_detail['id']; ?>">
-
- </tbody>
- </table>
- </div>
- </div>
- </td>
- <td><?php echo($api_detail['size']); ?></td>
- <td><?php echo($api_detail['date']); ?></td>
- <?php if ($api_detail['type'] == "file") { ?>
- <td>
- <a href="download.php?accessToken=<?php echo $access_token; ?>&uri=<?php echo $api_detail['uri']; ?>&fileName=<?php echo $api_detail['name']; ?>" > <i class="fa fa-download"> </i></a>
- </td>
-
- <?php }
- ?>
- </tr>
+ <?php
+ foreach ($dataF['items'] as $api_detail) {
+ if (isset($api_detail['id'])) {
+ $api_detail['id'] = $api_detail['id'];
+ $api_detail['parent'] = $api_detail['parent'];
+ } else {
+ $api_detail['id'] = "";
+ }
+ ?>
+ <tr>
+ <?php /**
+ <a href="/digibank/uri.php?access_tocken=<?php echo $access_token; ?>&uri=<?php echo($api_detail['uri']); ?>&id=<?php echo($api_detail['id']); ?>"></a>
+ * * */ ?>
+ <?php
+ if ($api_detail['type'] == "dir") {
+ echo '<td onclick="uriData(' . $api_detail['id'] . ',' . $api_detail['parent'] . ')">';
+ echo "<i class='fa fa-folder-o'></i> ";
+ echo($api_detail['name']);
+ } elseif ($api_detail['type'] == "file") {
+ echo "<td onclick='thisIsNotAFolder()'>";
+ echo "<i class='fa fa-file-o'></i> ";
+ echo($api_detail['name']);
+ }
+ echo "</td>";
+ ?>
+ <td><?php echo($api_detail['size']); ?></td>
+ <td><?php echo($api_detail['date']); ?></td>
+ <?php if ($api_detail['type'] == "file") { ?>
+ <td>
+ <a href="download.php?accessToken=<?php echo $access_token; ?>&uri=<?php echo $api_detail['uri']; ?>&fileName=<?php echo $api_detail['name']; ?>" > <i class="fa fa-download"> </i></a>
+ </td>
+ <?php }
+ ?>
+ </tr>
<?php }
?>
-
</tbody>
</table>
<div class="footer">
<a class="btn btn-default" style="float: right;" href="payment.php">Done</a>
</div>
-
</div>
</div>
</div>
@@ -156,7 +141,7 @@ $dataI = json_decode($issuedNew[1], TRUE
</div>
</section>
</div>
- <div id="issueddocument" class="tab-pane fade in active">
+ <div id="issueddocument" class="tab-pane">
<section class="content">
<div class="row">
<div class="col-md-12">
@@ -168,16 +153,15 @@ $dataI = json_decode($issuedNew[1], TRUE
<th>Name</th>
<th>Size</th>
<th>Date</th>
-
</tr>
-<?php
-foreach ($dataI['items'] as $issued_detail):
- ?>
- <tr><td>
- <?php
- echo "<i class='fa fa-file-o'></i> ";
- echo($issued_detail['name']);
+ <?php
+ foreach ($dataI['items'] as $issued_detail):
?>
+ <tr><td>
+ <?php
+ echo "<i class='fa fa-file-o'></i> ";
+ echo($issued_detail['name']);
+ ?>
</td>
<td><?php echo($issued_detail['size']); ?></td>
<td><?php echo($issued_detail['date']); ?></td>
@@ -185,11 +169,11 @@ foreach ($dataI['items'] as $issued_deta
<td>
<a href="download.php?accessToken=<?php echo $access_token; ?>&uri=<?php echo $issued_detail['uri']; ?>&fileName=<?php echo $issued_details['name']; ?>" > <i class="fa fa-download"> </i></a>
</td>
- <?php } ?>
+ <?php } ?>
</tr>
- <?php
- endforeach;
- ?>
+ <?php
+ endforeach;
+ ?>
</table>
<div class="footer">
<a href="payment.php"><input type="button" class="btn btn-primary" value="Done" /></a>
@@ -209,44 +193,45 @@ foreach ($dataI['items'] as $issued_deta
<!-- /.container-fluid -->
</div>
</div>
-
</body>
<?php include 'footer.php' ?>
<script>
- function uriData(id) {
- alert(id);
-
- $(".dataTable").empty();
+ function uriData(id, parent) {
+ $("#folderPath").empty();
var id = id;
var accessTocken = "<?php echo $access_token; ?>";
var uri = "<?php echo $api_detail['uri']; ?>";
var uriDataHtml = "";
var fileOrFolder = "";
+ var onclickFnc = "";
var accessToken = "<?php echo $access_token; ?>";
- if (id != null) {
- $.post("http://localhost/digibank/uri.php", {access_token: accessTocken, id: id}, function (result) {
- $(".dataTable1").show();
- $.each(result.items, function (i, l) {
-
- if (result.items[i].type == "file") {
- console.log(result.items);
- fileOrFolder = "<i class='fa fa-file-o'></i> ";
- } else {
- fileOrFolder = "<i class='fa fa-folder-o'></i> ";
- }
- uriDataHtml += "<tr><th>" + fileOrFolder + result.items[i].name + "</th><th>" + result.items[i].type + "</th><th>" + result.items[i].date + "</th>\n\
+
+ $.post("http://localhost/digibank/uri.php", {access_token: accessTocken, id: id}, function (result) {
+ $.each(result.items, function (i, l) {
+
+ if (result.items[i].type == "file") {
+ console.log(result.items);
+ fileOrFolder = "<i class='fa fa-file-o'></i> ";
+ onclickFnc = "onclick='thisIsNotAFolder()'";
+ } else {
+ fileOrFolder = "<i class='fa fa-folder-o'></i> ";
+ onclickFnc = "onclick='uriData(" + result.items[i].id + "," + result.items[i].parent + ")'";
+ }
+ uriDataHtml += "<tr><th " + onclickFnc + ">" + fileOrFolder + result.items[i].name + "</th><th>" + result.items[i].size + "</th><th>" + result.items[i].date + "</th>\n\
<th>" + result.items[i].uri + "</th><th>\n\
<a href='download.php?accessToken=" + accessToken + "&uri=" + result.items[i].uri + "&fileName=" + result.items[i].name + "' > <i class='fa fa-download'> </i></a><th></tr>";
- $("#div_" + id).html(uriDataHtml);
+ $("#folderPath").html(uriDataHtml);
+ });
+ //$("#parent").empty();
+ $("#parent").append("<i onclick=uriData(" + id + ",null)>" + result.directory + "</i>");
+ }, "json")
+ .fail(function () {
+ $("#folderPath").html("Some error found");
});
- }, "json")
- .fail(function () {
- $(".dataTable1").hide();
-
- });
- } else {
- alert('This is not a folder');
- }
+
+ }
+ function thisIsNotAFolder() {
+ alert('This is not a folder');
}
</script>
M download.php
+0 −2
--- 'a/download.php'
+++ b/download.php
@@ -4,7 +4,6 @@ $headers = array(
'Authorization: Bearer ' . $_GET['accessToken']
//'Authorization: Basic '. base64_encode("$username:$password")
);
-
$uriFile = 'https://developers.digitallocker.gov.in/public/oauth2/1/file/' . $_GET['uri'];
$uri = curl_init($uriFile);
curl_setopt($uri, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
@@ -18,5 +17,4 @@ $file = file_put_contents("Downloads/" .
//return file_get_contents("http://".$_SERVER['HTTP_HOST']."/digibank/Downloads/".$_GET['fileName']);
echo "Your File hase been downloaded please <a href='/digibank/Downloads/" . $_GET['fileName'] . "' download>Click Here</a> to view your document";
-
?>
\ No newline at end of file
M payment.php
+0 −28
--- 'a/payment.php'
+++ b/payment.php
@@ -1,6 +1,5 @@
<?php include 'header.php' ?>
<div class="container">
-
<div class="col-lg-2"></div>
<div class="col-lg-8">
<div class="panel panel-default">
@@ -8,9 +7,7 @@
<h4><i class="fa fa-fw fa-link"></i>Payment</h4>
</div>
<div class="panel-body">
-
<form role="form">
-
<script src='https://js.stripe.com/v2/' type='text/javascript'></script>
<fohttp://bootsnipp.com/snippets/featured/payment-receipt-bs3rm accept-charset="UTF-8" action="/" class="require-validation" data-cc-on-file="false" data-stripe-publishable-key="pk_bQQaTxnaZlzv4FnnuZ28LFHccVSaj" id="payment-form" method="post">
<div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" />
@@ -64,36 +61,11 @@
</div>
</form>
</div>
-
-
-
-
-
- </form>
-
-
-
</div>
</div>
-
</div>
<div class="col-lg-2"></div>
-
<!-- /.row -->
-
-
-</div>
<script src="js/jquery.js"></script>
-<script>
- var dls_server = 'https://developers.digitallocker.gov.in/public/oauth2/1/authorize';
- $('.dl_pop').click(function () {
-
-
- CallDL('code', '7QAKRAJO', '123456', 'http://localhost/curlexample/response.php');
- });
- function CallDL(requester_id, hash_key, time_st, hostname) {
- window.open(dls_server + "?response_type=" + requester_id + "&client_id=" + hash_key + "&state=" + time_st + "&redirect_uri=" + hostname, "_blank", "height=500,width=600,status=yes,toolbar=no,menubar=no,location=no");
- }
-</script>
<?php include 'footer.php' ?>
\ No newline at end of file
M upload.php
+0 −1
--- 'a/upload.php'
+++ b/upload.php
@@ -43,7 +43,6 @@
<div class="col-md-2">
</div>
</div>
-
</div>
<!-- /.row -->
</div>
M uploaddoc.php
+0 −2
--- 'a/uploaddoc.php'
+++ b/uploaddoc.php
@@ -26,7 +26,6 @@ $getToken = json_decode($notgettingdata[
$access_token = $getToken->access_token;
-
$headers = array(
'Authorization: Bearer ' . $access_token
//'Authorization: Basic '. base64_encode("$username:$password")
@@ -80,7 +79,6 @@ $dataF = json_decode($resFileNew[1], TRU
<div class="col-md-2">
<form action="browse.php" method="post" enctype="multipart/form-data">
<input type="text" value="<?php echo $access_token; ?>" name="accessToken" class="hidden"/>
-
<input type="file" id="fileUpload" name="fileUpload"/>
<select name="filePath">
<?php