From e2af267fb71daaa817de2787cda27403c0d1e5a2 Mon Sep 17 00:00:00 2001
From: src386
Date: Thu, 10 Sep 2015 10:11:09 +0200
Subject: [PATCH] rollback to movim 0.9-2015-08-25
---
README.md | 4 +-
sources/app/helpers/StringHelper.php | 35 +-
sources/app/models/conference/Conference.php | 24 +-
sources/app/models/config/Config.php | 4 +-
sources/app/models/contact/Contact.php | 106 ++--
sources/app/models/message/Message.php | 59 +-
sources/app/models/postn/Postn.php | 49 +-
sources/app/models/presence/Presence.php | 118 ++--
sources/app/models/rosterlink/RosterLink.php | 53 +-
.../app/models/subscription/Subscription.php | 24 +-
sources/app/views/about.tpl | 1 -
sources/app/views/page.tpl | 4 +-
sources/app/widgets/About/about.tpl | 2 +-
sources/app/widgets/About/locales.ini | 15 +-
sources/app/widgets/Account/Account.php | 2 +-
sources/app/widgets/Account/account.js | 4 -
.../app/widgets/AccountNext/AccountNext.php | 24 +-
sources/app/widgets/AdminLogin/adminlogin.tpl | 4 +-
sources/app/widgets/AdminMain/AdminMain.php | 4 +-
sources/app/widgets/AdminMain/adminmain.tpl | 2 +-
sources/app/widgets/AdminTest/AdminTest.php | 2 +-
sources/app/widgets/AdminTest/admintest.tpl | 3 +-
sources/app/widgets/Blog/blog.tpl | 2 +-
sources/app/widgets/Bookmark/Bookmark.php | 14 +
sources/app/widgets/Chat/Chat.php | 9 +-
sources/app/widgets/Chat/chat.js | 2 +-
sources/app/widgets/Config/Config.php | 4 +-
sources/app/widgets/Contact/Contact.php | 20 +
sources/app/widgets/Contact/_contact.tpl | 41 +-
sources/app/widgets/Group/Group.php | 8 +-
sources/app/widgets/Group/_group_header.tpl | 2 +-
sources/app/widgets/Group/_group_posts.tpl | 18 +-
sources/app/widgets/Groups/groups.js | 2 +-
sources/app/widgets/Help/help.tpl | 4 +-
sources/app/widgets/Login/locales.ini | 9 +-
sources/app/widgets/Login/login.js | 2 +-
sources/app/widgets/Login/login.tpl | 2 +-
sources/app/widgets/Notifs/notifs.css | 3 +-
sources/app/widgets/Post/_post.tpl | 2 +-
sources/app/widgets/Publish/Publish.php | 38 +-
.../app/widgets/Publish/_publish_embed.tpl | 4 +-
sources/app/widgets/Rooms/Rooms.php | 10 +-
sources/app/widgets/Rooms/_rooms.tpl | 19 +-
sources/app/widgets/Rooms/locales.ini | 1 -
sources/app/widgets/Roster/roster.tpl | 6 +-
sources/app/widgets/Vcard4/_vcard4_form.tpl | 46 +-
sources/app/widgets/Vcard4/locales.ini | 3 +-
sources/bootstrap.php | 28 +-
sources/composer.json | 3 +-
sources/index.php | 11 +-
sources/linker.php | 8 +-
sources/locales/fr.po | 513 ++++++++++++++----
sources/system/User.php | 3 +-
sources/system/Utils.php | 20 +-
sources/system/widget/WidgetBase.php | 40 +-
sources/themes/material/css/article.css | 17 +-
sources/themes/material/css/list.css | 1 -
sources/themes/material/css/style.css | 21 +-
58 files changed, 886 insertions(+), 593 deletions(-)
diff --git a/README.md b/README.md
index 316e4ef..27db349 100644
--- a/README.md
+++ b/README.md
@@ -7,12 +7,12 @@ Warning: BETA.
You need a valid SSL certificate to use Movim, auto-signed is not allowed.
-Current Movim version : 0.9 git2015-09-10
+Current Movim version : 0.9 git2015-08-25
**Changelog**
0.9b 2015-0
-- Update to Movim 0.9 git2015-09-10
+- Update to Movim 0.9 git2015-08-25
- Add notes in README about public pods & whitelisting
- script/install now check if path is empty.
- script/remove now delete /etc/php/fpm/pool.d/movim.conf (fix #8).
diff --git a/sources/app/helpers/StringHelper.php b/sources/app/helpers/StringHelper.php
index 2ff9590..3a6edce 100644
--- a/sources/app/helpers/StringHelper.php
+++ b/sources/app/helpers/StringHelper.php
@@ -47,9 +47,17 @@ class MovimEmoji
}
}
-function addUrls($string, $preview = false) {
+/**
+ * @desc Prepare the string (add the a to the links and show the smileys)
+ *
+ * @param string $string
+ * @param boolean display large emojis
+ * @param check the links and convert them to pictures (heavy)
+ * @return string
+ */
+function prepareString($string, $large = false, $preview = false) {
// Add missing links
- return preg_replace_callback(
+ $string = preg_replace_callback(
"/([\w\"'>]+\:\/\/[\w-?&;#+%:~=\.\/\@]+[\w\/])/", function ($match) use($preview) {
if(!in_array(substr($match[0], 0, 1), array('>', '"', '\''))) {
$content = $match[0];
@@ -76,18 +84,6 @@ function addUrls($string, $preview = false) {
}, $string
);
-}
-
-/**
- * @desc Prepare the string (add the a to the links and show the smileys)
- *
- * @param string $string
- * @param boolean display large emojis
- * @param check the links and convert them to pictures (heavy)
- * @return string
- */
-function prepareString($string, $large = false, $preview = false) {
- $string = addUrls($string, $preview);
// We remove all the style attributes
$string = preg_replace_callback(
@@ -98,7 +94,16 @@ function prepareString($string, $large = false, $preview = false) {
// Twitter hashtags
$string = preg_replace_callback(
- "/ #[a-zA-Z0-9_-]{3,}/", function ($match) { return ' '; }, ' ' . $string);
+ "/ #[a-zA-Z0-9_-]{3,}/", function ($match) {
+ return
+ ' ';
+ }, ' ' . $string
+ );
+
$string = preg_replace_callback(
"/ @[a-zA-Z0-9_-]{3,}/", function ($match) {
return
diff --git a/sources/app/models/conference/Conference.php b/sources/app/models/conference/Conference.php
index 81c094d..3f95153 100644
--- a/sources/app/models/conference/Conference.php
+++ b/sources/app/models/conference/Conference.php
@@ -2,31 +2,31 @@
namespace modl;
-class Conference extends Model {
+class Conference extends Model {
public $jid;
- protected $conference;
- protected $name;
- protected $nick;
+ public $conference;
+ public $name;
+ public $nick;
public $autojoin;
public $status;
-
+
public function __construct() {
$this->_struct = '
{
- "jid" :
+ "jid" :
{"type":"string", "size":128, "mandatory":true, "key":true },
- "conference" :
+ "conference" :
{"type":"string", "size":128, "mandatory":true, "key":true },
- "name" :
+ "name" :
{"type":"string", "size":128, "mandatory":true },
- "nick" :
+ "nick" :
{"type":"string", "size":128 },
- "autojoin" :
+ "autojoin" :
{"type":"int", "size":1 },
- "status" :
+ "status" :
{"type":"int", "size":1 }
}';
-
+
parent::__construct();
}
}
diff --git a/sources/app/models/config/Config.php b/sources/app/models/config/Config.php
index e4c514a..7d72bdb 100644
--- a/sources/app/models/config/Config.php
+++ b/sources/app/models/config/Config.php
@@ -31,7 +31,7 @@ class Config extends Model {
"loglevel" :
{"type":"string", "size":16, "mandatory":true },
"timezone" :
- {"type":"string", "size":32, "mandatory":true },
+ {"type":"string", "size":16, "mandatory":true },
"xmppwhitelist" :
{"type":"text" },
"info" :
@@ -50,7 +50,7 @@ class Config extends Model {
parent::__construct();
- $this->description = 'Description';//__('global.description');
+ $this->description = __('global.description');
$this->theme = 'material';
$this->locale = 'en';
$this->maxusers = -1;
diff --git a/sources/app/models/contact/Contact.php b/sources/app/models/contact/Contact.php
index f27132c..d657101 100644
--- a/sources/app/models/contact/Contact.php
+++ b/sources/app/models/contact/Contact.php
@@ -2,8 +2,6 @@
namespace modl;
-use Respect\Validation\Validator;
-
class Contact extends Model {
public $jid;
@@ -160,36 +158,37 @@ class Contact extends Model {
}
public function set($vcard, $jid) {
- $this->__set('jid', \echapJid($jid));
+ $this->jid = \echapJid($jid);
- $validate_date = Validator::date('Y-m-d');
if(isset($vcard->vCard->BDAY)
- && $validate_date->validate($vcard->vCard->BDAY))
- $this->__set('date', (string)$vcard->vCard->BDAY);
+ && (string)$vcard->vCard->BDAY != '')
+ $this->date = (string)$vcard->vCard->BDAY;
+ else
+ $this->date = null;
- $this->__set('date', date(DATE_ISO8601, strtotime($this->date)));
+ $this->date = date(DATE_ISO8601, strtotime($this->date));
- $this->__set('name', (string)$vcard->vCard->NICKNAME);
- $this->__set('fn', (string)$vcard->vCard->FN);
- $this->__set('url', (string)$vcard->vCard->URL);
+ $this->name = (string)$vcard->vCard->NICKNAME;
+ $this->fn = (string)$vcard->vCard->FN;
+ $this->url = (string)$vcard->vCard->URL;
- $this->__set('gender', (string)$vcard->vCard->{'X-GENDER'});
- $this->__set('marital', (string)$vcard->vCard->MARITAL->STATUS);
+ $this->gender = (string)$vcard->vCard->{'X-GENDER'};
+ $this->marital = (string)$vcard->vCard->MARITAL->STATUS;
- $this->__set('email', (string)$vcard->vCard->EMAIL->USERID);
+ $this->email = (string)$vcard->vCard->EMAIL->USERID;
- $this->__set('adrlocality', (string)$vcard->vCard->ADR->LOCALITY);
- $this->__set('adrpostalcode', (string)$vcard->vCard->ADR->PCODE);
- $this->__set('adrcountry', (string)$vcard->vCard->ADR->CTRY);
+ $this->adrlocality = (string)$vcard->vCard->ADR->LOCALITY;
+ $this->adrpostalcode = (string)$vcard->vCard->ADR->PCODE;
+ $this->adrcountry = (string)$vcard->vCard->ADR->CTRY;
if(filter_var((string)$vcard->vCard->PHOTO, FILTER_VALIDATE_URL)) {
- $this->__set('photobin', base64_encode(
- requestUrl((string)$vcard->vCard->PHOTO, 1)));
+ $this->photobin = base64_encode(
+ requestUrl((string)$vcard->vCard->PHOTO, 1));
} else {
- $this->__set('photobin', (string)$vcard->vCard->PHOTO->BINVAL);
+ $this->photobin = (string)$vcard->vCard->PHOTO->BINVAL;
}
- $this->__set('description', (string)$vcard->vCard->DESC);
+ $this->description = (string)$vcard->vCard->DESC;
}
public function createThumbnails() {
@@ -251,32 +250,32 @@ class Contact extends Model {
}
public function setTune($stanza) {
- $this->__set('tuneartist', (string)$stanza->items->item->tune->artist);
- $this->__set('tunelenght', (int)$stanza->items->item->tune->lenght);
- $this->__set('tunerating', (int)$stanza->items->item->tune->rating);
- $this->__set('tunesource', (string)$stanza->items->item->tune->source);
- $this->__set('tunetitle', (string)$stanza->items->item->tune->title);
- $this->__set('tunetrack', (string)$stanza->items->item->tune->track);
+ $this->tuneartist = (string)$stanza->items->item->tune->artist;
+ $this->tunelenght = (int)$stanza->items->item->tune->lenght;
+ $this->tunerating = (int)$stanza->items->item->tune->rating;
+ $this->tunesource = (string)$stanza->items->item->tune->source;
+ $this->tunetitle = (string)$stanza->items->item->tune->title;
+ $this->tunetrack = (string)$stanza->items->item->tune->track;
}
public function setVcard4($vcard) {
- $validate_date = Validator::date('Y-m-d');
- if(isset($vcard->bday->date)
- && $validate_date->validate($vcard->bday->date))
- $this->__set('date', (string)$vcard->bday->date);
+ if(isset($vcard->bday->date))
+ $this->date = (string)$vcard->bday->date;
+ if(empty($this->date))
+ $this->date = null;
- $this->__set('name', (string)$vcard->nickname->text);
- $this->__set('fn', (string)$vcard->fn->text);
- $this->__set('url', (string)$vcard->url->uri);
+ $this->name = (string)$vcard->nickname->text;
+ $this->fn = (string)$vcard->fn->text;
+ $this->url = (string)$vcard->url->uri;
if(isset($vcard->gender))
- $this->__set('gender ', (string)$vcard->gender->sex->text);
+ $this->gender = (string)$vcard->gender->sex->text;
if(isset($vcard->marital))
- $this->__set('marital', (string)$vcard->marital->status->text);
+ $this->marital = (string)$vcard->marital->status->text;
- $this->__set('adrlocality', (string)$vcard->adr->locality);
- $this->__set('adrcountry', (string)$vcard->adr->country);
- $this->__set('adrpostalcode', (string)$vcard->adr->code);
+ $this->adrlocality = (string)$vcard->adr->locality;
+ $this->adrcountry = (string)$vcard->adr->country;
+ $this->adrpostalcode = (string)$vcard->adr->code;
if(isset($vcard->impp)) {
foreach($vcard->impp->children() as $c) {
@@ -284,20 +283,21 @@ class Contact extends Model {
switch($key) {
case 'twitter' :
- $this->__set('twitter', str_replace('@', '', $value));
+ $this->twitter = str_replace('@', '', $value);
break;
case 'skype' :
- $this->__set('skype', (string)$value);
+ $this->skype = (string)$value;
break;
case 'ymsgr' :
- $this->__set('yahoo', (string)$value);
+ $this->yahoo = (string)$value;
break;
}
}
}
- $this->__set('email', (string)$vcard->email->text);
- $this->__set('description', trim((string)$vcard->note->text));
+ $this->email = (string)$vcard->email->text;
+
+ $this->description = trim((string)$vcard->note->text);
}
public function getPlace() {
@@ -389,26 +389,6 @@ class Contact extends Model {
}
}
- function getAlbum()
- {
- $uri = str_replace(
- ' ',
- '%20',
- 'http://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=80c1aa3abfa9e3d06f404a2e781e38f9&artist='.
- $this->tuneartist.
- '&album='.
- $this->tunesource.
- '&format=json'
- );
-
- $json = json_decode(requestURL($uri, 2));
-
- if($json->album) {
- $json->album->url = $json->album->image[2]->{'#text'};
- return $json->album;
- }
- }
-
function toRoster() {
return array(
'jid' => $this->jid,
diff --git a/sources/app/models/message/Message.php b/sources/app/models/message/Message.php
index 4b3bb46..654f974 100644
--- a/sources/app/models/message/Message.php
+++ b/sources/app/models/message/Message.php
@@ -6,15 +6,15 @@ class Message extends Model {
public $session;
public $jidto;
public $jidfrom;
-
- protected $resource;
-
+
+ public $resource;
+
public $type;
- protected $subject;
- protected $thread;
- protected $body;
- protected $html;
+ public $subject;
+ public $thread;
+ public $body;
+ public $html;
public $published;
public $delivered;
@@ -25,30 +25,30 @@ class Message extends Model {
{
$this->_struct = '
{
- "session" :
+ "session" :
{"type":"string", "size":128, "mandatory":true },
- "jidto" :
+ "jidto" :
{"type":"string", "size":128, "mandatory":true },
- "jidfrom" :
+ "jidfrom" :
{"type":"string", "size":128, "mandatory":true },
- "resource" :
+ "resource" :
{"type":"string", "size":128 },
- "type" :
+ "type" :
{"type":"string", "size":20 },
- "subject" :
+ "subject" :
{"type":"text"},
- "thread" :
+ "thread" :
{"type":"string", "size":128 },
- "body" :
+ "body" :
{"type":"text"},
- "html" :
+ "html" :
{"type":"text"},
- "published" :
+ "published" :
{"type":"date"},
- "delivered" :
+ "delivered" :
{"type":"date"}
}';
-
+
parent::__construct();
}
@@ -66,15 +66,15 @@ class Message extends Model {
$this->jidfrom = $jid[0];
if(isset($jid[1]))
- $this->__set('resource', $jid[1]);
+ $this->resource = $jid[1];
$this->type = 'chat';
if($stanza->attributes()->type) {
$this->type = (string)$stanza->attributes()->type;
}
- $this->__set('body', (string)$stanza->body);
- $this->__set('subject', (string)$stanza->subject);
+ $this->body = (string)$stanza->body;
+ $this->subject = (string)$stanza->subject;
$images = (bool)($this->type == 'chat');
@@ -83,9 +83,9 @@ class Message extends Model {
$this->html = \fixSelfClosing($this->html);
$this->html = \prepareString($this->html, false, $images);
} else {*/
- // $this->html = \prepareString($this->body, false, $images);
+ $this->html = \prepareString($this->body, false, $images);
//}
-
+
if($stanza->delay)
$this->published = gmdate('Y-m-d H:i:s', strtotime($stanza->delay->attributes()->stamp));
elseif($parent && $parent->delay)
@@ -95,15 +95,4 @@ class Message extends Model {
$this->delivered = gmdate('Y-m-d H:i:s');
}
}
-
- public function convertEmojis()
- {
- $emoji = \MovimEmoji::getInstance();
- $this->body = $emoji->replace($this->body);
- }
-
- public function addUrls()
- {
- $this->body = addUrls($this->body);
- }
}
diff --git a/sources/app/models/postn/Postn.php b/sources/app/models/postn/Postn.php
index ee4f512..8eae785 100644
--- a/sources/app/models/postn/Postn.php
+++ b/sources/app/models/postn/Postn.php
@@ -109,33 +109,33 @@ class Postn extends Model {
else
$entry = $item;
- $this->__set('origin', $from);
+ $this->origin = $from;
if($node)
- $this->__set('node', $node);
+ $this->node = $node;
else
- $this->__set('node', (string)$item->attributes()->node);
+ $this->node = (string)$item->attributes()->node;
- $this->__set('nodeid', (string)$entry->attributes()->id);
+ $this->nodeid = (string)$entry->attributes()->id;
if($entry->entry->id)
- $this->__set('nodeid', (string)$entry->entry->id);
+ $this->nodeid = (string)$entry->entry->id;
// Get some informations on the author
if($entry->entry->author->name)
- $this->__set('aname', (string)$entry->entry->author->name);
+ $this->aname = (string)$entry->entry->author->name;
if($entry->entry->author->uri)
- $this->__set('aid', substr((string)$entry->entry->author->uri, 5));
+ $this->aid = substr((string)$entry->entry->author->uri, 5);
if($entry->entry->author->email)
- $this->__set('aemail', (string)$entry->entry->author->email);
+ $this->aemail = (string)$entry->entry->author->email;
// Non standard support
if($entry->entry->source && $entry->entry->source->author->name)
- $this->__set('aname', (string)$entry->entry->source->author->name);
+ $this->aname = (string)$entry->entry->source->author->name;
if($entry->entry->source && $entry->entry->source->author->uri)
- $this->__set('aid', substr((string)$entry->entry->source->author->uri, 5));
+ $this->aid = substr((string)$entry->entry->source->author->uri, 5);
- $this->__set('title', (string)$entry->entry->title);
+ $this->title = (string)$entry->entry->title;
// Content
if($entry->entry->summary && (string)$entry->entry->summary != '')
@@ -153,22 +153,23 @@ class Postn extends Model {
$content = $summary.$content;
if($entry->entry->updated)
- $this->__set('updated', (string)$entry->entry->updated);
+ $this->updated = (string)$entry->entry->updated;
else
- $this->__set('updated', gmdate(DATE_ISO8601));
+ $this->updated = gmdate(DATE_ISO8601);
if($entry->entry->published)
- $this->__set('published', (string)$entry->entry->published);
+ $this->published = (string)$entry->entry->published;
elseif($entry->entry->updated)
- $this->__set('published', (string)$entry->entry->updated);
+ $this->published = (string)$entry->entry->updated;
else
- $this->__set('published', gmdate(DATE_ISO8601));
+ $this->published = gmdate(DATE_ISO8601);
if($delay)
- $this->__set('delay', $delay);
+ $this->delay = $delay;
$contentimg = $this->setAttachements($entry->entry->link);
+
// Tags parsing
if($entry->entry->category) {
$this->tags = array();
@@ -182,24 +183,22 @@ class Postn extends Model {
}
if(!empty($this->tags))
- $this->__set('tags', serialize($this->tags));
+ $this->tags = serialize($this->tags);
if($contentimg != '')
$content .= '
'.$contentimg;
if(!isset($this->commentplace))
- $this->__set('commentplace', $this->origin);
+ $this->commentplace = $this->origin;
- $this->__set('content', trim($content));
- //$this->__set('contentcleaned', prepareString(html_entity_decode($this->content)));
- $purifier = new \HTMLPurifier();
- $this->contentcleaned = $purifier->purify(html_entity_decode($this->content));
+ $this->content = trim($content);
+ $this->contentcleaned = prepareString(html_entity_decode($this->content));
if($entry->entry->geoloc) {
if($entry->entry->geoloc->lat != 0)
- $this->__set('lat', (string)$entry->entry->geoloc->lat);
+ $this->lat = (string)$entry->entry->geoloc->lat;
if($entry->entry->geoloc->lon != 0)
- $this->__set('lon', (string)$entry->entry->geoloc->lon);
+ $this->lon = (string)$entry->entry->geoloc->lon;
}
}
diff --git a/sources/app/models/presence/Presence.php b/sources/app/models/presence/Presence.php
index 0f64f7a..002e785 100644
--- a/sources/app/models/presence/Presence.php
+++ b/sources/app/models/presence/Presence.php
@@ -4,23 +4,23 @@ namespace Modl;
class Presence extends Model {
protected $id;
-
+
protected $session;
protected $jid;
-
+
// General presence informations
protected $resource;
protected $value;
protected $priority;
protected $status;
-
+
// Client Informations
protected $node;
protected $ver;
-
+
// Delay - XEP 0203
protected $delay;
-
+
// Last Activity - XEP 0256
protected $last;
@@ -33,84 +33,84 @@ class Presence extends Model {
// vcard-temp:x:update, not saved in the DB
public $photo = false;
-
+
public function __construct() {
$this->_struct = '
{
- "id" :
+ "id" :
{"type":"string", "size":128, "mandatory":true },
- "session" :
+ "session" :
{"type":"string", "size":64, "mandatory":true, "key":true },
- "jid" :
+ "jid" :
{"type":"string", "size":64, "mandatory":true, "key":true },
- "resource" :
+ "resource" :
{"type":"string", "size":64, "key":true },
- "value" :
+ "value" :
{"type":"int", "size":11, "mandatory":true },
- "priority" :
+ "priority" :
{"type":"int", "size":11 },
- "status" :
+ "status" :
{"type":"text"},
- "node" :
+ "node" :
{"type":"string", "size":128 },
- "ver" :
+ "ver" :
{"type":"string", "size":128 },
- "delay" :
+ "delay" :
{"type":"date"},
- "last" :
+ "last" :
{"type":"int", "size":11 },
- "publickey" :
+ "publickey" :
{"type":"text"},
- "muc" :
+ "muc" :
{"type":"int", "size":1 },
- "mucjid" :
+ "mucjid" :
{"type":"string", "size":64 },
- "mucaffiliation" :
+ "mucaffiliation" :
{"type":"string", "size":32 },
- "mucrole" :
+ "mucrole" :
{"type":"string", "size":32 }
}';
-
+
parent::__construct();
}
-
+
public function setPresence($stanza) {
$jid = explode('/',(string)$stanza->attributes()->from);
-
+
if($stanza->attributes()->to)
$to = current(explode('/',(string)$stanza->attributes()->to));
else
$to = $jid[0];
- $this->__set('session', $to);
- $this->__set('jid', $jid[0]);
+ $this->session = $to;
+ $this->jid = $jid[0];
if(isset($jid[1]))
- $this->__set('resource', $jid[1]);
+ $this->resource = $jid[1];
else
- $this->__set('resource', 'default');
-
- $this->__set('status', (string)$stanza->status);
-
+ $this->resource = 'default';
+
+ $this->status = (string)$stanza->status;
+
if($stanza->c) {
- $this->__set('node', (string)$stanza->c->attributes()->node);
- $this->__set('ver', (string)$stanza->c->attributes()->ver);
+ $this->node = (string)$stanza->c->attributes()->node;
+ $this->ver = (string)$stanza->c->attributes()->ver;
}
-
+
if($stanza->priority)
- $this->__set('priority', (string)$stanza->priority);
-
+ $this->priority = (string)$stanza->priority;
+
if((string)$stanza->attributes()->type == 'error') {
- $this->__set('value', 6);
+ $this->value = 6;
} elseif((string)$stanza->attributes()->type == 'unavailable') {
- $this->__set('value', 5);
+ $this->value = 5;
} elseif((string)$stanza->show == 'away') {
- $this->__set('value', 2);
+ $this->value = 2;
} elseif((string)$stanza->show == 'dnd') {
- $this->__set('value', 3);
+ $this->value = 3;
} elseif((string)$stanza->show == 'xa') {
- $this->__set('value', 4);
+ $this->value = 4;
} else {
- $this->__set('value', 1);
+ $this->value = 1;
}
// Specific XEP
@@ -118,41 +118,41 @@ class Presence extends Model {
foreach($stanza->children() as $name => $c) {
switch($c->attributes()->xmlns) {
case 'jabber:x:signed' :
- $this->__set('publickey', (string)$c);
+ $this->publickey = (string)$c;
break;
case 'http://jabber.org/protocol/muc#user' :
- $this->__set('muc ', true);
+ $this->muc = true;
if($c->item->attributes()->jid)
- $this->__set('mucjid', cleanJid((string)$c->item->attributes()->jid));
+ $this->mucjid = cleanJid((string)$c->item->attributes()->jid);
else
- $this->__set('mucjid', (string)$stanza->attributes()->from);
+ $this->mucjid = (string)$stanza->attributes()->from;
- $this->__set('mucrole', (string)$c->item->attributes()->role);
- $this->__set('mucaffiliation', (string)$c->item->attributes()->affiliation);
+ $this->mucrole = (string)$c->item->attributes()->role;
+ $this->mucaffiliation = (string)$c->item->attributes()->affiliation;
break;
case 'vcard-temp:x:update' :
- $this->__set('photo', true);
+ $this->photo = true;
break;
}
}
}
-
+
if($stanza->delay) {
- $this->__set('delay',
+ $this->delay =
gmdate(
- 'Y-m-d H:i:s',
+ 'Y-m-d H:i:s',
strtotime(
(string)$stanza->delay->attributes()->stamp
)
)
- );
+ ;
}
-
+
if($stanza->query) {
- $this->__set('last', (int)$stanza->query->attributes()->seconds);
+ $this->last = (int)$stanza->query->attributes()->seconds;
}
}
-
+
public function getPresence() {
$txt = array(
1 => 'online',
@@ -162,7 +162,7 @@ class Presence extends Model {
5 => 'offline',
6 => 'server_error'
);
-
+
$arr = array();
$arr['jid'] = $this->jid;
$arr['resource'] = $this->resource;
@@ -172,7 +172,7 @@ class Presence extends Model {
$arr['status'] = $this->status;
$arr['node'] = $this->node;
$arr['ver'] = $this->ver;
-
+
return $arr;
}
diff --git a/sources/app/models/rosterlink/RosterLink.php b/sources/app/models/rosterlink/RosterLink.php
index 61595da..2668c41 100644
--- a/sources/app/models/rosterlink/RosterLink.php
+++ b/sources/app/models/rosterlink/RosterLink.php
@@ -2,57 +2,56 @@
namespace modl;
-class RosterLink extends Model {
+class RosterLink extends Model {
public $session;
public $jid;
-
- protected $rostername;
+
+ public $rostername;
public $rosterask;
public $rostersubscription;
-
- protected $realname;
-
- protected $groupname;
-
+
+ public $realname;
+
+ public $groupname;
+
public $chaton;
public $publickey;
-
+
public function __construct() {
$this->_struct = '
{
- "session" :
+ "session" :
{"type":"string", "size":128, "mandatory":true, "key":true },
- "jid" :
+ "jid" :
{"type":"string", "size":128, "mandatory":true, "key":true },
- "rostername" :
+ "rostername" :
{"type":"string", "size":128 },
- "rosterask" :
+ "rosterask" :
{"type":"string", "size":128 },
- "rostersubscription" :
+ "rostersubscription" :
{"type":"string", "size":128 },
- "realname" :
+ "realname" :
{"type":"string", "size":128 },
- "groupname" :
+ "groupname" :
{"type":"string", "size":128 },
- "chaton" :
+ "chaton" :
{"type":"int", "size":11 }
}';
-
+
parent::__construct();
}
-
+
function set($stanza) {
$this->jid = (string)$stanza->attributes()->jid;
-
- if(isset($stanza->attributes()->name)
- && (string)$stanza->attributes()->name != '')
- $this->__set('rostername', (string)$stanza->attributes()->name);
+
+ if(isset($stanza->attributes()->name) && (string)$stanza->attributes()->name != '')
+ $this->rostername = (string)$stanza->attributes()->name;
else
- $this->__set('rostername', (string)$stanza->attributes()->jid);
- $this->__set('rosterask', (string)$stanza->attributes()->ask);
- $this->__set('rostersubscription', (string)$stanza->attributes()->subscription);
- $this->__set('groupname', (string)$stanza->group);
+ $this->rostername = (string)$stanza->attributes()->jid;
+ $this->rosterask = (string)$stanza->attributes()->ask;
+ $this->rostersubscription = (string)$stanza->attributes()->subscription;
+ $this->groupname = (string)$stanza->group;
}
}
diff --git a/sources/app/models/subscription/Subscription.php b/sources/app/models/subscription/Subscription.php
index 6dd273f..6fe980d 100644
--- a/sources/app/models/subscription/Subscription.php
+++ b/sources/app/models/subscription/Subscription.php
@@ -4,11 +4,11 @@ namespace modl;
class Subscription extends Model {
public $jid;
- protected $server;
- protected $node;
- protected $subscription;
- protected $subid;
- protected $title;
+ public $server;
+ public $node;
+ public $subscription;
+ public $subid;
+ public $title;
public $description;
public $tags;
public $timestamp;
@@ -40,13 +40,13 @@ class Subscription extends Model {
}
function set($jid, $server, $node, $s) {
- $this->__set('jid', $jid);
- $this->__set('server', $server);
- $this->__set('node', $node);
- $this->__set('jid', (string)$s->attributes()->jid);
- $this->__set('subscription', (string)$s->attributes()->subscription);
- $this->__set('subid', (string)$s->attributes()->subid);
- $this->__set('tags', serialize(array()));
+ $this->jid = $jid;
+ $this->server = $server;
+ $this->node = $node;
+ $this->jid = (string)$s->attributes()->jid;
+ $this->subscription = (string)$s->attributes()->subscription;
+ $this->subid = (string)$s->attributes()->subid;
+ $this->tags = serialize(array());
if($this->subid = '')
$this->subid = 'default';
diff --git a/sources/app/views/about.tpl b/sources/app/views/about.tpl
index 61f570c..51f4f82 100644
--- a/sources/app/views/about.tpl
+++ b/sources/app/views/about.tpl
@@ -5,7 +5,6 @@
widget('Tabs');?>
widget('About');?>
- widget('Help');?>
widget('Caps');?>
diff --git a/sources/app/views/page.tpl b/sources/app/views/page.tpl
index f11aaac..34e897c 100644
--- a/sources/app/views/page.tpl
+++ b/sources/app/views/page.tpl
@@ -11,8 +11,8 @@
-
+
+
diff --git a/sources/app/widgets/About/about.tpl b/sources/app/widgets/About/about.tpl
index 60e2226..5e33396 100644
--- a/sources/app/widgets/About/about.tpl
+++ b/sources/app/widgets/About/about.tpl
@@ -20,7 +20,7 @@
{$c->__('about.translators')}
- {$c->__('about.translators_text')} www.transifex.com/projects/p/movim/
+ Thanks to all the translators translations.launchpad.net/movim
diff --git a/sources/app/widgets/About/locales.ini b/sources/app/widgets/About/locales.ini
index 0581b91..decc689 100644
--- a/sources/app/widgets/About/locales.ini
+++ b/sources/app/widgets/About/locales.ini
@@ -1,9 +1,8 @@
[about]
-thanks = Thanks
-developers = Developers
-translators = Translators
-translators_text = "Thanks to all the translators"
-software = Software
-resources = Resources
-api = API
-info = Movim is an XMPP-based communication platform. All the project, except the following software and resources, is under
+thanks = Thanks
+developers = Developers
+translators = Translators
+software = Software
+resources = Resources
+api = API
+info = Movim is an XMPP-based communication platform. All the project, except the following software and resources, is under
diff --git a/sources/app/widgets/Account/Account.php b/sources/app/widgets/Account/Account.php
index c56e7b5..ff4ebd8 100644
--- a/sources/app/widgets/Account/Account.php
+++ b/sources/app/widgets/Account/Account.php
@@ -13,7 +13,7 @@ class Account extends WidgetBase
$this->addjs('account.js');
$this->registerEvent('register_changepassword_handle', 'onPasswordChanged');
$this->registerEvent('register_remove_handle', 'onRemoved');
- $this->registerEvent('register_get_handle', 'onRegister', 'account');
+ $this->registerEvent('register_get_handle', 'onRegister');
}
function onPasswordChanged()
diff --git a/sources/app/widgets/Account/account.js b/sources/app/widgets/Account/account.js
index d6f3724..85bf564 100644
--- a/sources/app/widgets/Account/account.js
+++ b/sources/app/widgets/Account/account.js
@@ -10,7 +10,3 @@ var Account = {
Presence_ajaxLogout();
}
}
-
-MovimWebsocket.attach(function() {
- Notification.current('account');
-});
diff --git a/sources/app/widgets/AccountNext/AccountNext.php b/sources/app/widgets/AccountNext/AccountNext.php
index ba1086a..3089be3 100644
--- a/sources/app/widgets/AccountNext/AccountNext.php
+++ b/sources/app/widgets/AccountNext/AccountNext.php
@@ -9,12 +9,12 @@ class AccountNext extends WidgetBase {
{
$this->addjs('accountnext.js');
$this->addcss('accountnext.css');
-
+
$this->registerEvent('register_get_handle', 'onForm');
$this->registerEvent('register_set_handle', 'onRegistered');
- $this->registerEvent('register_set_errorconflict', 'onRegisterError', 'accountnext');
- $this->registerEvent('register_set_errornotacceptable', 'onRegisterNotAcceptable', 'accountnext');
- $this->registerEvent('register_get_errorserviceunavailable', 'onServiceUnavailable', 'accountnext');
+ $this->registerEvent('register_set_errorconflict', 'onRegisterError');
+ $this->registerEvent('register_set_errornotacceptable', 'onRegisterNotAcceptable');
+ $this->registerEvent('register_get_errorserviceunavailable', 'onServiceUnavailable');
}
function display()
@@ -35,7 +35,7 @@ class AccountNext extends WidgetBase {
switch($form->x->attributes()->xmlns) {
case 'jabber:x:data' :
$formview = $this->tpl();
-
+
$formh = $xtf->getHTML($form->x->asXML());
$formview->assign('submitdata', $this->call('ajaxRegister', "movim_form_to_json('data')"));
@@ -47,13 +47,13 @@ class AccountNext extends WidgetBase {
case 'jabber:x:oob' :
$oobview = $this->tpl();
$oobview->assign('url', (string)$form->x->url);
-
+
$html = $oobview->draw('_accountnext_oob', true);
-
+
RPC::call('movim_fill', 'subscription_form', $html);
break;
}
-
+
} else{
$formh = $xtf->getHTML($form->asXML());
}
@@ -65,9 +65,9 @@ class AccountNext extends WidgetBase {
$view = $this->tpl();
$view->assign('url', (string)$form->x->url);
-
+
$html = $view->draw('_accountnext_registered', true);
-
+
RPC::call('movim_fill', 'subscription_form', $html);
RPC::call('setUsername', $data->username->value);
}
@@ -77,12 +77,12 @@ class AccountNext extends WidgetBase {
$error = $package->content;
Notification::append(null, $error);
}
-
+
function onRegisterNotAcceptable()
{
Notification::append(null, $this->__('error.not_acceptable'));
}
-
+
function onServiceUnavailable()
{
Notification::append(null, $this->__('error.service_unavailable'));
diff --git a/sources/app/widgets/AdminLogin/adminlogin.tpl b/sources/app/widgets/AdminLogin/adminlogin.tpl
index 5a8f1fa..5d40df7 100644
--- a/sources/app/widgets/AdminLogin/adminlogin.tpl
+++ b/sources/app/widgets/AdminLogin/adminlogin.tpl
@@ -12,10 +12,10 @@
+ value="{$c->__('button.submit')}" />
diff --git a/sources/app/widgets/AdminMain/AdminMain.php b/sources/app/widgets/AdminMain/AdminMain.php
index 2888cc4..9ec3d7f 100644
--- a/sources/app/widgets/AdminMain/AdminMain.php
+++ b/sources/app/widgets/AdminMain/AdminMain.php
@@ -72,8 +72,6 @@ class AdminMain extends WidgetBase
$cd = new \Modl\ConfigDAO();
$config = $cd->get();
- $l = Locale::start();
-
$this->view->assign('conf', $cd->get());
$this->view->assign('logs',
array(
@@ -98,6 +96,6 @@ class AdminMain extends WidgetBase
}
$this->view->assign('timezones', getTimezoneList());
- $this->view->assign('langs', $l->getList());
+ $this->view->assign('langs', loadLangArray());
}
}
diff --git a/sources/app/widgets/AdminMain/adminmain.tpl b/sources/app/widgets/AdminMain/adminmain.tpl
index a3f7979..79de4cd 100644
--- a/sources/app/widgets/AdminMain/adminmain.tpl
+++ b/sources/app/widgets/AdminMain/adminmain.tpl
@@ -155,7 +155,7 @@
+ value="{$c->__('button.submit')}"/>
diff --git a/sources/app/widgets/AdminTest/AdminTest.php b/sources/app/widgets/AdminTest/AdminTest.php
index 8f8cdda..0b3aeb3 100644
--- a/sources/app/widgets/AdminTest/AdminTest.php
+++ b/sources/app/widgets/AdminTest/AdminTest.php
@@ -46,7 +46,7 @@ class AdminTest extends WidgetBase
$config = $cd->get();
$this->view->assign('dbconnected', $md->_connected);
- $this->view->assign('dbtype', $supported[$config->type]);
+ $this->view->assign('dbtype', $supported[$conf['type']]);
$this->view->assign('dbinfos', sizeof($md->check()));
$this->view->assign('websocketurl', $config->websocketurl);
}
diff --git a/sources/app/widgets/AdminTest/admintest.tpl b/sources/app/widgets/AdminTest/admintest.tpl
index a08ecd8..39968fa 100644
--- a/sources/app/widgets/AdminTest/admintest.tpl
+++ b/sources/app/widgets/AdminTest/admintest.tpl
@@ -34,11 +34,10 @@
-
+
{if="$dbconnected"}
{if="$dbinfos > 0"}
-
diff --git a/sources/app/widgets/Blog/blog.tpl b/sources/app/widgets/Blog/blog.tpl
index 0027338..1f1c42f 100644
--- a/sources/app/widgets/Blog/blog.tpl
+++ b/sources/app/widgets/Blog/blog.tpl
@@ -103,7 +103,7 @@
{if="isset($attachements.links)"}
{loop="$attachements.links"}
- {if="substr($value.href, 0, 5) != 'xmpp:' && filter_var($value.href, FILTER_VALIDATE_URL)"}
+ {if="substr($value.href, 0, 5) != 'xmpp:'"}
-
diff --git a/sources/app/widgets/Bookmark/Bookmark.php b/sources/app/widgets/Bookmark/Bookmark.php
index 324200c..ade02b8 100644
--- a/sources/app/widgets/Bookmark/Bookmark.php
+++ b/sources/app/widgets/Bookmark/Bookmark.php
@@ -30,6 +30,10 @@ class Bookmark extends WidgetBase
{
$this->addcss('bookmark.css');
$this->registerEvent('bookmark', 'onBookmark');
+ $this->registerEvent('bookmarkerror', 'onBookmarkError');
+
+ //$this->registerEvent('mucrole', 'onMucRole');
+
$this->registerEvent('groupsubscribed', 'onGroupSubscribed');
$this->registerEvent('groupunsubscribed', 'onGroupUnsubscribed');
}
@@ -124,6 +128,16 @@ class Bookmark extends WidgetBase
RPC::call('movim_fill', 'bookmarks', $html);
Notification::append(null, $this->__('bookmarks.updated'));
}
+ /*
+ function onMucRole($arr)
+ {
+
+ }
+ */
+ function onBookmarkError($error)
+ {
+ Notification::append(null, $this->__('bookmarks.error').$error);
+ }
function ajaxGetBookmark()
{
diff --git a/sources/app/widgets/Chat/Chat.php b/sources/app/widgets/Chat/Chat.php
index a85bcde..85ee764 100644
--- a/sources/app/widgets/Chat/Chat.php
+++ b/sources/app/widgets/Chat/Chat.php
@@ -253,7 +253,7 @@ class Chat extends WidgetBase
}
$m->body = rawurldecode($message);
- //$m->html = prepareString($m->body, false, true);
+ $m->html = prepareString($m->body, false, true);
$m->published = gmdate('Y-m-d H:i:s');
$m->delivered = gmdate('Y-m-d H:i:s');
@@ -265,7 +265,7 @@ class Chat extends WidgetBase
$p = new Publish;
$p->setTo($to);
//$p->setHTML($m->html);
- $p->setContent($m->body);
+ $p->setContent(htmlspecialchars($m->body));
if($muc) {
$p->setMuc();
@@ -488,10 +488,7 @@ class Chat extends WidgetBase
if(isset($message->html)) {
$message->body = $message->html;
} else {
- // We add some smileys...
- $message->convertEmojis();
- $message->addUrls();
- // $message->body = prepareString(htmlentities($message->body , ENT_COMPAT,'UTF-8'));
+ $message->body = prepareString(htmlentities($message->body , ENT_COMPAT,'UTF-8'));
}
if($message->type == 'groupchat') {
diff --git a/sources/app/widgets/Chat/chat.js b/sources/app/widgets/Chat/chat.js
index cfb7785..afa727d 100644
--- a/sources/app/widgets/Chat/chat.js
+++ b/sources/app/widgets/Chat/chat.js
@@ -77,6 +77,7 @@ var Chat = {
};
bubble.querySelector('span.user').innerHTML = message.resource;
+
var conversation = document.getElementById(id);
if(conversation) {
conversation.appendChild(bubble);
@@ -109,7 +110,6 @@ var Chat = {
if(bubble) {
bubble.querySelector('div.bubble div').innerHTML = message.body;
-
bubble.querySelector('div.bubble span.info').innerHTML = message.published;
movim_append(id, bubble.outerHTML);
diff --git a/sources/app/widgets/Config/Config.php b/sources/app/widgets/Config/Config.php
index 61bdddc..4ce56a4 100644
--- a/sources/app/widgets/Config/Config.php
+++ b/sources/app/widgets/Config/Config.php
@@ -36,9 +36,7 @@ class Config extends WidgetBase
/* We load the user configuration */
$this->user->reload();
- $l = Locale::start();
-
- $view->assign('languages', $l->getList());
+ $view->assign('languages', loadLangArray());
$view->assign('me', $this->user->getLogin());
$view->assign('conf', $this->user->getConfig());
diff --git a/sources/app/widgets/Contact/Contact.php b/sources/app/widgets/Contact/Contact.php
index 35eac2c..392a3b5 100644
--- a/sources/app/widgets/Contact/Contact.php
+++ b/sources/app/widgets/Contact/Contact.php
@@ -271,6 +271,26 @@ class Contact extends WidgetBase
}
}
+ function getLastFM($contact)
+ {
+ $uri = str_replace(
+ ' ',
+ '%20',
+ 'http://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=80c1aa3abfa9e3d06f404a2e781e38f9&artist='.
+ $contact->tuneartist.
+ '&album='.
+ $contact->tunesource.
+ '&format=json'
+ );
+
+ $json = json_decode(requestURL($uri, 2));
+
+ $img = $json->album->image[2]->{'#text'};
+ $url = $json->album->url;
+
+ return array($img, $url);
+ }
+
/**
* @brief Validate the jid
*
diff --git a/sources/app/widgets/Contact/_contact.tpl b/sources/app/widgets/Contact/_contact.tpl
index 04eb608..8e86ab6 100644
--- a/sources/app/widgets/Contact/_contact.tpl
+++ b/sources/app/widgets/Contact/_contact.tpl
@@ -131,6 +131,14 @@
{/if}
+ {if="$contact->description != null && trim($contact->description) != ''"}
+ -
+
+ {$c->__('general.about')}
+
{$contact->description}
+
+ {/if}
+
{if="$contact->mood != null"}
{$moods = unserialize($contact->mood)}
-
@@ -142,16 +150,7 @@
{/if}
-
- {if="$contact->description != null && trim($contact->description) != ''"}
-
-
- {$c->__('general.about')}
- {$contact->description}
-
- {/if}
-
{if="$blog != null"}
{/if}
- {$album = $contact->getAlbum()}
- {if="$album"}
+ {if="$contact->tuneartist || $contact->tunetitle"}