Browse Source

- Merge with edhelas

pull/16/head
Jaussoin Timothée 12 years ago
parent
commit
c1256f9091
  1. 14
      app/controllers/AccountnextController.php
  2. 9
      app/views/account.tpl
  3. 12
      app/views/accountnext.tpl
  4. 246
      app/widgets/Account/server-vcards.xml
  5. 87
      app/widgets/AccountError/AccountError.php
  6. 1
      app/widgets/AccountError/accounterror.tpl
  7. 239
      app/widgets/AccountNext/AccountNext.php
  8. 47
      app/widgets/AccountNext/_accountnext_form.tpl
  9. 1
      app/widgets/AccountNext/accountnext.css
  10. 1
      app/widgets/AccountNext/accountnext.js
  11. 12
      app/widgets/AccountNext/accountnext.tpl
  12. 1
      app/widgets/Login/Login.php
  13. 6
      app/widgets/Login/login.js
  14. 41
      app/widgets/Subscribe/Subscribe.php
  15. 57
      app/widgets/Subscribe/img/star.svg
  16. 40
      app/widgets/Subscribe/subscribe.css
  17. 35
      app/widgets/Subscribe/subscribe.tpl
  18. 7
      lib/XMPPtoForm.php
  19. 3
      system/Route.php
  20. 12
      themes/movim/css/forms.css
  21. 6
      themes/movim/css/style.css

14
app/controllers/AccountnextController.php

@ -0,0 +1,14 @@
<?php
class AccountnextController extends BaseController {
function load() {
$this->session_only = false;
}
function dispatch() {
$this->page->setTitle(t('%s - Account', APP_TITLE));
$this->page->menuAddLink(t('Home'), 'main');
$this->page->menuAddLink(t('Account Creation'), 'account', true);
}
}

9
app/views/account.tpl

@ -1,4 +1,11 @@
<?php /* -*- mode: html -*- */
?>
<div id="main">
<div id="left">
</div>
<div id="center">
<?php $this->widget('Subscribe');?>
</div>
</div>
<?php $this->widget('Account');?>
<?php //$this->widget('Account');?>

12
app/views/accountnext.tpl

@ -0,0 +1,12 @@
<?php /* -*- mode: html -*- */
?>
<div id="main">
<div id="left">
<?php $this->widget('AccountError');?>
</div>
<div id="center">
<?php $this->widget('AccountNext');?>
</div>
</div>
<?php //$this->widget('Account');?>

246
app/widgets/Account/server-vcards.xml

@ -1,246 +0,0 @@
<vcards>
<vcard>
<fn>
<text>movim.eu</text>
</fn>
<kind>
<text>application</text>
</kind>
<url>
<uri>http://movim.eu/</uri>
</url>
<note>
<text>The Movim XMPP service.</text>
</note>
<registration xmlns="urn:xmpp:vcard:registration:1">
<uri>xmpp:movim.eu</uri>
</registration>
<bday>
<date>2013</date>
</bday>
<adr>
<country>IE</country>
</adr>
<ca xmlns="urn:xmpp:vcard:ca:0">
<name>CAcert</name>
<uri>http://www.cacert.org/</uri>
</ca>
<name xmlns="jabber:iq:version">Metronome</name>
<impp>
<uri>xmpp:edhelas@movim.eu</uri>
</impp>
<geo>
<uri>geo:53.06,-7.29</uri>
</geo>
</vcard>
<vcard>
<fn>
<text>jappix.com</text>
</fn>
<kind>
<text>application</text>
</kind>
<url>
<uri>http://jappix.com/</uri>
</url>
<note>
<text>The Jappix XMPP service.</text>
</note>
<registration xmlns="urn:xmpp:vcard:registration:1">
<uri>xmpp:jappix.com</uri>
</registration>
<bday>
<date>2010</date>
</bday>
<adr>
<country>FR</country>
</adr>
<ca xmlns="urn:xmpp:vcard:ca:0">
<name>CAcert</name>
<uri>http://www.cacert.org/</uri>
</ca>
<name xmlns="jabber:iq:version">Metronome</name>
<impp>
<uri>xmpp:vanaryon@jappix.com</uri>
</impp>
<geo>
<uri>geo:50.67,3.19</uri>
</geo>
</vcard>
<vcard>
<fn>
<text>tigase.im</text>
</fn>
<kind>
<text>application</text>
</kind>
<url>
<uri>http://www.tigase.im/</uri>
</url>
<note>
<text>The public Tigase service. - Also supports IPv6!</text>
</note>
<registration xmlns="urn:xmpp:vcard:registration:1">
<uri>xmpp:tigase.im</uri>
</registration>
<bday>
<date>2010</date>
</bday>
<adr>
<country>EU</country>
</adr>
<ca xmlns="urn:xmpp:vcard:ca:0">
<name>StartSSL</name>
<uri>http://www.startssl.com/</uri>
</ca>
<name xmlns="jabber:iq:version">Tigase</name>
<impp>
<uri>xmpp:admin@im.flosoft.biz</uri>
</impp>
<geo>
<uri>geo:50.69,3.19</uri>
</geo>
</vcard>
<vcard>
<fn>
<text>lightwitch.org</text>
</fn>
<kind>
<text>application</text>
</kind>
<url>
<uri>http://www.lightwitch.org/</uri>
</url>
<note>
<text>LW.Org XMPP Public Service.</text>
</note>
<registration>
<uri>xmpp:lightwitch.org</uri>
</registration>
<bday>
<date>2009</date>
</bday>
<adr>
<country>USA</country>
</adr>
<ca>
<name>StartSSL</name>
<uri>http://www.startssl.com/</uri>
</ca>
<name>Metronome</name>
<impp>
<uri>xmpp:maranda@lightwitch.org</uri>
</impp>
<geo>
<uri>geo:40.73,-74.17</uri>
</geo>
</vcard>
<vcard>
<fn>
<text>jabber.me</text>
</fn>
<kind>
<text>application</text>
</kind>
<url>
<uri>http://www.jabber.me/</uri>
</url>
<note>
<text>Just Jabber Me! - Also supports IPv6!</text>
</note>
<registration xmlns="urn:xmpp:vcard:registration:1">
<uri>xmpp:jabber.me</uri>
</registration>
<bday>
<date>2010</date>
</bday>
<adr>
<country>EU</country>
</adr>
<ca xmlns="urn:xmpp:vcard:ca:0">
<name>StartSSL</name>
<uri>http://www.startssl.com/</uri>
</ca>
<name xmlns="jabber:iq:version">Tigase</name>
<impp>
<uri>xmpp:admin@im.flosoft.biz</uri>
</impp>
<geo>
<uri>geo:50.69,3.19</uri>
</geo>
</vcard>
<vcard>
<fn>
<text>sure.im</text>
</fn>
<kind>
<text>application</text>
</kind>
<url>
<uri>http://www.sure.im/</uri>
</url>
<note>
<text>Just Sure Im! - Also supports IPv6!</text>
</note>
<registration xmlns="urn:xmpp:vcard:registration:1">
<uri>xmpp:sure.im</uri>
</registration>
<bday>
<date>2010</date>
</bday>
<adr>
<country>EU</country>
</adr>
<ca xmlns="urn:xmpp:vcard:ca:0">
<name>StartSSL</name>
<uri>http://www.startssl.com/</uri>
</ca>
<name xmlns="jabber:iq:version">Tigase</name>
<impp>
<uri>xmpp:admin@im.flosoft.biz</uri>
</impp>
<geo>
<uri>geo:50.69,3.19</uri>
</geo>
</vcard>
<vcard>
<fn>
<text>jabbim.cz</text>
</fn>
<kind>
<text>application</text>
</kind>
<url>
<uri>http://www.jabbim.cz/</uri>
</url>
<note>
<text>Stable ejabberd clustered server with good support and many transports and services: ICQ, AIM, MSN, Facebook, Weather, Yahoo, Notes, bots, MUCs, proxy65, STUN server for voice support, and more</text>
</note>
<registration xmlns="urn:xmpp:vcard:registration:1">
<uri>xmpp:jabbim.cz</uri>
</registration>
<bday>
<date>2005</date>
</bday>
<adr>
<country>CZ</country>
</adr>
<ca xmlns="urn:xmpp:vcard:ca:0">
<name>CAcert</name>
<uri>http://www.cacert.org/</uri>
</ca>
<name xmlns="jabber:iq:version">ejabberd</name>
<impp>
<uri>xmpp:pinky@njs.netlab.cz</uri>
</impp>
</vcard>
<vcard><fn><text>njs.netlab.cz</text></fn><kind><text>application</text></kind><url><uri>http://www.jabbim.cz/</uri></url><note><text>Public service hosted by jabbim.cz</text></note><registration xmlns="urn:xmpp:vcard:registration:1"><uri>xmpp:njs.netlab.cz</uri></registration><bday><date>2001</date></bday><adr><country>CZ</country></adr><ca xmlns="urn:xmpp:vcard:ca:0"><name>CAcert</name><uri>http://www.cacert.org/</uri></ca><name xmlns="jabber:iq:version">ejabberd</name><impp><uri>xmpp:pinky@njs.netlab.cz</uri></impp></vcard>
<vcard><fn><text>jabbim.pl</text></fn><kind><text>application</text></kind><url><uri>http://www.jabbim.cz/</uri></url><note><text>Public service hosted by jabbim.cz</text></note><registration xmlns="urn:xmpp:vcard:registration:1"><uri>xmpp:jabbim.pl</uri></registration><bday><date>2005</date></bday><adr><country>CZ</country></adr><ca xmlns="urn:xmpp:vcard:ca:0"><name>CAcert</name><uri>http://www.cacert.org/</uri></ca><name xmlns="jabber:iq:version">ejabberd</name><impp><uri>xmpp:pinky@njs.netlab.cz</uri></impp></vcard>
<vcard><fn><text>jabbim.sk</text></fn><kind><text>application</text></kind><url><uri>http://www.jabbim.cz/</uri></url><note><text>Public service hosted by jabbim.cz</text></note><registration xmlns="urn:xmpp:vcard:registration:1"><uri>xmpp:jabbim.sk</uri></registration><bday><date>2005</date></bday><adr><country>CZ</country></adr><ca xmlns="urn:xmpp:vcard:ca:0"><name>CAcert</name><uri>http://www.cacert.org/</uri></ca><name xmlns="jabber:iq:version">ejabberd</name><impp><uri>xmpp:pinky@njs.netlab.cz</uri></impp></vcard>
<vcard><fn><text>jabbim.com</text></fn><kind><text>application</text></kind><url><uri>http://www.jabbim.cz/</uri></url><note><text>Public service hosted by jabbim.cz</text></note><registration xmlns="urn:xmpp:vcard:registration:1"><uri>xmpp:jabbim.com</uri></registration><bday><date>2005</date></bday><adr><country>CZ</country></adr><ca xmlns="urn:xmpp:vcard:ca:0"><name>CAcert</name><uri>http://www.cacert.org/</uri></ca><name xmlns="jabber:iq:version">ejabberd</name><impp><uri>xmpp:pinky@njs.netlab.cz</uri></impp></vcard>
<vcard><fn><text>forumanalogue.fr</text></fn><kind><text>application</text></kind><url><uri>http://www.forumanalogue.fr/</uri></url><note><text>A public self-hosted Jabber server located in France.</text></note><registration xmlns="urn:xmpp:vcard:registration:1"><uri>xmpp:forumanalogue.fr</uri></registration><bday><date>2010</date></bday><adr><country>FR</country></adr><ca xmlns="urn:xmpp:vcard:ca:0"><name>StartSSL</name><uri>http://www.startssl.com/</uri></ca><name xmlns="jabber:iq:version">Openfire</name><impp><uri>xmpp:clement@forumanalogue.fr</uri></impp><geo><uri>geo:45.8,4.84</uri></geo><lang><parameters><pref>1</pref></parameters><language-tag>fr</language-tag></lang></vcard>
</vcards>

87
app/widgets/AccountError/AccountError.php

@ -0,0 +1,87 @@
<?php
/**
* @package Widgets
*
* @file AccountError.php
* This file is part of MOVIM.
*
* @brief The account creation widget error.
*
* @author Timothée Jaussoin <edhelas@gmail.com>
*
* @version 1.0
* @date 25 November 2011
*
* Copyright (C)2010 MOVIM project
*
* See COPYING for licensing information.
*/
class AccountError extends WidgetBase {
function WidgetLoad()
{
$warning = '';
if(isset($_GET['err']))
switch ($_GET['err']) {
case 'datamissing':
$warning = '
<div class="message warning">
'.t('Some data are missing !').'
</div> ';
break;
case 'jiderror':
$warning = '
<div class="message warning">
'.t('Wrong ID').'
</div> ';
break;
case 'passworddiff':
$warning = '
<div class="message info">
'.t('You entered different passwords').'
</div> ';
break;
case 'nameerr':
$warning = '
<div class="message warning">
'.t('Invalid name').'
</div> ';
break;
case 'notacceptable':
$warning = '
<div class="message error">
'.t('Request not acceptable').'
</div> ';
break;
case 'userconflict':
$warning = '
<div class="message warning">
'.t('Username already taken').'
</div> ';
break;
case 'xmppconnect':
$warning = '
<div class="message error">
'.t('Could not connect to the XMPP server').'
</div> ';
break;
case 'xmppcomm':
$warning = '
<div class="message error">
'.t('Could not communicate with the XMPP server').'
</div> ';
break;
case 'unknown':
$warning = '
<div class="message error">
'.t('Unknown error').'
</div> ';
break;
}
$this->view->assign('warning', $warning);
}
}

1
app/widgets/AccountError/accounterror.tpl

@ -0,0 +1 @@
{$warning}

239
app/widgets/AccountNext/AccountNext.php

@ -0,0 +1,239 @@
<?php
/**
* @package Widgets
*
* @file Subscribe.php
* This file is part of MOVIM.
*
* @brief The account creation widget.
*
* @author Timothée Jaussoin <edhelas@gmail.com>
*
* @version 1.0
* @date 25 November 2011
*
* Copyright (C)2010 MOVIM project
*
* See COPYING for licensing information.
*/
class AccountNext extends WidgetBase {
function WidgetLoad()
{
$this->addcss('accountnext.css');
$this->addjs('accountnext.js');
$xml = simplexml_load_string(file_get_contents('http://movim.eu/server-vcards.xml'));
$xml = (array)$xml->children();
$this->view->assign(
'getsubscriptionform',
$this->genCallAjax('ajaxDiscoverServer', "'".$_GET['s']."'")
);
$this->view->assign('ndd', $_GET['s']);
$this->view->assign('servers', $xml['vcard']);
}
function ajaxDiscoverServer($ndd) {
try {
$dns = dns_get_record('_xmpp-client._tcp.'.$ndd);
if(isset($dns[0]['target']) && $dns[0]['target'] != null) {
$domain = $dns[0]['target'];
} else {
$domain = $ndd['ndd'];
}
$f = fsockopen($domain, 5222, $errno, $errstr, 10);
if(!$f ) {
RPC::call('movim_reload', Route::urlize('account', 'xmppconnect'));
RPC::commit();
exit;
}
global $language;
$stream = simplexml_load_string('<?xml version="1.0"?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" version="1.0"><iq type="get" id="reg1" xml:lang="'.$language.'"><query xmlns="jabber:iq:register"/></iq></stream:stream>');
$stream->addAttribute('to', $ndd);
if (false === fwrite($f, $stream->asXML())) {
\system\Logs\Logger::log('fail write to stream');
throw new \Exception('fail write to stream');
}
unset($stream);
$response = stream_get_contents($f);
if(!$response) {
RPC::call('movim_reload', Route::urlize('account', 'xmppcomm'));
RPC::commit();
exit;
}
$response = simplexml_load_string($response);
$id = (string)$response->attributes()->id;
$elements = (array)$response->iq->query;
// We close properly our first register request
$stream = simplexml_load_string('<?xml version="1.0"?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" version="1.0"><iq type="set" id="unreg1"><query xmlns="jabber:iq:register"><remove/></query></iq></stream:stream>');
$stream->addAttribute('to', $ndd);
fwrite($f, $stream->asXML());
fclose($f); unset($f);
if(!empty($elements)) {
$formview = $this->tpl();
if($response->iq->query->instructions && $response->iq->query->x) {
$instr = '
<div class="element simple large">
<label>'.(string)$response->iq->query->instructions.'</label>';
if($response->iq->query->x->url)
$instr .= '
<a href="'.(string)$response->iq->query->x->url.'" target="_blank">'.
(string)$response->iq->query->x->url.'
</a>';
$instr .= '
</div>';
}
$form = new XMPPtoForm();
if(!empty($response->iq->query->x)){
$formh = $form->getHTML($response->iq->query->x->asXML());
} else{// no <x> element in the XML
$formh = $form->getHTML($response->iq->query->asXML());
}
if($formh != '')
$instr = '';
$formview->assign('instr', $instr);
$formview->assign('formh', $formh);
$formview->assign('id', $id);
$formview->assign('ndd', $ndd);
$formview->assign('domain', $domain);
$formview->assign(
'submitdata',
$this->genCallAjax('ajaxSubmitData', "movim_form_to_json('data')"));
$html = $formview->draw('_accountnext_form', true);
/*
if(isset($elements['data'])) {
$html .= '<img src="data:image/jpg;base64,'.$elements['data'].'"/>';
}
*/
} else {
$html = '
<div class="message warning">
'.t('No account creation form founded on the server').'
</div>';
}
RPC::call('movim_fill', 'subscription_form', $html);
RPC::commit();
} catch(Exception $e) {
header(sprintf('HTTP/1.1 %d %s', $e->getCode(), $e->getMessage()));
header('Content-Type: text/plain; charset=utf-8');
\system\Logs\Logger::log($e->getMessage());
}
}
function ajaxSubmitData($datas) {
define(XMPP_HOST, $datas->to->value);
define(XMPP_CONN, $datas->ndd->value);
unset($datas->to);
unset($datas->ndd);
define(XMPP_PORT, 5222);
try {
// We try to connect to the XMPP Server
$f = fsockopen(XMPP_CONN, XMPP_PORT, $errno, $errstr, 10);
if(!$f) {
RPC::call('movim_reload', Route::urlize('accountnext', 'xmppconnect'));
RPC::commit();
exit;
}
// We create the XML Stanza
$stream = simplexml_load_string('<?xml version="1.0"?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" version="1.0"><iq id="'.$datas->id->value.'" type="set"><query xmlns="jabber:iq:register"><x xmlns="jabber:x:data" type="form"></x></query></iq></stream:stream>');
unset($datas->id);
$stream->addAttribute('to', XMPP_HOST);
$xmpp = new FormtoXMPP();
$stream = $xmpp->getXMPP($stream->asXML(), $datas);
fwrite($f, $stream->asXML());
unset($stream);
$response = stream_get_contents($f);
if(!$response) {
RPC::call('movim_reload', Route::urlize('accountnext', array(XMPP_HOST, 'xmppcomm')));
RPC::commit();
exit;
}
fclose($f); unset($f);
$response = simplexml_load_string($response);
if(!$response) throw new Exception('The XMPP server sent an invalid response', 500);
if($stream_error = $response->xpath('/stream:stream/stream:error')) {
list($stream_error) = $stream_error;
list($cond) = $stream_error->children();
throw new Exception($stream_error->text ? $stream_error->text : $cond->getName(), 500);
}
$iq = $response->iq;
if($iq->error) {
list($cond) = $iq->error->children();
if($cond->getName() == 'conflict') {
RPC::call('movim_reload', Route::urlize('accountnext', array(XMPP_HOST,'userconflict')));
RPC::commit();
exit;
} else if($cond->getName() == 'not-acceptable') {
RPC::call('movim_reload', Route::urlize('accountnext', array(XMPP_HOST,'notacceptable')));
RPC::commit();
exit;
}
throw new Exception($iq->error->text ? $iq->error->text : $cond->getName(), 400);
}
if($iq = $response->iq and $iq->attributes()->type == 'result') {
RPC::call('movim_reload', Route::urlize('login', 'acccreated'));
RPC::commit();
exit;
} else {
RPC::call('movim_reload', Route::urlize('accountnext', array(XMPP_HOST,'unknown')));
RPC::commit();
exit;
}
} catch(Exception $e) {
header(sprintf('HTTP/1.1 %d %s', $e->getCode(), $e->getMessage()));
header('Content-Type: text/plain; charset=utf-8');
\system\Logs\Logger::log($e->getCode().' '.$e->getMessage().' file:'.$e->getFile().' - l.'.$e->getLine());
}
}
function flagPath($country) {
return BASE_URI.'themes/movim/img/flags/'.strtolower($country).'.png';
}
}

47
app/widgets/AccountNext/_accountnext_form.tpl

@ -0,0 +1,47 @@
<form name="data">
<fieldset>
{$instr}
<div class="clear"></div>
{$formh}
<input
type="hidden"
value="{$domain}"
name="ndd"
id="ndd"
/>
<input
type="hidden"
value="{$ndd}"
name="to"
id="to"
/>
<input
type="hidden"
value="{$id}"
name="id"
id="id"
/>
<input
id="submitb"
type="submit"
style="display: none;"
value="submit"
name="submitb"
/>
<a
class="button color green icon yes"
style="float: right;"
onclick="
localStorage.username = document.querySelector('#username').value+'@'+'{$ndd}';
{$submitdata}"
>
{$c->t('Validate')}
</a>
</fieldset>
</form>

1
app/widgets/AccountNext/accountnext.css

@ -0,0 +1 @@

1
app/widgets/AccountNext/accountnext.js

@ -0,0 +1 @@

12
app/widgets/AccountNext/accountnext.tpl

@ -0,0 +1,12 @@
<div id="subscribe">
<h1>{$c->t('Create a new account')} {$c->t('on')} {$ndd}</h1>
<div id="subscription_form" class="paddedtop">
{$c->t('Loading')}
</div>
<script type="text/javascript">
{$getsubscriptionform}
</script>
</div>

1
app/widgets/Login/Login.php

@ -34,6 +34,7 @@ class Login extends WidgetBase {
'document.getElementById(\'submitb\').click();
'.$submit.'
loginButtonSet(\''.t('Connecting...').'\', true);
localStorage.username = document.querySelector(\'#login\').value;
Session.clear();
this.onclick=null;');

6
app/widgets/Login/login.js

@ -6,3 +6,9 @@ function fillExample(login, pass) {
document.querySelector('#login').value = login;
document.querySelector('#pass').value = pass;
}
movim_add_onload(function()
{
if(localStorage.username != null)
document.querySelector('#login').value = localStorage.username;
});

41
app/widgets/Subscribe/Subscribe.php

@ -0,0 +1,41 @@
<?php
/**
* @package Widgets
*
* @file Subscribe.php
* This file is part of MOVIM.
*
* @brief The account creation widget.
*
* @author Timothée Jaussoin <edhelas@gmail.com>
*
* @version 1.0
* @date 25 November 2011
*
* Copyright (C)2010 MOVIM project
*
* See COPYING for licensing information.
*/
class Subscribe extends WidgetBase {
function WidgetLoad()
{
$this->addcss('subscribe.css');
$this->addjs('subscribe.js');
$xml = simplexml_load_string(file_get_contents('http://movim.eu/server-vcards.xml'));
$xml = (array)$xml->children();
$this->view->assign('servers', $xml['vcard']);
}
function flagPath($country) {
return BASE_URI.'themes/movim/img/flags/'.strtolower($country).'.png';
}
function accountNext($server) {
return Route::urlize('accountnext', array($server));
}
}

57
app/widgets/Subscribe/img/star.svg

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generated by IcoMoon.io -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
width="32"
height="32"
viewBox="0 0 32 32"
id="svg2"
inkscape:version="0.48.4 r9939"
sodipodi:docname="star.svg">
<metadata
id="metadata10">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs8" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1012"
id="namedview6"
showgrid="false"
inkscape:zoom="7.375"
inkscape:cx="-9.1525424"
inkscape:cy="16"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="1"
inkscape:current-layer="svg2" />
<path
d="M12.483 12.211c0 0-4.213 0.467-7.024 0.779-0.253 0.031-0.477 0.2-0.561 0.457s0 0.525 0.187 0.695c2.088 1.905 5.225 4.759 5.225 4.759-0.003 0-0.861 4.151-1.432 6.92-0.048 0.251 0.043 0.516 0.261 0.675 0.217 0.159 0.497 0.161 0.717 0.037 2.459-1.397 6.141-3.499 6.141-3.499s3.684 2.101 6.139 3.5c0.224 0.123 0.504 0.12 0.721-0.039 0.219-0.159 0.309-0.424 0.26-0.673-0.571-2.771-1.428-6.921-1.428-6.921s3.137-2.853 5.225-4.755c0.187-0.175 0.269-0.443 0.187-0.699s-0.307-0.425-0.56-0.455c-2.811-0.315-7.025-0.781-7.025-0.781s-1.747-3.864-2.911-6.44c-0.109-0.231-0.339-0.392-0.608-0.392s-0.5 0.163-0.604 0.392c-1.165 2.576-2.911 6.44-2.911 6.44z"
fill="#ffffff"
id="path4"
style="fill:#e2e152;fill-opacity:1" />
</svg>

40
app/widgets/Subscribe/subscribe.css

@ -0,0 +1,40 @@
#subscribe .block {
border: 1px solid #DDD;
margin-right: 1em;
margin-bottom: 1em;
width: 48%;
padding: 1em;
display: inline-block;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
}
#subscribe .block:hover {
background-color: #EEE;
cursor: pointer;
border-color: #BBB;
}
#subscribe .block h1 {
padding: 0;
line-height: 1em;
font-size: 1.2em;
}
#subscribe .block img.flag {
float: right;
margin-top: -1em;
}
#subscribe .block a {
text-decoration: none;
line-height: 1.5em;
}
#subscribe .block.star {
background-image: url('img/star.svg');
background-size: 3em 3em;
background-position: 100% 100%;
background-repeat: no-repeat;
}

35
app/widgets/Subscribe/subscribe.tpl

@ -0,0 +1,35 @@
<div id="subscribe">
<h1>{$c->t('Create a new account')}</h1>
<p class="paddedtop">{$c->t('Movim is a decentralized social network, before creating a new account you need to choose a server to register.')}</p>
<div class="paddedtop">
{loop="$servers"}
<div
class="block {if="$value->checked"}star{/if}"
onclick="movim_redirect('{$c->route('accountnext', array($value->fn->text, false))}')">
<h1>{$value->fn->text}</h1>
<img
class="flag"
title="{$value->adr->country}"
alt="{$value->adr->country}"
src="{$c->flagPath($value->adr->country)}"/>
<p>{$value->note->text}</p>
<a target="_blank" href="{$value->url->uri}">
{$value->url->uri}
</a>
</div>
{/loop}
<div class="block">
<h1>{$c->t('Your server here ?')}</h1>
<p>
{$c->t('Contact us to add yours to the officially supported servers list')} • <a href="http://movim.eu/">http://movim.eu/</a>
</p>
</div>
</div>
</div>

7
lib/XMPPtoForm.php

@ -178,8 +178,13 @@ class XMPPtoForm{
$this->html .= $value.' ';
}
}
$this->html .= '"';
if($s['var'] == 'username')
$this->html .= ' pattern="[a-z0-9_-]*" ';
$this->html .= '"
$this->html .= '
type="'.$type.'"
title="'.$s->desc.'"
xmpptype="'.$s['type'].'"

3
system/Route.php

@ -4,7 +4,8 @@ class Route extends \BaseController {
public function __construct() {
$this->_routes = array(
'account' => array('err'),
'account' => false,
'accountnext' => array('s', 'err'),
'visio' => false,
'main' => false,
'news' => false,

12
themes/movim/css/forms.css

@ -74,7 +74,7 @@ legend {
min-height: 2em;
border-radius: 0.1em;
background-color: white;
margin: 0px;
margin: 0;
padding: 0% 0.5em;
box-sizing: border-box;
-webkit-box-sizing: border-box;
@ -88,8 +88,8 @@ legend {
}
.element > *:not(label):not(img):invalid {
border: 1px solid red;
color: #B70000;
box-shadow: none !important;
color: red;
}
.element > textarea, textarea {
@ -276,13 +276,9 @@ legend {
display: inline-block;
max-width: 100%;
/*text-transform: uppercase;
font-weight: bold;*/
font-size: 1em;
line-height: 2em;
/*font-family: helvetica, sans-serif;*/
font-family: OpenSans-Reg;
text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.2);
box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.3);

6
themes/movim/css/style.css

@ -534,8 +534,8 @@ ul li input[type=checkbox]:checked ~ .tabbed {
transparent 75%, transparent);
color: #fff;
padding: 1em;
padding: 0.7em;
line-height: 1.5em;
margin: 0.5em 0px;
clear: both;
@ -735,7 +735,7 @@ dl dd {
}
.breadcrumb > a:first-child {
padding-left: 1.5em;
padding-left: 1em;
}
.breadcrumb > a:not(:first-child):after {

Loading…
Cancel
Save