Merge pull request #867 from tobiasd/remote_me_option

remote_self as option
This commit is contained in:
fabrixxm 2013-12-26 02:02:21 -08:00
commit c0212c09ec
4 changed files with 15 additions and 9 deletions

View File

@ -328,6 +328,7 @@ function admin_page_site_post(&$a){
$enotify_no_content = ((x($_POST,'enotify_no_content')) ? True : False);
$private_addons = ((x($_POST,'private_addons')) ? True : False);
$disable_embedded = ((x($_POST,'disable_embedded')) ? True : False);
$allow_users_remote_self = ((x($_POST,'allow_users_remote_self')) ? True : False);
$no_multi_reg = ((x($_POST,'no_multi_reg')) ? True : False);
$no_openid = !((x($_POST,'no_openid')) ? True : False);
@ -453,6 +454,7 @@ function admin_page_site_post(&$a){
set_config('system','newuser_private', $newuser_private);
set_config('system','enotify_no_content', $enotify_no_content);
set_config('system','disable_embedded', $disable_embedded);
set_config('system','allow_users_remote_self', $allow_users_remote_self);
set_config('system','block_extended_register', $no_multi_reg);
set_config('system','no_openid', $no_openid);
@ -603,7 +605,7 @@ function admin_page_site(&$a) {
'$enotify_no_content' => array('enotify_no_content', t("Don't include post content in email notifications"), get_config('system','enotify_no_content'), t("Don't include the content of a post/comment/private message/etc. in the email notifications that are sent out from this site, as a privacy measure.")),
'$private_addons' => array('private_addons', t("Disallow public access to addons listed in the apps menu."), get_config('config','private_addons'), t("Checking this box will restrict addons listed in the apps menu to members only.")),
'$disable_embedded' => array('disable_embedded', t("Don't embed private images in posts"), get_config('system','disable_embedded'), t("Don't replace locally-hosted private photos in posts with an embedded copy of the image. This means that contacts who receive posts containing private photos will have to authenticate and load each image, which may take a while.")),
'$allow_users_remote_self' => array('allow_users_remote_self', t('Allow Users to set remote_self'), get_config('system','allow_users_remote_self'), t('With checking this, every user is allowed to mark every contact as a remote_self in the repair contact dialog. Setting this flag on a contact causes mirroring every posting of that contact in the users stream.')),
'$no_multi_reg' => array('no_multi_reg', t("Block multiple registrations"), get_config('system','block_extended_register'), t("Disallow users to register additional accounts for use as pages.")),
'$no_openid' => array('no_openid', t("OpenID support"), !get_config('system','no_openid'), t("OpenID support for registration and logins.")),
'$no_regfullname' => array('no_regfullname', t("Fullname check"), !get_config('system','no_regfullname'), t("Force users to register with a space between firstname and lastname in Full name, as an antispam measure")),

View File

@ -59,8 +59,9 @@ function crepair_post(&$a) {
$poll = ((x($_POST,'poll')) ? $_POST['poll'] : '');
$attag = ((x($_POST,'attag')) ? $_POST['attag'] : '');
$photo = ((x($_POST,'photo')) ? $_POST['photo'] : '');
$remote_self = ((x($_POST,'remote_self')) ? intval($_POST['remote_self']) : 0);
$r = q("UPDATE `contact` SET `name` = '%s', `nick` = '%s', `url` = '%s', `request` = '%s', `confirm` = '%s', `notify` = '%s', `poll` = '%s', `attag` = '%s'
$r = q("UPDATE `contact` SET `name` = '%s', `nick` = '%s', `url` = '%s', `request` = '%s', `confirm` = '%s', `notify` = '%s', `poll` = '%s', `attag` = '%s', `remote_self` = '%d'
WHERE `id` = %d AND `uid` = %d LIMIT 1",
dbesc($name),
dbesc($nick),
@ -70,6 +71,7 @@ function crepair_post(&$a) {
dbesc($notify),
dbesc($poll),
dbesc($attag),
$remote_self,
intval($contact['id']),
local_user()
);
@ -154,6 +156,9 @@ function crepair_content(&$a) {
'$label_notify' => t('Notification Endpoint URL'),
'$label_poll' => t('Poll/Feed URL'),
'$label_photo' => t('New photo from this URL'),
'$label_remote_self' => t('Remote Self'),
'$allow_remote_self' => get_config('system','allow_users_remote_self'),
'$remote_self' => array('remote_self', t('Mirror postings from this contact'), $contact['remote_self'], t('Mark this contact as remote_self, this will cause friendica to repost new entries from this contact.')),
'$contact_name' => $contact['name'],
'$contact_nick' => $contact['nick'],
'$contact_id' => $contact['id'],
@ -164,7 +169,7 @@ function crepair_content(&$a) {
'$poll' => $contact['poll'],
'$contact_attag' => $contact['attag'],
'$lbl_submit' => t('Submit')
));
));
return $o;

View File

@ -89,6 +89,7 @@
{{include file="field_checkbox.tpl" field=$enotify_no_content}}
{{include file="field_checkbox.tpl" field=$private_addons}}
{{include file="field_checkbox.tpl" field=$disable_embedded}}
{{include file="field_checkbox.tpl" field=$allow_users_remote_self}}
<div class="submit"><input type="submit" name="page_site" value="{{$submit}}" /></div>
<h3>{{$advanced}}</h3>

View File

@ -1,9 +1,3 @@
{{*
* AUTOMATICALLY GENERATED TEMPLATE
* DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
*
*}}
<form id="crepair-form" action="crepair/{{$contact_id}}" method="post" >
<h4>{{$contact_name}}</h4>
@ -43,6 +37,10 @@
<label id="crepair-photo-label" class="crepair-label" for="crepair-photo">{{$label_photo}}</label>
<input type="text" id="crepair-photo" class="crepair-input" name="photo" value="" />
<div class="clear"></div>
{{if $allow_remote_self eq 1}}
<h4>{{$label_remote_self}}</h4>
{{include file="field_checkbox.tpl" field=$remote_self}}
{{/if}}
<input type="submit" name="submit" value="{{$lbl_submit}}" />