Bug 645724 - ---
Summary: ---
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: beacon
Version: 13
Hardware: i686
OS: Linux
low
medium
Target Milestone: ---
Assignee: Satya Komaragiri
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-10-22 10:04 UTC by cade
Modified: 2011-06-28 11:19 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-06-28 11:19:02 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description cade 2010-10-22 10:04:34 UTC
Description of problem:
Problem with login into beacon. Login was successfull (username and password are correct), but on click button "Login" browser show part of php code.

"db = $db; $this->fullPath = $fullPath; $this->request = $request; $this->read_settings($confFile); $this->pages = include($this->i18npath . $this->settings->language . ".inc"); } function fetchui() { // Get the localized UI $html = $this->localizeHTML("beaconui.html"); $html = str_replace("{imgpath}", $this->settings->url . $this->settings->php->imagepath, $html); $html = str_replace("{previousdocs}", $this->getdoclist(), $html); // Return return $html; } function getdoclist() { $text = ""; $i = 0; $documents = $this->db->user_documents($_SESSION['auth_username']); while ($i < count($documents)) { $text .= '
'; $text .= ''.$documents[$i]["name"].'    '; $text .= '    Edit     '; $text .= '    Delete     '; $text .= '


'; $i++; } return $text; } function newdoc() { // Check which plugin it is $plugin = $this->request->payload->plugin; $filename = $this->request->payload->filename; // Get the plugin Object $plugin_object = include($this->pluginpath . $plugin . "/php/" . $plugin . ".php"); // Construct the object to be sent to the plugin $beacon->path = $this->pluginpath . $plugin . "/"; $beacon->url = $this->settings->url . $this->settings->php->pluginpath . $plugin . "/"; $beacon->parser = new BeaconXSLTransformer(); // Get the HTML $html = $plugin_object->newdoc($beacon); // Get the Source $beacon->html = $html; $source = $plugin_object->getsrc($beacon); // Ask the DB to create the new document $id = $this->db->create_document($filename, $html, $source, date('Y-m-d'), $_SESSION['auth_username'], $plugin); $url = "ajax.php?plugin=$plugin&id=$id&type=html"; // Get the UI of the document $ui = $this->localizeHTML("document.html"); $ui = str_replace("{id}", $id, $ui); $ui = str_replace("{src}", $url, $ui); $ui = str_replace("{imgpath}", $this->settings->url . $this->settings->php->imagepath, $ui); // Build the object $response['result'] = "success"; $response['payload']['ui'] = $ui; $response['payload']['id'] = $id; // Send JSON of the object return json_encode($response); } function editdoc() { // Check which plugin it is $id = $this->request->payload->id; // Ask the DB to create the new document $obj = $this->db->fetch_document($id); $url = "ajax.php?plugin=".$obj['plugin']."&id=$id&type=html"; // Get the UI of the document $ui = $this->localizeHTML("document.html"); $ui = str_replace("{id}", $id, $ui); $ui = str_replace("{src}", $url, $ui); $ui = str_replace("{imgpath}", $this->settings->url . $this->settings->php->imagepath, $ui); // Build the object $response['result'] = "success"; $response['payload']['ui'] = $ui; $response['payload']['id'] = $id; $response['payload']['plugin'] = $obj['plugin']; // Send JSON of the object return json_encode($response); } function view() { switch ($_GET['type']) { case "html": $plugin = $_GET['plugin']; $id = $_GET['id']; $plugin_object = include($this->pluginpath . $plugin . "/php/" . $plugin . ".php"); $obj = $this->db->fetch_document($id); $html = $obj['html']; // Get the CSS Path $css_path = $plugin_object->get_css_path(); if (!isset($_GET['nocss'])) { // Apply the CSS path and wrap HTML in tags if ($css_path) { $css_path = $this->settings->url . $this->settings->php->pluginpath . $plugin . "/" . $css_path; $html = ''.$html; $html = str_replace('{css}', $css_path, $html); $html = $html.""; } } return $html; case "source": $id = $_GET['id']; $obj = $this->db->fetch_document($id); $source = $obj['source']; return $source; case "revision": $id = $_GET['id']; $plugin = $_GET['plugin']; $plugin_object = include($this->pluginpath . $plugin . "/php/" . $plugin . ".php"); $obj = $this->db->fetch_revision($id); $html = $obj['html']; // Get the CSS Path $css_path = $plugin_object->get_css_path(); if (!isset($_GET['nocss'])) { // Apply the CSS path and wrap HTML in tags if ($css_path) { $css_path = $this->settings->url . $this->settings->php->pluginpath . $plugin . "/" . $css_path; $html = ''.$html; $html = str_replace('{css}', $css_path, $html); $html = $html.""; } } return $html; } } function savedoc() { $plugin = $this->request->payload->plugin; $id = $this->request->payload->id; $html = urldecode($this->request->payload->html); // Build the plugin object $plugin_object = include($this->pluginpath . $plugin . "/php/" . $plugin . ".php"); // Construct the object to be sent to the plugin $beacon->path = $this->pluginpath . $plugin . "/"; $beacon->url = $this->settings->url . $this->settings->php->pluginpath . $plugin . "/"; $beacon->parser = new BeaconXSLTransformer(); $beacon->html = $html; // Get the HTML $source = $plugin_object->getsrc($beacon); if ($source) { $result = $this->db->save_document($id, $html, $source, date('Y-m-d h:i:s')); return "DONE"; } else { return "FAIL"; } } function getsrc() { $id = $this->request->payload->id; $plugin = $this->request->payload->plugin; $html = urldecode($this->request->payload->html); $plugin_object = include($this->pluginpath . $plugin . "/php/" . $plugin . ".php"); $beacon->path = $this->pluginpath . $plugin . "/"; $beacon->parser = new BeaconXSLTransformer(); $beacon->html = $html; $text = $plugin_object->getsrc($beacon); if (!$text) { return "FAIL"; } return $text; } function gethtml() { $id = $this->request->payload->id; $plugin = $this->request->payload->plugin; $src = urldecode($this->request->payload->src); $plugin_object = include($this->pluginpath . $plugin . "/php/" . $plugin . ".php"); $beacon->path = $this->pluginpath . $plugin . "/"; $beacon->parser = new BeaconXSLTransformer(); $beacon->src = $src; $text = $plugin_object->gethtml($beacon); if (!$text) { return "FAIL"; } return $text; } function getrevisions() { $id = $this->request->payload->id; $text = $this->db->fetch_revisions($id); $result['revisions'] = $text; return json_encode($result); } function fetchdoc() { } function deletedoc() { $id = $this->request->payload->id; $obj = $this->db->fetch_document($id); $this->db->delete_document($id); $return['plugin'] = $obj['plugin']; $return['id'] = $obj['id']; return json_encode($return); } function read_settings($confFile) { $this->settings = json_decode(file_get_contents($confFile)); $this->phppath = $this->fullPath . $this->settings->php->path; $this->i18npath = $this->phppath . "i18n/"; $this->pluginpath = $this->fullPath . $this->settings->php->pluginpath; $this->htmlpath = $this->fullPath . $this->settings->php->htmlpath; } function localizeHTML($file) { $text = $this->getTemplate($file); $array = $this->pages[$file]; $array_keys = array_keys($array); $i = 0; for ($i = 0; $i < count($array_keys); $i++) { $text = str_replace("{" . $array_keys[$i] . "}", $array[ $array_keys[$i] ], $text); } return $text; } function tr($str) { if ($this->pages["miscellaneous"][$str]) { return $this->pages["miscellaneous"][$str]; } else { return "No Localized String Found"; } } function getTemplate($file) { return file_get_contents($this->htmlpath . $file); } function random_str($length){ $randstr = ""; for($i=0; $i<$length; $i++) { $randnum = mt_rand(0,61); if($randnum < 10) { $randstr .= chr($randnum+48); } else if($randnum < 36) { $randstr .= chr($randnum+55); } else { $randstr .= chr($randnum+61); } } return $randstr; } }; ?>"

Version-Release number of selected component (if applicable):
beacon-0.5-3.fc12.noarch

How reproducible:


Steps to Reproduce:
1. Install beacon.
2. goto localhost/beacon/php in your browser
3. Click Login
4. After creating account click login 
5. Now you can see php code
  
Actual results:
Could'n work with beacon

Expected results:
Can work with beacon

Additional info:

Comment 1 cade 2010-10-25 10:14:27 UTC
problem is in the php/lib/BeaconAPI.php
in first string should be <?php

Comment 2 cade 2010-10-26 05:29:13 UTC
New bug:
[Tue Oct 26 11:20:58 2010] [error] [client 127.0.0.1] PHP Notice:  Undefined index: id in /usr/share/beacon/php/lib/BeaconAuthenticator.php on line 39, referer: http://localhost/beacon/php/                     
[Tue Oct 26 11:20:58 2010] [error] [client 127.0.0.1] PHP Notice:  Undefined index: id in /usr/share/beacon/php/lib/BeaconAuthenticator.php on line 61, referer: http://localhost/beacon/php/                     
[Tue Oct 26 11:20:58 2010] [error] [client 127.0.0.1] PHP Notice:  Undefined index: id in /usr/share/beacon/php/lib/BeaconAuthenticator.php on line 61, referer: http://localhost/beacon/php/beacon.php

Fixed in BeaconAuthenticator.php:
line 39,61 should be:
$this->user_id = $user['uid'];
(not $this->user_id = $user['id'];)

Comment 3 cade 2010-10-26 05:51:50 UTC
And new bug:
PHP Fatal error:  Call to a member function newdoc() on a non-object in /usr/share/beacon/php/lib/BeaconAPI.php on line 69, referer: http://localhost/beacon/php/beacon.php

Additional info:
couldn't create new document

Comment 4 Nandeep Mali 2010-10-26 08:32:50 UTC
Hello,

Thank you for going through the bugs and trying out Beacon. I will look into these issues that you have posted. Will need to refresh myself with the codebase though.

Meanwhile, if possible, could you try the git version on your setup?

It can be found here: http://git.tuxfamily.org/?p=gitroot/beacon/trunk.git;a=tree

There is also a Django based adaptation of the same if you are interested in that.

I was working on Beacon an year back and since then the project has been dormant. It has gone through several revisions and the development stopped just before finalizing the productization. 

Can I know what you will be using Beacon for? Or if you are interested in developing it further?

Our aim with Beacon was to make a stand alone Javascript library with independent backends. The PHP code is more or less a prototype.

My apologies for delay in reply. Let me look into the issues and get back to you. I do not have a Fedora machine at the moment though. And do try the git version to see if it works for you.

Thanks
Nandeep

Comment 5 cade 2010-10-26 10:34:43 UTC
(In reply to comment #4)
Hello,

I'll follow your advice with git version.

I want to use Beacon for documentation writing
(like http://docs.fedoraproject.org/en-US/Fedora/13/html/Security-Enhanced_Linux/
or http://docs.redhat.com/docs/en-US/Red_Hat_Certificate_System/8.0/html/Install_Guide/index.html).

If I clearly understand, Django is tool for the Python programming language.

I would really appreciate if you tell me tool for writing guides/documents.

Thank you for reply
Denis

Comment 6 cade 2010-10-26 11:13:29 UTC
Hello,

I tried git version, it has same bug with:

PHP Fatal error:  Call to a member function newdoc() on a non-object in
/usr/share/beacon/php/lib/BeaconAPI.php on line 69, referer:
http://localhost/beacon/php/beacon.php

Comment 7 Satya Komaragiri 2010-10-26 11:57:41 UTC
Hi Denis,

Could you please paste the contents of your settings.php and beacon.conf? You will find them in the php and beacon folders inside /usr/share/beacon respectively.

Also, are you by any chance trying to create a guidexml document?

Regards,
Satya

Comment 8 cade 2010-10-27 02:21:09 UTC
Hi Satya,

I tried to create giudexml document, it is not created and the logs error:

[Wed Oct 27 08:15:00 2010] [error] [client 127.0.0.1] PHP Notice:  Undefined index: id in /usr/share/beacon/php/lib/BeaconAuthenticator.php on line 60, referer: http://localhost/beacon/php/beacon.php           
[Wed Oct 27 08:15:00 2010] [error] [client 127.0.0.1] PHP Fatal error:  Call to a member function newdoc() on a non-object in /usr/share/beacon/php/lib/BeaconAPI.php on line 69, referer: http://localhost/beacon/php/beacon.php

/usr/share/beacon/php/settings.php:

<?php
/*
 * Beacon PHP Settings
 *
 */

// Choose whether new user registration is allowed
$beacon_create_user = false;

// Path to conf file
$beacon_conf_path = "../beacon/beacon.conf";

// Choose what DB engine is to be used
$beacon_db_type = "mysql";

// MySQL specific settings
$beacon_mysql_hostname = "localhost" ;    //replace with your database location
$beacon_mysql_database = "beacon" ;     //replace with your database name

$beacon_mysql_username = "beacon" ;     //replace with database username
$beacon_mysql_password = "password" ; 

/usr/share/beacon/beacon/beacon.conf:

{
    "url": "http://localhost/beacon/",
    "backend": "php",
    "php": {
        "path": "php/",
        "handler": "php/ajax.php",
        "scriptpath": "beacon/js/",
        "csspath": "beacon/css/",
        "imagepath": "beacon/img/",
        "pluginpath": "beacon/plugins/",
        "i18npath": "beacon/i18n/",
        "htmlpath": "beacon/html/"
    },
    "python": {

    },
    "plugins": [
        "docbook",
        "guidexml"
    ],
    "container": "#container",
    "isRoot": true,
    "language": "en_US",
    "theme": "redmond"
}

Comment 9 Satya Komaragiri 2010-10-28 10:11:21 UTC
Hi Denis,

Refer to: 
    "plugins": [
        "docbook",
        "guidexml"
    ],

did you add guidexml manually? or is this the upstream git version? For Fedora, the only plug-in enabled is the DocBook one as DocBook was format being used for Fedora documentation (as you will find in all the wiki pages, Beacon is called DocBook Editor). That is the only plug-in we test for Fedora RPM.

The GuideXML plug-in underwent some changes in the upstream with some testing on Gentoo forums, but I haven't followed it up much. 

I am sorry if this doesn't solve the problem. I'm taking this up with the upstream but if you could use the DocBook version and and let me know how it works, I'll be glad as I cannot reproduce the same errors on my end.

Regards,
Satya

Comment 10 Satya Komaragiri 2010-10-28 10:49:11 UTC
If you still get an error or a blank document when you create a new document (I received another bug report for this yesterday),could you verify if the line 119 in /usr/share/beacon/beacon/plugins/docbook/xml/new-template.xml is 
 
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.docbook.org/xml/4.4/docbookx.dtd" >
 
and not

<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.docbook.org/xml/4.4/docbookx.dtd" [


I'll fix these bugs and update the rpm pretty soon.

Comment 11 cade 2010-10-28 11:54:03 UTC
(In reply to comment #9)
> Hi Denis,
> 
> Refer to: 
>     "plugins": [
>         "docbook",
>         "guidexml"
>     ],
> 
> did you add guidexml manually? or is this the upstream git version? For Fedora,
> the only plug-in enabled is the DocBook one as DocBook was format being used
> for Fedora documentation (as you will find in all the wiki pages, Beacon is
> called DocBook Editor). That is the only plug-in we test for Fedora RPM.
> 
> The GuideXML plug-in underwent some changes in the upstream with some testing
> on Gentoo forums, but I haven't followed it up much. 
> 
> I am sorry if this doesn't solve the problem. I'm taking this up with the
> upstream but if you could use the DocBook version and and let me know how it
> works, I'll be glad as I cannot reproduce the same errors on my end.
> 
> Regards,
> Satya

Hi, Satya

This is upstream git version, in fedora rpm version only docbook available.
What does it mean "use the DocBook version", should I try rpm version once again (the same problems)?

I install git version after  Nandeep's advice:

(In reply to comment #4)
> Hello,
> 
> Thank you for going through the bugs and trying out Beacon. I will look into
> these issues that you have posted. Will need to refresh myself with the
> codebase though.
> 
> Meanwhile, if possible, could you try the git version on your setup?
> 
> It can be found here:
> http://git.tuxfamily.org/?p=gitroot/beacon/trunk.git;a=tree
> 
> There is also a Django based adaptation of the same if you are interested in
> that.
> 
> I was working on Beacon an year back and since then the project has been
> dormant. It has gone through several revisions and the development stopped just
> before finalizing the productization. 
> 
> Can I know what you will be using Beacon for? Or if you are interested in
> developing it further?
> 
> Our aim with Beacon was to make a stand alone Javascript library with
> independent backends. The PHP code is more or less a prototype.
> 
> My apologies for delay in reply. Let me look into the issues and get back to
> you. I do not have a Fedora machine at the moment though. And do try the git
> version to see if it works for you.
> 
> Thanks
> Nandeep

My main problem, is not errors in log file (this is a problem too), it is failure with document creating. After clicking create button, there is one action, what beacon doing: create new tab in the top.


(In reply to comment #10)
> If you still get an error or a blank document when you create a new document (I
> received another bug report for this yesterday),could you verify if the line
> 119 in /usr/share/beacon/beacon/plugins/docbook/xml/new-template.xml is 
> 
> <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
> "http://www.docbook.org/xml/4.4/docbookx.dtd" >
> 
> and not
> 
> <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
> "http://www.docbook.org/xml/4.4/docbookx.dtd" [
> 
> 
> I'll fix these bugs and update the rpm pretty soon.

In my version of /usr/share/beacon/beacon/plugins/docbook/xml/new-template.xml i have no line like this:
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
 "http://www.docbook.org/xml/4.4/docbookx.dtd" >

Comment 12 Satya Komaragiri 2010-10-28 12:22:24 UTC
Ok, in the git version itself, could you try using the DocBook plugin? You can choose that from select document type drop-down instead of selecting guidexml.

Could you do this and let me know what do you see?

Regards,
Satya

Comment 13 cade 2010-10-29 02:03:56 UTC
(In reply to comment #12)
> Ok, in the git version itself, could you try using the DocBook plugin? You can
> choose that from select document type drop-down instead of selecting guidexml.
> 
> Could you do this and let me know what do you see?
> 
> Regards,
> Satya

I already tried docbook plugin in rpm and git versions with same result. My message with comments 1, 2, 3 is about rpm version with docbook plugin. 
Both plugins (docbook, guidexml) in git version have the same problem with creating new document.

Comment 14 Bug Zapper 2011-05-31 10:50:40 UTC
This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '13'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 13's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 13 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 15 Bug Zapper 2011-06-28 11:19:02 UTC
Fedora 13 changed to end-of-life (EOL) status on 2011-06-25. Fedora 13 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.