| @@ 139-150 (lines=12) @@ | ||
| 136 | return ['exit' => 'callback', 'out' => $out]; | |
| 137 | } | |
| 138 |                 } else { | |
| 139 |                     if (! empty($_GET['code'])) { | |
| 140 | $aToken = $client->fetchAccessTokenWithAuthCode($_GET['code']); | |
| 141 | $options['access_token'] = $aToken; | |
| 142 |                         $this->session->set('GoogleDriveTokens', $aToken)->set('GoogleDriveAuthParams', $options); | |
| 143 | $out = [ | |
| 144 | 'node' => $options['id'], | |
| 145 |                             'json' => '{"protocol": "googledrive", "mode": "done", "reset": 1}', | |
| 146 | 'bind' => 'netmount', | |
| 147 | ]; | |
| 148 | ||
| 149 | return ['exit' => 'callback', 'out' => $out]; | |
| 150 | } | |
| 151 | $folders = []; | |
| 152 | foreach ($service->files->listFiles([ | |
| 153 | 'pageSize' => 1000, | |
| @@ 245-256 (lines=12) @@ | ||
| 242 | return ['exit' => 'callback', 'out' => $out]; | |
| 243 | } | |
| 244 |                 } else { | |
| 245 |                     if (! empty($_GET['code'])) { | |
| 246 | $aToken = $client->fetchAccessTokenWithAuthCode($_GET['code']); | |
| 247 | $options['access_token'] = $aToken; | |
| 248 |                         $this->session->set('GoogleDriveTokens', $aToken)->set('GoogleDriveAuthParams', $options); | |
| 249 | $out = [ | |
| 250 | 'node' => $options['id'], | |
| 251 |                             'json' => '{"protocol": "googledrive", "mode": "done", "reset": 1}', | |
| 252 | 'bind' => 'netmount', | |
| 253 | ]; | |
| 254 | ||
| 255 | return ['exit' => 'callback', 'out' => $out]; | |
| 256 | } | |
| 257 | $path = $options['path']; | |
| 258 |                     if ($path === '/') { | |
| 259 | $path = 'root'; | |