Exemplo n.º 1
0
 function upload2picasa($file)
 {
     $remoteConfig = \Config::getSection("REMOTE_IMAGE");
     $uploader = \ChipVN_ImageUploader_Manager::make('Picasa');
     echo $uploader->login($remoteConfig["google_user_name"], $remoteConfig["google_user_pass"]);
     // we don't need password here
     //$uploader->setApi($remoteConfig["google_client_id"]); // register in console.developers.google.com
     //$uploader->setSecret($remoteConfig["google_secret_key"]);
     // you can set upload to an albumId by array of albums or an album, system will get a random album to upload
     //$uploader->setAlbumId(array('51652569125195125', '515124156195725'));
     //$uploader->setAlbumId('51652569125195125');
     //echo("will echo noe");
     //print_r($remoteConfig);
     //echo $uploader->addAlbum('testing 1');
     //echo("ok on");
     //if (!$uploader->hasValidToken()) {
     //    $uploader->getOAuthToken('http://yourdomain.com/test.php');
     //}
     //print_r($file);
     //echo $uploader->upload(getcwd() . '/test.jpg');
     // this plugin does not support transload image
 }
Exemplo n.º 2
0
 public function basicAuth()
 {
     $config = \Config::getSection("OAUTH_CONFIG");
     $this->authuser = Client::authenticate(array("otp:serverUrl" => $config["SERVER"], "otp:publicKey" => $config["BROKER_ID"], "otp:privateKey" => $config["BROKER_SECRET"]));
     $this->auth(null, null);
 }