aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/impel.php71
-rw-r--r--mod/mail.php5
-rw-r--r--mod/photos.php4
-rw-r--r--mod/siteinfo.php1
4 files changed, 78 insertions, 3 deletions
diff --git a/mod/impel.php b/mod/impel.php
new file mode 100644
index 000000000..360f994fc
--- /dev/null
+++ b/mod/impel.php
@@ -0,0 +1,71 @@
+<?php /** @file */
+
+// import page design element
+
+
+function impel_init(&$a) {
+
+ $ret = array('success' => false);
+
+ if(! $local_user())
+ json_return_and_die($ret);
+
+ $elm = $_REQUEST['element'];
+ $x = base64_urldecode($elm);
+ if(! $x)
+ json_return_and_die($ret);
+
+ $j = json_decode($x,true);
+ if(! $j)
+ json_return_and_die($ret);
+
+
+ $channel = get_channel();
+
+ $arr = array();
+
+ switch($j['type']) {
+ case 'webpage':
+ $arr['item_restrict'] = ITEM_WEBPAGE;
+ break;
+ case 'block':
+ $arr['item_restrict'] = ITEM_BUILDBLOCK;
+ break;
+ case 'layout':
+ $arr['item_restrict'] = ITEM_PDL;
+ break;
+ default:
+ logger('mod_impel: unrecognised element type' . print_r($j,true));
+ break;
+ }
+ $arr['uid'] = local_user();
+ $arr['aid'] = $channel['channel_account_id'];
+ $arr['title'] = $j['title'];
+ $arr['body'] = $j['body'];
+ $arr['term'] = $j['term'];
+ $arr['owner_xchan'] = get_observer_hash();
+ $arr['author_xchan'] = (($j['author_xchan']) ? $j['author_xchan'] : $get_observer_hash());
+ $arr['mimetype'] = (($j['mimetype']) ? $j['mimetype'] : 'text/bbcode');
+
+
+ $channel = get_channel();
+
+ // Verify ability to use html or php!!!
+
+ $execflag = false;
+
+ if($arr['mimetype'] === 'application/x-php') {
+ $z = q("select account_id, account_roles from account left join channel on channel_account_id = account_id where channel_id = %d limit 1",
+ intval(local_user())
+ );
+
+ if($z && ($z[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE)) {
+ $execflag = true;
+ }
+ }
+
+ $x = item_store($arr,$execflag);
+ $ret['success'] = true;
+ json_return_and_die(true);
+
+} \ No newline at end of file
diff --git a/mod/mail.php b/mod/mail.php
index d6d802fe7..f4897149a 100644
--- a/mod/mail.php
+++ b/mod/mail.php
@@ -72,7 +72,10 @@ function mail_post(&$a) {
if(! ($their_perms & PERMS_W_MAIL)) {
notice( t('Selected channel has private message restrictions. Send failed.'));
- return;
+ // reported issue: let's still save the message and continue. We'll just tell them
+ // that nothing useful is likely to happen. They might have spent hours on it.
+ // return;
+
}
}
diff --git a/mod/photos.php b/mod/photos.php
index f02f0f5f7..dc593f22b 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -654,7 +654,7 @@ function photos_content(&$a) {
);
if($cmd === 'edit') {
- if(($album !== t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== t('Contact Photos'))) {
+ if(($album !== t('Profile Photos')) && ($album !== 'Profile Photos') && ($album !== 'Contact Photos') && ($album !== t('Contact Photos'))) {
if($can_post) {
if($a->get_template_engine() === 'internal') {
$album_e = template_escape($album);
@@ -676,7 +676,7 @@ function photos_content(&$a) {
}
}
else {
- if(($album !== t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== t('Contact Photos'))) {
+ if(($album !== t('Profile Photos')) && ($album !== 'Profile Photos') && ($album !== 'Contact Photos') && ($album !== t('Contact Photos'))) {
if($can_post) {
$edit = array(t('Edit Album'), $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex($album) . '/edit');
}
diff --git a/mod/siteinfo.php b/mod/siteinfo.php
index 3071e52fb..de55c69cf 100644
--- a/mod/siteinfo.php
+++ b/mod/siteinfo.php
@@ -63,6 +63,7 @@ function siteinfo_init(&$a) {
'plugins' => $visible_plugins,
'register_policy' => $register_policy[$a->config['system']['register_policy']],
'directory_mode' => $directory_mode[$a->config['system']['directory_mode']],
+ 'language' => get_config('system','language'),
'diaspora_emulation' => get_config('system','diaspora_enabled'),
'rss_connections' => get_config('system','feed_contacts'),
'default_service_restrictions' => $service_class,