diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/admin.php | 3 | ||||
-rw-r--r-- | mod/photos.php | 72 | ||||
-rw-r--r-- | mod/settings.php | 25 |
3 files changed, 45 insertions, 55 deletions
diff --git a/mod/admin.php b/mod/admin.php index 3b8cd2a95..794bac69b 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -299,11 +299,9 @@ function admin_page_site_post(&$a){ $poll_interval = ((x($_POST,'poll_interval')) ? intval(trim($_POST['poll_interval'])) : 0); $maxloadavg = ((x($_POST,'maxloadavg')) ? intval(trim($_POST['maxloadavg'])) : 50); $feed_contacts = ((x($_POST,'feed_contacts')) ? intval($_POST['feed_contacts']) : 0); - $diaspora_enabled = ((x($_POST,'diaspora_enabled')) ? intval($_POST['diaspora_enabled']) : 0); $verify_email = ((x($_POST,'verify_email')) ? 1 : 0); set_config('system', 'feed_contacts', $feed_contacts); - set_config('system', 'diaspora_enabled', $diaspora_enabled); set_config('system', 'delivery_interval', $delivery_interval); set_config('system', 'poll_interval', $poll_interval); set_config('system', 'maxloadavg', $maxloadavg); @@ -465,7 +463,6 @@ function admin_page_site(&$a) { '$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles - <a href='#' id='cnftheme'>change theme settings</a>"), $theme_choices), '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile_theme'), t("Theme for mobile devices"), $theme_choices_mobile), // '$site_channel' => array('site_channel', t("Channel to use for this website's static pages"), get_config('system','site_channel'), t("Site Channel")), - '$diaspora_enabled' => array('diaspora_enabled',t('Enable Diaspora Protocol'), get_config('system','diaspora_enabled'), t('Communicate with Diaspora and Friendica - experimental')), '$feed_contacts' => array('feed_contacts', t('Allow Feeds as Connections'),get_config('system','feed_contacts'),t('(Heavy system resource usage)')), '$maximagesize' => array('maximagesize', t("Maximum image size"), intval(get_config('system','maximagesize')), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")), '$register_policy' => array('register_policy', t("Does this site allow new member registration?"), get_config('system','register_policy'), "", $register_choices), diff --git a/mod/photos.php b/mod/photos.php index b65218e94..dc70e4f90 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -107,11 +107,16 @@ function photos_post(&$a) { $newalbum = notags(trim($_REQUEST['albumname'])); if($newalbum != $album) { - $x = photos_album_rename($page_owner_uid,$album,$newalbum); - if($x) { - $newurl = str_replace(bin2hex($album),bin2hex($newalbum),$_SESSION['photo_return']); - goaway($a->get_baseurl() . '/' . $newurl); - } + + // @fixme - syncronise with DAV or disallow completely + + goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); + +// $x = photos_album_rename($page_owner_uid,$album,$newalbum); +// if($x) { +// $newurl = str_replace(bin2hex($album),bin2hex($newalbum),$_SESSION['photo_return']); +// goaway($a->get_baseurl() . '/' . $newurl); +// } } /* @@ -474,7 +479,12 @@ function photos_content(&$a) { $datatype = argv(2); $datum = argv(3); } else { - $datatype = 'summary'; + if(argc() > 2) { + $datatype = argv(2); + $datum = ''; + } + else + $datatype = 'summary'; } if(argc() > 4) @@ -563,10 +573,12 @@ function photos_content(&$a) { $albums = ((array_key_exists('albums', $a->data)) ? $a->data['albums'] : photos_albums_list($a->data['channel'],$a->data['observer'])); - $def_album = get_pconfig($a->data['channel']['channel_id'],'system','photo_path'); - if($def_album) { - $selname = filepath_macro($def_album); - $albums['album'][] = array('text' => $selname); + if(! $selname) { + $def_album = get_pconfig($a->data['channel']['channel_id'],'system','photo_path'); + if($def_album) { + $selname = filepath_macro($def_album); + $albums['album'][] = array('text' => $selname); + } } $tpl = get_markup_template('photos_upload.tpl'); @@ -602,15 +614,15 @@ function photos_content(&$a) { if($datatype === 'album') { - - - if((strlen($datum) & 1) || (! ctype_xdigit($datum))) { - notice( t('Album name could not be decoded') . EOL); - logger('mod_photos: illegal album encoding: ' . $datum); - $datum = ''; + if(strlen($datum)) { + if((strlen($datum) & 1) || (! ctype_xdigit($datum))) { + notice( t('Album name could not be decoded') . EOL); + logger('mod_photos: illegal album encoding: ' . $datum); + $datum = ''; + } } - $album = hex2bin($datum); + $album = (($datum) ? hex2bin($datum) : ''); $r = q("SELECT `resource_id`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` = '%s' AND `scale` <= 4 and photo_usage IN ( %d, %d ) and is_nsfw = %d $sql_extra GROUP BY `resource_id`", @@ -657,17 +669,21 @@ function photos_content(&$a) { $album_e = $album; } $albums = ((array_key_exists('albums', $a->data)) ? $a->data['albums'] : photos_albums_list($a->data['channel'],$a->data['observer'])); - $edit_tpl = get_markup_template('album_edit.tpl'); - $album_edit = replace_macros($edit_tpl,array( - '$nametext' => t('Enter a new album name'), - '$name_placeholder' => t('or select an existing one (doubleclick)'), - '$nickname' => $a->data['channel']['channel_address'], - '$album' => $album_e, - '$albums' => $albums['albums'], - '$hexalbum' => bin2hex($album), - '$submit' => t('Submit'), - '$dropsubmit' => t('Delete Album') - )); + + // @fixme - syncronise actions with DAV + +// $edit_tpl = get_markup_template('album_edit.tpl'); +// $album_edit = replace_macros($edit_tpl,array( +// '$nametext' => t('Enter a new album name'), +// '$name_placeholder' => t('or select an existing one (doubleclick)'), +// '$nickname' => $a->data['channel']['channel_address'], +// '$album' => $album_e, +// '$albums' => $albums['albums'], +// '$hexalbum' => bin2hex($album), +// '$submit' => t('Submit'), +// '$dropsubmit' => t('Delete Album') +// )); + } } diff --git a/mod/settings.php b/mod/settings.php index f26182dc6..cbd6abafc 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -123,13 +123,6 @@ function settings_post(&$a) { call_hooks('feature_settings_post', $_POST); - if($_POST['dspr-submit']) { - set_pconfig(local_channel(),'system','diaspora_allowed',intval($_POST['dspr_allowed'])); - set_pconfig(local_channel(),'system','diaspora_public_comments',intval($_POST['dspr_pubcomment'])); - set_pconfig(local_channel(),'system','prevent_tag_hijacking',intval($_POST['dspr_hijack'])); - info( t('Diaspora Policy Settings updated.') . EOL); - } - build_sync_packet(); return; } @@ -664,33 +657,17 @@ function settings_content(&$a) { $settings_addons = ""; $o = ''; - $diaspora_enabled = get_config('system','diaspora_enabled'); $r = q("SELECT * FROM `hook` WHERE `hook` = 'feature_settings' "); - if((! $r) && (! $diaspora_enabled)) + if(! $r) $settings_addons = t('No feature settings configured'); - if($diaspora_enabled) { - $dspr_allowed = get_pconfig(local_channel(),'system','diaspora_allowed'); - $pubcomments = get_pconfig(local_channel(),'system','diaspora_public_comments'); - if($pubcomments === false) - $pubcomments = 1; - $hijacking = get_pconfig(local_channel(),'system','prevent_tag_hijacking'); - } - call_hooks('feature_settings', $settings_addons); $tpl = get_markup_template("settings_addons.tpl"); $o .= replace_macros($tpl, array( '$form_security_token' => get_form_security_token("settings_featured"), '$title' => t('Feature/Addon Settings'), - '$diaspora_enabled' => $diaspora_enabled, - '$dsprdesc' => t('Settings for the built-in Diaspora emulator'), - '$pubcomments' => array('dspr_pubcomment', t('Allow any Diaspora member to comment on your public posts'), $pubcomments, '', $yes_no), - '$dspr_allowed' => array('dspr_allowed', t('Enable the Diaspora protocol for this channel'), $dspr_allowed, '', $yes_no), - '$dsprtitle' => t('Diaspora Policy Settings'), - '$hijacking' => array('dspr_hijack', t('Prevent your hashtags from being redirected to other sites'), $hijacking, '', $yes_no), - '$dsprsubmit' => t('Submit'), '$settings_addons' => $settings_addons )); return $o; |