Browse Source

Fix account subscription to fit with the Movim API

pull/317/head
Timothée Jaussoin 9 years ago
parent
commit
7db7793a58
  1. 6
      app/helpers/UtilsHelper.php
  2. 6
      app/widgets/AccountNext/AccountNext.php
  3. 2
      app/widgets/AccountNext/_accountnext_oob.tpl
  4. 2
      app/widgets/Subscribe/Subscribe.php

6
app/helpers/UtilsHelper.php

@ -554,7 +554,7 @@ function geoRadius($latitude, $longitude, $radius)
/*
* @desc Request a simple url
*/
function requestURL($url, $timeout = 10, $post = false)
function requestURL($url, $timeout = 10, $post = false, $json = false)
{
$ch = curl_init($url);
@ -565,6 +565,10 @@ function requestURL($url, $timeout = 10, $post = false)
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0');
if($json) {
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Accept: application/json']);
}
if(is_array($post)) {
$params = '';

6
app/widgets/AccountNext/AccountNext.php

@ -30,13 +30,13 @@ class AccountNext extends \Movim\Widget\Base {
{
$form = $package->content;
if($package->from == 'movim.eu') {
/*if($package->from == 'movim.eu') {
$movimview = $this->tpl();
$movimview->assign('submitdata', $this->call('ajaxRegister', "MovimUtils.formToJson('data')"));
$html = $movimview->draw('_accountnext_movim', true);
RPC::call('MovimTpl.fill', '#subscription_form', $html);
} else {
} else {*/
$xtf = new \XMPPtoForm();
if(!empty($form->x)){
switch($form->x->attributes()->xmlns) {
@ -67,7 +67,7 @@ class AccountNext extends \Movim\Widget\Base {
}
RPC::call('MovimTpl.fill', '#subscription_form', $html);
}
//}
}
function onRegistered($packet)

2
app/widgets/AccountNext/_accountnext_oob.tpl

@ -8,7 +8,7 @@
{$c->__('oob.about')}
</p>
<p>
<a href="{$url}" target="_blank">{$url}</a>
<a href="{$url}">{$url}</a>
</p>
</li>
</ul>

2
app/widgets/Subscribe/Subscribe.php

@ -18,7 +18,7 @@ class Subscribe extends \Movim\Widget\Base
function display()
{
$json = requestURL(MOVIM_API.'servers', 3);
$json = requestURL(MOVIM_API.'servers', 3, false, true);
$json = json_decode($json);
$cd = new \Modl\ConfigDAO;

Loading…
Cancel
Save