Update functions.php

pull/13/head
qkqpttgf 2020-01-02 09:50:33 +08:00 committed by GitHub
parent e37dfcf48e
commit 1330eed999
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 5 deletions

View File

@ -173,10 +173,16 @@ function gethiddenpass($path,$passfile)
$ispassfile = fetch_files(spurlencode(path_format($path . '/' . $passfile),'/'));
//echo $path . '<pre>' . json_encode($ispassfile, JSON_PRETTY_PRINT) . '</pre>';
if (isset($ispassfile['file'])) {
$passwordf=explode("\n",curl_request($ispassfile['@microsoft.graph.downloadUrl']));
$password=$passwordf[0];
$password=md5($password);
return $password;
$arr = curl_request($ispassfile['@microsoft.graph.downloadUrl']);
if ($arr['stat']==200) {
$passwordf=explode("\n",$arr['body']);
$password=$passwordf[0];
$password=md5($password);
return $password;
} else {
//return md5('DefaultP@sswordWhenNetworkError');
return md5( md5(time()).rand(1000,9999) );
}
} else {
if ($path !== '' ) {
$path = substr($path,0,strrpos($path,'/'));
@ -217,7 +223,8 @@ function get_refresh_token()
}
document.cookie=\'language=; path=/\';
</script>';
setConfig([ 'refresh_token' => $tmptoken ]);
//setConfig([ 'refresh_token' => $tmptoken ]);
setConfig($ret);
$str .= '
<meta http-equiv="refresh" content="5;URL=' . $url . '">';
return message($str, $constStr['WaitJumpIndex'][$constStr['language']]);