if (!$nuke_db) {
        $error = "Error. Please configure 'mod_auth_mysql' plugin at aMember CP -> Setup -> mod_auth_mysql";
        if (!$_SESSION['check_setup_mod_auth_mysql_error']) {
            $db->log_error($error);
        }
        $_SESSION['check_setup_mod_auth_mysql_error'] = $error;
        return $error;
    }
    return '';
}
if (!check_setup_mod_auth_mysql()) {
    setup_plugin_hook('subscription_added', 'mod_auth_mysql_added');
    setup_plugin_hook('subscription_updated', 'mod_auth_mysql_updated');
    setup_plugin_hook('subscription_deleted', 'mod_auth_mysql_deleted');
    setup_plugin_hook('subscription_removed', 'mod_auth_mysql_removed');
    setup_plugin_hook('subscription_rebuild', 'mod_auth_mysql_rebuild');
}
function mod_auth_mysql_rebuild(&$members)
{
    global $config, $db, $plugin_config;
    $this_config = $plugin_config['protect']['mod_auth_mysql'];
    $m_db = $this_config['db'];
    if ($m_db == '') {
        return;
    }
    ///
    //    $db->query("DELETE FROM $m_db");
    ///
    foreach ($members as $login => $m) {
        $pwd = crypt($m['pass']);
        $groups = '';
Exemplo n.º 2
0
    if (in_array('ikobo', (array) $config['aff']['payout_methods'])) {
        add_member_field('aff_ikobo_email', _AFF_MEMBER_F3_1, 'text', '', '', array('hidden_anywhere' => 1));
    }
    if (in_array('moneybookers', (array) $config['aff']['payout_methods'])) {
        add_member_field('aff_moneybookers_email', _AFF_MEMBER_F4_1, 'text', '', '', array('hidden_anywhere' => 1));
    }
    if (in_array('egold', (array) $config['aff']['payout_methods'])) {
        add_member_field('aff_egold_id', _AFF_MEMBER_F5_1, 'text', '', '', array('hidden_anywhere' => 1));
    }
    if (in_array('check', (array) $config['aff']['payout_methods'])) {
        add_member_field('aff_check_payable_to', _AFF_MEMBER_F6_1, 'text', '', '', array('hidden_anywhere' => 1));
    }
    if (in_array('safepay', (array) $config['aff']['payout_methods'])) {
        add_member_field('aff_safepay_email', _AFF_MEMBER_F7_1, 'text', '', '', array('hidden_anywhere' => 1));
    }
    setup_plugin_hook('finish_waiting_payment', 'add_affiliate_commission');
    setup_plugin_hook('get_member_links', 'aff_get_member_links');
    if ($config['aff']['signup_type'] == 1) {
        setup_plugin_hook('update_users', 'aff_make_affiliate');
    }
}
function check_aff_signup_email_sent($member_id)
{
    global $db, $config;
    $user = $db->get_user($member_id);
    if (!$user['data']['aff_signup_email_sent']) {
        mail_signup_affiliate($member_id);
        $user['data']['aff_signup_email_sent']++;
        $db->update_user($member_id, $user);
    }
}
*                                                                          
* aMember is free for both commercial and non-commercial use providing that the
* copyright headers remain intact and the links remain on the html pages.
* Re-distribution of this script without prior consent is strictly prohibited.
*
*/
$config['cc_code'] = 1;
$config['cc_name_f'] = 1;
$config['cc_name_l'] = 1;
if (0 || $config['payment']['theinternetcommerce']['wells_fargo']) {
    $config['cc_company'] = 1;
    $config['cc_phone'] = 1;
}
require_once "{$config['root_dir']}/plugins/payment/theinternetcommerce/pay.inc.php";
setup_plugin_hook('get_member_links', 'theinternetcommerce_get_member_links');
setup_plugin_hook('daily', 'theinternetcommerce_rebill');
add_product_field('is_recurring', 'Recurring Billing', 'select', 'should user be charged automatically<br />
             when subscription expires', '', array('options' => array('' => 'No', 1 => 'Yes')));
add_product_field('trial1_days', 'Trial 1 Duration', 'period', 'Trial 1 duration');
add_product_field('trial1_price', 'Trial 1 Price', 'money', 'set 0 for free trial');
add_product_field('rebill_times', 'Recurring Times', 'text', 'Recurring Times. This is the number of payments which<br />
     will occur at the regular rate. If omitted, payment will<br />
     continue to recur at the regular rate until the subscription<br />
     is cancelled.<br />
     NOTE: not for all payment processing this option is working');
add_product_field('theinternetcommerce_currency', 'TheInternetCommerce Currency', 'select', 'valid only for TheInternetCommerce processing.<br /> You should not change it<br /> if you use 
    another payment processors', '', array('options' => array('' => 'USD', 'GBP' => 'GBP', 'EUR' => 'EUR', 'CAD' => 'CAD', 'JPY' => 'JPY')));
add_member_field('cc_street', 'Billing Street Address', 'text', "", '', array('hidden_anywhere' => 1));
add_member_field('cc_city', 'Billing City', 'text', "", '');
add_member_field('cc_state', 'Billing State', 'select', "", '', array('options' => db_getStatesForCountry('US', true)));
add_member_field('cc_zip', 'Billing ZIP', 'text', "", '');
Exemplo n.º 4
0
function set_protect_plugin_hooks(&$protect)
{
    $pn = $protect->get_plugin_name();
    foreach ($protect->hooks as $f) {
        eval("function _{$pn}_{$f}(\$a1='',\$a2='',\$a3='',\$a4='',\$a5='',\$a6='',\$a7='',\$a8='',\$a9=''){\n            \$protect = & instantiate_plugin('protect', '{$pn}');\n            return \$protect->{$f}(\$a1,\$a2,\$a3,\$a4,\$a5,\$a6,\$a7,\$a8,\$a9);\n        };");
        setup_plugin_hook("{$f}", "_{$pn}_{$f}");
    }
}
Exemplo n.º 5
0
function cc_core_init($plugin)
{
    global $config, $cc_core;
    // get features array
    $pl =& instantiate_plugin('payment', $plugin);
    $features = $pl->get_plugin_features();
    $cc_core[$plugin] =& $pl;
    ///
    add_paysystem_to_list(array('paysys_id' => $plugin, 'title' => $pl->config['title'] ? $pl->config['title'] : $features['title'], 'description' => $pl->config['description'] ? $pl->config['description'] : $features['description'], 'public' => 1, 'recurring' => $features['no_recurring'] ? 0 : 1));
    // add product fields
    if (!$features['no_recurring']) {
        add_product_field('is_recurring', 'Recurring Billing', 'checkbox', 'should user be charged automatically<br />
                     when subscription expires', '');
        add_product_field('trial1_days', 'Trial 1 Duration', 'period', 'Trial 1 duration', 'validate_period');
        add_product_field('trial1_price', 'Trial 1 Price', 'money', 'set 0 for free trial', '');
        add_product_field('trial_group', 'Trial Group', 'text', "If this field is filled-in, user will be unable to order the product<br />\n             twice. It is extermelly useful for any trial product. This field<br />\n             can have different values for different products, then 'trial history'<br />\n             will be separate for these groups of products.<br />\n             If your site offers only one level of membership,<br />\n             just enter \"1\" to this field. \n            ");
        add_product_field('rebill_times', 'Recurring Times', 'text', 'Recurring Times. This is the number of payments which<br />
             will occur including first payment. If omitted, payment will<br />
             continue to recur at the regular rate until the subscription<br />
             is cancelled.<br />
             NOTE: not for all payment processing this option is working');
    }
    if ($features['currency']) {
        add_product_field($plugin . '_currency', $pl->config['title'] . " Currency", 'select', "valid only for {$plugin} payments", '', array('options' => $features['currency']));
    }
    /// add member fields
    add_member_field('cc_country', 'Billing Country', 'select', "", '', array('options' => db_getCountryList(true)));
    add_member_field('cc_street', 'Billing Street Address', 'text', "", '', array('hidden_anywhere' => 1));
    add_member_field('cc_city', 'Billing City', 'text', "", '');
    add_member_field('cc_state', 'Billing State', 'state', "", '', array('options' => array(), 'require_value' => array(array('name' => 'cc_country'))));
    add_member_field('cc_zip', 'Billing ZIP', 'text', "", '');
    if ($features['name_f']) {
        add_member_field('cc_name_f', 'Billing First Name', 'text', '');
        add_member_field('cc_name_l', 'Billing Last Name', 'text', '');
    } elseif ($features['name']) {
        add_member_field('cc_name', 'Billing Name', 'text', '');
    }
    if ($features['company']) {
        add_member_field('cc_company', 'Billing Company', 'text', '');
    }
    if ($features['phone']) {
        add_member_field('cc_phone', 'Billing Phone#', 'text', '');
    }
    if ($features['housenumber']) {
        add_member_field('cc_housenumber', 'Billing Housenumber', 'text', '');
    }
    add_member_field('cc', 'Credit Card # (visible)', 'readonly', 'credit card number', '', array('hidden_anywhere' => 1));
    add_member_field('cc-hidden', 'Credit Card # (crypted)', 'hidden', '', '', array('hidden_anywhere' => 1));
    add_member_field('cc-expire', 'Credit Card Expire', 'readonly', 'Expiration date (mmyy)', '', array('hidden_anywhere' => 1));
    if ($features['code'] == 2) {
        add_member_field('cc_code', 'Credit Card Code (crypted)', 'hidden', '', '', array('hidden_anywhere' => 1));
    }
    if ($features['province_outside_of_us']) {
        add_member_field('cc_province', 'Billing International Province', 'text', "for international provinces outside of US & Canada include the province name here", '');
    }
    if ($features['maestro_solo_switch']) {
        add_member_field('cc_issuenum', 'Card Issue #', 'text', "is required for Maestro/Solo/Switch credit cards only", '');
        add_member_field('cc_startdate', 'Card Start Date', 'text', "is required for Maestro/Solo/Switch credit cards only", '');
    }
    if ($features['type_options']) {
        add_member_field('cc_type', 'CC Type', 'select', 'credit card type', '', array('options' => $features['type_options']));
    }
    /// setup hooks
    if (!$features['no_recurring']) {
        setup_plugin_hook('get_member_links', $plugin . '_get_member_links');
        setup_plugin_hook('hourly', $plugin . '_rebill');
    }
}
Exemplo n.º 6
0
        $row = mysql_fetch_assoc($q);
        return $row;
    }
    function setRecord($ip, $failed_logins, $last_failed)
    {
        $prefix = $this->db->config['prefix'];
        $row = $this->getRecord($ip);
        settype($failed_logins, 'integer');
        settype($last_failed, 'integer');
        $ip = $this->db->escape($ip);
        if ($row) {
            $this->db->query("UPDATE {$prefix}failed_login SET \n                failed_logins={$failed_logins}, last_failed={$last_failed}\n                WHERE failed_login_id={$row['failed_login_id']}");
        } else {
            $this->db->query("INSERT INTO {$prefix}failed_login \n            (ip, login_type, failed_logins, last_failed) \n            VALUES\n            ('{$ip}', '{$this->account_type}', {$failed_logins}, {$last_failed})");
        }
    }
    function deleteRecord($ip)
    {
        $prefix = $this->db->config['prefix'];
        $ip = $this->db->escape($ip);
        $this->db->query("DELETE FROM {$prefix}failed_login \n            WHERE ip='{$ip}' AND login_type='{$this->account_type}'");
    }
}
function clear_failed_logins()
{
    global $db, $config;
    $terminator = time() - $config['bruteforce_delay'];
    $db->query("DELETE FROM {$db->config[prefix]}failed_login WHERE last_failed<{$terminator}", true);
}
setup_plugin_hook('daily', 'clear_failed_logins');
Exemplo n.º 7
0
}
if (!check_setup_fb_connect()) {
    setup_plugin_hook('check_logged_in', 'fb_connect_check_logged_in');
    setup_plugin_hook('after_login', 'fb_connect_after_login');
    setup_plugin_hook('after_logout', 'fb_connect_after_logout');
    setup_plugin_hook('fill_in_signup_form', 'fb_connect_fill_in_signup_form');
    setup_plugin_hook('get_member_links', 'fb_connect_get_member_links');
    //  setup_plugin_hook('get_left_member_links', 'fb_connect_get_member_links');
    setup_plugin_hook('subscription_added', 'fb_connect_added');
    //	setup_plugin_hook('subscription_updated', 'fb_connect_updated');
    //	setup_plugin_hook('subscription_deleted', 'fb_connect_deleted');
    //	setup_plugin_hook('subscription_removed', 'fb_connect_removed');
    //	setup_plugin_hook('subscription_rebuild', 'fb_connect_rebuild');
    //	setup_plugin_hook('finish_waiting_payment', 'fb_connect_payment_completed');
    if (function_exists('amember_filter_output')) {
        setup_plugin_hook('filter_output', 'fb_connect_filter_output');
    }
}
////
// Version 3.2.3+ allows us to add template items automatically
function fb_connect_filter_output(&$source, $resource_name, $smarty)
{
    global $config, $db, $plugin_config, $vars;
    $this_config = $plugin_config['protect']['fb_connect'];
    $testmode = $this_config['testmode'];
    /// Header Elements
    if ($resource_name == 'layout.html') {
        // Add FB Namespace
        $source = preg_replace('|<html ([^>]*)>|i', '<html $1 xmlns:fb="http://www.facebook.com/2008/fbml">', $source, 1);
        // Add FB Javascript
        $fbappid = trim($this_config['appid']);
Exemplo n.º 8
0
add_product_field('amthankyou_copy', 'Thank You Page Copy', 'textarea', 'Enter the copy you want to show on the<br />
                   thank you page when this product is purchased.', '', array('insert_after' => 'amthankyou_header'));
function check_setup_amthankyou()
{
    global $plugin_config, $config, $db;
    $this_config = $plugin_config['protect']['amthankyou'];
    return '';
}
// end check_setup_amthankyou
if (!check_setup_amthankyou()) {
    // setup_plugin_hook('subscription_updated', 'amthankyou_updated');
    // setup_plugin_hook('subscription_rebuild', 'amthankyou_rebuild');
    // setup_plugin_hook('subscription_added',   'amthankyou_added');
    // setup_plugin_hook('subscription_deleted', 'amthankyou_deleted');
    // setup_plugin_hook('subscription_removed', 'amthankyou_removed');
    setup_plugin_hook('filter_output', 'amthankyou_filter_output');
}
//
// Thank You Page Insertion
//
function amthankyou_filter_output(&$source, $resource_name, $smarty)
{
    global $db, $plugin_config, $config;
    if ($resource_name == "thanks.html") {
        //
        // Get Smarty Template Variables
        //
        $tplvars = $smarty->_tpl_vars;
        $payment = $tplvars['payment'];
        $member = $_SESSION['_amember_user'];
        $member_id = $member['member_id'];
Exemplo n.º 9
0
<?php

add_product_field('is_recurring', 'Recurring Billing', 'select', 'should user be charged automatically<br />
             when subscription expires', '', array('options' => array('' => 'No', 1 => 'Yes')));
add_paysystem_to_list(array('paysys_id' => 'verotel', 'title' => $config['payment']['verotel']['title'] ? $config['payment']['verotel']['title'] : _PLUG_PAY_VEROTEL_TITLE, 'description' => $config['payment']['verotel']['description'] ? $config['payment']['verotel']['description'] : _PLUG_PAY_VEROTEL_DESC, 'public' => 1, 'recurring' => 1, 'fixed_price' => 1));
add_product_field('verotel_id', 'VeroTel Site ID', 'text', '');
function verotel_vsf(&$vars)
{
    $err = array();
    if (preg_match('/^.*_+.*$/', $vars['login'])) {
        $err[] = "Verotel does not accept usernames with underscores";
    }
    return $err;
}
setup_plugin_hook('validate_signup_form', 'verotel_vsf');
class payment_verotel extends payment
{
    function do_payment($payment_id, $member_id, $product_id, $price, $begin_date, $expire_date, &$vars)
    {
        global $config, $db;
        $product =& get_product($product_id);
        $member = $db->get_user($member_id);
        $c_product_id = $product->config['verotel_id'];
        if (!$c_product_id) {
            fatal_error("Verotel Product ID empty for Product# {$product_id}");
        }
        $vars = array('verotel_id' => $this->config['merchant_id'], 'verotel_product' => $c_product_id, 'verotel_website' => $c_product_id, 'verotel_usercode' => $member['login'], 'verotel_passcode' => $member['pass'], 'verotel_custom1' => $payment_id, 'verotel_custom2' => $member_id, 'verotel_custom3' => $product_id);
        $vars1 = array();
        foreach ($vars as $kk => $vv) {
            $v = urlencode($vv);
            $k = urlencode($kk);
        $plugin = 'manual_euro_bank';
        $payments = $db->get_expired_payments($dat, $dat, $plugin);
        foreach ($payments as $p) {
            if ($p['data']['CANCELLED']) {
                continue;
            }
            $product = get_product($p['product_id']);
            if (!$product->config['is_recurring']) {
                continue;
            }
            $pc =& new PriceCalculator();
            $pc->addProduct($p['product_id']);
            $pc->setTax(get_member_tax($p['member_id']));
            $terms =& $pc->calculate();
            $pp = array('member_id' => $p['member_id'], 'product_id' => $p['product_id'], 'paysys_id' => $p['paysys_id'], 'begin_date' => $dat, 'expire_date' => $product->get_expire($dat), 'amount' => calculate_price($p['product_id'], $p['member_id'], $vars, $prices));
            if ($err = $db->add_payment($pp)) {
                trigger_error("Cannot add payment : {$err}", E_USER_WARNING);
            }
            $payment_id = $GLOBALS['_amember_added_payment_id'];
            $this->signup_moderator_mail($payment_id, $signup = false);
        }
    }
}
function manual_euro_bank_daily()
{
    global $db;
    $pl =& instantiate_plugin('payment', 'manual_euro_bank');
    $pl->rebill();
}
setup_plugin_hook('daily', 'manual_euro_bank_daily');
Exemplo n.º 11
0
            }
            for ($i = 0; $i < count($issuerArrayLong); $i++) {
                $issuer = array();
                $issuer['issuerID'] = $issuerArrayLong[$i]->issuerID;
                $issuer['issuerName'] = $issuerArrayLong[$i]->issuerName;
                $ideal_issuers['long'][] = $issuer;
            }
            $db->config_set('ideal_issuers', $ideal_issuers, 1);
        }
    }
}
if (!$config['ideal_issuers']) {
    ideal_get_issuers_list();
}
$config['ideal_options'] = array();
$config['ideal_options'][] = "Kies uw bank...";
if ($config['ideal_issuers']['short']) {
    foreach ($config['ideal_issuers']['short'] as $short) {
        $key = $short['issuerID'];
        $config['ideal_options'][$key] = $short['issuerName'];
    }
}
if ($config['ideal_issuers']['long']) {
    $config['ideal_options'][] = "---Overige banken---";
    foreach ($config['ideal_issuers']['long'] as $long) {
        $key = $long['issuerID'];
        $config['ideal_options'][$key] = $long['issuerName'];
    }
}
setup_plugin_hook('daily', 'ideal_get_issuers_list');
    if (!$nuke_db) {
        $error = "Error. Please configure 'plugin_template' plugin at aMember CP -> Setup -> plugin_template";
        if (!$_SESSION['check_setup_plugin_template_error']) {
            $db->log_error($error);
        }
        $_SESSION['check_setup_plugin_template_error'] = $error;
        return $error;
    }
    return '';
}
if (!check_setup_plugin_template()) {
    setup_plugin_hook('subscription_added', 'plugin_template_added');
    setup_plugin_hook('subscription_updated', 'plugin_template_updated');
    setup_plugin_hook('subscription_deleted', 'plugin_template_deleted');
    setup_plugin_hook('subscription_removed', 'plugin_template_removed');
    setup_plugin_hook('subscription_rebuild', 'plugin_template_rebuild');
}
function plugin_template_rebuild(&$members)
{
    global $config, $db, $plugin_config;
    $this_config = $plugin_config['protect']['plugin_template'];
    /// some actions when admin click aMember CP -> Rebuild Db
    /// it should compare all records in your third-party
    /// database with aMember supplied-list ($members)
    /// Or you may just skip this hook
}
function plugin_template_added($member_id, $product_id, $member)
{
    $this_config = $plugin_config['protect']['plugin_template'];
    /// It's a most important function - when user subscribed to
    /// new product (and his subscription status changed to ACTIVE
Exemplo n.º 13
0
*    Release: 3.1.8PRO ($Revision: 2976 $)
*
* Please direct bug reports,suggestions or feedback to the cgi-central forums.
* http://www.cgi-central.net/forum/
*                                                                          
* aMember is free for both commercial and non-commercial use providing that the
* copyright headers remain intact and the links remain on the html pages.
* Re-distribution of this script without prior consent is strictly prohibited.
*
*/
$config['cc_code'] = 1;
$config['cc_name_f'] = 1;
$config['cc_name_l'] = 1;
require_once "{$config['root_dir']}/plugins/payment/netbilling/pay.inc.php";
setup_plugin_hook('get_member_links', 'netbilling_get_member_links');
setup_plugin_hook('daily', 'netbilling_rebill');
add_product_field('is_recurring', 'Recurring Billing', 'select', 'should user be charged automatically<br />
             when subscription expires', '', array('options' => array('' => 'No', 1 => 'Yes')));
add_product_field('rebill_times', 'Recurring Times', 'text', 'Recurring Times. This is the number of payments which<br />
     will occur at the regular rate. If omitted, payment will<br />
     continue to recur at the regular rate until the subscription<br />
     is cancelled.<br />
     NOTE: not for all payment processing this option is working');
add_member_field('cc_street', 'Billing Street Address', 'text', "", '', array('hidden_anywhere' => 1));
add_member_field('cc_city', 'Billing City', 'text', "", '');
add_member_field('cc_state', 'Billing State', 'select', "", '', array('options' => db_getStatesForCountry('US', true)));
add_member_field('cc_zip', 'Billing ZIP', 'text', "", '');
add_member_field('cc_country', 'Billing Country', 'select', "", '', array('options' => db_getCountryList(true)));
add_member_field('cc', 'Credit Card # (visible)', 'readonly', "credit card number (read-only)", '', array('hidden_anywhere' => 1));
add_member_field('cc-hidden', 'Credit Card # (crypted)', 'hidden', '', '', array('hidden_anywhere' => 1));
add_member_field('cc-expire', 'Credit Card Expire', 'readonly', 'Expiration date (mmyy)', '', array('hidden_anywhere' => 1));
Exemplo n.º 14
0
require_once $config['root_dir'] . "/plugins/protect/openid/openid.php";
function check_setup_openid()
{
    global $plugin_config, $config, $db;
    $this_config = $plugin_config['protect']['openid'];
    if (!$this_config['sqlupdated']) {
        openid_sql_field();
    }
    add_member_field('openid', "OpenID UserID", 'text', "", '', array('sql' => 1, 'sql_type' => 'TEXT', 'display_profile' => '0', 'display_signup' => '0', 'default' => 0));
    return '';
}
if (!check_setup_openid()) {
    setup_plugin_hook('check_logged_in', 'openid_check_logged_in');
    setup_plugin_hook('after_login', 'openid_after_login');
    setup_plugin_hook('after_logout', 'openid_after_logout');
    setup_plugin_hook('fill_in_signup_form', 'openid_fill_in_signup_form');
    //setup_plugin_hook('subscription_added', 'openid_added');
    // setup_plugin_hook('subscription_updated', 'openid_updated');
    // setup_plugin_hook('subscription_deleted', 'openid_deleted');
    // setup_plugin_hook('subscription_removed', 'openid_removed');
    // setup_plugin_hook('subscription_rebuild', 'openid_rebuild');
    // setup_plugin_hook('finish_waiting_payment', 'openid_payment_completed');
}
////
// Checks that member has a linked OpenID account and is already logged in to OpenID
// If so, allows immediate login to the linked amember account.
function openid_check_logged_in()
{
    global $config, $db, $plugin_config;
    $this_config = $plugin_config['protect']['openid'];
    $testmode = $this_config['testmode'];
Exemplo n.º 15
0
}
function amember_nr_cleanup_files()
{
    global $config;
    $d = opendir($dirname = "{$config['root_dir']}/data/new_rewrite");
    if (!$d) {
        return;
    }
    while ($f = @readdir($d)) {
        if ($f[0] == '.') {
            continue;
        }
        if ($f == '_vti_cnf') {
            continue;
        }
        if ($f == 'CVS') {
            continue;
        }
        if ($f == 'readme.txt') {
            continue;
        }
        if (time() - @filectime("{$dirname}/{$f}") > 3 * 3600) {
            @unlink("{$dirname}/{$f}");
        }
    }
    closedir($d);
}
setup_plugin_hook('after_login', 'amember_nr_after_login');
setup_plugin_hook('after_logout', 'amember_nr_after_logout');
setup_plugin_hook('daily', 'amember_nr_cleanup_files');
    if (!isset($config['protect']['htpasswd_shared']) || $this_config['htpasswd'] == '' || !is_file($this_config['htpasswd'])) {
        $error = ".htpasswd file is not configured for 'htpasswd_shared' plugin.";
        if (!$_SESSION['check_setup_htpasswd_shared_error']) {
            $db->log_error($error);
        }
        $_SESSION['check_setup_htpasswd_shared_error'] = $error;
        return $error;
    }
    return '';
}
if (!check_setup_htpasswd_shared()) {
    setup_plugin_hook('subscription_added', 'htpasswd_shared_added');
    setup_plugin_hook('subscription_updated', 'htpasswd_shared_updated');
    setup_plugin_hook('subscription_deleted', 'htpasswd_shared_deleted');
    setup_plugin_hook('subscription_rebuild', 'htpasswd_shared_rebuild');
    setup_plugin_hook('subscription_check_uniq_login', 'htpasswd_shared_check_uniq');
}
function htpasswd_shared_added($member_id, $product_id, $member)
{
    $member_1 = $member;
    $member_1['pass'] = '******' . md5(time());
    htpasswd_shared_updated($member_id, $member_1, $member);
}
function htpasswd_shared_updated($member_id, $oldmember, $newmember)
{
    global $db, $config;
    $this_config = $config['protect']['htpasswd_shared'];
    if ($oldmember['pass'] == $newmember['pass'] && $oldmember['login'] == $newmember['login']) {
        return;
    }
    //nothing to change
Exemplo n.º 17
0
        }
        // Add publish permissions button
        if ($this_config['publish_stream']) {
            add_member_field('fbperm_publish', "Allow Facebook Wall Updates", 'readonly', "Allow us to automatically put a notice on your Wall<br/>\n\t\t\t\twhenever you order a new product from us", '', array('display_profile' => '1', 'display_signup' => '0', 'default' => "<a href='https://graph.facebook.com/oauth/authorize?client_id={$this_config['appid']}&redirect_uri={$config['root_url']}/profile.php&scope=publish_stream'>Grant Permission</a>"));
        }
    }
    return '';
}
if (!check_setup_fb_connect()) {
    setup_plugin_hook('check_logged_in', 'fb_connect_check_logged_in');
    setup_plugin_hook('after_login', 'fb_connect_after_login');
    setup_plugin_hook('after_logout', 'fb_connect_after_logout');
    setup_plugin_hook('fill_in_signup_form', 'fb_connect_fill_in_signup_form');
    setup_plugin_hook('get_member_links', 'fb_connect_get_member_links');
    //  setup_plugin_hook('get_left_member_links', 'fb_connect_get_member_links');
    setup_plugin_hook('subscription_added', 'fb_connect_added');
    //	setup_plugin_hook('subscription_updated', 'fb_connect_updated');
    //	setup_plugin_hook('subscription_deleted', 'fb_connect_deleted');
    //	setup_plugin_hook('subscription_removed', 'fb_connect_removed');
    //	setup_plugin_hook('subscription_rebuild', 'fb_connect_rebuild');
    //	setup_plugin_hook('finish_waiting_payment', 'fb_connect_payment_completed');
}
////
// Checks for active Facebook user
function fb_connect_get_fbuser()
{
    global $config, $db, $plugin_config;
    $this_config = $plugin_config['protect']['fb_connect'];
    $testmode = $this_config['testmode'];
    $facebook = new Facebook(array('appId' => "{$this_config['appid']}", 'secret' => "{$this_config['appsecret']}", 'cookie' => true));
    $session = $facebook->getSession();
Exemplo n.º 18
0
*
*     Author: Alex Scott
*      Email: alex@cgi-central.net
*        Web: http://www.cgi-central.net
*    Details: ccbill payment plugin
*    FileName $RCSfile$
*    Release: 3.2.3PRO ($Revision: 4936 $)
*
* Please direct bug reports,suggestions or feedback to the cgi-central forums.
* http://www.cgi-central.net/forum/
*                                                                          
* aMember PRO is a commercial software. Any distribution is strictly prohibited.
*
*/
setup_plugin_hook('hourly', 'ccbill_datalink');
setup_plugin_hook('validate_signup_form', 'ccbill_vsf');
add_paysystem_to_list(array('paysys_id' => 'ccbill', 'title' => $config['payment']['ccbill']['title'] ? $config['payment']['ccbill']['title'] : _PLUG_PAY_CC_BILL_TITLE, 'description' => $config['payment']['ccbill']['description'] ? $config['payment']['ccbill']['description'] : _PLUG_PAY_CC_BILL_DESCR, 'public' => 1, 'recurring' => 1));
add_product_field('ccbill_id', 'ccBill Product/Subscription ID', 'text', 'you must create the same product<br />
             in ccbill for CC billing. Enter pricegroup here');
add_product_field('ccbill_subaccount_id', 'ccBill SubAccount ID', 'text', 'keep empty to use default value (from config)');
add_product_field('ccbill_cc_form', 'ccBill CC Form ID', 'text', 'enter ccBill Form id to pay with credit card');
if ($GLOBALS['config']['payment']['ccbill']['use_cheques']) {
    $plugins['payment'][] = 'ccbill_check';
    add_paysystem_to_list(array('paysys_id' => 'ccbill_check', 'title' => 'Online Check', 'description' => _PLUG_PAY_CC_BILL_CHECK_DESCR, 'public' => 1, 'recurring' => 1));
    add_product_field('ccbill_check_form', 'ccBill Check Form ID', 'text', 'enter ccBill Form id to pay with online check');
}
if ($GLOBALS['config']['payment']['ccbill']['use_900']) {
    $plugins['payment'][] = 'ccbill_900';
    add_paysystem_to_list(array('paysys_id' => 'ccbill_900', 'title' => 'ccBill 900', 'description' => _PLUG_PAY_CC_BILL_TEL_DESCR, 'public' => 1, 'recurring' => 1));
    add_product_field('ccbill_900_subaccount_id', 'ccBill 900 SubAccount ID', 'text', 'enter to specify alternative subaccount ID for ccBill900 billing');
    add_product_field('ccbill_900_form', 'ccBill 900 Form ID', 'text', 'enter ccBill Form id to pay with ccBill900 phone bill');
Exemplo n.º 19
0
// end check_setup_amail_aweber
if (!check_setup_amail_aweber()) {
    // setup_plugin_hook('subscription_added'    , 'amail_aweber_added'                 );	// product subscription added but not paid for yet
    setup_plugin_hook('finish_waiting_payment', 'amail_aweber_finish_waiting_payment');
    // product subscription has now been paid for
    setup_plugin_hook('subscription_deleted', 'amail_aweber_deleted');
    // product subscription deleted
    setup_plugin_hook('subscription_removed', 'amail_aweber_removed');
    // member profile removed
    setup_plugin_hook('subscription_updated', 'amail_aweber_updated');
    // member or admin updated member profile
    setup_plugin_hook('subscription_rebuild', 'amail_aweber_rebuild');
    // rebuild the database
    setup_plugin_hook('daily', 'amail_aweber_daily');
    // setup_plugin_hook('hourly', 'amail_aweber_hourly');
    setup_plugin_hook('filter_output', 'amail_aweber_filter_output');
}
//
// Filter Output (on the Thank You page)
//
function amail_aweber_filter_output(&$source, $resource_name, $smarty)
{
    global $db, $plugin_config, $config;
    if ($resource_name == "thanks.html") {
        //
        // Get Smarty Template Variables
        //
        $tplvars = $smarty->_tpl_vars;
        $payment = $tplvars['payment'];
        $member = $_SESSION['_amember_user'];
        if (empty($member)) {
Exemplo n.º 20
0
*    Details: The installation file
*    FileName $RCSfile$
*    Release: 3.1.9PRO ($Revision: 3915 $)
*
* Please direct bug reports,suggestions or feedback to the cgi-central forums.
* http://www.cgi-central.net/forum/
*                                                                          
*
* aMember PRO is a commercial software. Any distribution is strictly prohibited.
*
*
*/
setup_plugin_hook('update_users', 'htpasswd_update');
setup_plugin_hook('update_payments', 'htpasswd_update');
setup_plugin_hook('daily', 'htpasswd_update');
setup_plugin_hook('subscription_rebuild', 'htpasswd_update');
function htpasswd_update($payment_id = 0, $member_id = 0)
{
    global $config, $plugin_config;
    $this_config = $plugin_config['protect']['htpasswd'];
    global $db;
    $ul = $db->get_allowed_users();
    // should return array[product_id][user_login]=password
    $users = array();
    foreach ($ul as $product_id => $user) {
        foreach ($user as $l => $p) {
            $users[$l] = $p;
        }
    }
    $f = @fopen($fn = "{$config['data_dir']}/.htpasswd", 'w');
    foreach ((array) $this_config['add_htpasswd'] as $fname) {
Exemplo n.º 21
0
*                                                                          
* aMember is free for both commercial and non-commercial use providing that the
* copyright headers remain intact and the links remain on the html pages.
* Re-distribution of this script without prior consent is strictly prohibited.
*
*/
//$config['cc_code'] = 1;
$config['cc_name_f'] = 1;
$config['cc_name_l'] = 1;
if ($config['payment']['payready']['wells_fargo']) {
    $config['cc_company'] = 1;
    $config['cc_phone'] = 1;
}
require_once "{$config['root_dir']}/plugins/payment/payready/pay.inc.php";
setup_plugin_hook('get_member_links', 'payready_get_member_links');
setup_plugin_hook('daily', 'payready_rebill');
add_product_field('is_recurring', 'Recurring Billing', 'select', 'should user be charged automatically<br />
             when subscription expires', '', array('options' => array('' => 'No', 1 => 'Yes')));
add_product_field('trial1_days', 'Trial 1 Duration', 'period', 'Trial 1 duration');
add_product_field('trial1_price', 'Trial 1 Price', 'money', 'set 0 for free trial');
add_product_field('rebill_times', 'Recurring Times', 'text', 'Recurring Times. This is the number of payments which<br />
     will occur at the regular rate. If omitted, payment will<br />
     continue to recur at the regular rate until the subscription<br />
     is cancelled.<br />
     NOTE: not for all payment processing this option is working');
add_product_field('authorize_currency', 'PayReady Currency', 'select', 'valid only for PayReady processing.<br /> You should not change it<br /> if you use 
    another payment processors', '', array('options' => array('' => 'USD', 'GBP' => 'GBP', 'EUR' => 'EUR', 'CAD' => 'CAD', 'JPY' => 'JPY')));
global $config;
$config['cc_type_options'] = array('1' => 'VISA', '2' => 'Master Card', '3' => 'American Express', '4' => 'Discover Card');
add_member_field('cc_type', 'Credit Card Type', 'select', '', '', array('options' => $config['cc_type_options']));
add_member_field('cc_street', 'Billing Street Address', 'text', "", '', array('hidden_anywhere' => 1));
Exemplo n.º 22
0
        if ($_ga_tracked++) {
            return;
        }
    }
    $out .= <<<CUT
    </script>
    <!-- google analytics code end -->

CUT;
    $source = preg_replace('|</body>|i', $out . "\n</body>", $source, 1, $count);
    if (!$count) {
        $source .= $out;
    }
}
if (amConfig('google_analytics')) {
    setup_plugin_hook('filter_output', 'insert_google_analytics');
}
/**
 * @return bool true if customer is logged-in
 */
function amember_is_loggedin()
{
    return (bool) $_SESSION['_amember_user']['member_id'];
}
/**
 * Return user record of logged-in customer
 * @return array user record
 */
function amember_get_userrecord()
{
    if ($_SESSION['_amember_user']['member_id']) {