Browse Source

debugging...

pull/16/head
www-data 13 years ago
parent
commit
821ed011ca
  1. 17
      app/widgets/Account/Account.php
  2. 4
      index.php
  3. 2
      infos.php
  4. 6
      lib/XMPPtoForm.php

17
app/widgets/Account/Account.php

@ -27,7 +27,8 @@ class Account extends WidgetBase {
}
function ajaxDiscoverServer($ndd) {
Logger::log($ndd);
Logger::log('ajaxDiscoverServer');
Logger::log($ndd);
if($ndd['ndd'] == '') {
RPC::call('movim_reload', Route::urlize('account', 'datamissing'));
RPC::commit();
@ -86,7 +87,7 @@ class Account extends WidgetBase {
fclose($f); unset($f);
if(!empty($elements)) {
root.log('elements');
Logger::log('elements');
$html .= '
<form name="data">
<fieldset>
@ -187,6 +188,8 @@ class Account extends WidgetBase {
}
function ajaxSubmitData($datas) {
Logger::log('ajaxSubmitData');
Logger::log($datas);
define(XMPP_HOST, $datas->to->value);
define(XMPP_CONN, $datas->ndd->value);
@ -217,10 +220,12 @@ class Account extends WidgetBase {
$stream = $xmpp->getXMPP($stream->asXML(), $datas);
fwrite($f, $stream->asXML());
Logger::log('post');
Logger::log($stream);
unset($stream);
$response = stream_get_contents($f);
Logger::log($response);
if(!$response) {
RPC::call('movim_reload', Route::urlize('account', 'xmppcomm'));
RPC::commit();
@ -241,7 +246,8 @@ class Account extends WidgetBase {
}
$iq = $response->iq;
Logger::log('response');
Logger::log($response);
if($iq->error) {
list($cond) = $iq->error->children();
if($cond->getName() == 'conflict') {
@ -268,7 +274,8 @@ class Account extends WidgetBase {
} catch(Exception $e) {
header(sprintf('HTTP/1.1 %d %s', $e->getCode(), $e->getMessage()));
header('Content-Type: text/plain; charset=utf-8');
echo $e->getMessage(),"\n";
Logger::log($e->getCode().' '.$e->getMessage().' file:'.$e->getFile().' - l.'.$e->getLine());
echo $e->getMessage(),"\n";
}
}

4
index.php

@ -36,7 +36,7 @@
* using massively asynchronous javascript and abstracting XMPP calls into an
* events-based API.
*/
define('ENVIRONMENT','debug');
define('ENVIRONMENT','prod');
define('ROOTDIR', dirname(__FILE__));
if (ENVIRONMENT === 'debug') {
ini_set('log_errors', 0);
@ -63,4 +63,4 @@ WidgetWrapper::destroyInstance();
if (ENVIRONMENT === 'debug') {
echo Logger::displayLog();
}
}

2
infos.php

@ -17,6 +17,8 @@
*/
// We load the Movim kernel
define('ENVIRONMENT','debug');
define('ROOTDIR', dirname(__FILE__));
require_once("init.php");
// We get the informations

6
lib/XMPPtoForm.php

@ -273,6 +273,12 @@ class FormtoXMPP{
exit;
} elseif(substr($key, 0, 8) == 'generic_') {
$key = str_replace('generic_', '', $key);
Logger::log($key);
Logger::log($value);
if (!is_string($value)) {
$value = $value->value;
}
Logger::log($value);
$node->addChild($key, $value);
} elseif($value->attributes) {
$field = $node->addChild('field');

Loading…
Cancel
Save