Php odk aggregate server

Dear All,

Yeah i know, it sound insane but this is what my client wants. Tried to
follow a few tutorials (
http://guillaume.larocque.space/2016/Intercept-odk-collect-submissions/)
invain.
Read through the OpenRosaAPI (
https://bitbucket.org/javarosa/javarosa/wiki/OpenRosaAPI).

I was able to set it up and my small server can actually serve the forms
and fill in data. But now i cant seem to get it working on submission. It
throws me the Error. Invalid status code on HEad request. If you have a
web proxy, you may need to,login to your network
. I have no proxies set
up on my server.

anyone who has done it or who can solve this for me?

http://178.62.32.219/odk/formList/
http://178.62.32.219/odk/submission/

My credentials are guest - guest or admin - mypass

Code to the files is here

Thanks

You should probably post to 'ODK developers'

See this post there if it helps you

https://groups.google.com/d/msg/opendatakit-developers/PFWsIb3nnTk/hSE47e0dZskJ

I would like to thank you for sharing your code here It would help me in
what I am working now

thanks
Sham

In your submission/index.php you are not sending header response 401
anywhere, which is REQUIRED By ODK Collect

Correct logic is

step1 401

step2 204

step3 201

if( !empty($_FILES) ) //STEP 3
{
//file collect logic
//you can colecet your file here
http_response_code(201); // to let collect know, submission is
succcessful

}
else
{
if( !empty($_SERVER['PHP_AUTH_DIGEST']) //STEP 2
{

    //here you can implement authorization logic if you like or yo can 

skin

    //to proceed furtther vyou need to retur resposne code 204
    http_response_code(204);




}
else // STEP 1 LOGIC else you need to retur response code 401
{

//http://guillaume.larocque.space/2016/Intercept-odk-collect-submissions/

    http_response_code(401);
    header('Content-Type: text/xml; charset=utf-8');
    header('WWW-Authenticate: Digest realm="**INSERT YOUR REALM 

HERE**",qop="auth",nonce="'.uniqid().'",opaque="'.md5('INSERT YOUR REALM
HERE
').'"');
}
}

your are missing STEP 1 logic

i can edit the code , but then i have to test it and for that i have to
setup debug enviroment , i guess you already have debug enviroment setup

thanks. I will be grateful

··· On Sat, Sep 10, 2016 at 12:06 PM, wrote:

i think i can fix one of your error

In this file https://gist.github.com/ken-muturi/
0f880e2cb1d19558e94ab05fc08797a6

change line 37

From -
36 }
37 else
38 {

To -
36 }
37 else if(isset( $_SERVER['PHP_AUTH_DIGEST'] ))
38 {

At very end

else
{
//code for handling invalid form
}

I am thinking of make php server for odk collect
So i'll share my code on github if it will work

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Manish,

I see you have used your framework to make your version work. Can u try to
debug this for me https://github.com/ken-muturi/php-odk/ . Perhaps you can
get where i got it wrong. Its pretty basic PHP.

thanks

··· On Wed, Nov 23, 2016 at 6:34 AM, Manish Dhruw wrote:

This

https://github.com/JhulFramework/PHPServer4ODK
https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2FJhulFramework%2FPHPServer4ODK&sa=D&sntz=1&usg=AFQjCNGM6X-0JmjLjEBr6QWegXtQXmKLEg

Noo its not final, Not even 50% yet

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

The actual definition for this is defined at
https://bitbucket.org/javarosa/javarosa/wiki/OpenRosaAPI

The response codes are not based upon whether or not there are files in the
request.

If the request does not have proper authentication and authorization,
return 401

If the request is a HEAD request, return 204

If the request is a POST request, and you can complete the action
successfully, return 201

Please also note the need for appropriate headers on the requests and
responses.

··· On Sun, Nov 27, 2016 at 3:12 AM, Manish Dhruw wrote:

let me know if it works, if it doesnt i'll try to edit code

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Any crack on this ? anyone to help in debuging ? folk this repo

Thanks

··· On Tue, Sep 13, 2016 at 2:27 PM, Ken Muturi wrote:

thanks. I will be grateful

On Sat, Sep 10, 2016 at 12:06 PM, eskylite@gmail.com wrote:

i think i can fix one of your error

In this file https://gist.github.com/ken-muturi/0f880e2cb1d19558e94ab05fc
08797a6

change line 37

From -
36 }
37 else
38 {

To -
36 }
37 else if(isset( $_SERVER['PHP_AUTH_DIGEST'] ))
38 {

At very end

else
{
//code for handling invalid form
}

I am thinking of make php server for odk collect
So i'll share my code on github if it will work

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Manish,

i can load the forms to odk collect and fill in data. But I cannot submit
the data to the server. I am thinking its a http response code error.

Below is the message i receive on submission.

"Error: Invalid status code on Head request. If you have a web proxy, you
may need to login to your network"

Thanks

··· On Thu, Nov 24, 2016 at 2:56 PM, Manish Dhruw wrote:

sorry, I m reallly lazy to run code , so if you can explain the problem,
it would save time

On Thursday, November 24, 2016 at 5:23:55 PM UTC+5:30, Manish Dhruw wrote:

@ken Can you tell whats error you are getting or whats the problem?

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Have you made any progress on this? I'll be ready to help you with the testing.
Thanks

Are you talking about https://github.com/JhulFramework/PHPServer4ODK or https://github.com/ken-muturi/php-odk/?

Just checking to be sure I'm testing the right one. Are you still working on it or should I consider it as "final" (meaning subsequent changes will mainly be bug fixing?)

Thanks

··· From: Manish Dhruw [mailto:eskylite@gmail.com] Sent: 22 November 2016 04:01 To: ODK Community Cc: bripatand@gmail.com Subject: Re: [ODK Community] Re: PHP ODK AGGREGATE SERVER

if you are asking me, yes it is working with odk collect. login in > upload xforms then try odk collect

@Manish_Dhruw Hi,

I tested your code. The installation, download to collect, and upload a submission to server are all OK. However, when I try to view the submission on the portal, I am getting this error:

Jhul\Components\EX\Sys\Handlers\Debug
ERROR_NO_READ_ACCES to field "_modules\main\models\data\M::ik"
Error(Fatal) - 1
/var/www/required/odk/0.1/framework/jhul/Jhul/Components/Database/Store/Data/_Base.php:112

Can you help me out about what is going wrong?

Thanks,
Saad