Compare commits

...

6 Commits

9 changed files with 35 additions and 33 deletions

View File

@ -2,15 +2,13 @@ For the ONLYOFFICE Applications example to work properly you need to do the foll
1. Download and extract the Example.zip into a directory selected for it, for instance, C:\OnlyofficeExample
2. Use the settings.config file to change the received authorization key for the document service. The file can be found in the unpacked root folder (C:\OnlyofficeExample\web.appsettings.config, in our example). The authorization key is specified in the files.docservice.key field.
2. Run the IIS Manager (C:\Windows\system32\inetsrv\InetMgr.exe or Start -> All Programs -> Administrative Tools -> Internet Information Services (IIS) Manager for Windows Server 2003)
3. Run the IIS Manager (C:\Windows\system32\inetsrv\InetMgr.exe or Start -> All Programs -> Administrative Tools -> Internet Information Services (IIS) Manager for Windows Server 2003)
3. Add the unpacked Example to the list of sites with the physical path to the C:\OnlyofficeExample (or the one you selected) folder.
4. Add the unpacked Example to the list of sites with the physical path to the C:\OnlyofficeExample (or the one you selected) folder.
4. Make sure that the user account under which the IIS NetworkService process is executed has the write access rights for the C:\OnlyofficeExample\App_Data folder (this is significant for the IIS later than 6.0).
5. Make sure that the user account under which the IIS NetworkService process is executed has the write access rights for the C:\OnlyofficeExample\App_Data folder (this is significant for the IIS later than 6.0).
6. Make the created ONLYOFFIC<49> Applications example available through IP or domain name so that it could be connected from the web by the document service for proper document rendering.
5. Make the created ONLYOFFIC<49> Applications example available through IP or domain name so that it could be connected from the web by the document service for proper document rendering.

View File

@ -2,15 +2,13 @@ For the ONLYOFFICE Applications example to work properly you need to do the foll
1. Download and extract the Example.zip into a directory selected for it, for instance, C:\OnlyofficeExample
2. Use the settings.config file to change the received authorization key for the document service. The file can be found in the unpacked root folder (C:\OnlyofficeExample\settings.config, in our example). The authorization key is specified in the files.docservice.key field.
2. Run the IIS Manager (C:\Windows\system32\inetsrv\InetMgr.exe or Start -> All Programs -> Administrative Tools -> Internet Information Services (IIS) Manager for Windows Server 2003)
3. Run the IIS Manager (C:\Windows\system32\inetsrv\InetMgr.exe or Start -> All Programs -> Administrative Tools -> Internet Information Services (IIS) Manager for Windows Server 2003)
3. Add the unpacked Example to the list of sites with the physical path to the C:\OnlyofficeExample (or the one you selected) folder.
4. Add the unpacked Example to the list of sites with the physical path to the C:\OnlyofficeExample (or the one you selected) folder.
4. Make sure that the user account under which the IIS NetworkService process is executed has the write access rights for the C:\OnlyofficeExample\App_Data folder (this is significant for the IIS later than 6.0).
5. Make sure that the user account under which the IIS NetworkService process is executed has the write access rights for the C:\OnlyofficeExample\App_Data folder (this is significant for the IIS later than 6.0).
6. Make the created ONLYOFFICE Applications example available through IP or domain name so that it could be connected from the web by the document service for proper document rendering.
5. Make the created ONLYOFFICE Applications example available through IP or domain name so that it could be connected from the web by the document service for proper document rendering.

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

@ -33,7 +33,9 @@
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<title>ONLYOFFICE</title>
<link rel="icon" href="images/favicon.ico" type="image/x-icon" />
<link rel="icon"
href="images/<%- editor.documentType %>.ico"
type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="stylesheets/editor.css" />
</head>
<body>

View File

@ -32,7 +32,11 @@ require_once( dirname(__FILE__) . '/config.php' );
require_once( dirname(__FILE__) . '/functions.php' );
function sendlog($msg, $logFileName) {
file_put_contents($logFileName, $msg . PHP_EOL, FILE_APPEND);
$logsFolder = "logs/";
if (!file_exists($logsFolder)) {
mkdir($logsFolder);
}
file_put_contents($logsFolder . $logFileName, $msg . PHP_EOL, FILE_APPEND);
}
function guid() {
@ -143,9 +147,9 @@ function getClientIp() {
return $ipaddress;
}
function serverPath($forDocumentServer) {
return $forDocumentServer && isset($GLOBALS['EXAMPLE_URL']) && $GLOBALS['EXAMPLE_URL'] != ""
? $GLOBALS['EXAMPLE_URL']
function serverPath($forDocumentServer = NULL) {
return $forDocumentServer && isset($GLOBALS['EXAMPLE_URL']) && $GLOBALS['EXAMPLE_URL'] != ""
? $GLOBALS['EXAMPLE_URL']
: ('http://' . $_SERVER['HTTP_HOST']);
}
@ -201,7 +205,7 @@ function getStoragePath($fileName, $userAddress = NULL) {
if (!file_exists($directory) && !is_dir($directory)) {
mkdir($directory);
}
sendlog("getStoragePath result: " . $directory . $fileName, "logs/common.log");
sendlog("getStoragePath result: " . $directory . $fileName, "common.log");
return $directory . $fileName;
}
@ -212,24 +216,24 @@ function getStoredFiles() {
$result = array();
if ($storagePath != "")
{
$directory = $directory . DIRECTORY_SEPARATOR;
$directory = $directory . DIRECTORY_SEPARATOR;
if (!file_exists($directory) && !is_dir($directory)) {
return $result;
}
}
$directory = $directory . getCurUserHostAddress($userAddress) . DIRECTORY_SEPARATOR;
$directory = $directory . getCurUserHostAddress() . DIRECTORY_SEPARATOR;
if (!file_exists($directory) && !is_dir($directory)) {
return $result;
}
}
$cdir = scandir($directory);
$result = array();
foreach($cdir as $key => $fileName) {
if (!in_array($fileName,array(".", ".."))) {
if (!is_dir($directory . DIRECTORY_SEPARATOR . $fileName)) {
if (!is_dir($directory . DIRECTORY_SEPARATOR . $fileName)) {
$dat = filemtime($directory . DIRECTORY_SEPARATOR . $fileName);
$result[$dat] = (object) array(
"name" => $fileName,
@ -248,11 +252,11 @@ function getVirtualPath($forDocumentServer) {
$virtPath = serverPath($forDocumentServer) . '/' . $storagePath . getCurUserHostAddress() . '/';
sendlog("getVirtualPath virtPath: " . $virtPath, "logs/common.log");
sendlog("getVirtualPath virtPath: " . $virtPath, "common.log");
return $virtPath;
}
function FileUri($file_name, $forDocumentServer) {
function FileUri($file_name, $forDocumentServer = NULL) {
$uri = getVirtualPath($forDocumentServer) . $file_name;
return $uri;
}

View File

@ -62,7 +62,7 @@
if(!@copy(dirname(__FILE__) . DIRECTORY_SEPARATOR . "app_data" . DIRECTORY_SEPARATOR . $demoName, getStoragePath($demoFilename)))
{
sendlog("Copy file error to ". getStoragePath($demoFilename), "logs/common.log");
sendlog("Copy file error to ". getStoragePath($demoFilename), "common.log");
//Copy error!!!
}

View File

@ -52,7 +52,7 @@ if (isset($_GET["type"]) && !empty($_GET["type"])) { //Checks if type value exis
nocache_headers();
sendlog(serialize($_GET),"logs/webedior-ajax.log");
sendlog(serialize($_GET), "webedior-ajax.log");
$type = $_GET["type"];
@ -144,8 +144,8 @@ function download() {
}
function track() {
sendlog("Track START", "logs/webedior-ajax.log");
sendlog("_GET params: " . serialize( $_GET ), "logs/webedior-ajax.log");
sendlog("Track START", "webedior-ajax.log");
sendlog("_GET params: " . serialize( $_GET ), "webedior-ajax.log");
global $_trackerStatus;
$data;
@ -163,7 +163,7 @@ function track() {
return $result;
}
sendlog("InputStream data: " . serialize($data), "logs/webedior-ajax.log");
sendlog("InputStream data: " . serialize($data), "webedior-ajax.log");
$status = $_trackerStatus[$data["status"]];
@ -183,12 +183,12 @@ function track() {
$key = getDocEditorKey(downloadUri);
try {
sendlog("Convert " . $downloadUri . " from " . $downloadExt . " to " . $curExt, "logs/webedior-ajax.log");
sendlog("Convert " . $downloadUri . " from " . $downloadExt . " to " . $curExt, "webedior-ajax.log");
$convertedUri;
$percent = GetConvertedUri($downloadUri, $downloadExt, $curExt, $key, FALSE, $convertedUri);
$downloadUri = $convertedUri;
} catch (Exception $e) {
sendlog("Convert after save ".$e->getMessage(), "logs/webedior-ajax.log");
sendlog("Convert after save ".$e->getMessage(), "webedior-ajax.log");
$result["error"] = "error: " . $e->getMessage();
return $result;
}
@ -208,7 +208,7 @@ function track() {
break;
}
sendlog("track result: " . serialize($result), "logs/webedior-ajax.log");
sendlog("track result: " . serialize($result), "webedior-ajax.log");
return $result;
}
@ -274,7 +274,7 @@ function delete() {
unlink($filePath);
}
catch (Exception $e) {
sendlog("Deletion ".$e->getMessage(), "logs/webedior-ajax.log");
sendlog("Deletion ".$e->getMessage(), "webedior-ajax.log");
$result["error"] = "error: " . $e->getMessage();
return $result;
}