Once you've added some groups, <a href="help/Quick-Start-andfinally">move on to the next section</a>.
-<iframe src="http://dir.friendica.com/directory/forum" width="950" height="600"></iframe>
+<iframe src="http://dir.friendica.social/directory" width="950" height="600"></iframe>
function dfrn_dispatch_public($postdata)
{
- $msg = Diaspora::decodeRaw([], $postdata);
+ $msg = Diaspora::decodeRaw([], $postdata, true);
if (!$msg) {
// We have to fail silently to be able to hand it over to the salmon parser
return false;
use Friendica\Database\DBA;
use Friendica\Model\Item;
-function lockview_content(App $a) {
-
+function lockview_content(App $a)
+{
$type = (($a->argc > 1) ? $a->argv[1] : 0);
if (is_numeric($type)) {
$item_id = intval($type);
- $type='item';
+ $type = 'item';
} else {
$item_id = (($a->argc > 2) ? intval($a->argv[2]) : 0);
}
- if (!$item_id)
+ if (!$item_id) {
killme();
+ }
- if (!in_array($type, ['item','photo','event']))
+ if (!in_array($type, ['item','photo','event'])) {
killme();
+ }
- $fields = ['uid', 'private', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid'];
+ $fields = ['uid', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid'];
$condition = ['id' => $item_id];
+
if ($type != 'item') {
$item = DBA::selectFirst($type, $fields, $condition);
} else {
+ $fields[] = 'private';
$item = Item::selectFirst($fields, $condition);
}
killme();
}
-
- if (($item['private'] == 1) && empty($item['allow_cid']) && empty($item['allow_gid'])
- && empty($item['deny_cid']) && empty($item['deny_gid'])) {
-
+ if ($item['private'] == 1
+ && empty($item['allow_cid'])
+ && empty($item['allow_gid'])
+ && empty($item['deny_cid'])
+ && empty($item['deny_gid']))
+ {
echo L10n::t('Remote privacy information not available.') . '<br />';
killme();
}
- $allowed_users = expand_acl($item['allow_cid']);
+ $allowed_users = expand_acl($item['allow_cid']);
$allowed_groups = expand_acl($item['allow_gid']);
- $deny_users = expand_acl($item['deny_cid']);
- $deny_groups = expand_acl($item['deny_gid']);
+ $deny_users = expand_acl($item['deny_cid']);
+ $deny_groups = expand_acl($item['deny_gid']);
$o = L10n::t('Visible to:') . '<br />';
$l = [];
$r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
DBA::escape(implode(', ', $allowed_groups))
);
- if (DBA::isResult($r))
- foreach($r as $rr)
+ if (DBA::isResult($r)) {
+ foreach ($r as $rr) {
$l[] = '<b>' . $rr['name'] . '</b>';
+ }
+ }
}
+
if (count($allowed_users)) {
$r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
- DBA::escape(implode(', ',$allowed_users))
+ DBA::escape(implode(', ', $allowed_users))
);
- if (DBA::isResult($r))
- foreach($r as $rr)
+ if (DBA::isResult($r)) {
+ foreach ($r as $rr) {
$l[] = $rr['name'];
-
+ }
+ }
}
if (count($deny_groups)) {
$r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
DBA::escape(implode(', ', $deny_groups))
);
- if (DBA::isResult($r))
- foreach($r as $rr)
+ if (DBA::isResult($r)) {
+ foreach ($r as $rr) {
$l[] = '<b><strike>' . $rr['name'] . '</strike></b>';
+ }
+ }
}
+
if (count($deny_users)) {
$r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
- DBA::escape(implode(', ',$deny_users))
+ DBA::escape(implode(', ', $deny_users))
);
- if (DBA::isResult($r))
- foreach($r as $rr)
+ if (DBA::isResult($r)) {
+ foreach ($r as $rr) {
$l[] = '<strike>' . $rr['name'] . '</strike>';
-
+ }
+ }
}
echo $o . implode(', ', $l);
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBA;
+use Friendica\Model\Contact;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Map;
$title = strip_tags(html_entity_decode($title, ENT_QUOTES, 'UTF-8'));
}
+ $author_link = $event['author-link'];
+ $plink = $event['plink'];
+
+ $event['author-link'] = Contact::magicLink($author_link);
+ $event['plink'] = Contact::magicLink($author_link, $plink);
+
$html = self::getHTML($event);
$event['desc'] = BBCode::convert($event['desc']);
$event['location'] = BBCode::convert($event['location']);
use Friendica\App;
use Friendica\BaseModule;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Model\Photo;
/**
* @brief: Decodes incoming Diaspora message in the new format
*
- * @param array $importer Array of the importer user
- * @param string $raw raw post message
+ * @param array $importer Array of the importer user
+ * @param string $raw raw post message
+ * @param boolean $no_exit Don't do an http exit on error
*
* @return array
* 'message' -> decoded Diaspora XML message
* 'author' -> author diaspora handle
* 'key' -> author public key (converted to pkcs#8)
*/
- public static function decodeRaw(array $importer, $raw)
+ public static function decodeRaw(array $importer, $raw, $no_exit = false)
{
$data = json_decode($raw);
if (!is_object($j_outer_key_bundle)) {
logger('Outer Salmon did not verify. Discarding.');
- System::httpExit(400);
+ if ($no_exit) {
+ return false;
+ } else {
+ System::httpExit(400);
+ }
}
$outer_iv = base64_decode($j_outer_key_bundle->iv);
if (!is_object($basedom)) {
logger('Received data does not seem to be an XML. Discarding. '.$xml);
- System::httpExit(400);
+ if ($no_exit) {
+ return false;
+ } else {
+ System::httpExit(400);
+ }
}
$base = $basedom->children(NAMESPACE_SALMON_ME);
$author_addr = base64_decode($key_id);
if ($author_addr == '') {
logger('No author could be decoded. Discarding. Message: ' . $xml);
- System::httpExit(400);
+ if ($no_exit) {
+ return false;
+ } else {
+ System::httpExit(400);
+ }
}
$key = self::key($author_addr);
if ($key == '') {
logger("Couldn't get a key for handle " . $author_addr . ". Discarding.");
- System::httpExit(400);
+ if ($no_exit) {
+ return false;
+ } else {
+ System::httpExit(400);
+ }
}
$verify = Crypto::rsaVerify($signed_data, $signature, $key);
if (!$verify) {
logger('Message did not verify. Discarding.');
- System::httpExit(400);
+ if ($no_exit) {
+ return false;
+ } else {
+ System::httpExit(400);
+ }
}
return ['message' => (string)base64url_decode($base->data),
$author["contact-id"] = $contact["id"];
$contact = null;
+
+/*
+ This here would be better, but we would get problems with contacts from the statusnet addon
+ This is kept here as a reminder for the future
+
+ $cid = Contact::getIdForURL($author["author-link"], $importer["uid"]);
+ if ($cid) {
+ $contact = DBA::selectFirst('contact', [], ['id' => $cid]);
+ }
+*/
if ($aliaslink != '') {
$condition = ["`uid` = ? AND `alias` = ? AND `network` != ? AND `rel` IN (?, ?)",
$importer["uid"], $aliaslink, Protocol::STATUSNET,
$gcid = GContact::update($contact);
GContact::link($gcid, $contact["uid"], $contact["id"]);
- } else {
+ } elseif ($contact["network"] != Protocol::DFRN) {
$contact = null;
}
self::$conv_list = [];
}
- logger("Import OStatus message", LOGGER_DEBUG);
+ logger('Import OStatus message for user ' . $importer['uid'], LOGGER_DEBUG);
if ($xml == "") {
return false;
}).trigger('change');
+ // Click event listener for the album edit link/button.
+ $("body").on('click', '#album-edit-link', function() {
+ var modalUrl = $(this).attr("data-modal-url");
+ if (typeof modalUrl !== "undefined") {
+ addToModal(modalUrl, 'photo-album-edit-wrapper');
+ }
+ });
});
$(window).load(function() {
}
}
-// This function loads html content from a friendica page
-// into a modal.
-function addToModal(url) {
+
+/**
+ * This function loads html content from a friendica page into a modal.
+ *
+ * @param {string} url The url with html content.
+ * @param {string} id The ID of a html element (can be undefined).
+ * @returns {void}
+ */
+function addToModal(url, id) {
var char = qOrAmp(url);
url = url + char + 'mode=none';
var modal = $('#modal').modal();
+ // Only search for an element if we have an ID.
+ if (typeof id !== "undefined") {
+ url = url + " div#" + id;
+ }
+
modal
.find('#modal-body')
.load(url, function (responseText, textStatus) {
});
}
-// Add a element (by it's id) to a bootstrap modal.
+// Add an element (by its id) to a bootstrap modal.
function addElmToModal(id) {
var elm = $(id).html();
var modal = $('#modal').modal();
<div id="photo-album-edit-wrapper">
-<form name="photo-album-edit-form" id="photo-album-edit-form" action="photos/{{$nickname}}/album/{{$hexalbum}}" method="post" >
- <label id="photo-album-edit-name-label" for="photo-album-edit-name" >{{$nametext}}</label>
- <div class="pull-left photo-album-edit-name">
- <input class="form-control" type="text" size="64" name="albumname" value="{{$album|escape:'html'}}" id="photo-album-edit-name" style="width: 100%;">
- </div>
-
- <div class="pull-right">
- <input class="btn-primary btn btn-small" id="photo-album-edit-submit" type="submit" name="submit" value="{{$submit|escape:'html'}}" />
- <input class="btn-primary btn btn-small" id="photo-album-edit-drop" type="submit" name="dropalbum" value="{{$dropsubmit|escape:'html'}}" onclick="return confirmDelete();" />
- </div>
-</form>
+ <form name="photo-album-edit-form" id="photo-album-edit-form" action="photos/{{$nickname}}/album/{{$hexalbum}}" method="post" >
+ <label id="photo-album-edit-name-label" for="photo-album-edit-name" >{{$nametext}}</label>
+ <div class="pull-left photo-album-edit-name">
+ <input class="form-control" type="text" size="64" name="albumname" value="{{$album|escape:'html'}}" id="photo-album-edit-name">
+ </div>
+
+ <div class="pull-right">
+ <input class="btn-primary btn btn-small" id="photo-album-edit-submit" type="submit" name="submit" value="{{$submit|escape:'html'}}" />
+ <input class="btn-primary btn btn-small" id="photo-album-edit-drop" type="submit" name="dropalbum" value="{{$dropsubmit|escape:'html'}}" onclick="return confirmDelete();" />
+ </div>
+ </form>
+ <div class="clear"></div>
</div>
<div class="clear"></div>
{{include file="section_title.tpl" title=$title pullright=1}}
{{* The link to create a new event *}}
+ {{if $new_event.0}}
<div class="pull-right" id="new-event-link">
<button type="button" class="btn-link page-action faded-icon" onclick="addToModal('{{$new_event.0}}')" title="{{$new_event.1}}" data-toggle="tooltip">
<i class="fa fa-plus"></i>
</button>
</div>
+ {{/if}}
{{* We create our own fullcallendar header (with title & calendar view *}}
<div id="fc-header" class="clear">
{{if $edit}}
<span class="icon-padding"> </span>
- <a id="album-edit-link" class="page-action faded-icon" href="{{$edit.1}}" title="{{$edit.0}}" data-toggle="tooltip">
+ <button id="album-edit-link" class="btn-link page-action faded-icon" type="button" data-modal-url="{{$edit.1}}" title="{{$edit.0}}" data-toggle="tooltip">
<i class="fa fa-pencil"></i>
- </a>
+ </button>
{{/if}}
{{if ! $noorder}}
/*
* Name: frio
* Description: Bootstrap V3 theme. The theme is currently under construction, so it is far from finished. For further information have a look at the <a href="https://github.com/friendica/friendica/tree/develop/view/theme/frio/README.md">ReadMe</a>.
- * Version: V.0.8
+ * Version: V.0.8.5
* Author: Rabuzarus <https://friendica.kommune4.de/profile/rabuzarus>
*
*/