public function testDownloadDoc()
 {
     $alfrescoServerUrl = 'http://192.168.11.30:8080/alfresco';
     $pathFile = 'notas.txt';
     $pathFile1 = 'notas222.txt';
     $pathFolder = '/tmp';
     $pathFolder1 = '/home/jennyleekkkkk/processmaker';
     $user = '******';
     $pwd = 'atopml2005';
     $adownloadDoc = downloadDoc($alfrescoServerUrl, $pathFile, $pathFolder, $user, $pwd);
     try {
         $adownloadDoc1 = downloadDoc($alfrescoServerUrl, $pathFile, $pathFolder1, $user, $pwd);
     } catch (Exception $e) {
         $this->assertEquals("Undefined index:  HTTP_REFERER", $e->getMessage(), 'ERROR!');
     }
     $this->assertEquals($adownloadDoc, true);
     try {
         $adownloadDoc1 = downloadDoc($alfrescoServerUrl, $pathFile1, $pathFolder, $user, $pwd);
     } catch (Exception $e) {
         $this->assertEquals("simplexml_load_string(): Entity: line 1: parser error : Entity 'nbsp' not defined", $e->getMessage(), 'ERROR!');
     }
 }
Beispiel #2
0
	else
	{
		//todo drive edit
		//require_once $_SERVER['DOCUMENT_ROOT'].'/'.BX_ROOT.'/modules/drive/worker.php';
		$appID = trim(CSocServGoogleOAuth::GetOption("google_appid"));
		$appSecret = trim(CSocServGoogleOAuth::GetOption("google_appsecret"));

		$oauthCredentials = new OauthCredentials($row['OATOKEN'], '', time(), 3600, $appID, $appSecret);

		if(!empty($_REQUEST['commit']) && !empty($_REQUEST['id']))
		{

			$filename = CTempFile::GetFileName(uniqid('_wd'));
			CheckDirPath($filename);
			file_put_contents($_SERVER['DOCUMENT_ROOT'] . '/log_deb.txt', var_export('in commit', true), FILE_APPEND);
			$doc = downloadDoc($_REQUEST['id'], $ob->get_mime_type($ob->_path), $oauthCredentials);
			$a = removeDoc($_REQUEST['id'], $oauthCredentials);
			file_put_contents($filename, $doc['content']);
			$options = array(
				'new' => false,
				'FILE_NAME' => $ob->arParams['element_name'],
				'ELEMENT_ID' => $ob->arParams['item_id'],
				'TMP_FILE' => $filename,
			);

			global $DB;
			$DB->startTransaction();
			if (!$ob->put_commit($options))
			{
				$DB->rollback();
				@unlink($filename);