コード例 #1
0
ファイル: redred.php プロジェクト: phellmes/hubzilla-addons
function redred_settings_post($a, $post)
{
    if (!local_channel()) {
        return;
    }
    // don't check redred settings if redred submit button is not clicked
    if (!x($_POST, 'redred-submit')) {
        return;
    }
    $channel = App::get_channel();
    // Don't let somebody post to their self channel. Since we aren't passing message-id this would be very very bad.
    if (!trim($_POST['redred_channel'])) {
        notice(t('Channel is required.') . EOL);
        return;
    }
    if ($channel['channel_address'] === trim($_POST['redred_channel'])) {
        notice(t('Invalid channel.') . EOL);
        return;
    }
    set_pconfig(local_channel(), 'redred', 'baseapi', trim($_POST['redred_baseapi']));
    set_pconfig(local_channel(), 'redred', 'username', trim($_POST['redred_username']));
    set_pconfig(local_channel(), 'redred', 'password', z_obscure(trim($_POST['redred_password'])));
    set_pconfig(local_channel(), 'redred', 'channel', trim($_POST['redred_channel']));
    set_pconfig(local_channel(), 'redred', 'post', intval($_POST['redred_enable']));
    set_pconfig(local_channel(), 'redred', 'post_by_default', intval($_POST['redred_default']));
    info(t('redred Settings saved.') . EOL);
}
コード例 #2
0
ファイル: dwpost.php プロジェクト: phellmes/hubzilla-addons
function dwpost_settings_post(&$a, &$b)
{
    if (x($_POST, 'dwpost-submit')) {
        set_pconfig(local_channel(), 'dwpost', 'post', intval($_POST['dwpost']));
        set_pconfig(local_channel(), 'dwpost', 'post_by_default', intval($_POST['dw_bydefault']));
        set_pconfig(local_channel(), 'dwpost', 'dw_username', trim($_POST['dw_username']));
        set_pconfig(local_channel(), 'dwpost', 'dw_password', z_obscure(trim($_POST['dw_password'])));
    }
}
コード例 #3
0
function ljpost_settings_post(&$a, &$b)
{
    if (x($_POST, 'ljpost-submit')) {
        set_pconfig(local_channel(), 'ljpost', 'post', intval($_POST['ljpost']));
        set_pconfig(local_channel(), 'ljpost', 'post_by_default', intval($_POST['lj_bydefault']));
        set_pconfig(local_channel(), 'ljpost', 'lj_username', trim($_POST['lj_username']));
        set_pconfig(local_channel(), 'ljpost', 'lj_password', z_obscure(trim($_POST['lj_password'])));
        info(t('LiveJournal Settings saved.') . EOL);
    }
}
コード例 #4
0
ファイル: wppost.php プロジェクト: anmol26s/hubzilla-yunohost
function wppost_settings_post(&$a, &$b)
{
    if (x($_POST, 'wppost-submit')) {
        set_pconfig(local_channel(), 'wppost', 'post', intval($_POST['wppost']));
        set_pconfig(local_channel(), 'wppost', 'post_by_default', intval($_POST['wp_bydefault']));
        set_pconfig(local_channel(), 'wppost', 'wp_username', trim($_POST['wp_username']));
        set_pconfig(local_channel(), 'wppost', 'wp_password', z_obscure(trim($_POST['wp_password'])));
        set_pconfig(local_channel(), 'wppost', 'wp_blog', trim($_POST['wp_blog']));
        set_pconfig(local_channel(), 'wppost', 'forward_comments', trim($_POST['wp_forward_comments']));
        info(t('Wordpress Settings saved.') . EOL);
    }
}
コード例 #5
0
function rtof_settings_post($a, $post)
{
    if (!local_channel()) {
        return;
    }
    // don't check rtof settings if rtof submit button is not clicked
    if (!x($_POST, 'rtof-submit')) {
        return;
    }
    set_pconfig(local_channel(), 'rtof', 'baseapi', trim($_POST['rtof_baseapi']));
    set_pconfig(local_channel(), 'rtof', 'username', trim($_POST['rtof_username']));
    set_pconfig(local_channel(), 'rtof', 'password', z_obscure(trim($_POST['rtof_password'])));
    set_pconfig(local_channel(), 'rtof', 'post', intval($_POST['rtof_enable']));
    set_pconfig(local_channel(), 'rtof', 'post_by_default', intval($_POST['rtof_default']));
    info(t('rtof Settings saved.') . EOL);
}
コード例 #6
0
ファイル: Pconfig.php プロジェクト: BlaBlaNet/hubzilla
 function post()
 {
     if (!local_channel()) {
         return;
     }
     if ($_SESSION['delegate']) {
         return;
     }
     check_form_security_token_redirectOnErr('/pconfig', 'pconfig');
     $cat = trim(escape_tags($_POST['cat']));
     $k = trim(escape_tags($_POST['k']));
     $v = trim($_POST['v']);
     if (in_array(argv(2), $this->disallowed_pconfig())) {
         notice(t('This setting requires special processing and editing has been blocked.') . EOL);
         return;
     }
     if (strpos($k, 'password') !== false) {
         $v = z_obscure($v);
     }
     set_pconfig(local_channel(), $cat, $k, $v);
     build_sync_packet();
     goaway(z_root() . '/pconfig/' . $cat . '/' . $k);
 }