authpartner
Clone or download
Modified Files
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,71 @@
+# Compiled source #
+###################
+*.com
+*.class
+*.dll
+*.exe
+*.o
+*.so
+
+# Packages #
+############
+# it's better to unpack these files and commit the raw source
+# git has its own built in compression methods
+*.7z
+*.dmg
+*.gz
+*.iso
+*.jar
+*.rar
+*.tar
+*.zip
+
+# Logs and databases #
+######################
+*.log
+*.sql
+*.sqlite
+
+# OS generated files #
+######################
+.DS_Store
+.DS_Store?
+._*
+.Spotlight-V100
+.Trashes
+ehthumbs.db
+Thumbs.db
+
+##Codignitor##
+##############
+application/cache/*
+!application/cache/index.html
+!application/cache/.htaccess
+
+application/logs/*
+!application/logs/index.html
+!application/logs/.htaccess
+
+user_guide_src/build/*
+user_guide_src/cilexer/build/*
+user_guide_src/cilexer/dist/*
+user_guide_src/cilexer/pycilexer.egg-info/*
+/vendor/
+
+# IDE Files
+#-------------------------
+/nbproject/
+.idea/*
+
+## Sublime Text cache files
+*.tmlanguage.cache
+*.tmPreferences.cache
+*.stTheme.cache
+*.sublime-workspace
+*.sublime-project
+
+# Custom #
+######################
+.DS_Store
+
+config.php
\ No newline at end of file
--- 'a/browse.php'
+++ b/browse.php
@@ -1,20 +1,17 @@
<?php
-
+ include 'config.php';
$fileBrowse = $_FILES['fileUpload']['tmp_name'];
$filePath = $_POST['filePath'] . "/" . $_FILES['fileUpload']['name'];
-
$access_token = $_POST['accesstoken'];
$fileContent = file_get_contents($fileBrowse);
$finfo = new \finfo(FILEINFO_MIME_TYPE);
$mime = $finfo->buffer($fileContent);
-
-$client_secret = 'Pax7Rmv9uWo2KrNcXMtlDtsQN';
+$client_secret = $config['client_secret_upload'];
$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 . '');
-
$ch = curl_init();
-curl_setopt($ch, CURLOPT_URL, "https://developers.digitallocker.gov.in/public/oauth2/1/file/upload");
+curl_setopt($ch, CURLOPT_URL, $config['upload_file']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_NOSIGNAL, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
@@ -28,5 +25,5 @@ $output = curl_exec($ch);
curl_close($ch);
header("Location: uploaddoc.php?code=".$_POST['code']."&state=".$_POST['state']); /* Redirect browser */
exit();
-//echo "Your File has been uploaded please <a href=/digibank/index.php>Click Here</a> to go main page";
+
?>
\ No newline at end of file
Binary files /dev/null and b/css/loading.gif differ
--- 'a/css/styles.css'
+++ b/css/styles.css
@@ -95,30 +95,19 @@ p {
.dropdown-menu>li>a{
color:#fff;
}
-.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{/*color:#262626;text-decoration:none;*/background-color:#fff !important; margin-left:15px; padding-left:8px !important;}
-/*.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{
- color:#fff;text-decoration:none;background-color:#337ab7;outline:0}
-.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{
- color:#777}
-.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{
- text-decoration:none;
- cursor:not-allowed;
- background-color:transparent;
- background-image:none;
-
- filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}
-.open>.dropdown-menu{display:block}.open>a{outline:0}
-.dropdown-menu-right{right:0;left:auto}
-.dropdown-menu-left{right:auto;left:0}
-.dropdown-header{
- display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}
-.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}
-.pull-right>.dropdown-menu{right:0;left:auto}
-.dropup .caret,.navbar-fixed-bottom .dropdown .caret{
- content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}
-.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{
- top:auto;bottom:100%;margin-bottom:2px} */
-/* indresh end style*/
+.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{ background-color:#fff !important; margin-left:15px; padding-left:8px !important;}
+
+
+
+.table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td, .table > tfoot > tr > th, .table > thead > tr > td, .table > thead > tr > th {
+ border-top: 1px solid #ddd;
+ line-height: 1.42857;
+ padding: 8px;
+ vertical-align: top;
+ cursor:hand;
+ cursor:pointer;
+}
+
/*
* 1.2. Helper CSS
*/
@@ -5313,4 +5302,17 @@ h3.widget-title.side-nav {margin-top: 20
padding-bottom: 0 !important; }
.no-padding {
- padding: 0 !important; }
\ No newline at end of file
+ padding: 0 !important; }
+#loading {
+ content: '';
+ display: block;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ position:absolute;
+ width: 100%; height: 100%; background: url('loading.gif') no-repeat center center;
+ margin:0 auto;
+ z-index:10000000;
+ /**opacity: 0.4; **/
+}
\ No newline at end of file
--- 'a/doc.php'
+++ b/doc.php
@@ -1,5 +1,6 @@
<?php
include 'header.php';
+include 'config.php';
$code = $_GET['code'];
$state = $_GET['state'];
if (file_exists("xml/hashKey.xml")) {
@@ -10,13 +11,13 @@ if (file_exists("xml/hashKey.xml")) {
$access_token = $xml['access_token'];
$cd = (array) $xml['code']['num'];
if ($cd != $code) {
- $url = "https://developers.digitallocker.gov.in/public/oauth2/1/token";
+ $url = $config['access_token_download'];
$post = array(
'code' => $code,
'grant_type' => 'authorization_code',
- 'client_id' => 'NIELN3M9',
- 'client_secret' => 'DQ3pWgCtB0I3EhSrtTXU',
- 'redirect_uri' => 'http://localhost/digibank/doc.php',
+ 'client_id' => $config['client_id_download'],
+ 'client_secret' => $config['client_secret_download'],
+ 'redirect_uri' => $config['download_redirect_uri'],
);
$vh = curl_init($url);
curl_setopt($vh, CURLOPT_CUSTOMREQUEST, "POST");
@@ -65,7 +66,7 @@ $headers = array(
'Authorization: Bearer ' . $access_token
//'Authorization: Basic '. base64_encode("$username:$password")
);
-$urlFile = 'https://developers.digitallocker.gov.in/public/oauth2/1/files/';
+$urlFile = $config['file_uri'];
$vhf = curl_init($urlFile);
curl_setopt($vhf, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($vhf, CURLOPT_HTTPHEADER, $headers);
@@ -82,7 +83,7 @@ $headers = array(
'Authorization: Bearer ' . $access_token
//'Authorization: Basic '. base64_encode("$username:$password")
);
-$urlissued = 'https://developers.digitallocker.gov.in/public/oauth2/1/files/issued';
+$urlissued = $config['issued_doc_url'];
$vhi = curl_init($urlissued);
curl_setopt($vhi, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($vhi, CURLOPT_HTTPHEADER, $headers);
@@ -96,7 +97,8 @@ $issuedNew = explode('¿', $resissued);
$dataI = json_decode($issuedNew[1], TRUE);
?>
-<div id="wrapper">
+<div id="wrapper">
+
<div id="page-wrapper">
<div class="container-fluid">
<!-- Page Heading -->
@@ -108,6 +110,7 @@ $dataI = json_decode($issuedNew[1], TRUE
<li><a data-toggle="tab" href="#issueddocument" ><img src="images/issuedfile.png">Issued Document</a></li>
</ul>
<div class="tab-content">
+
<div id="uploadeddocument" class="tab-pane fade in active">
<section class="content">
<div class="row">
@@ -124,42 +127,44 @@ $dataI = json_decode($issuedNew[1], TRUE
</tr>
<div><b onclick="uriData(null, null)" class="fa fa-home fa-2x" style="color:blueviolet;"></b><b id="parent" style="color:blueviolet;"></b></div>
</thead>
- <tbody id="folderPath">
- <?php
- foreach ((array) ($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'] = "";
+ <tbody id="folderPath" style="position:relative">
+ <div id="loading" style="height:42px; width:56px; margin:0 auto;"></div>
+ <?php
+ foreach ((array) ($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
+ if (($api_detail['type']) == "dir") {
+ echo '<td onclick="uriData(' . $api_detail['id'] . ',' . $api_detail['parent'] . ')">';
+ echo '<img src="images/folder.svg"></img>';
+ echo($api_detail['name']);
+ }
+ if ($api_detail['type'] == "file") {
+ echo "<td onclick='thisIsNotAFolder()'>";
+ echo '<img src="images/file.svg"></img>';
+ echo($api_detail['name']);
}
+ echo "</td>";
?>
- <tr>
- <?php
- if (($api_detail['type']) == "dir") {
- echo '<td onclick="uriData(' . $api_detail['id'] . ',' . $api_detail['parent'] . ')">';
- echo '<img src="images/folder.svg"></img>';
- echo($api_detail['name']);
- }
- if ($api_detail['type'] == "file") {
- echo "<td onclick='thisIsNotAFolder()'>";
- echo '<img src="images/file.svg"></img>';
- 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>
- <button onclick="download('<?php echo($api_detail['uri'] . ',' . $api_detail['name']); ?>')"><i class="fa fa-download"> </i></button>
+ <td><?php echo($api_detail['size']); ?></td>
- </td>
- <?php }
- ?>
- </tr>
- <?php }
- ?>
+ <td><?php echo($api_detail['date']); ?></td>
+ <?php if ($api_detail['type'] == "file") { ?>
+ <td>
+ <button onclick="download('<?php echo($api_detail['uri'] . ',' . $api_detail['name']); ?>')"><i class="fa fa-download"> </i></button>
+
+ </td>
+ <?php }
+ ?>
+ </tr>
+ <?php }
+ ?>
</tbody>
</table>
<div class="footer">
@@ -263,6 +268,7 @@ $dataI = json_decode($issuedNew[1], TRUE
});
}
function download(uris, filename) {
+ $('#loading').show();
var getdata = uris.split(",");
var uri = getdata[0];
var filename = getdata[1];
@@ -274,10 +280,12 @@ $dataI = json_decode($issuedNew[1], TRUE
data: arraydata
}).done(function (response)
{
+ $('#loading').hide();
var getdata = JSON.parse(response);
console.log(getdata[1]);
window.open("data:" + getdata[0] + ";base64," + getdata[1], '', 'height=650,width=840');
});
}
+ $('#loading').hide();
</script>
</html>
\ No newline at end of file
--- 'a/download.php'
+++ b/download.php
@@ -1,10 +1,10 @@
<?php
-
+include 'config.php';
$headers = array(
'Authorization: Bearer ' . $_POST['accesstoken']
//'Authorization: Basic '. base64_encode("$username:$password")
);
-$uriFile = 'https://developers.digitallocker.gov.in/public/oauth2/1/file/' . $_POST['uri'];
+$uriFile = $config['download_file_uri'] . $_POST['uri'];
$uri = curl_init($uriFile);
curl_setopt($uri, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($uri, CURLOPT_HTTPHEADER, $headers);
--- 'a/header.php'
+++ b/header.php
@@ -1,4 +1,5 @@
<!DOCTYPE html>
+<?php include 'config.php'; ?>
<html lang="en">
<head>
<meta charset="utf-8">
@@ -39,6 +40,7 @@
.dropdown{
margin:6px 16px;
color:#fff !important;
+ cursor: pointer; cursor: hand;
}
.dropdown-submenu {
@@ -50,6 +52,7 @@
.dropdown-menu>li{
margin-left: -15px;
+ cursor: pointer; cursor: hand;
}
</style>
</head>
@@ -80,7 +83,6 @@
<li><a>Aadhaar Mobile Update</a></li><hr>
<li><a>Best Finger Detection</a></li><hr>
<li><a>Aadhaar eKYC PVC Print</a></li>
-
</ul>
</div>
</li>
@@ -117,18 +119,18 @@
<li><a tabindex="-1" href="https://digilocker.gov.in/public/register">Open Digilocker Account</a>
</li><hr>
<li>
- <span><form action = "https://developers.digitallocker.gov.in/public/oauth2/1/authorize" method = "GET" role="form">
+ <span><form action = "<?php echo $config['code_download']?>" method = "GET" role="form">
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">Response Type</label>
<input type="text" class="form-control" name = "response_type" value="code">
</div>
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">Client ID</label>
- <input type="text" class="form-control" name = "client_id" value="NIELN3M9">
+ <input type="text" class="form-control" name = "client_id" value="<?php echo $config['client_id_download'] ?>">
</div>
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">Redirect Uri</label>
- <input type="text" class="form-control" name = "redirect_uri" value="http://localhost/digibank/doc.php">
+ <input type="text" class="form-control" name = "redirect_uri" value=<?php echo $config['download_redirect_uri'] ?>>
</div>
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">State</label>
@@ -139,18 +141,18 @@
</span>
</li><hr>
<li>
- <span> <form action = "https://developers.digitallocker.gov.in/public/oauth2/1/authorize" method = "GET" role="form">
+ <span> <form action = "<?php echo $config['code_download'] ?>" method = "GET" role="form">
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">Response Type</label>
<input type="text" class="form-control" name = "response_type" value="code">
</div>
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">Client ID</label>
- <input type="text" class="form-control" name = "client_id" value="7QAKRAJO">
+ <input type="text" class="form-control" name = "client_id" value="<?php echo $config['client_id_upload'] ?>">
</div>
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">Redirect Uri</label>
- <input type="text" class="form-control" name = "redirect_uri" value="http://localhost/digibank/uploaddoc.php">
+ <input type="text" class="form-control" name = "redirect_uri" value="<?php echo $config['uploaddoc_redirect_uri'] ?>">
</div>
<div class="form-group has-success" style="display:none">
<label class="control-label" for="inputSuccess">State</label>
Binary files /dev/null and b/images/loading.gif differ
Binary files /dev/null and b/images/loading12.gif differ
--- 'a/uploaddoc.php'
+++ b/uploaddoc.php
@@ -1,64 +1,65 @@
<?php
include 'header.php';
+include 'config.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' => '7QAKRAJO',
- 'client_secret' => 'Pax7Rmv9uWo2KrNcXMtlDtsQN',
- 'redirect_uri' => 'http://localhost/digibank/uploaddoc.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);
+$url = $config['access_token_download'];
+$post = array(
+ 'code' => $code,
+ 'grant_type' => 'authorization_code',
+ 'client_id' => $config['client_id_upload'],
+ 'client_secret' => $config['client_secret_upload'],
+ 'redirect_uri' => $config['uploaddoc_redirect_uri'],
+);
+$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]);
+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]);
- if (isset($getToken->access_token)) {
- $access_token = $getToken->access_token;
- }
- if (isset($access_token)) {
- $doc = new DOMDocument('1.0');
- $doc->formatOutput = true;
- $doc = new DOMDocument('1.0');
- $doc->formatOutput = true;
- $root = $doc->createElement('maincontent');
- $root = $doc->appendChild($root);
- $title = $doc->createElement('code');
- $title = $root->appendChild($title);
- $enclosure = $doc->createAttribute('num');
- $enclosure->value = $code;
- $title->appendChild($enclosure);
- $title = $doc->createElement('access_token');
- $title = $root->appendChild($title);
- $text = $doc->createTextNode($access_token);
- $text = $title->appendChild($text);
- $doc->save("xml/hashhkey.xml");
- }
- if (file_exists("xml/hashhkey.xml")) {
- $xml = (array) simplexml_load_file("xml/hashhkey.xml") or die("Error: Cannot create object");
- } else {
- echo "xml/hashhkey.xml file doesnot exists";
- }
- $access_token = $xml['access_token'];
+if (isset($getToken->access_token)) {
+ $access_token = $getToken->access_token;
+}
+if (isset($access_token)) {
+ $doc = new DOMDocument('1.0');
+ $doc->formatOutput = true;
+ $doc = new DOMDocument('1.0');
+ $doc->formatOutput = true;
+ $root = $doc->createElement('maincontent');
+ $root = $doc->appendChild($root);
+ $title = $doc->createElement('code');
+ $title = $root->appendChild($title);
+ $enclosure = $doc->createAttribute('num');
+ $enclosure->value = $code;
+ $title->appendChild($enclosure);
+ $title = $doc->createElement('access_token');
+ $title = $root->appendChild($title);
+ $text = $doc->createTextNode($access_token);
+ $text = $title->appendChild($text);
+ $doc->save("xml/hashhkey.xml");
+}
+if (file_exists("xml/hashhkey.xml")) {
+ $xml = (array) simplexml_load_file("xml/hashhkey.xml") or die("Error: Cannot create object");
+} else {
+ echo "xml/hashhkey.xml file doesnot exists";
+}
+$access_token = $xml['access_token'];
$headers = array(
'Authorization: Bearer ' . $access_token
//'Authorization: Basic '. base64_encode("$username:$password")
);
-$urlFile = 'https://developers.digitallocker.gov.in/public/oauth2/1/files/';
+$urlFile = $config['file_uri'];
$vhf = curl_init($urlFile);
curl_setopt($vhf, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($vhf, CURLOPT_HTTPHEADER, $headers);
@@ -88,20 +89,19 @@ $dataF = json_decode($resFileNew[1], TRU
<div class="col-md-12">
<div class="box box-body col-sm-12" >
<div class="row" style="margin-top:10px;">
- <div class="col-md-6"><b onclick="uriData(null, null)" class="fa fa-home fa-2x" style="color:blueviolet;"></b><b id="parent" style="color:blueviolet;"></b>
+ <div class="col-md-6"><b onclick="uriData(null, null)" class="fa fa-home fa-2x" style="color:blueviolet;"></b><b id="parent" style="color:blueviolet;"></b>
</div>
<div class="col-md-6">
<form action="browse.php" method="post" enctype="multipart/form-data" >
<div class="col-md-8" style="padding-left:130px;">
- <input type="text" value="<?php echo $access_token; ?>" name="accesstoken" class="hidden"/>
- <input type="text" value="<?php echo $code; ?>" name="code" class="hidden"/>
- <input type="text" value="<?php echo $state; ?>" name="state" class="hidden"/>
- <input type="text" name="filePath" class="hidden" value="" id="filePath"/>
- <input type="file" id="fileUpload" name="fileUpload"/>
- </div>
+ <input type="text" value="<?php echo $access_token; ?>" name="accesstoken" class="hidden"/>
+ <input type="text" value="<?php echo $code; ?>" name="code" class="hidden"/>
+ <input type="text" value="<?php echo $state; ?>" name="state" class="hidden"/>
+ <input type="text" name="filePath" class="hidden" value="" id="filePath"/>
+ <input type="file" id="fileUpload" name="fileUpload"/>
+ </div>
<div class="col-md-4 " >
- <input type="submit" name="submit" class="btn btn-primary" value="Upload" style="height:23px; width:78px; padding:0px !important;">
-
+ <input type="submit" name="submit" class="btn btn-primary" value="Upload" style="height:23px; width:78px; padding:0px !important;">
</div>
</form>
</div>
@@ -116,41 +116,42 @@ $dataF = json_decode($resFileNew[1], TRU
</tr>
</thead>
<tbody id="folderPath">
- <?php
- foreach ((array) ($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'] = "";
+ <div id="loading" style="height:42px; width:56px; margin:0 auto;"></div>
+ <?php
+ foreach ((array) ($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
+ if (($api_detail['type']) == "dir") {
+ echo '<td onclick="uriData(' . $api_detail['id'] . ',' . $api_detail['parent'] . ')">';
+ echo '<img src="images/folder.svg"></img>';
+ echo($api_detail['name']);
}
+ if ($api_detail['type'] == "file") {
+ echo "<td onclick='thisIsNotAFolder()'>";
+ echo '<img src="images/file.svg"></img>';
+ echo($api_detail['name']);
+ }
+ echo "</td>";
?>
- <tr>
- <?php
- if (($api_detail['type']) == "dir") {
- echo '<td onclick="uriData(' . $api_detail['id'] . ',' . $api_detail['parent'] . ')">';
- echo '<img src="images/folder.svg"></img>';
- echo($api_detail['name']);
- }
- if ($api_detail['type'] == "file") {
- echo "<td onclick='thisIsNotAFolder()'>";
- echo '<img src="images/file.svg"></img>';
- 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>
- <button onclick="download('<?php echo($api_detail['uri'] . ',' . $api_detail['name']); ?>')"><i class="fa fa-download"> </i></button>
-
- </td>
- <?php }
- ?>
- </tr>
- <?php }
- ?>
+ <td><?php echo($api_detail['size']); ?></td>
+ <td><?php echo($api_detail['date']); ?></td>
+ <?php if ($api_detail['type'] == "file") { ?>
+ <td>
+ <button onclick="download('<?php echo($api_detail['uri'] . ',' . $api_detail['name']); ?>')"><i class="fa fa-download"> </i></button>
+
+ </td>
+ <?php }
+ ?>
+ </tr>
+ <?php }
+ ?>
</tbody>
</table>
<div class="footer">
@@ -213,6 +214,7 @@ $dataF = json_decode($resFileNew[1], TRU
});
}
function download(uris, filename) {
+ $('#loading').show();
var getdata = uris.split(",");
var uri = getdata[0];
var filename = getdata[1];
@@ -224,10 +226,12 @@ $dataF = json_decode($resFileNew[1], TRU
data: arraydata
}).done(function (response)
{
+ $('#loading').hide();
var getdata = JSON.parse(response);
console.log(getdata[1]);
window.open("data:" + getdata[0] + ";base64," + getdata[1], '', 'height=650,width=840');
});
}
+ $('#loading').hide();
</script>
</html>
\ No newline at end of file
--- 'a/uri.php'
+++ b/uri.php
@@ -1,11 +1,13 @@
<?php
-
+include 'config.php';
$id = $_POST['id'];
$headers = array(
'Authorization: Bearer ' . $_POST['access_token']
//'Authorization: Basic '. base64_encode("$username:$password")
);
-$urlUri = 'https://developers.digitallocker.gov.in/public/oauth2/1/files/' . $id;
+//$urlUri = 'https://developers.digitallocker.gov.in/public/oauth2/1/files/' . $id;
+$urlUri = $config['download_uri'] . $id;
+
$uri = curl_init($urlUri);
curl_setopt($uri, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($uri, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
--- 'a/xml/hashKey.xml'
+++ b/xml/hashKey.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<maincontent>
- <code num="e0750218230ade78bda1f4fb6fb12b7707072af7"/>
- <access_token>1454faa5e3ff3dd52ab7ba52ba3f3c405e8f478f</access_token>
+ <code num="fef7f0c318e732d0c602d7fdcede6821e97430b4"/>
+ <access_token>c4f2ab01f198ab7244d8192f149d270f53621833</access_token>
</maincontent>
--- 'a/xml/hashhkey.xml'
+++ b/xml/hashhkey.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<maincontent>
- <code num="f78ef07e6c9543bf202306b62a7a12eff11d0781"/>
- <access_token>ce5698bd26acbd2aa38764d7b94c838e22602f46</access_token>
+ <code num="7a125bacab687d9a76524043eb7a45619226529d"/>
+ <access_token>f022d49ca882da912c6ba7c4b6e0759fae2f4c43</access_token>
</maincontent>