[xwiki-users] How to display a local file
Hi! I'm looking for a receipt to display a local file inside an xwiki page. The use case is that this is an intranet documentation provided by xwiki. Every user in the audience has normally some configuration files in a standardized location. The content may differ between for each user (or concrete his workstation). This is also the reason not to expose the files on a webserver and use the RemoteCode marco. Current solution is to at a link [[ConfigFile>>file:///etc.....]] It would be nicer to display the content inside the xwiki page. Best Regards, H.-Dirk Schmitt -- Signature H.-Dirk Schmitt ------------------------------------------------------------------------ * H.-Dirk Schmitt <http://www.computer42.org>* Dipl.Math. eMail:/[email protected]/ mobile:/+49 177 616 8564/ phone: /+49 2642 99 41 10/ fax: /+49 2642 99 41 15/ Kripper Str. 35, D-53489 Sinzig pgp: http://www.computer42.org/~dirk/OpenPGP-fingerprint.html <http://www.computer42.org/%7Edirk/OpenPGP-fingerprint.html>
On 12/06/2012 11:39 AM, H.-Dirk Schmitt wrote:
Hi!
I'm looking for a receipt to display a local file inside an xwiki page.
The use case is that this is an intranet documentation provided by xwiki. Every user in the audience has normally some configuration files in a standardized location. The content may differ between for each user (or concrete his workstation). This is also the reason not to expose the files on a webserver and use the RemoteCode marco.
Current solution is to at a link [[ConfigFile>>file:///etc.....]] It would be nicer to display the content inside the xwiki page.
For security reasons, that kind of thing is not supposed to be doable. Try using an iframe. -- Sergiu Dumitriu http://purl.org/net/sergiu/
On 12/06/2012 05:44 PM, Sergiu Dumitriu wrote:
On 12/06/2012 11:39 AM, H.-Dirk Schmitt wrote:
Hi!
I'm looking for a receipt to display a local file inside an xwiki page.
The use case is that this is an intranet documentation provided by xwiki. Every user in the audience has normally some configuration files in a standardized location. The content may differ between for each user (or concrete his workstation). This is also the reason not to expose the files on a webserver and use the RemoteCode marco.
Current solution is to at a link [[ConfigFile>>file:///etc.....]] It would be nicer to display the content inside the xwiki page.
For security reasons, that kind of thing is not supposed to be doable.
Try using an iframe.
It's also doable using the programming right (providing a macro for example), but then again you must be careful what you allow (what paths, etc.) so that users can't abuse it and display /etc/shadow or whatever they fancy. Jerome.
Why is $xwiki.getURLContent("file:///etc/...") not supposed to work? (if you have programming rights). paul Le 6 déc. 2012 à 08:44, Sergiu Dumitriu a écrit :
On 12/06/2012 11:39 AM, H.-Dirk Schmitt wrote:
Hi!
I'm looking for a receipt to display a local file inside an xwiki page.
The use case is that this is an intranet documentation provided by xwiki. Every user in the audience has normally some configuration files in a standardized location. The content may differ between for each user (or concrete his workstation). This is also the reason not to expose the files on a webserver and use the RemoteCode marco.
Current solution is to at a link [[ConfigFile>>file:///etc.....]] It would be nicer to display the content inside the xwiki page.
For security reasons, that kind of thing is not supposed to be doable.
Try using an iframe.
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
On 12/06/2012 12:04 PM, Paul Libbrecht wrote:
Why is $xwiki.getURLContent("file:///etc/...") not supposed to work? (if you have programming rights).
Because the OP asked for files local to the user's computer, not the server. file:/// on the server will still point to the server. The only thing that has access to the client machine is the browser. And browser makers try really hard to prevent web pages from having access to the user's disk. Unless some LDAP tricks are used to link a user to a certain computer, and the XWiki server can have access to each user machine.
paul
Le 6 déc. 2012 à 08:44, Sergiu Dumitriu a écrit :
On 12/06/2012 11:39 AM, H.-Dirk Schmitt wrote:
Hi!
I'm looking for a receipt to display a local file inside an xwiki page.
The use case is that this is an intranet documentation provided by xwiki. Every user in the audience has normally some configuration files in a standardized location. The content may differ between for each user (or concrete his workstation). This is also the reason not to expose the files on a webserver and use the RemoteCode marco.
Current solution is to at a link [[ConfigFile>>file:///etc.....]] It would be nicer to display the content inside the xwiki page.
For security reasons, that kind of thing is not supposed to be doable.
Try using an iframe.
-- Sergiu Dumitriu http://purl.org/net/sergiu/
-- Sergiu Dumitriu http://purl.org/net/sergiu
Thanks Sergiu, I agree this is absolutely a dangerous thing to do and should not be encouraged at all! paul Le 6 déc. 2012 à 10:27, Sergiu Dumitriu a écrit :
On 12/06/2012 12:04 PM, Paul Libbrecht wrote:
Why is $xwiki.getURLContent("file:///etc/...") not supposed to work? (if you have programming rights).
Because the OP asked for files local to the user's computer, not the server. file:/// on the server will still point to the server.
The only thing that has access to the client machine is the browser. And browser makers try really hard to prevent web pages from having access to the user's disk.
Unless some LDAP tricks are used to link a user to a certain computer, and the XWiki server can have access to each user machine.
paul
Le 6 déc. 2012 à 08:44, Sergiu Dumitriu a écrit :
On 12/06/2012 11:39 AM, H.-Dirk Schmitt wrote:
Hi!
I'm looking for a receipt to display a local file inside an xwiki page.
The use case is that this is an intranet documentation provided by xwiki. Every user in the audience has normally some configuration files in a standardized location. The content may differ between for each user (or concrete his workstation). This is also the reason not to expose the files on a webserver and use the RemoteCode marco.
Current solution is to at a link [[ConfigFile>>file:///etc.....]] It would be nicer to display the content inside the xwiki page.
For security reasons, that kind of thing is not supposed to be doable.
Try using an iframe.
-- Sergiu Dumitriu http://purl.org/net/sergiu/
-- Sergiu Dumitriu http://purl.org/net/sergiu _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Hi, Looks like this configuration would better fit in a cookie... And a more xwikied solution could be to store it in an Xobject attached to the users profiles pages. Is there a special reason for having it on users computers, other than being user-specific ? BR, Jerem Le 6 déc. 2012 17:39, "H.-Dirk Schmitt" <[email protected]> a écrit :
Hi!
I'm looking for a receipt to display a local file inside an xwiki page.
The use case is that this is an intranet documentation provided by xwiki. Every user in the audience has normally some configuration files in a standardized location. The content may differ between for each user (or concrete his workstation). This is also the reason not to expose the files on a webserver and use the RemoteCode marco.
Current solution is to at a link [[ConfigFile>>file:///etc.....]] It would be nicer to display the content inside the xwiki page.
Best Regards,
H.-Dirk Schmitt
-- Signature H.-Dirk Schmitt ------------------------------------------------------------------------
* H.-Dirk Schmitt <http://www.computer42.org>* Dipl.Math.
eMail:/[email protected]/ mobile:/+49 177 616 8564/ phone: /+49 2642 99 41 10/ fax: /+49 2642 99 41 15/ Kripper Str. 35, D-53489 Sinzig
pgp: http://www.computer42.org/~dirk/OpenPGP-fingerprint.html <http://www.computer42.org/%7Edirk/OpenPGP-fingerprint.html>
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
On 06.12.2012 19:47, Jeremie BOUSQUET wrote:
Is there a special reason for having it on users computers, other than being user-specific ?
Simple and consistent right management :-) If the user running the web browser haven't the right to view the file - it is not displayed. Why should a consistent right management (unix filesystem) duplicated to the xwiki server? ;-) Best Regards, H.-Dirk Schmitt -- Signature H.-Dirk Schmitt ------------------------------------------------------------------------ * H.-Dirk Schmitt <http://www.computer42.org>* Dipl.Math. eMail:/[email protected]/ mobile:/+49 177 616 8564/ phone: /+49 2642 99 41 10/ fax: /+49 2642 99 41 15/ Kripper Str. 35, D-53489 Sinzig pgp: http://www.computer42.org/~dirk/OpenPGP-fingerprint.html <http://www.computer42.org/%7Edirk/OpenPGP-fingerprint.html>
On 06.12.2012 17:44, Sergiu Dumitriu wrote:
Try using an iframe.
I have only seen examples with javascript manipulating the dom of the page. Is there a more simple solution ? Best Regards, H.-Dirk Schmitt -- Signature H.-Dirk Schmitt ------------------------------------------------------------------------ * H.-Dirk Schmitt <http://www.computer42.org>* Dipl.Math. eMail:/[email protected]/ mobile:/+49 177 616 8564/ phone: /+49 2642 99 41 10/ fax: /+49 2642 99 41 15/ Kripper Str. 35, D-53489 Sinzig pgp: http://www.computer42.org/~dirk/OpenPGP-fingerprint.html <http://www.computer42.org/%7Edirk/OpenPGP-fingerprint.html>
participants (5)
-
H.-Dirk Schmitt -
Jeremie BOUSQUET -
Jerome Velociter -
Paul Libbrecht -
Sergiu Dumitriu